/* Site-wide menu, footer, home-page sections, content pages (about, legal, guides), forms, ad slots and the cookie notice.
   Built on the variables of style.css (light and dark). Page markup comes from tools/site/build_site.py. */

/* ---------- Header with menu ---------- */
.site-header .nav-bar { gap: 14px; justify-content: flex-start; }
.site-header .header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.main-nav > a, .nav-dd-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 0; border-radius: 10px; background: none;
  color: var(--text); font: inherit; font-size: .93rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.main-nav > a:hover, .nav-dd-btn:hover, .nav-dd.open .nav-dd-btn { background: var(--surface-2); text-decoration: none; }
.main-nav a.is-active, .nav-dd-btn.is-active { color: var(--primary); background: var(--primary-soft); }
.nav-dd { position: relative; }
.nav-dd .caret { font-size: .7rem; transition: transform .2s; }
.nav-dd.open .caret { transform: rotate(180deg); }
.nav-panel {
  display: none; position: absolute; top: calc(100% + 10px); left: -8px; width: 640px; max-width: calc(100vw - 32px);
  grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-lg);
}
.nav-dd.open .nav-panel { display: grid; }
.nav-panel h4 { margin: 0 0 8px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-panel a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; color: var(--text); font-size: .92rem; font-weight: 600; }
.nav-panel a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.nav-panel a small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 10px 16px 16px; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  .main-nav > a, .nav-dd-btn { padding: 12px 12px; width: 100%; justify-content: space-between; }
  .nav-dd { width: 100%; }
  .nav-panel { position: static; width: auto; max-width: none; box-shadow: none; border-radius: 12px; grid-template-columns: 1fr; margin: 4px 0 8px; padding: 12px 14px; gap: 10px; background: var(--surface-2); }
}

/* ---------- Rich footer ---------- */
.site-footer.site-footer-rich { background: var(--surface); border-top: 1px solid var(--border); margin-top: 64px; padding: 0; text-align: left; color: var(--text); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; padding: 44px 16px 28px; }
.footer-brand p { color: var(--muted); font-size: .92rem; margin: 12px 0 0; max-width: 340px; }
.footer-col h4 { margin: 0 0 12px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a, .footer-link-btn { color: var(--text); font-size: .93rem; font-weight: 500; background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; text-align: left; }
.footer-col a:hover, .footer-link-btn:hover { color: var(--primary); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 16px 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; }
.footer-bottom p { margin: 0; max-width: 760px; }
.site-footer.compact { margin-top: 32px; }
.site-footer.compact .footer-bottom { border-top: 0; justify-content: center; text-align: center; }
.site-footer.compact .footer-bottom a { color: var(--muted); margin: 0 8px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Home page ---------- */
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 4px; }
.hero-cta .btn.ghost-light { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .28); box-shadow: none; }
.hero-cta .btn.ghost-light:hover { background: rgba(255, 255, 255, .22); }
.stats-strip { margin-top: -38px; position: relative; z-index: 2; }
.stats-strip .strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); }
.strip-item { padding: 22px 20px; text-align: center; }
.strip-item + .strip-item { border-left: 1px solid var(--border); }
.strip-item b { display: block; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.15; }
.strip-item span { color: var(--muted); font-size: .88rem; font-weight: 600; }
@media (max-width: 700px) { .stats-strip .strip { grid-template-columns: 1fr 1fr; } .strip-item:nth-child(3) { border-left: 0; } .strip-item:nth-child(n+3) { border-top: 1px solid var(--border); } }

.home-section { margin-top: 72px; }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 30px; }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-2); margin-bottom: 8px; }
.sec-head h2 { margin: 0 0 8px; font-size: clamp(1.55rem, 3.2vw, 2.15rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.sec-head p { margin: 0; color: var(--muted); font-size: 1.02rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px 24px; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; margin-bottom: 14px; box-shadow: 0 8px 18px rgba(18, 53, 91, .3); }
.step h3 { margin: 0 0 6px; font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.feature-ico { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem; background: var(--primary-soft); margin-bottom: 14px; }
.feature:nth-child(3n+2) .feature-ico { background: color-mix(in srgb, var(--primary-2) 16%, var(--surface)); }
.feature:nth-child(3n) .feature-ico { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); }
.feature h3 { margin: 0 0 6px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px; color: var(--text); transition: transform .2s, box-shadow .2s; }
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.guide-card .tag { align-self: flex-start; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 999px; }
.guide-card h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.guide-card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.guide-card .more { font-weight: 700; color: var(--primary); font-size: .9rem; }
.guide-card .time { color: var(--muted); font-size: .8rem; font-weight: 600; }
@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .guide-grid { grid-template-columns: 1fr; } }

.faq { max-width: 820px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

.cta-band { background: var(--grad); color: #fff; border-radius: 28px; padding: 40px 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.cta-band h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 3vw, 1.9rem); color: #fff; letter-spacing: -.02em; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .88); max-width: 520px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-actions .btn.ghost-light { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .3); box-shadow: none; }
.exam-intro { max-width: 720px; margin: 0 auto 8px; text-align: center; }

/* ---------- Content pages: about, legal, guides ---------- */
.page-band { background: var(--hero-bg); border-bottom: 1px solid var(--border); padding: 44px 0 36px; }
.page-band h1 { margin: 6px 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.page-band .lead { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 720px; }
.crumbs { font-size: .86rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.content-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; padding: 36px 16px 8px; align-items: start; }
.content-wrap.single { grid-template-columns: minmax(0, 780px); justify-content: center; }
.prose { font-size: 1.04rem; line-height: 1.8; }
.prose h2 { margin: 2em 0 .5em; font-size: 1.5rem; letter-spacing: -.01em; line-height: 1.25; scroll-margin-top: 84px; }
.prose h3 { margin: 1.6em 0 .4em; font-size: 1.17rem; }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); }
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; -webkit-overflow-scrolling: touch; }
.table-wrap table { margin: 0; min-width: 520px; }
.callout { background: var(--primary-soft); border-left: 4px solid var(--primary); border-radius: 12px; padding: 14px 18px; margin: 0 0 1.4em; }
.callout.warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-left-color: var(--warn); }
.callout p:last-child { margin-bottom: 0; }
.side-box { position: sticky; top: 84px; display: grid; gap: 16px; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; }
.side-card h4 { margin: 0 0 10px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.side-card a { font-weight: 600; }
@media (max-width: 960px) { .content-wrap { grid-template-columns: minmax(0, 1fr); } .side-box { position: static; } }

.article-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .86rem; font-weight: 600; margin-top: 14px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 22px; margin: 0 0 26px; }
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.2em; font-size: .96rem; }
.related { margin-top: 44px; }
.related h2 { font-size: 1.3rem; margin: 0 0 14px; }
.article-cta { margin: 38px 0 0; background: var(--primary-soft); border: 1px solid var(--border); border-radius: 20px; padding: 24px 26px; }
.article-cta h3 { margin: 0 0 6px; }
.article-cta p { margin: 0 0 14px; color: var(--muted); }

/* ---------- Forms (contact) ---------- */
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 600px) { .contact-form .row { grid-template-columns: 1fr; } }

/* ---------- Ads ---------- */
.ad-slot { display: block; margin: 32px auto; max-width: 970px; text-align: center; overflow: hidden; }
.ad-slot[hidden] { display: none !important; }
.ad-slot .ad-label { display: block; margin-bottom: 6px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ad-slot.preview .ad-box { border: 2px dashed var(--border); background: var(--surface-2); color: var(--muted); padding: 34px 12px; border-radius: 14px; font-weight: 700; font-size: .9rem; }

/* ---------- Cookie notice ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 780px; margin: 0 auto; z-index: 60; display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 16px 20px;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner p { margin: 0; font-size: .9rem; color: var(--muted); flex: 1; line-height: 1.5; }
.cookie-banner p b { color: var(--text); }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 640px) { .cookie-banner { flex-direction: column; align-items: stretch; } .cookie-actions .btn { flex: 1; } }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 10px; z-index: 100; border: 1px solid var(--border); }
.skip-link:focus { left: 8px; }
