/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg:          #070b14;
  --bg-2:        #0c1120;
  --bg-3:        #121928;
  --card:        #111826;
  --card-hover:  #18202e;
  --border:      rgba(255,255,255,0.07);
  --border-acc:  rgba(240,165,0,0.35);
  --text:        #dde5f5;
  --text-2:      #8a94ae;
  --text-3:      #4a526a;
  --gold:        #f0a500;
  --gold-dim:    rgba(240,165,0,0.12);
  --gold-glow:   rgba(240,165,0,0.22);
  --blue:        #4d8ef5;
  --blue-dim:    rgba(77,142,245,0.1);
  --moon:        #e8e2cc;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 32px rgba(0,0,0,0.5);
  --shadow-sm:   0 2px 12px rgba(0,0,0,0.3);
  --font-disp:   'Cormorant Garamond', Georgia, serif;
  --font-ui:     'Jost', system-ui, sans-serif;
  --nav-h:       64px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img, svg { display: block; }
ul, ol { list-style: none; }

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(7,11,20,0.85);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.nav__logo-svg {
  width: 32px; height: 32px;
  color: var(--gold);
  flex-shrink: 0;
  transition: color .2s ease;
}
.brand-name {
  font-family: var(--font-disp);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.brand-name__calendari {
  color: #fff;
  transition: color .2s ease;
}
.brand-name__on {
  color: var(--gold);
  transition: color .2s ease;
}
/* Hover: mesmo dourado que «Próximos feriados» (.country-card__next strong) */
.nav__logo:hover .nav__logo-svg,
.nav__logo:hover .brand-name__calendari,
.nav__logo:hover .brand-name__on {
  color: var(--gold);
}
.nav__right { display: flex; align-items: center; gap: 12px; }

/* Country picker */
.country-picker { position: relative; }
.country-picker__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-2);
  font-size: .875rem;
  font-family: var(--font-ui);
  transition: all .2s;
}
.country-picker__btn svg { width: 18px; height: 18px; }
.country-picker__btn:hover {
  border-color: var(--border-acc);
  color: var(--text);
  background: var(--card-hover);
}
.cp-chevron { transition: transform .2s; }
.country-picker__btn[aria-expanded="true"] .cp-chevron { transform: rotate(180deg); }
.country-picker__drop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 200;
}
.country-picker__drop::-webkit-scrollbar { width: 4px; }
.country-picker__drop::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.cp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: .875rem;
  color: var(--text-2);
  transition: all .15s;
}
.cp-item:hover { background: var(--card-hover); color: var(--text); }
.cp-item svg { width: 28px; height: 21px; border-radius: 3px; flex-shrink: 0; }

/* ─── Main ───────────────────────────────────────────────────────────────── */
.main { padding-top: var(--nav-h); min-height: 100vh; }

/* ─── Loader ─────────────────────────────────────────────────────────────── */
/* ─── Full-page splash loader ────────────────────────────────────────────── */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #070b14;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease, visibility .4s ease;
}
#splash.splash--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ── Flip calendar widget ── */
.splash__cal {
  position: relative;
  width: 140px;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: visible;
  filter: drop-shadow(0 8px 32px rgba(240,165,0,.25));
}

/* Rings at top */
.splash__rings {
  display: flex;
  justify-content: space-around;
  padding: 0 22px;
  margin-bottom: -4px;
  position: relative;
  z-index: 2;
}
.splash__ring {
  width: 14px;
  height: 18px;
  border: 3px solid #f0a500;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: #070b14;
}

/* Header */
.splash__cal-header {
  background: #f0a500;
  padding: 8px 12px 7px;
  border-radius: 8px 8px 0 0;
  text-align: center;
}
.splash__cal-month {
  font-family: var(--font-disp, serif);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #070b14;
}

/* Flip number area */
.splash__flip {
  position: relative;
  height: 100px;
  background: #111827;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  border: 1.5px solid rgba(240,165,0,.2);
  border-top: none;
  perspective: 300px;
}
/* Dividing line in middle */
.splash__flip::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1.5px;
  background: rgba(0,0,0,.6);
  z-index: 10;
}

/* Back half — shows the NEXT number, visible through the flip */
.splash__flip-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  background: #0d1525;
}
.splash__flip-back span {
  font-family: var(--font-disp, serif);
  font-size: 4.5rem;
  font-weight: 700;
  color: #f0a500;
  line-height: 1;
  user-select: none;
}

/* Top static half — shows current number top */
.splash__flip-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  background: #111827;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 3;
}
.splash__flip-top span {
  font-family: var(--font-disp, serif);
  font-size: 4.5rem;
  font-weight: 700;
  color: #f0c040;
  line-height: 1;
  transform: translateY(50%);
  user-select: none;
}

/* Bottom static half — shows current number bottom (revealed after flip) */
.splash__flip-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  background: #0f1622;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1;
}
.splash__flip-bottom span {
  font-family: var(--font-disp, serif);
  font-size: 4.5rem;
  font-weight: 700;
  color: #e09820;
  line-height: 1;
  transform: translateY(-50%);
  user-select: none;
}

/* Flipping leaf — top half that rotates down */
.splash__flip-leaf {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  background: #111827;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: bottom center;
  z-index: 5;
  backface-visibility: hidden;
}
.splash__flip-leaf span {
  font-family: var(--font-disp, serif);
  font-size: 4.5rem;
  font-weight: 700;
  color: #f0c040;
  line-height: 1;
  transform: translateY(50%);
  user-select: none;
}
.splash__flip-leaf--flip {
  animation: leafFlip .28s ease-in forwards;
}
@keyframes leafFlip {
  0%   { transform: rotateX(0deg);   }
  100% { transform: rotateX(-90deg); }
}

/* Label */
.splash__label {
  font-family: var(--font-disp, serif);
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: .16em;
  color: #f0a500;
  text-transform: uppercase;
  opacity: .9;
}

/* Progress bar */
.splash__bar {
  width: 140px;
  height: 2px;
  background: rgba(240,165,0,.18);
  border-radius: 2px;
  overflow: hidden;
}
.splash__bar-fill {
  height: 100%;
  background: #f0a500;
  border-radius: 2px;
  animation: splashBar 1.6s ease-in-out infinite;
}
@keyframes splashBar {
  0%   { width: 0%;   margin-left: 0; }
  50%  { width: 80%;  margin-left: 0; }
  100% { width: 0%;   margin-left: 100%; }
}


/* ─── Top route progress bar (replaces in-page spinner) ─────────────────── */
.route-bar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}
.route-bar--loading::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--gold);
  animation: routeBarAnim 1.2s ease-in-out infinite;
  transform-origin: left center;
}
.route-bar--done::after { display: none; }
@keyframes routeBarAnim {
  0%   { width: 0%;   opacity: 1; }
  70%  { width: 85%;  opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* ─── Error ──────────────────────────────────────────────────────────────── */
.error-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-2);
}
.error-state h2 {
  font-family: var(--font-disp);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 12px;
}

/* ─── Hero (Home) ────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 56px;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(240,165,0,0.12), transparent),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(77,142,245,0.06), transparent);
  pointer-events: none;
}
.hero__stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 65%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 15%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,0.2) 0%, transparent 100%);
  pointer-events: none;
}
.hero__date-block {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
}
.hero__weekday {
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero__day {
  font-family: var(--font-disp);
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 300;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.02em;
}
.hero__month-year {
  font-family: var(--font-disp);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 300;
  color: var(--text-2);
  letter-spacing: .04em;
}
.hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.hero__meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: var(--text-2);
}
.hero__meta-item > span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.hero__meta-item svg { width: 18px; height: 18px; }
.hero__meta-item strong { color: var(--text); font-weight: 500; font-size: .95rem; }
.hero__meta-item small  { font-size: .7rem; opacity: .7; letter-spacing: .02em; }
.moon-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(232,226,204,0.08);
  border: 1px solid rgba(232,226,204,0.15);
  font-size: .8rem;
  color: var(--moon);
}
.moon-badge svg { width: 22px; height: 22px; }
.hero__title {
  font-family: var(--font-disp);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--text-2);
  font-weight: 300;
  margin-top: 10px;
}

/* ─── Home: feeds + assistente ──────────────────────────────────────────── */

/* ─ 3-column layout ─ */
.home-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - var(--nav-h));
  align-items: start;
}
@media (min-width: 1100px) {
  .home-page { grid-template-columns: 264px minmax(0, 1fr) 264px; }
}

.home-sidebar {
  display: none;
  flex-direction: column;
  padding: 28px 18px 28px;
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--nav-h));
  background: var(--bg-2);
}
.home-sidebar--right {
  border-right: none;
  border-left: 1px solid var(--border);
}
@media (min-width: 1100px) {
  .home-sidebar {
    display: flex;
    position: sticky;
    top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    overflow: hidden;
  }
}

.home-center { min-width: 0; padding-bottom: 40px; }

/* Sidebar feed panels */
.home-sidebar .home-feed-panel {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.home-sidebar .home-feed-panel__title {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.home-sidebar .home-feed-list {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

/* Upcoming commemoratives bottom grid */
.com-bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  padding: 4px 20px 32px;
}
.com-bottom-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s, background .18s;
}
.com-bottom-item:hover {
  border-color: var(--accent);
  background: var(--bg-3);
}
.com-bottom-item__date {
  font-size: .72rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.com-bottom-item__name {
  font-size: .85rem;
  color: var(--text-1);
  line-height: 1.35;
}

/* Next-holiday pill inside the hero */
.hero__next-holiday {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px auto 0;
  padding: 11px 18px;
  background: rgba(240,165,0,0.10);
  border: 1px solid rgba(240,165,0,0.28);
  border-radius: 50px;
  font-size: clamp(.8rem, 1.8vw, .95rem);
  color: var(--text);
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.hero__next-holiday:hover {
  background: rgba(240,165,0,0.17);
  border-color: rgba(240,165,0,0.5);
}
.hero__next-holiday__label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  font-weight: 600;
}
.hero__next-holiday__name { display: block; color: var(--text); font-weight: 500; }
.hero__next-holiday__date { display: block; color: var(--text-2); font-size: .8rem; }
.hero__next-holiday svg { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }

/* Feed items (shared: sidebar + mobile stacked) */
.home-feed-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.home-feed-panel__title {
  font-family: var(--font-disp);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-feed-panel__title svg {
  width: 16px; height: 16px;
  color: var(--gold);
  flex-shrink: 0;
}
.home-feed-panel__subtitle {
  font-size: .72rem;
  color: var(--text-3);
  margin-bottom: 10px;
}
.home-feed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
}
.home-feed-list::-webkit-scrollbar { width: 3px; }
.home-feed-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.home-feed-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid transparent;
  font-size: .8rem;
  color: var(--text-2);
  transition: border-color .15s, background .15s;
}
a.home-feed-item:hover {
  border-color: var(--border-acc);
  background: var(--card-hover);
  color: var(--text);
}
/* Non-clickable items (no slug / no description) */
.no-link { cursor: default; }
.no-link .holiday-item__name,
.no-link .home-feed-item__name,
.no-link .upcoming-name,
.no-link .com-bottom-item__name { opacity: .75; }
a.holiday-item:hover, a.upcoming-item:hover, a.com-bottom-item:hover {
  border-color: var(--border-acc);
  background: var(--card-hover);
}
.home-feed-item__name { color: var(--text); font-weight: 500; line-height: 1.3; }
.home-feed-item__date { color: var(--gold); font-size: .72rem; font-weight: 600; }
.home-feed-item__tag  { color: var(--text-3); font-size: .68rem; }
.home-feed-empty { font-size: .8rem; color: var(--text-3); padding: 8px 2px; }

/* Mobile-only stacked feeds (hidden on desktop where sidebars take over) */
.home-feeds-mobile {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 16px;
  margin: 24px 0 0;
}
@media (min-width: 480px) { .home-feeds-mobile { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .home-feeds-mobile { display: none; } }

/* Assistant */
.home-assistant {
  margin: 22px 16px 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.home-assistant__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.home-assistant__head svg { width: 24px; height: 24px; color: var(--gold); flex-shrink: 0; }
.home-assistant__title {
  font-family: var(--font-disp);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.home-assistant__sub { font-size: .8rem; color: var(--text-3); margin-top: 3px; }
.home-assistant__hint { font-size: .78rem; color: var(--gold); margin-bottom: 8px; min-height: 1.1em; }
.home-assistant__out {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  box-sizing: border-box;
}
/* .home-assistant__out--streaming: min-height is set in JS from final text height */

/* Small inline icons (back links) — SVG without size expands huge in flex rows */
.icon--inline {
  display: block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}
.page-back-link {
  font-size: .85rem;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.page-back-link:hover { color: var(--gold); }

/* Center hero adjustments */
.home-center .hero { padding: 44px 20px 32px; }
.home-center .section-head { padding: 28px 16px 14px; max-width: none; }
.home-center .countries-grid { max-width: none; padding: 0 16px 32px; }

/* Country-card: today event with fade */
.country-card__today {
  position: relative;
  overflow: hidden;
  max-height: 68px;
  margin-top: 4px;
}
.country-card__today-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.country-card__today-event {
  font-size: .76rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-card__today-event--nat  { color: var(--gold); font-weight: 600; }
.country-card__today-event--opt  { color: #7bb4ff; font-weight: 500; }
.country-card__today-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 32px;
  background: linear-gradient(to bottom, transparent, var(--card));
  pointer-events: none;
}
.country-card:hover .country-card__today-fade {
  background: linear-gradient(to bottom, transparent, var(--card-hover));
}
.country-card__today-hint {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  font-size: .66rem;
  color: var(--text-3);
  letter-spacing: .04em;
}

/* ─── Section header ─────────────────────────────────────────────────────── */
.section-head {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 20px;
}
.section-head h2 {
  font-family: var(--font-disp);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 400;
  color: var(--text);
  letter-spacing: .02em;
}
.section-head p { color: var(--text-2); font-size: .9rem; margin-top: 4px; }

/* ─── Country grid ───────────────────────────────────────────────────────── */
.countries-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.country-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all .25s cubic-bezier(.2,.6,.3,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.country-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cc1, var(--gold)), var(--cc2, var(--blue)));
  opacity: 0;
  transition: opacity .25s;
}
.country-card:hover {
  background: var(--card-hover);
  border-color: var(--border-acc);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.country-card:hover::before { opacity: 1; }
.country-card__flag {
  width: 48px; height: 36px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
}
.country-card__flag svg { width: 100%; height: 100%; }
.country-flag-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}
.cp-item .country-flag-img {
  width: 28px;
  height: 21px;
  flex-shrink: 0;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  object-fit: contain;
  object-position: center;
  background: var(--bg-3);
}
.country-card__name {
  font-family: var(--font-disp);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
}
.country-card__lang {
  font-size: .75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.country-card__next {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-2);
}
.country-card__next strong { color: var(--gold); display: block; font-size: .75rem; margin-bottom: 2px; font-weight: 500; }
.country-card__cal-link {
  display: flex;
  align-items: center;
  gap: 6px;
}
.country-card__cal-link .icon--sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-3);
}

/* ─── Country page ───────────────────────────────────────────────────────── */
.country-hero {
  position: relative;
  overflow: hidden;
  padding: 52px 24px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.country-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(240,165,0,0.08), transparent);
  pointer-events: none;
}
.country-flag-large {
  width: 80px; height: 60px;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
}
.country-flag-large svg { width: 100%; height: 100%; }
.country-flag-large .country-flag-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.country-hero__name {
  font-family: var(--font-disp);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 300;
  letter-spacing: .02em;
}
.country-hero__today {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: .875rem;
  color: var(--text-2);
}
.country-hero__today svg { width: 16px; height: 16px; }
.country-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.country-nav__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  font-size: .85rem;
  color: var(--text-2);
  transition: all .2s;
}
.country-nav__btn svg { width: 16px; height: 16px; }
.country-nav__btn:hover, .country-nav__btn.active {
  background: var(--gold-dim);
  border-color: var(--border-acc);
  color: var(--gold);
}

/* ─── Two-col layout ─────────────────────────────────────────────────────── */
.two-col {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
.three-col {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.three-col > * { min-width: 0; }
.three-col .country-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}
@media (max-width: 1100px) {
  .three-col {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .three-col .country-sidebar--left { display: none; }
}
@media (max-width: 900px) {
  .three-col {
    grid-template-columns: 1fr;
  }
  .three-col .country-sidebar--left { display: none; }
  .three-col .country-sidebar:not(.country-sidebar--left) {
    position: static;
  }
}

/* ─── Calendar grid ──────────────────────────────────────────────────────── */
.cal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.cal-header__title {
  font-family: var(--font-disp);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: .03em;
}
.cal-nav-btn {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all .2s;
}
.cal-nav-btn svg { width: 18px; height: 18px; }
.cal-nav-btn:hover { border-color: var(--border-acc); color: var(--gold); background: var(--gold-dim); }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 16px 4px;
  gap: 2px;
}
.cal-weekday {
  font-size: .7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 0;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px 16px 16px;
  gap: 2px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .875rem;
  color: var(--text-2);
  transition: all .15s;
  cursor: pointer;
  position: relative;
  padding: 2px;
}
.cal-day:hover { background: var(--bg-3); color: var(--text); }
.cal-day--today {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
  border: 1px solid var(--border-acc);
}
.cal-day--other { color: var(--text-3); }
.cal-day--has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
.cal-day--has-holiday::after { background: #ef4444; }
.cal-day__num { font-size: .8rem; line-height: 1; }

a.cal-day {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.cal-day--selected {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  background: rgba(232, 198, 120, 0.07);
}
.cal-day--selected.cal-day--today {
  background: rgba(232, 198, 120, 0.12);
}

.country-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.country-sidebar__today-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.country-sidebar__today-link:hover {
  text-decoration: underline;
}

/* ─── Holiday list ───────────────────────────────────────────────────────── */
.holiday-list { display: flex; flex-direction: column; gap: 0; }
.holiday-month-group { margin-bottom: 32px; }
.holiday-month-label {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: .04em;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.holiday-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background .15s;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
}
.holiday-item:hover { background: var(--card-hover); }
.holiday-item__date {
  text-align: center;
  min-width: 48px;
  flex-shrink: 0;
}
.holiday-item__day {
  font-family: var(--font-disp);
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
  color: var(--gold);
}
.holiday-item__weekday {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
}
.holiday-item__icon {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.holiday-item__icon svg { width: 18px; height: 18px; }
.holiday-item__icon--nat  { background: rgba(239,68,68,0.1); color: #ef4444; }
.holiday-item__icon--rel  { background: rgba(251,191,36,0.1); color: #fbbf24; }
.holiday-item__icon--int  { background: rgba(77,142,245,0.1); color: var(--blue); }
.holiday-item__icon--cul  { background: rgba(52,211,153,0.1); color: #34d399; }
.holiday-item__name { font-size: .95rem; font-weight: 400; line-height: 1.4; }
.holiday-item__type { font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.holiday-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 500;
  margin-top: 4px;
}
.holiday-tag--nat  { background: rgba(239,68,68,0.12); color: #ef4444; }
.holiday-tag--opt  { background: rgba(251,191,36,0.12); color: #fbbf24; }

/* ─── Sidebar card ───────────────────────────────────────────────────────── */
.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
}
.sidebar-card__head-note {
  flex: 1 0 100%;
  padding-left: 26px;
  font-size: .72rem;
  font-weight: 400;
  color: var(--text-3);
  line-height: 1.35;
}
.sidebar-card__head svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-card__body { padding: 16px 18px; }
.sidebar-card__empty {
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}
.sidebar-card__empty a { color: var(--gold); }
.upcoming-list { display: flex; flex-direction: column; gap: 0; }
.upcoming-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-item:hover { color: var(--gold); }
.upcoming-date {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--gold);
  min-width: 36px;
  line-height: 1.2;
}
.upcoming-date small { display: block; font-family: var(--font-ui); font-size: .65rem; color: var(--text-3); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.upcoming-name { flex: 1; line-height: 1.4; }
.upcoming-kind {
  display: block;
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #fbbf24;
  margin-top: 3px;
}
.upcoming-kind--nat { color: #f87171; }
.upcoming-kind--com { color: #34d399; }
.upcoming-item--day { padding-left: 0; }
.upcoming-list--day .upcoming-item--day:first-child { padding-top: 2px; }
.upcoming-badge { font-size: .7rem; padding: 1px 7px; border-radius: 50px; background: rgba(239,68,68,0.1); color: #ef4444; flex-shrink: 0; margin-top: 1px; }

/* ─── Event detail ───────────────────────────────────────────────────────── */
.event-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.event-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-3);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.event-breadcrumb a { color: var(--text-2); transition: color .15s; }
.event-breadcrumb a:hover { color: var(--gold); }
.event-breadcrumb__sep { opacity: .4; }
.event-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.event-type-icon {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  flex-shrink: 0;
}
.event-type-icon svg { width: 28px; height: 28px; }
.event-type-icon--nat  { background: rgba(239,68,68,0.12); color: #ef4444; }
.event-type-icon--rel  { background: rgba(251,191,36,0.12); color: #fbbf24; }
.event-type-icon--int  { background: rgba(77,142,245,0.12); color: var(--blue); }
.event-type-icon--cul  { background: rgba(52,211,153,0.12); color: #34d399; }
.event-type-icon--def  { background: var(--gold-dim); color: var(--gold); }
.event-heading {
  font-family: var(--font-disp);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .01em;
}
.event-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 50px;
  background: var(--gold-dim);
  border: 1px solid var(--border-acc);
  font-size: .8rem;
  color: var(--gold);
}
.event-date-pill svg { width: 14px; height: 14px; }
.event-content { line-height: 1.8; color: var(--text-2); }
.event-content p { margin-bottom: 1.2em; font-size: 1rem; }
.event-content h2 {
  font-family: var(--font-disp);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  margin: 2em 0 .8em;
  letter-spacing: .02em;
}
.event-content h3 {
  font-family: var(--font-disp);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  margin: 1.5em 0 .6em;
}
.event-next {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.event-next h3 {
  font-family: var(--font-disp);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
}
.event-next-list { display: flex; flex-direction: column; gap: 8px; }
.event-next-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text-2);
}
.event-next-item svg { width: 14px; height: 14px; color: var(--gold); flex-shrink: 0; }

/* ─── Year picker ────────────────────────────────────────────────────────── */
.year-tabs {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.year-tab {
  padding: 6px 16px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  font-size: .85rem;
  color: var(--text-2);
  transition: all .2s;
}
.year-tab:hover { border-color: var(--border-acc); color: var(--text); }
.year-tab.active { background: var(--gold-dim); border-color: var(--border-acc); color: var(--gold); font-weight: 500; }

/* ─── Full holiday page layout ───────────────────────────────────────────── */
.holidays-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 24px 64px;
}

/* Tipos de feriado (build_index.py → kind) */
.holiday-section {
  margin-bottom: 48px;
}
.holiday-section:last-child { margin-bottom: 0; }
.holiday-section__title {
  font-family: var(--font-disp);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.holiday-section--national .holiday-section__title { color: #f87171; }
.holiday-section--optional .holiday-section__title { color: #fbbf24; }
.holiday-section--commemorative .holiday-section__title { color: var(--text-2); }
.holiday-section__subtitle {
  font-size: .85rem;
  color: var(--text-3);
  margin-bottom: 20px;
  max-width: 52ch;
  line-height: 1.55;
}
.holiday-kind-tag {
  display: inline-block;
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 8px;
  border-radius: 50px;
  margin-top: 5px;
}
.holiday-kind-tag--nat { background: rgba(239,68,68,0.14); color: #f87171; }
.holiday-kind-tag--int { background: rgba(245,158,11,0.12); color: #fbbf24; }
.holiday-kind-tag--cul { background: rgba(148,163,184,0.1); color: var(--text-3); }

/* ─── Calendar month full page ───────────────────────────────────────────── */
.cal-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}
.cal-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.cal-page-header h1 {
  font-family: var(--font-disp);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 300;
  letter-spacing: .03em;
  flex: 1;
}
.cal-full-grid {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-full-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.cal-full-weekday {
  padding: 12px 8px;
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
}
.cal-full-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-full-day {
  min-height: 110px;
  padding: 10px 10px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.cal-full-day:nth-child(7n) { border-right: none; }
.cal-full-day:hover { background: var(--bg-3); }
.cal-full-day--today { background: var(--gold-dim); }
.cal-full-day--today .cal-full-num { color: var(--gold); font-weight: 600; }
.cal-full-day--other { opacity: .35; }
.cal-full-num {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.cal-full-events { display: flex; flex-direction: column; gap: 3px; }
.cal-full-event {
  font-size: .68rem;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity .15s;
}
.cal-full-event:hover { opacity: .8; }
.cal-full-event--holiday { background: rgba(239,68,68,0.15); color: #fca5a5; }
.cal-full-event--national {
  background: rgba(239,68,68,0.18);
  color: #fca5a5;
}
.cal-full-event--optional {
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
}
.cal-full-event--event   { background: rgba(240,165,0,0.1);  color: #fcd34d; }
a.cal-full-event {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.cal-full-event:hover { opacity: 0.92; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 40px 24px;
}
.footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.footer__brand .brand-name {
  font-size: 1.1rem;
  font-weight: 600;
}
.footer__brand .brand-name__calendari {
  color: #fff;
}
.footer__brand .brand-name__on {
  color: var(--gold);
}
.footer__brand svg {
  width: 28px;
  height: 28px;
  color: var(--gold);
}
.footer__tagline { font-size: .85rem; color: var(--text-3); }
.footer__copyright {
  margin-top: 20px;
  font-size: .78rem;
  color: var(--text-3);
  letter-spacing: .02em;
}
.footer__countries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.footer__country-link {
  font-size: .78rem;
  color: var(--text-3);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: all .2s;
}
.footer__country-link:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-2); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav__logo .brand-name { display: none; }
  .hero { padding: 48px 16px 36px; }
  .countries-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 0 16px 48px; }
  .cal-full-day { min-height: 70px; padding: 6px; }
  .cal-full-num { font-size: .9rem; }
  .event-hero { flex-direction: column; }
}
