/* ============================================================
   Contador One — Site (Apple-clean) shared styles
   Builds on colors_and_type.css tokens.
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--brand);
}
.eyebrow-muted { color: var(--fg-subtle); }
.display {
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.04;
  color: var(--ink); margin: 0;
}
.italic-brand { font-style: italic; color: var(--brand); }
.lead { font-size: 21px; line-height: 1.55; color: var(--fg-muted); font-weight: 400; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-weight: 500; font-size: 15px;
  padding: 13px 22px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; line-height: 1;
  transition: background .2s cubic-bezier(.2,.8,.2,1), border-color .2s, transform .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-press); }
.btn-dark { background: var(--c1-marrom); color: #fff; }
.btn-dark:hover { background: var(--c1-marrom-700); }
.btn-secondary { background: var(--c1-marrom-50); color: var(--fg); }
.btn-secondary:hover { background: var(--c1-marrom-100); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { color: var(--brand); }
.btn-light { background: #fff; color: #404040; }
.btn-light:hover { background: var(--c1-cinza-100); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.32); }
.btn-outline-light:hover { background: rgba(255,255,255,.10); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.link-arrow {
  color: var(--brand); font-weight: 500; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.link-arrow:hover { gap: 10px; }
.link-arrow span { transition: transform .2s; }

/* ============================================================
   HEADER + MEGA MENU
   ============================================================ */
/* Top utility bar — white in light theme (#16), dark in dark theme */
.site-topbar {
  background: var(--surface); color: var(--fg-muted); font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.site-topbar .container-wide { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.site-topbar a { color: var(--fg-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.site-topbar a:hover { color: var(--brand); }
.site-topbar .tb-right { display: flex; gap: 26px; align-items: center; }
[data-theme="dark"] .site-topbar { background: #0f0f0f; color: rgba(255,255,255,.7); border-bottom-color: rgba(255,255,255,.08); }
[data-theme="dark"] .site-topbar a { color: rgba(255,255,255,.7); }
[data-theme="dark"] .site-topbar a:hover { color: #fff; }

/* wrapper must not form a containing block, so the header sticks to the
   whole page (not just the ~102px tall wrapper) */
[data-site-header] { display: contents; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform .34s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
  will-change: transform;
}
.site-header.hide { transform: none; }
.site-header.stuck { box-shadow: var(--shadow-sm); }
.site-header .brand .logo-dark { display: none; }
[data-theme="dark"] .site-header { background: rgba(22,22,22,0.82); }
[data-theme="dark"] .site-header .brand .logo-light { display: none; }
[data-theme="dark"] .site-header .brand .logo-dark { display: block; }

/* theme toggle */
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: transparent; color: var(--fg); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, border-color .15s; flex: none;
}
.theme-toggle:hover { background: var(--c1-marrom-50); color: var(--brand); border-color: var(--c1-laranja-300); }
.theme-toggle .moon { display: block; } .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: none; } [data-theme="dark"] .theme-toggle .sun { display: block; }
.site-header .nav { display: flex; align-items: center; height: 64px; gap: 8px; }
.site-header .brand img { height: 30px; }
.site-header .nav-links { display: flex; align-items: center; gap: 4px; margin-left: 28px; flex: 1; }
.nav-item { position: relative; }
.nav-item > a, .nav-item > button {
  font-family: inherit; background: none; border: 0; cursor: pointer;
  color: var(--fg); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 9px 14px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s; white-space: nowrap;
}
.nav-item > a:hover, .nav-item > button:hover { background: var(--c1-marrom-50); color: var(--ink); }
.nav-item .chev { width: 14px; height: 14px; transition: transform .2s; opacity: .55; }
.nav-item.open .chev { transform: rotate(180deg); }
.nav-item.open > button { background: var(--c1-marrom-50); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* Mega menu panel */
.megamenu {
  position: fixed; left: 0; right: 0; top: 102px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .22s cubic-bezier(.2,.8,.2,1), transform .22s cubic-bezier(.2,.8,.2,1), visibility .22s;
  z-index: 99;
}
.megamenu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.megamenu-inner {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); margin: 0 auto; max-width: 1180px;
  padding: 36px 40px; overflow: hidden; position: relative;
}
.megamenu-inner::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 360px; height: 360px;
  background: url('andorinhas/andorinha-marrom.png') center/contain no-repeat;
  opacity: 0.05; pointer-events: none; transform: scaleX(-1);
}
.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 40px; position: relative; z-index: 1; }
.mega-col h4 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-subtle); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.mega-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mega-col li a {
  display: flex; align-items: center; gap: 11px; padding: 7px 8px; margin: 0 -8px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink);
  font-size: 14px; transition: background .14s;
}
.mega-col li a:hover { background: var(--c1-laranja-50); color: var(--brand); }
.mega-col li a .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c1-cinza-400);
  transition: background .14s;
}
.mega-col li a:hover .dot { background: var(--brand); }
.mega-foot {
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; z-index: 1;
}
.mega-foot .mf-text { display: flex; flex-direction: column; gap: 2px; }
.mega-foot .mf-text strong { font-size: 15px; }
.mega-foot .mf-text span { font-size: 13px; color: var(--fg-muted); }
.mega-foot .mf-actions { display: flex; gap: 10px; flex: none; }

.mega-backdrop {
  position: fixed; inset: 0; top: 102px; background: rgba(38,38,38,0.18);
  opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s; z-index: 98;
}
.mega-backdrop.show { opacity: 1; visibility: visible; }

/* mobile menu button */
.menu-toggle { display: none; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 6px; margin-left: auto; }

/* floating back-to-top (always available) */
.to-top-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.9);
  transition: opacity .25s, transform .25s cubic-bezier(.2,.8,.2,1), visibility .25s, background .15s;
}
.to-top-fab.show { opacity: 1; visibility: visible; transform: none; }
.to-top-fab:hover { background: var(--brand-hover); transform: translateY(-2px); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--c1-marrom); color: #b8b8b8; padding: 72px 0 36px; font-size: 14px; }
.site-footer .fgrid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.site-footer h5 { color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.site-footer a { color: #b8b8b8; text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.site-footer .flogo { height: 34px; margin-bottom: 18px; }
.site-footer .fdesc { line-height: 1.6; color: #999; max-width: 300px; }
.site-footer .fbird { display: flex; gap: 6px; margin-top: 22px; }
.site-footer .fbird img { height: 22px; opacity: .9; }
.site-footer .fbottom {
  border-top: 1px solid rgba(255,255,255,0.10); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: #888; gap: 16px;
}
.site-footer .fbottom em { color: var(--c1-laranja-300); font-style: italic; }

/* ============================================================
   Sections / reveal
   ============================================================ */
.section { padding: 104px 0; }
.section-soft { background: var(--bg-soft); }
.section-dark { background: var(--c1-marrom); color: #fff; }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head .eyebrow { display: block; margin-bottom: 16px; }
.section-head h2 { font-size: clamp(32px, 4vw, 50px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 18px; }
.section-head p { font-size: 19px; line-height: 1.55; color: var(--fg-muted); margin: 0; }
.section-dark .section-head p { color: #c2c2c2; }
/* Dark sections: global element color (marrom) would override inheritance — force light. */
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4, .section-dark h5 { color: #fff; }

[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .menu-toggle { display: inline-flex; }
  .site-header .nav { position: relative; }
  .site-header .nav-links {
    display: none; position: absolute; top: calc(100% + 10px); right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 2px; margin-left: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: 8px;
  }
  .site-header .nav-links.open { display: flex; }
  .site-header .nav-links .nav-item > a,
  .site-header .nav-links .nav-item > button { width: 100%; justify-content: flex-start; }
  .nav-actions .btn-ghost { display: none; }
  .site-footer .fgrid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .mega-grid { grid-template-columns: 1fr 1fr; }
  .mega-foot { flex-direction: column; align-items: flex-start; }
  .mega-foot .mf-actions { width: 100%; }
}
@media (max-width: 600px) {
  .section { padding: 72px 0; }
  .site-footer .fgrid { grid-template-columns: 1fr; }
  .site-footer .fbottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .mega-grid { grid-template-columns: 1fr; }
  .mega-foot .mf-actions { flex-direction: column; }
  .mega-foot .mf-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   THEME TOKENS (light defaults + dark overrides)
   ============================================================ */
:root {
  --surface: #ffffff;          /* card / panel background */
  --surface-2: var(--bg-soft);
  --ink: var(--c1-marrom);     /* primary text / headings (theme-aware) */
}
[data-theme="dark"] {
  --bg: #161616;
  --bg-soft: #1c1c1c;
  --bg-muted: #242424;
  --fg: #ededed;
  --fg-muted: #b2b2b2;
  --fg-subtle: #8c8c8c;
  --border: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.24);
  --surface: #232323;
  --surface-2: #1c1c1c;
  --ink: #f0f0f0;
  --c1-cinza-50:  #202020;
  --c1-cinza-100: #282828;
  --c1-cinza-200: #323232;
  --c1-cinza-300: #3c3c3c;
  --c1-marrom-50:  #242424;
  --c1-marrom-100: #2e2e2e;
  --c1-laranja-50: #2a1d12;
  --success-bg: #18271a;
  --info-bg: #14282a;
  --warning-bg: #2a2413;
  --danger-bg: #2c1818;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5), 0 2px 5px rgba(0,0,0,0.4);
  --shadow-lg: 0 18px 44px rgba(0,0,0,0.6), 0 4px 14px rgba(0,0,0,0.5);
}
/* keep permanently-light chips legible (sit on white/coloured covers) */
[data-theme="dark"] .season-tag,
[data-theme="dark"] .card .cover .st,
[data-theme="dark"] .feature .cover .season-tag,
[data-theme="dark"] .art-cover .badge,
[data-theme="dark"] .seg-hero .tagline { color: #404040 !important; }
[data-theme="dark"] .filters { background: rgba(22,22,22,0.86) !important; }

/* ============================================================
   FOOTER — back to top (bottom-left)
   ============================================================ */
.site-footer .fbottom { flex-wrap: wrap; }
.to-top {
  font-family: inherit; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  color: #d8d8d8; font-size: 13px; font-weight: 500; padding: 9px 16px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.to-top:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-2px); }
.to-top svg { transition: transform .18s; }
.to-top:hover svg { transform: translateY(-2px); }
