:root {
  --ink: #17211b;
  --muted: #5e6c63;
  --line: #dce5df;
  --paper: #ffffff;
  --soft: #f3f7f4;
  --brand: #147a50;
  --brand-dark: #0c5537;
  --accent: #e9b44c;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(20, 55, 38, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
a { color: var(--brand-dark); text-underline-offset: 0.2em; }
a:hover { color: var(--brand); }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(220, 229, 223, 0.8); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(12px); }
.header-inner { min-height: 70px; display: flex; align-items: center; gap: 28px; }
.brand { color: var(--ink); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.04em; text-decoration: none; }
.brand span { color: var(--brand); }
.brand-tagline { color: var(--muted); font-size: 0.8rem; font-weight: 500; white-space: nowrap; }
.primary-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.primary-nav a { color: var(--muted); font-weight: 650; text-decoration: none; }
.primary-nav a:hover { color: var(--brand); }
.language-picker select { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 0 34px 0 12px; color: var(--ink); font-size: 0.92rem; }
.header-selectors { display: flex; align-items: center; gap: 10px; }
.year-picker select { min-width: 96px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 0 34px 0 12px; color: var(--ink); font-size: 0.92rem; }
.countries-year-picker-wrap { margin-bottom: 14px; }
.countries-year-picker-wrap .year-picker select { min-width: 130px; font-size: 0.92rem; }
.year-hint { margin-top: 4px; color: var(--muted); font-size: 0.88rem; }
.year-hint a { color: var(--brand-dark); font-weight: 650; }
.hero { padding-block: 68px 49px; background: radial-gradient(ellipse at 50% -20%, #e4f3e9 0, transparent 65%); }
.hero h1, .page-hero h1 { max-width: 820px; margin: 0; font-size: clamp(2.4rem, 7vw, 5.5rem); line-height: 1.02; letter-spacing: -0.055em; }
.page-hero { padding-block: 68px 42px; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.hero-copy, .page-hero > p:last-child { max-width: 720px; color: var(--muted); font-size: 1.16rem; }
.hero-subtitle { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.section { padding-block: 35px; }
.section-tint { background: var(--soft); }
.section h2 { margin-top: 0; letter-spacing: -0.025em; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { min-height: 190px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); text-decoration: none; transition: transform 160ms ease, border-color 160ms ease; }
.card:hover { transform: translateY(-3px); border-color: #a9cdb8; }
.card .card-code { color: var(--brand); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; }
.card h3 { margin: 18px 0 6px; color: var(--ink); font-size: 1.35rem; }
.card p { margin: 0; color: var(--muted); }
.card .card-link { margin-top: auto; padding-top: 18px; color: var(--brand-dark); font-weight: 750; }

.flag-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  object-fit: cover;
  flex-shrink: 0;
}

.flag-icon-lg {
  width: 40px;
  height: 40px;
}

.hero h1 .flag-icon {
  width: 0.8em;
  height: 0.8em;
  vertical-align: baseline;
  margin-right: 0.15em;
}

.flag-icon-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  object-fit: cover;
  flex-shrink: 0;
}
.year-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.year-link { display: inline-flex; min-width: 110px; justify-content: center; padding: 16px 22px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 1.15rem; font-weight: 800; text-decoration: none; }
.year-link-current { border-color: var(--brand); background: #eef8f2; color: var(--brand-dark); }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 0.9rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span + span::before, .breadcrumb a + span::before, .breadcrumb a + a::before { content: "/"; margin-right: 8px; color: #a3aea7; }
.notice { margin-bottom: 26px; padding: 15px 18px; border-left: 4px solid var(--accent); border-radius: 8px; background: #fff8e8; color: #6a5120; }
.holiday-list { display: grid; gap: 12px; }
.holiday-row { display: grid; grid-template-columns: minmax(150px, 0.32fr) 1fr; gap: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; }
.holiday-row time { color: var(--brand-dark); font-weight: 800; }
.holiday-row h2 { margin: 0; font-size: 1.12rem; }
.holiday-row p { margin: 4px 0 0; color: var(--muted); }
.year-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 34px; }
.year-nav a { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.source-box { padding-block: 8px; }

.site-footer { margin-top: 50px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 36px; }
.footer-inner p { margin: 0; }
.footer-inner a + a { margin-left: 18px; }

/* Hero stats — data overview cards between hero title and calendar. */
.hero-stats {
  margin-top: -12px;
  margin-bottom: 21px;
}
.stats-grid-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 55, 38, 0.05);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}
a.stat-card-hero:hover {
  border-color: #a9cdb8;
  box-shadow: 0 12px 28px rgba(20, 55, 38, 0.1);
}
.stat-number {
  font-size: 2.8rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--brand-dark);
}
.stat-card-hero h3 {
  margin: 0.5rem 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-card-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 940px) {
  .stats-grid-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hero-stats {
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
  }
  .stats-grid-hero {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    padding-right: 20px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .stat-card-hero {
    flex: 0 0 210px;
    scroll-snap-align: start;
  }
}

@media (max-width: 760px) {
  .brand-tagline { display: none; }
  .header-inner { flex-wrap: wrap; gap: 12px; padding-block: 14px; }
  .primary-nav {
    order: 4;
    width: 100%;
    margin: 0;
    margin-top: -10px;
    padding: 8px 0 0;
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .language-picker { margin-left: 0; }
  .header-selectors { margin-left: auto; }
  .hero { padding-block: 40px 27px; background: radial-gradient(ellipse at 50% -10%, #e4f3e9 0, transparent 70%); }
  .card-grid { grid-template-columns: 1fr; }
  .holiday-row { grid-template-columns: 1fr; gap: 8px; }
  .footer-inner { flex-direction: column; }
}

/* Country-year pages retain the denser calendar presentation from the original HoliWiki. */
#main-content > .hero:not(.wrap),
#main-content > .answer-box,
#main-content > .stats,
#main-content > .panel {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

#main-content > .hero:not(.wrap) { padding-block: 68px 42px; }
#main-content > .hero:not(.wrap) h1 {
  max-width: 880px;
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.answer-box,
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.answer-box {
  margin-bottom: 2rem;
  border-left: 5px solid var(--accent);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.answer-box strong { display: block; margin-bottom: 0.35rem; font-size: 1.1rem; }
.answer-box p { margin: 0; }
.panel { margin-bottom: 2rem; padding: clamp(1.25rem, 3vw, 2rem); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 2rem;
}
.stat {
  min-width: 0;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 18px;
}
.stat:nth-child(2) { border-left-color: #355c9a; }
.stat:nth-child(3) { border-left-color: var(--accent); }
.stat b { display: block; overflow-wrap: anywhere; font-size: 28px; line-height: 1.15; }
.stat p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.stat-value { display: flex; align-items: center; gap: 12px; }
.stat-year b { font-size: 28px; }
.calendar-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--brand);
  font-size: 22px;
}
.country-value small { color: var(--muted); font-size: 0.75rem; }
.stat-next b span, .stat-next b small { display: block; }
.stat-next b span { font-size: 1rem; }
.stat-next b small { margin-top: 0.3rem; font-size: 0.92rem; }

.calendar-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.calendar-intro p { margin: 0; color: var(--muted); }
.calendar-legend { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 0.75rem; font-size: 0.86rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.calendar-legend i { font-style: normal; }
.legend-star { color: var(--brand); }
.legend-workday { color: var(--accent); }
.calendar-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; }
.calendar-month {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(24, 52, 40, 0.06);
  overflow: visible;
}
.month-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
}
.month-heading h3 { margin: 0; font-size: 1rem; }
.month-heading span { color: var(--muted); font-size: 0.75rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0.55rem; }
.weekday-name { padding: 0.25rem 0; color: var(--muted); font-size: 0.68rem; font-weight: 800; text-align: center; }
.day-cell { position: relative; min-height: 48px; border: 1px solid #edf1ee; background: #fff; padding: 0.22rem; }
.day-cell.blank { border-color: transparent; background: transparent; }
.day-cell.has-holiday { background: #eef8f2; }
.day-cell.has-workday { background: #fff8e8; }
.day-cell.has-holiday.has-workday { background: linear-gradient(135deg, #eef8f2 50%, #fff8e8 50%); }
.day-number { display: block; color: #35423b; font-size: 0.72rem; font-variant-numeric: tabular-nums; line-height: 1; }
.day-events { display: flex; align-items: center; flex-wrap: wrap; gap: 0.12rem; margin-top: 0.35rem; }
.calendar-event {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: help;
  font-size: 0.68rem;
  outline: none;
}
.calendar-event.workday { background: var(--accent); }
.calendar-event:hover, .calendar-event:focus-visible { box-shadow: 0 0 0 3px rgba(20, 122, 80, 0.2); }
.event-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: 220px;
  transform: translateX(-50%);
  border-radius: 10px;
  background: #17221d;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
  color: #fff;
  padding: 0.7rem 0.8rem;
  text-align: left;
}
.event-popover strong, .event-popover small { display: block; }
.event-popover small { color: #d7e1dc; }
.calendar-event:hover .event-popover, .calendar-event:focus .event-popover { display: block; }

.holiday-table-section { margin-top: 2.25rem; }
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: rgba(255, 255, 255, 0.96);
  padding: 1rem;
}
.table-heading h3 { margin: 0; font-size: 1.2rem; }
.table-heading p { margin: 0.2rem 0 0; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.table-wrap table { width: 100%; border-collapse: collapse; background: #fff; }
.table-wrap th, .table-wrap td { border-bottom: 1px solid var(--line); padding: 0.85rem 1rem; text-align: left; vertical-align: top; }
.table-wrap th { background: var(--soft); color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.local-name { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.82rem; }
.type-badge { display: inline-block; border-radius: 999px; background: var(--soft); color: var(--brand-dark); padding: 0.25rem 0.6rem; font-size: 0.78rem; font-weight: 750; white-space: nowrap; }
.source-box { border-left: 4px solid var(--brand); background: var(--soft); box-shadow: none; }
.source-box p:last-child { margin-bottom: 0; }
.faq details { border-top: 1px solid var(--line); padding: 1rem 0; }
.faq details:last-child { padding-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 760; }
.faq details p { margin: 0.7rem 0 0; color: var(--muted); }

.holiday-stories {
  width: min(1120px, calc(100% - 40px));
  margin: 3rem auto 2rem;
}
.holiday-stories h2 { margin-bottom: 1.5rem; text-align: center; }
.stories-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.story-card { display: flex; gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.story-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f8e8d4;
  color: #9b2c20;
  font-family: ui-serif, Georgia, serif;
  padding: 0.25rem;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}
.story-body h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.story-body p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.7; }

/* Country directory — region-grouped layout inspired by Apple's country selector. */
.country-region-section {
  margin-bottom: 2.5rem;
}
.country-region-section h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.country-region-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 1rem;
}
.country-region-link,
.country-region-coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.98rem;
  transition: background 140ms ease;
}
.country-region-link {
  color: var(--brand-dark);
}
.country-region-link:hover {
  background: #eef8f2;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.country-region-link .flag-icon-sm {
  flex-shrink: 0;
}
.country-region-coming-soon {
  color: var(--muted);
  cursor: default;
}
.country-region-coming-soon .coming-soon {
  color: #a3aea7;
  font-size: 0.82rem;
  font-style: italic;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .country-region-grid {
    grid-template-columns: 1fr;
  }
}

/* Language list — simple, clean listing of supported languages. */
.language-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.language-item {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.language-native {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--ink);
}
.language-english {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}
.language-meta {
  margin-top: 6px;
  color: #a3aea7;
  font-size: 0.78rem;
}
@media (max-width: 620px) {
  .language-list {
    grid-template-columns: 1fr;
  }
}

/* Month quick-jump navigation — mobile only, horizontal scroll, sticky. */
.month-nav {
  display: none;
  margin-bottom: 1rem;
  position: sticky;
  top: 70px; /* JS overrides via inline style */
  z-index: 8;
  background: transparent;
  padding-top: 5px;
  padding-bottom: 0.4rem;
}
@media (max-width: 940px) {
  .month-nav {
    display: block;
  }
}
.month-nav-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.month-nav-scroll::-webkit-scrollbar { display: none; }
.month-nav-link {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms, border-color 140ms, color 140ms, box-shadow 140ms;
}
.month-nav-link:hover,
.month-nav-link:focus-visible {
  background: #eef8f2;
  border-color: var(--brand);
  color: var(--brand-dark);
}
.month-nav-link.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.month-nav-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Global home-page calendar — taller cells for multi-country flag display. */
.global-calendar .day-cell {
  min-height: 64px;
  padding: 0.28rem;
}
.global-calendar .day-cell.blank {
  border-color: transparent;
  background: transparent;
}
.global-calendar .day-cell.has-holiday {
  background: #eef8f2;
}
.global-calendar .day-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-top: 0.25rem;
}
.global-calendar .day-cell-flag {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  outline: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  line-height: 0;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 140ms ease;
}
.global-calendar .day-cell-flag:hover,
.global-calendar .day-cell-flag:focus-visible {
  box-shadow: 0 0 0 3px rgba(20, 122, 80, 0.25);
}
.global-calendar .day-cell-flag.pinned {
  box-shadow: 0 0 0 3px var(--brand);
}
.global-calendar .event-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: 230px;
  transform: translateX(-50%);
  border-radius: 10px;
  background: #17221d;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
  color: #fff;
  padding: 0.7rem 0.8rem;
  text-align: left;
  white-space: normal;
  font-size: 0.85rem;
}
.global-calendar .event-popover strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 0.9rem;
  font-weight: 700;
}
.popover-globe-icon {
  font-size: 24px;
  line-height: 1;
}
.global-calendar .event-popover strong a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
}
.global-calendar .event-popover strong a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.global-calendar .event-popover .popover-holiday-link,
.global-calendar .event-popover .popover-holiday-text {
  display: block;
  margin-top: 2px;
  line-height: 1.4;
}
.global-calendar .event-popover .popover-holiday-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
.global-calendar .event-popover .popover-holiday-text {
  color: #d7e1dc;
}
.global-calendar .event-popover .popover-holiday-link:hover,
.global-calendar .event-popover .popover-holiday-link:focus {
  color: #f5d080;
  text-decoration: underline;
}
.global-calendar .event-popover .popover-holiday-text {
  display: block;
  color: #d7e1dc;
}
.global-calendar .day-cell-flag:hover .event-popover,
.global-calendar .day-cell-flag:focus-visible .event-popover,
.global-calendar .day-cell-flag.pinned .event-popover {
  display: block;
}

/* Monthly calendar — list view, one month per section */
.monthly-calendar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.monthly-month {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.monthly-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.monthly-heading h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}
.monthly-heading span {
  color: var(--muted);
  font-size: 0.75rem;
}
.monthly-rows {
  padding: 0;
}
.monthly-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #edf1ee;
  font-size: 0.9rem;
}
.monthly-row:last-child {
  border-bottom: 0;
}
.monthly-date {
  flex-shrink: 0;
  width: 130px;
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.monthly-wday {
  flex-shrink: 0;
  width: 44px;
  color: var(--muted);
  font-weight: 650;
  text-align: center;
}
.monthly-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.monthly-sep {
  color: #c4d0c8;
  font-weight: 300;
  user-select: none;
}
.monthly-country-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 120px;
}
.monthly-country-link:hover {
  color: var(--brand);
  text-decoration: underline;
}
.monthly-intl-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-weight: 650;
  flex-shrink: 0;
  min-width: 120px;
}
.monthly-holiday-link {
  color: var(--brand-dark);
  font-weight: 650;
  text-decoration: none;
}
.monthly-holiday-link:hover {
  color: var(--brand);
  text-decoration: underline;
}
.monthly-holiday-text {
  color: var(--muted);
}

@media (max-width: 680px) {
  .monthly-row {
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
  }
  .monthly-date {
    min-width: auto;
  }
  .monthly-country-link,
  .monthly-intl-label {
    min-width: auto;
  }
}

@media (max-width: 940px) {
  .calendar-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .calendar-board { grid-template-columns: 1fr; }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat b { font-size: 24px; }
  .stat-year b { font-size: 24px; }
  .calendar-symbol { width: 32px; height: 32px; font-size: 18px; }
  .stories-grid { grid-template-columns: 1fr; }
  .story-card { align-items: flex-start; flex-direction: column; }
  .calendar-intro { align-items: flex-start; flex-direction: column; }
  .day-cell { min-height: 44px; }
  .event-popover { left: 0; transform: none; }
}

/* Globe icon for international holidays */
.holiday-global-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef6ff;
  font-size: 24px;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 1;
}

/* Ownership section on holiday detail page */
.holiday-ownership {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: #f0f6ff;
  border: 1px solid #d6e4f5;
}
.holiday-ownership p {
  margin: 0;
  font-size: 0.9rem;
}
.ownership-detail {
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Ownership note in popover */
.popover-ownership {
  display: block;
  color: #a0b8d0;
  font-size: 0.75rem;
  margin: 0.15rem 0 0.3rem;
}

/* Country list in international holiday popover */
.popover-country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.popover-country-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #d7e1dc;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}
.popover-country-item:hover {
  color: #fff;
  text-decoration: underline;
}
.popover-country-item .flag-icon-sm {
  width: 18px;
  height: 18px;
}

/* Holiday detail page */
.holiday-meta {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.holiday-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.holiday-meta p { margin: 0.25rem 0; }
.holiday-aka { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.holiday-section {
  width: min(1120px, calc(100% - 40px));
  margin: 1.5rem auto;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.holiday-section h2 { margin-top: 0; }
.traditions-list { margin: 0; padding-left: 1.25rem; }
.traditions-list li { margin-bottom: 0.4rem; }
.related-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.related-holiday-card {
  display: inline-flex;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-weight: 650;
  text-decoration: none;
}
.related-holiday-card:hover { border-color: var(--brand); color: var(--brand); }

/* Country flags cell in holiday occurrence table */
.country-flags-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.country-flag-cell {
  position: relative;
  display: inline-flex;
  border-radius: 50%;
  line-height: 0;
  outline: none;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 140ms ease;
}
.country-flag-cell:hover,
.country-flag-cell:focus-visible {
  box-shadow: 0 0 0 3px rgba(20, 122, 80, 0.25);
}
.country-flag-cell .event-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 20;
  display: none;
  transform: translateX(-50%);
  border-radius: 8px;
  background: #17221d;
  color: #eef3ef;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
}
.country-flag-cell:hover .event-popover,
.country-flag-cell:focus-visible .event-popover {
  display: block;
}

/* Category tags */
.category-tag { margin-right: 0.3rem; text-decoration: none; }
.category-tag:hover { background: var(--brand); color: white; }
.category-cell { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* Occurrence table */
.occurrence-country a { text-decoration: none; font-weight: 650; }

/* Calendar popover link */
.popover-link {
  display: block;
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  font-size: 0.85rem;
}
.popover-link:hover { text-decoration: underline; }

/* Global calendar flag as link */
.holiday-flag-link {
  display: inline-flex;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
}
.holiday-flag-link:hover,
.holiday-flag-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(20, 122, 80, 0.25);
}

/* Responsive tables on small screens */
@media (max-width: 860px) {
  .table-wrap table { min-width: 600px; }
  .holiday-section { padding: 1rem; }
  .holiday-meta-row { flex-direction: column; gap: 0.25rem; }
}
