/* 좋은날 공통 스타일 - 전통적 따뜻함 + 모던 */
:root {
  --plum: #9d2d4a;
  --plum-dark: #7e2038;
  --plum-bg: #fdf2f5;
  --gold: #b8860b;
  --ink: #2d2226;
  --ink-soft: #5c4f54;
  --ink-faint: #6b5f64;
  --line: #ecdfe3;
  --bg: #faf6f3;
  --card: #ffffff;
  --good: #1a7a4a;
  --good-bg: #eefaf3;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(45, 34, 38, .07), 0 4px 16px rgba(45, 34, 38, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--plum); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ── */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner {
  max-width: 860px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.logo { font-size: 1.25rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo .logo-mark { color: var(--plum); }
.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 8px 12px; border-radius: 8px; color: var(--ink-soft);
  font-size: .92rem; font-weight: 600; white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { background: var(--plum-bg); color: var(--plum); text-decoration: none; }

/* ── 히어로 ── */
.hero { padding: 56px 0 40px; text-align: center; }
.hero h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; margin-bottom: 12px; }
.hero h1 em { font-style: normal; color: var(--plum); }
.hero p { color: var(--ink-soft); max-width: 560px; margin: 0 auto; }
.hero .badge {
  display: inline-block; background: var(--plum-bg); color: var(--plum-dark);
  font-size: .82rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin-bottom: 16px;
}

/* ── 오늘 정보 배너 ── */
.today-banner {
  background: linear-gradient(135deg, #fff 0%, var(--plum-bg) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin: 8px 0 24px; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; justify-content: center;
}
.today-banner .t-label { font-size: .82rem; color: var(--ink-faint); font-weight: 700; }
.today-banner .t-value { font-size: 1.05rem; font-weight: 800; }
.today-banner .t-value.good { color: var(--good); }

/* ── 카드 그리드 ── */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; padding: 8px 0 48px;
}
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease; display: block; color: inherit;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--plum); text-decoration: none; }
.tool-card .card-icon { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.tool-card h2, .tool-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 6px; }
.tool-card p { font-size: .88rem; color: var(--ink-soft); line-height: 1.55; }

/* ── 본문 ── */
.page-title { padding: 40px 0 8px; }
.page-title h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; }
.page-title .sub { color: var(--ink-soft); margin-top: 8px; font-size: .95rem; }
.updated { color: var(--ink-faint); font-size: .82rem; margin-top: 6px; }

.article {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; margin: 24px 0; box-shadow: var(--shadow);
}
.article h2 { font-size: 1.28rem; font-weight: 800; margin: 36px 0 12px; padding-top: 8px; }
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 8px; }
.article p { margin: 10px 0; color: var(--ink-soft); }
.article strong { color: var(--ink); }
.article ul, .article ol { margin: 10px 0 10px 22px; color: var(--ink-soft); }
.article li { margin: 5px 0; }
.article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .92rem; }
.article th, .article td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.article th { background: var(--bg); font-weight: 700; }
.table-wrap { overflow-x: auto; }

.callout {
  background: #fdf6e8; border: 1px solid #ecd9ac; border-radius: 10px;
  padding: 14px 16px; margin: 16px 0; font-size: .92rem; color: #6b4e12;
}
.callout-plum {
  background: var(--plum-bg); border: 1px solid #eccbd5; border-radius: 10px;
  padding: 14px 16px; margin: 16px 0; font-size: .92rem; color: var(--plum-dark);
}

/* ── 달력 ── */
.cal-box {
  background: var(--card); border: 2px solid var(--plum); border-radius: var(--radius);
  padding: 24px; margin: 24px 0; box-shadow: var(--shadow);
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav h2 { font-size: 1.25rem; font-weight: 800; }
.cal-nav button {
  background: var(--plum-bg); color: var(--plum-dark); border: none; border-radius: 8px;
  font-family: inherit; font-size: .95rem; font-weight: 700; padding: 8px 14px; cursor: pointer;
}
.cal-nav button:hover { background: #f7dfe7; }
table.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.calendar th { padding: 8px 2px; font-size: .82rem; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
table.calendar th.sun, table.calendar td.sun .d-num { color: #c0392b; }
table.calendar th.sat, table.calendar td.sat .d-num { color: #2b6cb0; }
table.calendar td { vertical-align: top; height: 74px; border: 1px solid #f5edef; padding: 4px; }
table.calendar td .d-num { font-weight: 700; font-size: .95rem; }
table.calendar td .d-lunar { font-size: .68rem; color: var(--ink-faint); display: block; }
table.calendar td.son { background: var(--good-bg); }
table.calendar td.son .d-tag {
  display: inline-block; background: var(--good); color: #fff; font-size: .66rem;
  font-weight: 700; border-radius: 5px; padding: 1px 5px; margin-top: 3px;
}
table.calendar td.today { outline: 2px solid var(--plum); outline-offset: -2px; border-radius: 4px; }
.cal-legend { margin-top: 12px; font-size: .82rem; color: var(--ink-faint); }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px; background: var(--good-bg); border: 1px solid var(--good); border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

.upcoming { margin-top: 18px; }
.upcoming h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.upcoming ul { list-style: none; }
.upcoming li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; margin: 6px 0;
  font-size: .93rem; background: #fff;
}
.upcoming li .u-date { font-weight: 700; }
.upcoming li .u-lunar { color: var(--ink-faint); font-size: .85rem; }
.upcoming li.weekend .u-date { color: var(--plum); }

/* ── 테스트 ── */
.test-box {
  background: var(--card); border: 2px solid var(--plum); border-radius: var(--radius);
  padding: 28px; margin: 24px 0; box-shadow: var(--shadow); text-align: center;
}
.test-box h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 18px; }
.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field input[type="date"], .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px rgba(157, 45, 74, .12); }
.btn-main {
  width: 100%; background: var(--plum); color: #fff; font-size: 1.05rem; font-weight: 800;
  font-family: inherit; padding: 14px; border: none; border-radius: 10px; cursor: pointer; margin-top: 6px;
  transition: background .15s;
}
.btn-main:hover { background: var(--plum-dark); }

/* ── 결과 카드 ── */
.result-card {
  display: none; margin-top: 22px; text-align: left;
  background: linear-gradient(160deg, #fff 0%, var(--plum-bg) 100%);
  border: 1px solid #eccbd5; border-radius: 16px; padding: 26px;
}
.result-card.show { display: block; }
.result-card .r-emoji { font-size: 2.6rem; text-align: center; display: block; }
.result-card .r-ilgan { text-align: center; color: var(--ink-faint); font-size: .85rem; font-weight: 700; margin-top: 6px; }
.result-card .r-title { text-align: center; font-size: 1.45rem; font-weight: 800; color: var(--plum-dark); margin: 4px 0 14px; }
.result-card .r-desc { color: var(--ink-soft); font-size: .95rem; }
.result-card .r-row { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e3bfcb; font-size: .92rem; }
.result-card .r-row b { color: var(--ink); }
.result-card .r-foot { margin-top: 14px; font-size: .78rem; color: var(--ink-faint); text-align: center; }
.btn-share {
  display: block; width: 100%; margin-top: 16px; background: #fff; color: var(--plum-dark);
  border: 2px solid var(--plum); border-radius: 10px; font-family: inherit;
  font-size: .98rem; font-weight: 800; padding: 12px; cursor: pointer;
}
.btn-share:hover { background: var(--plum-bg); }

/* ── FAQ ── */
.faq details { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; background: #fff; }
.faq summary { padding: 14px 16px; font-weight: 700; font-size: .95rem; cursor: pointer; list-style: none; position: relative; padding-right: 36px; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: 1.2rem; }
.faq details[open] summary::after { content: "−"; }
.faq .faq-body { padding: 0 16px 14px; color: var(--ink-soft); font-size: .93rem; }

.related { margin: 32px 0 48px; }
.related h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }

.ad-slot { margin: 24px 0; min-height: 0; }

/* ── 푸터 ── */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0; }
.footer-inner { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: var(--ink-soft); font-size: .88rem; font-weight: 600; }
.disclaimer { color: var(--ink-faint); font-size: .8rem; line-height: 1.6; }

@media (max-width: 640px) {
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 1.5rem; }
  .page-title h1 { font-size: 1.35rem; }
  .article { padding: 24px 18px; }
  .cal-box, .test-box { padding: 18px 12px; }
  table.calendar td { height: 60px; padding: 2px; }
  table.calendar td .d-lunar { display: none; }
  .header-inner { height: auto; flex-direction: column; align-items: flex-start; padding: 10px 16px; gap: 6px; }
  .main-nav { width: 100%; }
}
