/**
 * layout.css
 * ─────────────────────────────────────────────────────
 * Structural layout: container, sections, navbar, footer,
 * page hero, breadcrumb, newsletter strip, CTA strip.
 */

/* ══════════════════════════════════════════════════════
   CONTAINER & SECTIONS
══════════════════════════════════════════════════════ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

.section {
  padding: var(--sp-2xl) 0;
}
.section-alt {
  background: var(--clr-bg-alt);
}
.section-dark {
  background: var(--clr-primary);
  position: relative;
  overflow: hidden;
}

/* Dot grid texture — used on dark sections */
.section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(245, 166, 35, 0.09) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  pointer-events: none;
}

/* Section header pattern */
.section-header {
  margin-bottom: var(--sp-lg);
}
.section-header__tag {
  /* uses .tag */
}
.section-header__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  color: var(--clr-primary);
  margin-bottom: 14px;
}
.section-header__intro {
  font-size: var(--fs-md);
  color: var(--clr-text-muted);
  max-width: 580px;
  line-height: var(--lh-relaxed);
}
.section-header__intro em {
  color: var(--clr-earth);
  font-style: italic;
}
.section-header--center {
  text-align: center;
}
.section-header--center .section-header__intro {
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition:
    border-color var(--t-mid) var(--ease),
    box-shadow var(--t-mid) var(--ease);
}

.nav.scrolled {
  border-color: var(--clr-border);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* Logo */
.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn var(--t-slow) var(--ease) both;
}

.nav__logo-mark {
  width: 38px;
  height: 38px;
  background: var(--clr-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-accent);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.nav__logo-text {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--clr-primary);
  line-height: 1.3;
}
.nav__logo-text span {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-normal);
  color: var(--clr-text-muted);
}

/* Nav links */
.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__links a {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition:
    background var(--t-fast),
    color var(--t-fast);
}
.nav__links a:hover,
.nav__links a.active {
  background: var(--clr-bg-alt);
  color: var(--clr-primary);
}
.nav__links a.active {
  font-weight: var(--fw-semi);
}

/* Mobile-only donate link inside menu */
.nav__mobile-cta {
  display: none;
}

/* Donate CTA button (desktop) */
.nav__cta {
  background: var(--clr-accent);
  color: var(--clr-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  padding: 9px 20px;
  border-radius: var(--radius-full);
  transition:
    background var(--t-fast),
    transform var(--t-fast);
}
.nav__cta:hover {
  background: var(--clr-accent-dark);
  color: var(--clr-white);
  transform: translateY(-1px);
}

/* Hamburger button */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.nav__hamburger:hover {
  background: var(--clr-bg-alt);
}

.nav__hamburger span {
  display: block;
  height: 2px;
  background: var(--clr-primary);
  border-radius: 2px;
  transition:
    transform var(--t-mid) var(--ease),
    opacity var(--t-fast),
    width var(--t-mid);
  transform-origin: center;
}
.nav__hamburger span:nth-child(1) {
  width: 22px;
}
.nav__hamburger span:nth-child(2) {
  width: 16px;
}
.nav__hamburger span:nth-child(3) {
  width: 22px;
}

/* Hamburger open state → X */
.nav__hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 22px;
}
.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav__hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 22px;
}

/* ══════════════════════════════════════════════════════
   PAGE HERO BANNER
══════════════════════════════════════════════════════ */
.page-hero {
  background: var(--clr-primary);
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(245, 166, 35, 0.1) 1px,
    transparent 1px
  );
  background-size: 32px 32px;
  pointer-events: none;
}

/* Gradient fade into page bg */
.page-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--clr-bg) 0%, transparent 100%);
}

.page-hero__inner {
  position: relative;
  z-index: 2;
}

.page-hero__arc {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.page-hero__arc--1 {
  width: 360px;
  height: 360px;
  border: 1.5px solid rgba(245, 166, 35, 0.14);
  right: -80px;
  top: 40px;
}
.page-hero__arc--2 {
  width: 200px;
  height: 200px;
  border: 1.5px solid rgba(245, 166, 35, 0.08);
  right: 40px;
  top: 140px;
}

.page-hero__h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: var(--fw-medium);
  color: var(--clr-white);
  line-height: var(--lh-tight);
  max-width: 700px;
  margin-bottom: var(--sp-sm);
  animation: fadeUp 0.8s var(--ease) 0.15s both;
}
.page-hero__h1 em {
  font-style: italic;
  color: var(--clr-accent);
}

.page-hero__sub {
  font-size: var(--fs-md);
  color: rgba(255, 255, 255, 0.65);
  max-width: 540px;
  line-height: var(--lh-relaxed);
  animation: fadeUp 0.8s var(--ease) 0.3s both;
}

/* ══════════════════════════════════════════════════════
   BREADCRUMB
══════════════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--sp-md);
  animation: slideRight 0.6s var(--ease) 0.05s both;
}
.breadcrumb a {
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--t-fast);
}
.breadcrumb a:hover {
  color: var(--clr-accent);
}
.breadcrumb__sep {
  color: rgba(255, 255, 255, 0.25);
}
.breadcrumb__current {
  color: var(--clr-accent);
  font-weight: var(--fw-semi);
}

/* ══════════════════════════════════════════════════════
   NEWSLETTER STRIP
══════════════════════════════════════════════════════ */
.newsletter-strip {
  background: var(--clr-earth-light);
  padding: var(--sp-lg) 0;
}

.newsletter-strip__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}

.newsletter-strip__text h3 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium);
  color: var(--clr-primary);
  margin-bottom: 4px;
}
.newsletter-strip__text p {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
}

.newsletter-strip__form {
  display: flex;
  gap: 8px;
  flex: 1;
}
.newsletter-strip__form input {
  flex: 1;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  font-size: var(--fs-sm);
  font-family: var(--font-body);
  color: var(--clr-text);
  outline: none;
  transition: border-color var(--t-fast);
}
.newsletter-strip__form input:focus {
  border-color: var(--clr-primary-mid);
}
.newsletter-strip__form button {
  background: var(--clr-primary);
  color: var(--clr-white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  font-family: var(--font-body);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition:
    background var(--t-fast),
    transform var(--t-fast);
  border: none;
  cursor: pointer;
}
.newsletter-strip__form button:hover {
  background: var(--clr-primary-mid);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════
   CTA SECTION (Get Involved)
══════════════════════════════════════════════════════ */
.cta-section {
  background: var(--clr-primary);
  padding: var(--sp-2xl) 0;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cta-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(245, 166, 35, 0.08) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  pointer-events: none;
}

.cta-section__inner {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.cta-section__inner h2 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-medium);
  color: var(--clr-white);
  line-height: var(--lh-tight);
  margin-bottom: 14px;
}
.cta-section__inner h2 em {
  font-style: italic;
  color: var(--clr-accent);
}
.cta-section__inner p {
  font-size: var(--fs-md);
  color: rgba(255, 255, 255, 0.65);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--sp-lg);
}
.cta-section__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
.footer {
  background: var(--clr-bg-dark);
  padding: var(--sp-2xl) 0 var(--sp-lg);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}

.footer__brand p {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.5);
  line-height: var(--lh-relaxed);
  margin: 14px 0;
}

.footer h4 {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.footer ul li {
  margin-bottom: 10px;
}
.footer ul li a {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--t-fast);
}
.footer ul li a:hover {
  color: var(--clr-accent);
}

.footer__socials {
  display: flex;
  gap: 8px;
}
.footer__social-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  transition:
    background var(--t-fast),
    color var(--t-fast);
}
.footer__social-btn:hover {
  background: var(--clr-accent);
  color: var(--clr-primary);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: var(--sp-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer__bottom p {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.3);
}
.footer__bottom a {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.3);
  margin-left: 16px;
  transition: color var(--t-fast);
}
.footer__bottom a:hover {
  color: var(--clr-accent);
}

/**
 * Append to public/assets/css/layout.css
 * ─────────────────────────────────────────────────────
 * Top utility bar (Sponsor / Volunteer) sits above the
 * main nav. Desktop only — hidden on mobile, links move
 * into the hamburger drawer instead.
 */

/* ── Top utility bar ─────────────────────────────────── */
.topbar {
  background: var(--clr-primary);
  height: 34px;
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-nav) + 1);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  transition:
    background var(--t-fast),
    color var(--t-fast);
}
.topbar__link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--clr-accent);
}
.topbar__link + .topbar__link {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

/* Push main nav down to sit below the topbar */
.nav {
  top: 34px;
}

/* Adjust page-hero / hero-full top padding to account for the extra bar */
.page-hero,
.hero-full {
  padding-top: calc(68px + 34px);
}

/* ── Mobile: secondary links inside drawer ───────────── */
.nav__mobile-secondary {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--clr-border);
}
.nav__mobile-secondary .nav__secondary-link {
  font-size: var(--fs-sm);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--clr-bg-alt);
  color: var(--clr-text-muted);
  display: block;
}
.nav__mobile-secondary .nav__secondary-link:hover {
  background: var(--clr-primary-light);
  color: var(--clr-primary);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Hide top utility bar entirely on mobile/tablet */
  .topbar {
    display: none;
  }

  /* Nav goes back to top since topbar is gone */
  .nav {
    top: 0;
  }

  .page-hero,
  .hero-full {
    padding-top: 68px;
  }

  /* Show secondary links inside the open mobile drawer */
  .nav__links.nav-open .nav__mobile-secondary {
    display: flex;
  }
}

/**
 * Append to layout.css — AFTER the topbar.css block
 * already added. This makes the topbar slide up and
 * disappear on scroll, and the main nav slide up to
 * take its place smoothly.
 */

.topbar {
  transition:
    transform var(--t-mid) var(--ease),
    opacity var(--t-mid) var(--ease);
}

.topbar--hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Main nav slides up smoothly to occupy the freed space */
.nav {
  transition: top var(--t-mid) var(--ease);
}

.topbar--hidden ~ .nav,
.topbar.topbar--hidden + .nav {
  top: 0;
}

/**
 * Append to public/assets/css/layout.css
 * ─────────────────────────────────────────────────────
 * Dropdown menus for Programs, Schools, Enterprises.
 * Desktop: hover/click to open, positioned below trigger.
 * Mobile: expands inline within the drawer (accordion style).
 */

/* ── Dropdown wrapper ─────────────────────────────────── */
.nav__dropdown {
  position: relative;
}

.nav__dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-family: var(--font-body);
  color: var(--clr-text-muted);
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background var(--t-fast),
    color var(--t-fast);
}
.nav__dropdown-trigger:hover,
.nav__dropdown-trigger.active,
.nav__dropdown.open .nav__dropdown-trigger {
  background: var(--clr-bg-alt);
  color: var(--clr-primary);
}
.nav__dropdown-trigger.active {
  font-weight: var(--fw-semi);
}

.nav__dropdown-caret {
  font-size: 10px;
  transition: transform var(--t-mid) var(--ease);
  color: var(--clr-text-light);
}
.nav__dropdown.open .nav__dropdown-caret {
  transform: rotate(180deg);
}

/* ── Dropdown panel ───────────────────────────────────── */
.nav__dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: 280px;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--t-mid) var(--ease),
    transform var(--t-mid) var(--ease),
    visibility var(--t-mid);
  z-index: var(--z-dropdown);
}

.nav__dropdown.open .nav__dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Small arrow/caret pointing up to trigger */
.nav__dropdown-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--clr-white);
  border-left: 1px solid var(--clr-border);
  border-top: 1px solid var(--clr-border);
  border-radius: 2px 0 0 0;
}

/* ── "View all" link at top of panel ─────────────────── */
.nav__dropdown-viewall {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--clr-primary-mid);
  padding: 8px 12px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--clr-border);
}
.nav__dropdown-viewall:hover {
  color: var(--clr-accent-dark);
}

/* ── Each dropdown item ───────────────────────────────── */
.nav__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.nav__dropdown-item:hover {
  background: var(--clr-bg-alt);
}

.nav__dropdown-item__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--clr-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav__dropdown-item__text {
  display: flex;
  flex-direction: column;
}
.nav__dropdown-item__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-primary);
  line-height: 1.3;
}
.nav__dropdown-item__sub {
  font-size: 11px;
  color: var(--clr-text-light);
  margin-top: 1px;
}

/* ══════════════════════════════════════════════════════
   MOBILE — dropdown becomes inline accordion
══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nav__dropdown {
    width: 100%;
  }

  .nav__dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: var(--fs-base);
  }

  /* Panel becomes inline, not floating */
  .nav__dropdown-panel {
    position: static;
    width: 100%;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--clr-bg-alt);
    border-radius: var(--radius-sm);
    padding: 4px 4px 4px 16px;
    margin-top: 2px;

    /* Collapsed by default — height-based animation */
    display: none;
  }
  .nav__dropdown.open .nav__dropdown-panel {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .nav__dropdown-panel::before {
    display: none;
  }

  .nav__dropdown-item__icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}
