/* =============================================
   CALIDREAM FOUNDATION — GLOBAL STYLESHEET
   Trust palette: Navy + Teal + Gold
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #1A3557;
  --navy-mid:  #224068;
  --teal:      #0F9B8E;
  --teal-light:#13B5A6;
  --gold:      #E8A020;
  --gold-light:#F5B93A;
  --cream:     #F8F6F2;
  --white:     #FFFFFF;
  --text:      #1E2A38;
  --muted:     #5E6E82;
  --border:    #DDE3EB;
  --danger:    #C0392B;
  --success:   #0F9B8E;
  --shadow:    0 2px 16px rgba(26,53,87,0.09);
  --radius:    6px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-light); }
img { max-width: 100%; height: auto; }

/* ── UTILITY ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.text-center { text-align: center; }
.text-white { color: #fff; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--navy); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1rem; color: var(--muted); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
  display: block;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-light); color: #fff; transform: translateY(-2px); }

.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-mid); color: #fff; transform: translateY(-2px); }

.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy); transform: translateY(-2px); }

.btn-outline { background: transparent; border: 2px solid var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; }

.btn-outline-white { background: transparent; border: 2px solid rgba(255,255,255,0.6); color: #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,0.15); border-color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }

.btn-sm { padding: 9px 18px; font-size: 0.82rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }

/* ── TOPBAR ── */
.topbar {
  background: var(--navy);
  padding: 8px 0;
  font-size: 0.78rem;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-links { display: flex; gap: 20px; align-items: center; }
.topbar-links a { color: rgba(255,255,255,0.7); font-size: 0.75rem; transition: color 0.2s; }
.topbar-links a:hover { color: var(--gold); }

.topbar-actions { display: flex; gap: 10px; align-items: center; }

.topbar-cta {
  background: var(--gold);
  color: var(--navy) !important;
  padding: 5px 14px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.topbar-cta:hover { background: var(--gold-light); color: var(--navy) !important; }

/* ── HEADER / NAV ── */
header {
  background: var(--white);
  box-shadow: 0 1px 0 var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px; height: 40px;
  background: var(--navy);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-weight: 900;
  font-size: 1.2rem;
}

.logo-text { line-height: 1.1; }
.logo-text strong { display: block; font-size: 0.95rem; color: var(--navy); font-weight: 700; }
.logo-text span { font-size: 0.7rem; color: var(--teal); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }

/* HOVER FIX: Expanded zone + no gap + smooth animation */
.nav-item { 
  position: relative; 
  padding-bottom: 8px; /* Expands hover zone downward */
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover { background: var(--cream); color: var(--teal); }
.nav-link.active { color: var(--teal); background: rgba(15,155,142,0.08); }
.nav-link .arrow { font-size: 0.6rem; transition: transform 0.2s; }

.nav-item:hover .dropdown { 
  display: block; 
  animation: fadeIn 0.15s ease-in;
}
.nav-item:hover .arrow { transform: rotate(180deg); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 4px); /* Reduced gap - was +4px, now overlaps slightly */
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 220px;
  z-index: 100;
  padding: 8px 0;
}

.dropdown a {
  display: block;
  padding: 9px 18px;
  font-size: 0.84rem;
  color: var(--text);
  transition: background 0.15s;
}

.dropdown a:hover { background: var(--cream); color: var(--teal); }

.dropdown-mega {
  min-width: 600px;
  display: none;
  position: absolute;
  top: calc(100% - 4px); /* Same fix - reduced gap */
  left: -100px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  z-index: 100;
}

.nav-item:hover .dropdown-mega { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr; 
  gap: 24px;
  animation: fadeIn 0.15s ease-in;
}

.mega-col h4 { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.mega-col a { display: block; padding: 5px 0; font-size: 0.83rem; color: var(--text); border-bottom: 1px solid transparent; }
.mega-col a:hover { color: var(--teal); }

/* ── FLYOUT NAVIGATION ── */
.dropdown-section {
  padding: 4px 0;
}

.dropdown-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 18px 4px 18px;
  margin: 0;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.dropdown-item-flyout {
  position: relative;
}

.dropdown-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  font-size: 0.84rem;
  color: var(--text);
  transition: background 0.15s;
}

.dropdown-parent:hover {
  background: var(--cream);
  color: var(--teal);
}

.flyout-arrow {
  font-size: 0.9rem;
  color: var(--muted);
  margin-left: auto;
}

.flyout {
  display: none;
  position: absolute;
  left: 100%;
  top: -8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 240px;
  padding: 8px 0;
  z-index: 101;
  margin-left: -1px;
}

.dropdown-item-flyout:hover .flyout {
  display: block;
  animation: flyoutSlide 0.2s ease-out;
}

@keyframes flyoutSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.flyout a {
  display: block;
  padding: 9px 18px;
  font-size: 0.84rem;
  color: var(--text);
  transition: background 0.15s;
}

.flyout a:hover {
  background: var(--cream);
  color: var(--teal);
}

.flyout-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

/* ── STICKY TAB STRIP (Driver Safety Section) ── */
.safety-tabs {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tab-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.tab-strip::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.tab-item {
  display: inline-flex;
  align-items: center;
  padding: 14px 20px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-item:hover {
  color: var(--teal);
  background: rgba(15,155,142,0.04);
}

.tab-item.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.nav-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.lang-toggle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.lang-toggle:hover { border-color: var(--teal); color: var(--teal); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.hamburger span { width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: all 0.3s; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #0D2B4B 100%);
  padding: 80px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15,155,142,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-left .eyebrow { color: var(--gold); }

.hero-left h1 {
  color: #fff;
  margin-bottom: 20px;
}

.hero-left h1 em { font-style: normal; color: var(--gold); }

.hero-left p {
  color: rgba(255,255,255,0.72);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-top: 24px;
}

.hero-badge strong { color: rgba(255,255,255,0.9); }

.hero-right { position: relative; }

.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.stat-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}

.stat-card .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card .label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

/* ── ALERT BANNER ── */
.alert-banner {
  background: linear-gradient(90deg, #C0392B, #E74C3C);
  padding: 12px 0;
  text-align: center;
}

.alert-banner p {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  margin: 0;
}

.alert-banner a { color: var(--gold-light); font-weight: 700; }

/* ── SECTION HEADERS ── */
.section-header { margin-bottom: 48px; }
.section-header.center { text-align: center; }
.section-header p { max-width: 580px; font-size: 1.05rem; }
.section-header.center p { margin: 0 auto; }

/* ── CARDS ── */
.cards-grid {
  display: grid;
  gap: 24px;
}

.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.card-icon.teal { background: rgba(15,155,142,0.1); }
.card-icon.navy { background: rgba(26,53,87,0.1); }
.card-icon.gold { background: rgba(232,160,32,0.1); }
.card-icon.danger { background: rgba(192,57,43,0.12); }

.card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.card p { font-size: 0.9rem; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: 16px;
}

/* ── TICKET TABLE ── */
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ticket-table th {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ticket-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.ticket-table tr:nth-child(even) td { background: var(--cream); }
.ticket-table tr:hover td { background: rgba(15,155,142,0.05); }

.cvc-code { font-family: monospace; font-size: 0.82rem; background: rgba(26,53,87,0.08); padding: 2px 6px; border-radius: 3px; font-weight: 600; color: var(--navy); }

.fine-amount { font-weight: 700; color: var(--danger); }
.fine-total { font-weight: 700; color: var(--danger); font-size: 1rem; }
.points-badge { background: rgba(192,57,43,0.1); color: var(--danger); padding: 2px 8px; border-radius: 100px; font-size: 0.75rem; font-weight: 700; }

/* ── WARNING BOX ── */
.warning-box {
  background: rgba(192,57,43,0.06);
  border: 1px solid rgba(192,57,43,0.2);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}

.warning-box h4 { color: var(--danger); margin-bottom: 8px; }
.warning-box p { font-size: 0.9rem; margin: 0; }

.info-box {
  background: rgba(15,155,142,0.06);
  border: 1px solid rgba(15,155,142,0.2);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}

.info-box h4 { color: var(--teal); margin-bottom: 8px; }
.info-box p { font-size: 0.9rem; margin: 0; }

/* ── CTA STRIP ── */
.cta-strip {
  background: linear-gradient(135deg, var(--teal) 0%, #0D8A7E 100%);
  padding: 56px 0;
  text-align: center;
}

.cta-strip h2 { color: #fff; margin-bottom: 12px; }
.cta-strip p { color: rgba(255,255,255,0.8); max-width: 520px; margin: 0 auto 28px; }
.cta-strip .btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── COMPLIANCE CTA ── */
.compliance-cta {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 48px 0;
}

.compliance-cta h3 { color: #fff; margin-bottom: 8px; }
.compliance-cta p { color: rgba(255,255,255,0.65); margin: 0; font-size: 0.9rem; }
.compliance-cta .btns { display: flex; gap: 12px; flex-shrink: 0; }

/* ── FOOTER ── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand .logo-text strong { color: #fff; }
.footer-brand .logo-text span { color: var(--teal); }
.footer-brand p { color: rgba(255,255,255,0.55); font-size: 0.88rem; margin-top: 16px; line-height: 1.7; }

.footer-col h4 {
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  padding: 3px 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--teal-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
}

.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: rgba(255,255,255,0.45); }
.footer-bottom-links a:hover { color: rgba(255,255,255,0.8); }

.ein-line { color: rgba(255,255,255,0.35); font-size: 0.75rem; }

/* ── BREADCRUMB ── */
.breadcrumb {
  background: var(--cream);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.breadcrumb nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.breadcrumb a { color: var(--teal); }
.breadcrumb span { color: var(--muted); }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #0D2B4B 100%);
  padding: 56px 0;
}

.page-hero h1 { color: #fff; margin-bottom: 12px; }
.page-hero p { color: rgba(255,255,255,0.72); max-width: 600px; font-size: 1.05rem; margin: 0; }
.page-hero .eyebrow { color: var(--gold); }

/* ── SCHOOL LIST ── */
.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.school-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.school-card h4 { font-size: 0.95rem; color: var(--navy); }
.school-card span { font-size: 0.78rem; color: var(--muted); }
.school-card a { font-size: 0.8rem; color: var(--teal); font-weight: 600; margin-top: 4px; }

/* ── CITY PAGE ── */
.city-header {
  background: linear-gradient(135deg, var(--navy), #0D2B4B);
  padding: 64px 0;
}

.city-header h1 { color: #fff; }
.city-header .county-badge {
  background: var(--teal);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 16px;
}

/* ── BLOG ── */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.blog-card:hover { box-shadow: var(--shadow); }

.blog-card-img {
  height: 180px;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}

.blog-card-body { padding: 20px; }
.blog-card-body .tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}

.blog-card-body h3 { font-size: 1rem; margin-bottom: 8px; }
.blog-card-body p { font-size: 0.85rem; }

/* ── DONATE ── */
.donate-box {
  background: linear-gradient(135deg, var(--teal), #0D8A7E);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  color: #fff;
}

.donate-box h2 { color: #fff; margin-bottom: 12px; }
.donate-box p { color: rgba(255,255,255,0.8); max-width: 480px; margin: 0 auto 28px; }

.donate-amounts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }

.amount-btn {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.amount-btn:hover, .amount-btn.active {
  background: #fff;
  color: var(--teal);
  border-color: #fff;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-right { display: none; }
}

@media (max-width: 768px) {
  nav { display: none; }
  .hamburger { display: flex; }
  .cards-3, .cards-2 { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .compliance-cta { flex-direction: column; }
  .compliance-cta .btns { flex-direction: column; width: 100%; }
  .topbar-links { display: none; }
  .section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
