@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Nunito:wght@400;500;600;700&display=swap');

:root {
  --purple:       #4A3B9C;
  --purple-dark:  #2E2560;
  --purple-light: #6B5BC2;
  --gold:         #F0A500;
  --gold-light:   #FFD166;
  --white:        #FFFFFF;
  --off-white:    #F7F5FF;
  --text:         #1E1A3C;
  --text-muted:   #6B6690;
  --border:       #DDD8F5;
  --success:      #2D9E6B;
  --danger:       #C0392B;
  --card-bg:      #FFFFFF;
  --nav-height:   68px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background: var(--off-white);
  line-height: 1.6;
}


/* ════════════════════════════════════════════
   NAV — desktop
   ════════════════════════════════════════════ */
nav {
  background: var(--purple-dark);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img { height: 44px; }

.nav-logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.nav-logo-text span { color: var(--gold); display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.12);
  color: var(--gold-light);
}

.nav-links .btn-login {
  background: var(--gold);
  color: var(--purple-dark);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
}

.nav-links .btn-login:hover {
  background: var(--gold-light);
  color: var(--purple-dark);
}

/* ── Dropdown (desktop only) ── */
.nav-links .has-dropdown { position: relative; }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple-dark);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  min-width: 210px;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 200;
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(255,255,255,0.15);
}

/* Show ONLY via JS .is-open — no CSS :hover, which fires on touch devices */
.nav-dropdown.is-open { display: block; }

.nav-dropdown a {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 9px 16px !important;
  border-radius: 0 !important;
  font-size: 0.875rem !important;
  border-left: 3px solid transparent !important;
  white-space: nowrap;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.nav-dropdown a:hover {
  background: rgba(255,255,255,0.1) !important;
  border-left-color: var(--gold) !important;
  color: var(--gold-light) !important;
}

.nav-dropdown .dropdown-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 4px 0;
}

.dropdown-arrow { font-size: 0.6rem; opacity: 0.7; margin-left: 2px; }
.age-tag { color: rgba(255,255,255,0.4); font-size: 0.78rem; margin-left: auto; }

/* ── Hamburger (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px; height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }


/* ════════════════════════════════════════════
   MOBILE OVERLAY + DRAWER
   ════════════════════════════════════════════ */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-overlay.is-visible {
  display: block;
  opacity: 1;
}

.nav-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(320px, 85vw);
  height: 100%;
  height: 100dvh;
  background: var(--purple-dark);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.nav-drawer.is-open { transform: translateX(0); }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.nav-drawer-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
}

.nav-drawer-close:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0 2rem;
  flex: 1;
}

.nav-drawer-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 1.25rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.nav-drawer-links a:hover,
.nav-drawer-links a.active {
  background: rgba(255,255,255,0.08);
  border-left-color: var(--gold);
  color: var(--gold-light);
}

.drawer-login-btn {
  margin: 0.75rem 1.25rem 0 !important;
  padding: 10px 16px !important;
  border-radius: 24px !important;
  background: var(--gold) !important;
  color: var(--purple-dark) !important;
  font-weight: 700 !important;
  border-left: none !important;
  justify-content: center;
}

.drawer-login-btn:hover {
  background: var(--gold-light) !important;
  color: var(--purple-dark) !important;
}

.drawer-accordion { border-left: 3px solid transparent; }

.drawer-accordion-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 1.25rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.drawer-accordion-trigger:hover { background: rgba(255,255,255,0.08); }
.drawer-accordion-trigger[aria-expanded="true"] { color: var(--gold-light); }

.drawer-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0,0,0,0.2);
}

.drawer-accordion-body a {
  padding-left: 2.5rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
}


/* ════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 60%, var(--purple-light) 100%);
  padding: 4rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; max-width: 700px; margin: 0 auto; }

.hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--gold); }

.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2rem;
}

.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }


/* ════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════ */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 24px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

.btn-primary { background: var(--gold); color: var(--purple-dark); }
.btn-outline  { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.6); }
.btn-outline:hover { border-color: var(--white); }
.btn-purple   { background: var(--purple); color: var(--white); }
.btn-sm       { padding: 6px 16px; font-size: 0.85rem; }
.btn-danger   { background: var(--danger); color: var(--white); }


/* ════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════ */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section   { padding: 3rem 0; }

.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple-dark);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.section-title span { color: var(--gold); }
.section-sub { color: var(--text-muted); margin-bottom: 2rem; }


/* ════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover { box-shadow: 0 8px 24px rgba(74,59,156,0.12); transform: translateY(-2px); }

.card-icon {
  width: 48px; height: 48px;
  background: var(--off-white);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 { font-size: 1rem; font-weight: 700; color: var(--purple-dark); margin-bottom: 0.4rem; }
.card p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }


/* ════════════════════════════════════════════
   COMPONENTS
   ════════════════════════════════════════════ */

/* Announcement band */
.announce {
  background: var(--gold);
  padding: 0.6rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--purple-dark);
}
.announce a { color: var(--purple-dark); }

/* Page header */
.page-header {
  background: var(--purple-dark);
  padding: 2.5rem 2rem;
  color: var(--white);
}
.page-header h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.page-header .breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.25rem;
}
.page-header .breadcrumb a { color: var(--gold); text-decoration: none; }

/* Role badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; }
.badge-leader { background: #E8E4FF; color: var(--purple); }
.badge-scout  { background: #E8F5E9; color: #2E7D32; }
.badge-parent { background: #FFF3E0; color: #E65100; }
.badge-admin  { background: #FCE4EC; color: #C62828; }


/* ════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--text); }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--purple); }

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }


/* ════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════ */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1rem; font-weight: 500; }
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #2E7D32; }
.alert-danger  { background: #FFEBEE; color: #C62828; border-left: 4px solid #C62828; }
.alert-info    { background: #E8E4FF; color: var(--purple); border-left: 4px solid var(--purple); }


/* ════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

table.data-table th {
  background: var(--purple-dark);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

table.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:nth-child(even) td { background: var(--off-white); }
table.data-table tr:hover td { background: #EEEAFF; }


/* ════════════════════════════════════════════
   SIDEBAR LAYOUT
   ════════════════════════════════════════════ */
.layout-sidebar { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }

.sidebar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}

.sidebar-section { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.sidebar-section:last-child { border-bottom: none; }

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 1rem 0.5rem;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar a:hover { background: var(--off-white); color: var(--purple); }
.sidebar a.active { background: #EEEAFF; color: var(--purple); border-left-color: var(--purple); font-weight: 700; }


/* ════════════════════════════════════════════
   DOC LIST
   ════════════════════════════════════════════ */
.doc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
}

.doc-item:hover { box-shadow: 0 4px 12px rgba(74,59,156,0.1); border-color: var(--purple-light); }

.doc-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.doc-icon-pdf  { background: #FFEBEE; }
.doc-icon-xlsx { background: #E8F5E9; }
.doc-icon-docx { background: #E3F2FD; }

.doc-info { flex: 1; min-width: 0; }
.doc-info strong { display: block; font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info span   { font-size: 0.8rem; color: var(--text-muted); }


/* ════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════ */
footer {
  background: var(--purple-dark);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.875rem;
}

footer a { color: var(--gold); text-decoration: none; }
footer .footer-logo { margin-bottom: 1rem; }
footer .footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }


/* ════════════════════════════════════════════
   RESPONSIVE — tablet (≤900px)
   ════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Contact page sidebar collapses earlier */
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}


/* ════════════════════════════════════════════
   RESPONSIVE — mobile (≤768px)
   ════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Nav ── */
  nav { padding: 0 1rem; }
  .nav-links    { display: none !important; }   /* desktop links gone */
  .nav-hamburger { display: flex; }              /* hamburger appears */

  /* Dropdown cannot appear on mobile — .nav-links is hidden,
     and the only show trigger (.is-open) is JS which only runs on desktop */
  .nav-dropdown { display: none !important; }

  /* ── Global images ── */
  img { max-width: 100%; height: auto; }
  .container img { max-width: 100%; height: auto; }

  /* ── Hero ── */
  .hero h1 { font-size: 2rem; }
  .hero p  { font-size: 0.95rem; }

  /* ── Cards ── */
  .card-grid { grid-template-columns: 1fr; }

  /* ── Sidebar ── */
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }

  /* ── sections.php — big cards (380px 1fr inline grid) ── */
  .container div[style*="380px"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Image block inside card — fill width, cap height */
  .container div[style*="380px"] > div:first-child {
    min-height: 220px !important;
    width: 100% !important;
  }

  /* ── sections-*.php — about section (1fr 1fr grid with image+text) ──
     Stack to single column; image on top, text below */
  .container > .section div[style*="grid-template-columns:1fr 1fr"],
  .container > .section div[style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  /* Image wrapper (has position:relative or aspect-ratio) goes first */
  .container > .section div[style*="grid-template-columns:1fr 1fr"] > div[style*="position:relative"],
  .container > .section div[style*="grid-template-columns:1fr 1fr"] > div[style*="aspect-ratio"] {
    order: -1;
  }

  /* Image wrapper fills width */
  .container div[style*="aspect-ratio:4/3"],
  .container div[style*="aspect-ratio: 4/3"] {
    width: 100% !important;
  }

  /* ── 2-col grids used for info/comms/CTA panels ── */
  .container div[style*="grid-template-columns:1fr 1fr"][style*="gap:1.5rem"],
  .container div[style*="grid-template-columns:1fr 1fr"][style*="gap: 1.5rem"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* ── Contact page form inner 2-col (name + email row) ── */
  .container div[style*="grid-template-columns:1fr 1fr"][style*="gap:1rem"],
  .container div[style*="grid-template-columns:1fr 1fr"][style*="gap: 1rem"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* ── Contact / parent-helper sidebar stack ── */
  .container > .section > div[style*="grid-template-columns:1fr 420px"],
  .container > .section > div[style*="grid-template-columns: 1fr 420px"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
  }

}


/* ════════════════════════════════════════════
   RESPONSIVE — small phones (≤400px)
   ════════════════════════════════════════════ */
@media (max-width: 400px) {
  .nav-logo-text { font-size: 0.9rem; }
  .nav-logo img  { height: 36px; }

  /* Mini-card grids (auto-fit) go to 1 column */
  .container div[style*="repeat(auto-fit"] {
    grid-template-columns: 1fr !important;
  }
}
