/* ============================================================
   Eliana Faria Lima — shared editorial system
   Tokens, base typography, primitives. Used by all variations.
   ============================================================ */

:root {
  /* Civic editorial palette — warm ivory paper, deep navy, sober gold */
  --bg:          #F4EFE4;   /* warm ivory base */
  --bg-paper:    #FBF7EC;   /* lighter paper */
  --bg-deep:    #0C1A2C;    /* navy for dark sections */
  --bg-deep-2:  #081424;    /* deeper navy */
  --ink:        #1A1F2E;    /* primary text */
  --ink-soft:   #3A3F4D;
  --muted:      #6F7480;
  --muted-2:    #9A9EA8;
  --rule:       #D9CDB3;    /* warm hairline */
  --rule-soft:  rgba(176, 138, 74, 0.18);
  --gold:       #A88752;    /* sober civic gold */
  --gold-soft:  #C5A878;
  --gold-deep:  #8A6F40;
  --ivory:      #F1E9D2;    /* ivory on dark */
  --ivory-soft: #D6CDB7;

  /* Typography */
  --font-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-editorial: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;

  /* Spacing rhythm */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 128px;
  --space-8: 160px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-editorial);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ----- Type scale ----- */

.eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--gold);
}
.eyebrow.on-dark { color: var(--gold-soft); }

.kicker {
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 14px;
  color: var(--gold-deep);
  letter-spacing: 0.04em;
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0;
}
h3, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0;
}
h4 {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

p { margin: 0 0 1em; }
.lede {
  font-family: var(--font-editorial);
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 400;
}
.lede.on-dark { color: var(--ivory-soft); }

.italic { font-style: italic; }

/* ----- Rule lines ----- */
.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 0;
}
.rule-gold {
  width: 56px;
  height: 1.5px;
  background: var(--gold);
  border: 0;
  margin: 0;
}
.rule-vert {
  width: 1px;
  background: var(--rule);
}

/* ----- Layout ----- */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 64px;
}
.container-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 64px;
}
.section {
  padding: var(--space-6) 0;
}
.section-sm { padding: var(--space-4) 0; }

@media (max-width: 768px) {
  .container, .container-narrow {
    padding: 0 24px;
  }
  .section {
    padding: var(--space-4) 0;
  }
}

/* ----- Dark surfaces ----- */
.surface-deep {
  background: var(--bg-deep);
  color: var(--ivory);
}
.surface-deep h1, .surface-deep h2, .surface-deep h3 { color: var(--ivory); }
.surface-deep .lede { color: var(--ivory-soft); }

/* ----- Nav ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 20px 64px;
  display: flex;
  align-items: center;
  gap: 40px;
  background: rgba(251, 247, 236, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
  transition: all 0.3s ease;
}
.nav.on-dark {
  background: rgba(12, 26, 44, 0.92);
  border-bottom-color: rgba(197, 168, 120, 0.18);
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav .brand-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: var(--gold);
  line-height: 1;
  font-weight: 500;
}
.nav .brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.nav.on-dark .brand-name { color: var(--ivory); }
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 32px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav.on-dark .nav-links { color: var(--ivory-soft); }
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-cta {
  padding: 10px 20px;
  border: 1px solid var(--ink);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: var(--bg-deep);
  color: var(--ivory);
  cursor: pointer;
  border-color: var(--bg-deep);
  transition: all 0.3s ease;
}
.nav-cta:hover { background: var(--gold); border-color: var(--gold); }

.nav.on-dark .nav-cta {
  border-color: var(--ivory);
  color: var(--bg-deep);
  background: var(--ivory);
}
.nav.on-dark .nav-cta:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
}
.lang-switch {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  display: flex;
  gap: 6px;
  cursor: pointer;
}
.lang-switch span {
  transition: color 0.2s ease;
}
.lang-switch span:hover {
  color: var(--ink);
}
.lang-switch .on { color: var(--gold); font-weight: 600; }

/* Responsive Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin-bottom: 4px;
  transition: all 0.2s ease;
}
.menu-toggle span:last-child {
  margin-bottom: 0;
}
.nav.on-dark .menu-toggle span {
  background: var(--ivory);
}

@media (max-width: 991px) {
  .menu-toggle {
    display: block;
    margin-left: auto;
  }
  .nav {
    padding: 16px 24px;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    align-items: flex-start;
    display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  }
  .nav.on-dark .nav-links {
    background: var(--bg-deep);
    border-bottom-color: rgba(197, 168, 120, 0.2);
  }
  .nav-links.open {
    display: flex;
  }
  .lang-switch {
    margin-left: 0;
  }
}

/* ----- Footer ----- */
.foot {
  padding: 80px 64px 40px;
  background: var(--bg-deep);
  color: var(--ivory-soft);
  font-family: var(--font-ui);
}
.foot-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(197, 168, 120, 0.2);
}
.foot h5 {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin: 0 0 16px;
  color: var(--gold-soft);
  font-weight: 500;
}
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 10px; font-size: 13.5px; }
.foot a:hover { color: var(--ivory); }
.foot-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}

@media (max-width: 768px) {
  .foot {
    padding: 48px 24px 32px;
  }
  .foot-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .foot-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 14px 22px;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 220ms ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.on-dark { color: var(--ivory); border-color: var(--ivory); }
.btn.on-dark:hover { background: var(--ivory); color: var(--bg-deep); }
.btn-gold { color: var(--gold); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold); color: var(--bg); }
.btn-link {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--gold);
  display: inline-flex; align-items: center; gap: 10px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.arrow::after { content: '→'; font-family: var(--font-ui); }

/* ----- Image placeholders (no-photo-yet) ----- */
.photo-slot {
  position: relative;
  background: linear-gradient(135deg, #2a3548 0%, #1a2436 60%, #131b29 100%);
  overflow: hidden;
  color: rgba(241, 233, 210, 0.55);
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.photo-slot::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.06), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(176,138,74,0.10), transparent 70%);
  pointer-events: none;
}
.photo-slot .caption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  padding-left: 26px;
}
.photo-slot .caption::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 18px; height: 1px; background: var(--gold-soft);
}
.photo-slot.light {
  background: linear-gradient(135deg, #e8dfc9 0%, #d9cdb3 60%, #c9bb9c 100%);
  color: rgba(26, 31, 46, 0.45);
}
.photo-slot.light::after {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(168,135,82,0.12), transparent 70%);
}
.photo-slot.light .caption::before { background: var(--gold-deep); }

/* SVG placeholder line illustration (e.g. capitol, library silhouette) */
.photo-illus svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ----- Grain (for darker surfaces) ----- */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.85  0 0 0 0 0.75  0 0 0 0 0.45  0 0 0 0 0.4 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* ----- Card primitives ----- */
.article-card {
  display: block;
  background: var(--bg-paper);
  border: 1px solid var(--rule-soft);
  padding: 28px;
  transition: all 220ms ease;
  position: relative;
}
.article-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.article-card .ac-meta {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px;
}
.article-card .ac-meta .dot { width: 3px; height: 3px; background: currentColor; border-radius: 50%; }
.article-card .ac-title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 12px;
  font-weight: 500;
}
.article-card .ac-excerpt {
  font-family: var(--font-editorial);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.article-card .ac-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ----- BILINGUAL TRANSITION STYLING ----- */
[data-en], [data-pt] {
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.lang-fade-out {
  opacity: 0;
}
