/* =========================================================
   LifestyleCheck — Design System
   Premium editorial lifestyle aesthetic, mobile-first.
   ========================================================= */

:root {
  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --ink: #2B2622;
  --ink-soft: #4A423B;
  --muted: #6B6259;
  --border: #E8E1D8;
  --accent: #C1633D;
  --accent-dark: #9C4E30;
  --accent-soft: #F3E4DC;
  --accent-ink: #FFF8F4;
  --success: #2F5D50;
  --shadow-sm: 0 1px 2px rgba(43, 38, 34, 0.06);
  --shadow-md: 0 6px 20px rgba(43, 38, 34, 0.08);
  --shadow-lg: 0 16px 40px rgba(43, 38, 34, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1180px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration-color: transparent; transition: text-decoration-color .15s ease, color .15s ease; }
a:hover { text-decoration-color: currentColor; text-decoration-line: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none !important; transition: all .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(251,248,244,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; }
.main-nav { display: none; }
.main-nav ul { display: flex; list-style: none; gap: 26px; margin: 0; padding: 0; }
.main-nav a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.main-nav a.active, .main-nav a:hover { color: var(--accent-dark); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: inline-flex; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 24px; height: 24px; }
.mobile-nav { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); z-index: 99; overflow-y: auto; }
.mobile-nav.open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 20px; }
.mobile-nav li { border-bottom: 1px solid var(--border); }
.mobile-nav a { display: block; padding: 16px 4px; font-size: 1.1rem; color: var(--ink); }
.search-btn { background: none; border: none; cursor: pointer; padding: 8px; color: var(--ink-soft); }

@media (min-width: 880px) {
  .main-nav { display: block; }
  .nav-toggle { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
.hero-inner { display: grid; gap: 32px; }
.hero-eyebrow { display: inline-block; color: var(--accent-dark); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { max-width: 16ch; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
@media (min-width: 900px) {
  .hero-inner.with-media { grid-template-columns: 1.1fr .9fr; align-items: center; }
}

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 6px; }
.section-head .desc { color: var(--muted); margin: 0; max-width: 60ch; }
.section-link { font-weight: 600; font-size: .9rem; white-space: nowrap; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; display: flex; flex-direction: column; height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-media { aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; color: #fff; }
.card-media svg { width: 46%; height: 46%; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-tag { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); }
.card-body h3 { margin-bottom: 2px; font-size: 1.1rem; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-meta { color: var(--muted); font-size: .85rem; margin-top: auto; padding-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card-desc { color: var(--ink-soft); font-size: .93rem; }

/* Quiz card time badge */
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 600; }

/* ---------- Category chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); font-size: .88rem; font-weight: 600; text-decoration: none; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--muted); padding: 16px 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--border); }

/* ---------- Article ---------- */
.article-header { padding: 36px 0 20px; }
.article-header .card-tag { display: block; margin-bottom: 10px; }
.article-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; margin-top: 14px; }
.author-chip { display: flex; align-items: center; gap: 8px; }
.author-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.article-body { max-width: 72ch; font-size: 1.05rem; }
.article-body h2 { margin-top: 1.6em; }
.article-body h3 { margin-top: 1.3em; }
.article-body ul, .article-body ol { margin-bottom: 1.2em; }
.article-body a { font-weight: 600; }
.article-body em:first-child, .article-body p:first-of-type em:only-child { color: var(--muted); }
.disclaimer-note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 18px; color: var(--ink-soft); font-size: .92rem; margin: 1.4em 0; }
.faq-item { border-top: 1px solid var(--border); padding: 18px 0; }
.faq-item p:last-child { margin-bottom: 0; }
/* FAQ question/answer pairs are authored as "**Q**\nA" in markdown; nl2br
   turns the newline into <br>, so the question (a lone leading <strong>)
   gets its own visual line and some breathing room above/below. */
.article-body p > strong:first-child:only-of-type {
  display: block; margin-top: 1.2em; margin-bottom: 4px; font-size: 1.02em;
}
.author-box { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; margin: 2.5em 0; }
.author-box .author-avatar { width: 54px; height: 54px; font-size: 1.3rem; flex-shrink: 0; }

/* ---------- Ad slots ---------- */
.ad-slot { display: none; } /* disabled by default per AdSense-readiness plan; toggled on via data-ads-enabled */
[data-ads-enabled="true"] .ad-slot { display: block; margin: 2em auto; max-width: 720px; min-height: 100px; }
.ad-slot .ad-label { display: block; text-align: center; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ad-slot--head { max-width: 100%; }
.ad-slot--in-article { max-width: 72ch; }
.ad-slot--below-article { max-width: 720px; }

/* ---------- Quiz intro ---------- */
.quiz-intro-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .quiz-intro-grid { grid-template-columns: 1fr 340px; } }
.quiz-facts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; }
.quiz-facts h3 { margin-bottom: 14px; }
.quiz-facts ul { list-style: none; padding: 0; margin: 0 0 20px; }
.quiz-facts li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .92rem; color: var(--ink-soft); }
.quiz-facts li:first-child { border-top: none; }
.measures-list { list-style: none; padding: 0; margin: 1em 0; }
.measures-list li { padding: 6px 0 6px 26px; position: relative; color: var(--ink-soft); }
.measures-list li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }

/* ---------- Quiz player ---------- */
.quiz-app { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.quiz-progress-wrap { margin-bottom: 22px; }
.quiz-progress-label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.quiz-progress-bar { height: 8px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; width: 0%; }
.quiz-question h2 { font-size: 1.35rem; margin-bottom: 22px; }
.quiz-options { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0 0 26px; }
.quiz-option { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; cursor: pointer; font-size: 1rem; text-align: left; background: var(--bg); transition: all .15s ease; }
.quiz-option:hover { border-color: var(--accent); }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; }
.quiz-start-screen, .quiz-result-screen { text-align: center; padding: 20px 0; }
.quiz-app[hidden] { display: none; }

/* ---------- Results ---------- */
.result-score { font-family: var(--font-display); font-size: clamp(2.6rem, 8vw, 3.6rem); font-weight: 700; color: var(--accent-dark); margin: 6px 0; }
.result-tier-label { display: inline-block; background: var(--accent); color: #fff; padding: 6px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.result-headline { margin-top: 6px; }
.result-columns { display: grid; gap: 20px; text-align: left; margin: 28px 0; }
@media (min-width: 700px) { .result-columns { grid-template-columns: 1fr 1fr; } }
.result-col { background: var(--bg); border-radius: var(--radius-sm); padding: 18px 20px; }
.result-col h3 { font-size: 1rem; margin-bottom: 10px; }
.result-col ul { list-style: none; padding: 0; margin: 0; }
.result-col li { padding: 6px 0 6px 22px; position: relative; font-size: .93rem; color: var(--ink-soft); }
.result-col.doing-well li::before { content: '+'; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.result-col.improve li::before { content: '→'; position: absolute; left: 0; color: var(--accent-dark); font-weight: 700; }
.suggestions-list { text-align: left; list-style: decimal; padding-left: 1.4em; margin: 20px 0; }
.suggestions-list li { padding: 6px 0; color: var(--ink-soft); }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }

/* ---------- Newsletter ---------- */
.newsletter { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 40px 30px; text-align: center; }
.newsletter h2 { color: #fff; }
.newsletter p { color: #D9D2C8; max-width: 50ch; margin: 0 auto 22px; }
.newsletter-form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto; }
@media (min-width: 520px) { .newsletter-form { flex-direction: row; } }
.newsletter-form input { flex: 1; padding: 13px 16px; border-radius: 999px; border: none; font-size: .95rem; font-family: var(--font-body); }
.newsletter-note { font-size: .78rem; color: #A79E92; margin-top: 12px; }

/* ---------- Why section ---------- */
.why-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .why-grid { grid-template-columns: repeat(3, 1fr); } }
.why-item { text-align: left; }
.why-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #D9D2C8; margin-top: 60px; padding: 50px 0 26px; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1fr; margin-bottom: 30px; }
@media (min-width: 780px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand p { color: #A79E92; max-width: 32ch; }
.site-footer h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; font-family: var(--font-body); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #C9C0B4; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #453D36; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: #8C8378; font-size: .82rem; }

/* ---------- Forms (contact/search) ---------- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; background: var(--surface); color: var(--ink);
}
.form-field textarea { min-height: 140px; resize: vertical; }
.search-box { display: flex; gap: 10px; max-width: 560px; margin: 0 auto 30px; }
.search-box input { flex: 1; }
.search-results-count { color: var(--muted); margin-bottom: 20px; }

/* ---------- Prose / static pages ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { margin-bottom: 1.2em; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: 40px; }
.stack-sm > * + * { margin-top: 10px; }
.eyebrow { color: var(--accent-dark); font-weight: 700; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; }
