/* ============================================================
   CalendarGlobe — style.css
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --ink:          #0f1923;
  --ink-soft:     #4a5568;
  --ink-muted:    #8896a5;
  --paper:        #f8f6f1;
  --paper-warm:   #efe9de;
  --accent:       #c8462b;
  --accent-soft:  #f0e6e3;
  --accent-hover: #a8341e;
  --green:        #2d6a4f;
  --green-soft:   #e0f0e8;
  --border:       #ddd8cf;
  --white:        #ffffff;
  --radius:       6px;
  --radius-lg:    10px;
  --shadow-sm:    0 1px 3px rgba(15,25,35,0.08);
  --shadow:       0 1px 3px rgba(15,25,35,0.08), 0 4px 12px rgba(15,25,35,0.05);
  --shadow-lg:    0 4px 6px rgba(15,25,35,0.07), 0 10px 30px rgba(15,25,35,0.1);
  --max-width:    1100px;
  --nav-height:   56px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif;
  line-height: 1.15;
  letter-spacing: -0.3px;
}
h1 { font-size: clamp(28px, 4vw, 48px); }
h2 { font-size: clamp(20px, 3vw, 26px); }
h3 { font-size: 18px; }
h4 { font-size: 14px; font-family: 'DM Sans', sans-serif; font-weight: 600; letter-spacing: 0.2px; }

/* ── Utility ────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section-gap { padding: 40px 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-red    { background: var(--accent-soft);  color: var(--accent); }
.badge-muted  { background: var(--paper-warm);   color: var(--ink-muted); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--ink);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-links > a,
.nav-dropdown-trigger {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.nav-links > a:hover,
.nav-dropdown-trigger:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 180px;
  z-index: 300;
}
.nav-dropdown-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s;
}
.nav-dropdown-menu a:hover {
  background: var(--paper);
  color: var(--accent);
}

/* Mega Menu */
.mega-menu {
  display: none;
  padding: 0;
  min-width: 420px;
  left: 0;
}
.mega-col {
  flex: 1;
  padding: 16px 0;
  border-right: 1px solid var(--border);
  min-width: 160px;
}
.mega-col:last-child { border-right: none; }
.mega-col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  padding: 4px 18px 8px;
}
.mega-col a {
  display: block;
  padding: 7px 18px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s;
  white-space: nowrap;
}
.mega-col a:hover {
  background: var(--paper);
  color: var(--accent);
}
.mega-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 18px;
}
.mega-all-link {
  font-weight: 600 !important;
  color: var(--accent) !important;
}

/* Desktop only: hover opens dropdowns */
@media (min-width: 641px) {
  .nav-dropdown:hover .nav-dropdown-menu { display: block; }
  .mega-dropdown:hover .mega-menu { display: flex; }
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  margin-left: auto;
  padding: 8px;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--border);
}
.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 24px;
  font-size: 13px;
  color: var(--ink-muted);
}
.breadcrumb-inner a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-inner a:hover { color: var(--accent); }
.breadcrumb-inner .sep { margin: 0 6px; color: var(--border); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: var(--ink);
  padding: 52px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent, transparent 40px,
    rgba(255,255,255,0.015) 40px,
    rgba(255,255,255,0.015) 41px
  );
  pointer-events: none;
}
.hero-flag    { font-size: 56px; margin-bottom: 16px; display: block; position: relative; }
.hero h1      { color: var(--white); margin-bottom: 10px; position: relative; }
.hero-sub     { color: rgba(255,255,255,0.5); font-size: 15px; font-weight: 300; position: relative; }

/* ── Year Tabs ──────────────────────────────────────────────── */
.year-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.year-tabs-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}
.year-tab {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
  display: block;
}
.year-tab:hover  { color: var(--ink); }
.year-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Page Layout ────────────────────────────────────────────── */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.sidebar { display: flex; flex-direction: column; gap: 20px; }

/* ── Section Header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 22px; }
.section-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
}
.card-icon  { font-size: 17px; }
.card-title { font-weight: 600; font-size: 14px; }

/* ── Stats Row ──────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.stat-item { background: var(--white); padding: 20px; text-align: center; }
.stat-number {
  font-family: 'DM Serif Display', serif;
  font-size: 32px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Holiday Table ──────────────────────────────────────────── */
.holiday-table { width: 100%; border-collapse: collapse; }
.holiday-table tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.holiday-table tr:last-child { border-bottom: none; }
.holiday-table tr:hover { background: var(--paper); }
.holiday-table td { padding: 12px 20px; font-size: 14px; vertical-align: middle; }
.holiday-table .col-date    { color: var(--ink-muted); font-size: 13px; white-space: nowrap; width: 110px; }
.holiday-table .col-weekday { color: var(--ink-muted); font-size: 12px; width: 80px; }
.holiday-table .col-name    { font-weight: 500; }
.holiday-table .col-type    { text-align: right; white-space: nowrap; }

/* ── School Holidays Grid ───────────────────────────────────── */
.school-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.school-item { background: var(--white); padding: 14px 20px; transition: background 0.12s; }
.school-item:hover { background: var(--paper); }
.school-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.school-dates           { font-size: 14px; font-weight: 500; }
.school-dates.tbd       { color: var(--ink-muted); font-style: italic; font-weight: 400; }
.school-dates.no-break  { color: var(--ink-muted); font-size: 13px; }

/* ── Region Chips ───────────────────────────────────────────── */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 28px;
}
.region-chip {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  display: block;
}
.region-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ── Sidebar Cards ──────────────────────────────────────────── */
.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.info-card-title {
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--ink-muted); }
.info-value { font-weight: 600; }

.quick-links { list-style: none; }
.quick-links li { border-bottom: 1px solid var(--border); }
.quick-links li:last-child { border-bottom: none; }
.quick-links a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all 0.12s;
}
.quick-links a:hover { color: var(--accent); background: var(--paper); padding-left: 22px; }

.nearby-list { list-style: none; }
.nearby-list li { border-bottom: 1px solid var(--border); }
.nearby-list li:last-child { border-bottom: none; }
.nearby-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s;
}
.nearby-list a:hover { background: var(--paper); color: var(--accent); }
.nearby-flag { font-size: 18px; line-height: 1; }

/* ── Coming Soon Banner ─────────────────────────────────────── */
.coming-soon-banner {
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 28px;
}
.coming-soon-banner h3 { margin-bottom: 8px; font-size: 18px; }
.coming-soon-banner p  { color: var(--ink-muted); font-size: 14px; }

/* ── Country Grid (Homepage) ────────────────────────────────── */
.continent-section { margin-bottom: 48px; }
.continent-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.country-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.country-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.country-card.coming-soon { opacity: 0.55; cursor: default; pointer-events: none; }
.country-card-flag { font-size: 24px; line-height: 1; flex-shrink: 0; }
.country-card-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.country-card-badge { font-size: 10px; color: var(--ink-muted); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.5);
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}
.footer-brand .nav-logo { margin-bottom: 12px; display: inline-block; }
.footer-brand p { font-size: 13px; line-height: 1.6; max-width: 240px; }
.footer-col h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom { font-size: 12px; text-align: center; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 640px) {
  .nav-links    { display: none; }
  .nav-toggle   { display: block; }
  .hero         { padding: 36px 16px 28px; }
  .hero-flag    { font-size: 44px; }
  .stats-row    { grid-template-columns: repeat(3, 1fr); }
  .school-grid  { grid-template-columns: 1fr; }
  .regions-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .footer-grid  { grid-template-columns: 1fr; gap: 24px; }
  .page-container { padding: 24px 16px; }
  .container    { padding: 0 16px; }
  .holiday-table .col-weekday { display: none; }
}

/* ── Mobile Nav Open State ──────────────────────────────────── */
.nav-links.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0; bottom: 0;
  background: var(--ink);
  overflow-y: auto;
  z-index: 199;
  padding: 0;
  gap: 0;
}

/* Top-level trigger rows */
.nav-links.open .nav-dropdown {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-links.open .nav-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  padding: 16px 20px;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
}
.nav-links.open .nav-dropdown-trigger::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  color: rgba(255,255,255,0.4);
  transition: transform 0.2s;
}
.nav-links.open .nav-dropdown.is-open .nav-dropdown-trigger::after {
  content: '−';
}

/* Mega menu hidden by default on mobile */
.nav-links.open .mega-menu {
  display: none;
  flex-direction: row;
  position: static;
  background: rgba(0,0,0,0.25);
  border: none;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.nav-links.open .nav-dropdown.is-open .mega-menu {
  display: flex;
}

/* Each column becomes a section */
.nav-links.open .mega-col {
  flex: 1;
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 14px 16px;
}
.nav-links.open .mega-col:last-child { border-right: none; }

.nav-links.open .mega-col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.35);
  padding: 0 0 8px 0;
}
.nav-links.open .mega-col a {
  display: block;
  padding: 7px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  white-space: normal;
  background: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.nav-links.open .mega-col a:last-child { border-bottom: none; }
.nav-links.open .mega-col a:hover { color: var(--white); background: none; }
.nav-links.open .mega-divider {
  background: rgba(255,255,255,0.06);
  margin: 8px 0;
}