/* ─────────────────────────────────────────────────────────────
   overrides.css  — mobile & custom overrides (never edit styles.css)
   ───────────────────────────────────────────────────────────── */

/* ── 2.0  Mobile header — burger icon + Apply button ────────── */
.header-apply { display: none; }

@media (max-width: 980px) {
  /* Burger: strip the navy pill, show as clean icon */
  .menu-btn {
    background: transparent;
    color: var(--navy);
    padding: 8px;
    line-height: 0;
  }
  /* Apply button */
  .header-apply {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    white-space: nowrap;
  }
  .header-apply:hover { background: var(--accent-dark); }
}

/* ── 2.1  Mobile padding ───────────────────────────────────── */
@media (max-width: 640px) {
  .section          { padding: 48px 0; }        /* was 80–100 px */
  .section.hero     { padding: 56px 0 40px; }
  .wrap             { padding-left: 20px;
                      padding-right: 20px; }
  /* Subnav: left-align items so first item isn't clipped when scrollable */
  .subnav-inner     { justify-content: flex-start; padding-left: 20px; padding-right: 20px; }
}

/* ── 2.2  Split-section mobile reorder ──────────────────────
   .split-home-l = image-left on desktop (col-photo first in DOM)
   Correct mobile order: eyebrow+heading → image → copy+CTA
   ─────────────────────────────────────────────────────────── */

/* Desktop (>880px): col-photo spans both rows; text stacks in col 2 */
@media (min-width: 881px) {
  .split-home-l               { row-gap: 0; }
  .split-home-l .col-photo   { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .split-home-l .text-top    { grid-column: 2; grid-row: 1; align-self: end; }
  .split-home-l .text-bottom { grid-column: 2; grid-row: 2; align-self: start; }
}

/* Tablet + mobile (≤880px): single col — explicit reading order */
@media (max-width: 880px) {
  .split-home-l .text-top    { grid-row: 1; }
  .split-home-l .col-photo   { grid-row: 2; align-self: auto; }
  .split-home-l .text-bottom { grid-row: 3; padding-top: 0; }
}

/* Mobile gap */
@media (max-width: 640px) {
  .split-home-l { gap: 1.4rem; }
}

/* ── 2.2b  Split-section mobile reorder (image RIGHT) ────────
   .split-home-r = image-right on desktop (col-photo last in DOM)
   Correct mobile order: eyebrow+heading → image → copy+CTA
   ─────────────────────────────────────────────────────────── */

/* Desktop (>880px): text stacks in col 1; col-photo spans rows in col 2 */
@media (min-width: 881px) {
  .split-home-r               { row-gap: 0; }
  .split-home-r .text-top    { grid-column: 1; grid-row: 1; align-self: end; }
  .split-home-r .col-photo   { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .split-home-r .text-bottom { grid-column: 1; grid-row: 2; align-self: start; }
}

/* Tablet + mobile (≤880px): single col — correct reading order */
@media (max-width: 880px) {
  .split-home-r .text-top    { grid-row: 1; }
  .split-home-r .col-photo   { grid-row: 2; align-self: auto; }
  .split-home-r .text-bottom { grid-row: 3; padding-top: 0; }
}

@media (max-width: 640px) {
  .split-home-r { gap: 1.4rem; }
}

/* ── 2.1a  Stats strip — horizontal scroll on mobile ────────────
   Wraps stats-inner in stats-scroller; fade edges hint at scroll.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .stats-scroller { position: relative; }

  /* Fade-edge gradients */
  .stats-scroller::before,
  .stats-scroller::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 48px;
    pointer-events: none;
    z-index: 1;
    transition: opacity .25s;
  }
  .stats-scroller::before { left: 0;  background: linear-gradient(to right, #fff, transparent); opacity: 0; }
  .stats-scroller::after  { right: 0; background: linear-gradient(to left,  #fff, transparent); opacity: 1; }
  .stats-scroller.at-start::before { opacity: 0; }
  .stats-scroller.scrolled::before { opacity: 1; }
  .stats-scroller.at-end::after    { opacity: 0; }

  /* Override the 5-col grid → horizontal flex scroll */
  .stats-inner {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
    gap: 0;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .stats-inner::-webkit-scrollbar { display: none; }

  .stat {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding-right: 20px;
    border-right: 1px solid var(--line);
    margin-right: 20px;
  }
  .stat:last-child { border-right: none; margin-right: 0; }
}

/* ── 2.1b  Infobar — hide decorative label chips & dividers ─────
   Keeps only the text labels and any CTA visible on small screens.
   #accreditation handled separately in 4.1 (scrollable row).
   ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .infobar-label   { display: none; }
  .infobar-divider { display: none; }
}

/* ── 2.2a  Contact form — full-bleed stacked blocks on mobile ──
   780px: single-column already in styles.css (.contact-grid)
   640px: strip wrap padding, let each block go edge-to-edge
          with alternating backgrounds to visually separate them
   ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #contact              { padding-top: 0; padding-bottom: 0; }
  #contact .wrap        { padding-left: 0 !important;
                          padding-right: 0 !important;
                          gap: 0; }
  .contact-grid .form   { padding: 32px 20px;
                          background: var(--paper); }   /* warm cream / light yellow */
  .contact-grid .contact-info { padding: 32px 20px;
                                background: var(--paper-2); } /* blue-grey */

  /* Continue alternating down the rest of the contact page */
  #find-us          { background: var(--paper); }    /* was bg-2 / blue-grey */
  #visit            { background: var(--paper-2); }  /* was white */
  #visit + .section { background: var(--paper); }    /* Continue exploring */
}

/* ── 2.2a-1  School hours — 3-col default, responsive ───────── */
.hours { grid-template-columns: repeat(3, 1fr) !important; }
@media (max-width: 900px) { .hours { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 500px) { .hours { grid-template-columns: 1fr !important; } }

/* ── 2.2b  Secondary stats columns — hide on mobile ───────────
   Info confirmed in prose before hiding. Exceptions:
   ThriveEd (about.html) + Aftercare (ecd.html) kept visible.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .visit-stats      { display: none !important; }   /* contact.html  */
  .boarding-stats   { display: none !important; }   /* campus-life   */
  .aftercare-stats  { display: none !important; }   /* ecd.html      */
  /* Let prose take full width when stats column disappears */
  .visit-section-grid { grid-template-columns: 1fr !important; }
}

/* ── 2.3  Gallery dots — CSS controls visibility ────────────── */
.gallery-dots {
  display: none;          /* hidden on desktop                   */
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}
@media (max-width: 640px) {
  .gallery-dots { display: flex; }   /* visible on mobile only  */
}

/* ── 2.4  Gallery horizontal scroll (mobile) ────────────────── */
@media (max-width: 640px) {
  .gallery {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 12px;
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery .cell {
    flex: 0 0 78%;
    scroll-snap-align: start;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-md);
  }
}

/* ── 3.0  Cookie consent banner ──────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--navy);
  padding: 18px 0;
  box-shadow: 0 -3px 24px rgba(0,0,0,.22);
  transform: translateY(110%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.cookie-inner p {
  flex: 1;
  font-size: .88rem;
  line-height: 1.55;
  margin: 0;
  color: rgba(255,255,255,.82);
}
.cookie-inner a { color: var(--accent); text-decoration: underline; }
.cookie-btns { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.cookie-accept {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s, transform .2s;
  font-family: var(--sans);
}
.cookie-accept:hover { background: var(--accent-dark); transform: translateY(-2px); }
.cookie-decline {
  background: none;
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 10px;
  color: rgba(255,255,255,.75);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 11px 18px;
  font-family: var(--sans);
  transition: border-color .2s, color .2s;
}
.cookie-decline:hover { border-color: rgba(255,255,255,.8); color: #fff; }
@media (max-width: 640px) {
  .cookie-inner { padding: 0 20px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .cookie-btns { align-self: flex-end; }
}

/* ── 4.0  ThriveEd stats section ────────────────────────────── */
.thriveed-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  column-gap: 56px;
  align-items: start;
}
.thriveed-text  { grid-area: 1 / 1; }
.thriveed-stats {
  grid-area: 1 / 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 3.5rem;     /* aligns stats with H2 on desktop (clears eyebrow + margin) */
  gap: 32px;
}
.thriveed-cta   { grid-area: 2 / 1; padding-top: 1.4em; }
.thriveed-stat  { border-left: 3px solid var(--accent-dark); padding-left: 1.2em; }
.thriveed-num   { font-family: var(--serif); font-size: clamp(2.2rem,4vw,3rem); font-weight: 500; color: var(--navy); line-height: 1; }
.thriveed-lbl   { font-weight: 600; color: var(--navy); margin-top: .2em; }

@media (max-width: 880px) {
  .thriveed-split { grid-template-columns: 1fr; grid-template-rows: auto; }
  .thriveed-text  { grid-area: 1 / 1; }
  .thriveed-stats {
    grid-area: 2 / 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 1.6rem;
    padding-top: 0;          /* reset desktop padding-top */
    border: none;
  }
  .thriveed-cta   { grid-area: 3 / 1; padding-top: 1.2em; }
  .thriveed-stat  {
    border-left: 3px solid var(--accent-dark);
    padding: 0 0 0 1.2em;
    display: flex;
    flex-direction: column;
    border-bottom: none;
  }
  .thriveed-stat + .thriveed-stat { border-left: 3px solid var(--accent-dark); }
  .thriveed-num   { font-size: clamp(1.6rem, 6vw, 2rem); text-align: left; }
  .thriveed-lbl   { text-align: left; font-size: .9rem; }
}

/* ── 4.0a  Boarding — tighten prose→checklist gap on mobile ── */
@media (max-width: 880px) {
  #boarding .split { gap: 16px; }
}

/* ── 4.1  Accreditations — scrollable row on mobile ─────────── */
@media (max-width: 640px) {
  #accreditation .wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
  }
  #accreditation .wrap::-webkit-scrollbar { display: none; }
  /* Hide only the flanking full-width line dividers */
  #accreditation .wrap > div.infobar-divider { display: none; }
  /* Restore dot separators overridden by the general infobar rule above */
  #accreditation span.infobar-divider { display: inline !important; }
  /* Keep inner content on one line and scrollable */
  #accreditation .wrap > div:not(.infobar-divider) {
    padding: 0 24px;
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ── 4.2  Steps — small label numbers, no circles (matches Ashbury) */
.step::before {
  border-radius: 0;
  border: none;
  width: auto;
  height: auto;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1;
  color: var(--accent-dark);
  margin-bottom: 8px;
  background: transparent;
  display: block;
  place-items: unset;
}

/* ── 4.3  Fees — stacked cards on mobile (matches Ashbury) ───── */
@media (max-width: 640px) {
  .fees-schedule { border: none; background: transparent; }
  .fees-schedule thead { display: none; }
  .fees-schedule tbody { display: flex; flex-direction: column; gap: 10px; }
  .fees-schedule tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--white);
  }
  .fees-schedule tbody tr:nth-child(2n) { background: var(--white); }
  .fees-schedule td {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 14px;
    border-bottom: none;
    text-align: left !important;
  }
  .fees-schedule td:first-child {
    grid-column: 1 / -1;
    background: var(--navy);
    color: #fff;
    padding: 12px 16px;
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 400;
  }
  .fees-schedule td:first-child span {
    display: block;
    font-size: .78rem;
    color: rgba(255,255,255,.55);
    font-weight: 400;
    font-style: normal;
    margin-top: 2px;
  }
  .fees-schedule td:nth-child(2) { border-right: 1px solid var(--line); }
  .fees-schedule td:nth-child(2)::before {
    content: "Monthly";
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 4px;
  }
  .fees-schedule td:nth-child(3)::before {
    content: "Annual";
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 4px;
  }
  .fees-schedule td:nth-child(2),
  .fees-schedule td:nth-child(3) { font-family: var(--sans); font-size: .95rem; color: var(--navy); }
  .fees-schedule td:nth-child(2) span,
  .fees-schedule td:nth-child(3) span { display: none; }

  /* fees-once-off: Fee | Amount | Note  (matches Ashbury exactly) */
  .fees-once-off { border: none; background: transparent; }
  .fees-once-off thead { display: none; }
  .fees-once-off tbody { display: flex; flex-direction: column; gap: 10px; }
  .fees-once-off tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--white);
  }
  .fees-once-off tbody tr:nth-child(2n) { background: var(--white); }
  .fees-once-off td {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 14px;
    border-bottom: none;
    text-align: left !important;
  }
  .fees-once-off td:first-child {
    grid-column: 1 / -1;
    background: var(--navy);
    color: #fff;
    padding: 12px 16px;
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 400;
  }
  .fees-once-off td:first-child span {
    display: block;
    font-size: .78rem;
    color: rgba(255,255,255,.55);
    font-weight: 400;
    font-style: normal;
    margin-top: 2px;
  }
  .fees-once-off td:nth-child(2) {
    border-right: 1px solid var(--line);
    justify-content: center;
    align-items: flex-start;
    font-family: var(--sans);
    font-size: .95rem;
    color: var(--navy);
  }
  .fees-once-off td:nth-child(2)::before {
    content: "Amount";
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 4px;
  }
  .fees-once-off td:nth-child(3)::before {
    content: "Note";
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 4px;
  }
  .fees-once-off td:nth-child(3) { font-style: italic; font-size: .78rem !important; color: var(--muted) !important; }

  /* fees-multi: Fee | ECD | Prep | High School  (4-col phase table) */
  .fees-multi { border: none; background: transparent; }
  .fees-multi thead { display: none; }
  .fees-multi tbody { display: flex; flex-direction: column; gap: 10px; }
  .fees-multi tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--white);
  }
  .fees-multi tbody tr:nth-child(2n) { background: var(--white); }
  .fees-multi td {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 14px;
    border-bottom: none;
    text-align: left !important;
    font-family: var(--sans);
    font-size: .95rem;
    color: var(--navy);
  }
  .fees-multi td:first-child {
    grid-column: 1 / -1;
    background: var(--navy);
    color: #fff;
    padding: 12px 16px;
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 400;
  }
  .fees-multi td:nth-child(2) { border-right: 1px solid var(--line); }
  .fees-multi td:nth-child(3) { border-right: 1px solid var(--line); }
  .fees-multi td:nth-child(2)::before {
    content: "ECD";
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 4px;
  }
  .fees-multi td:nth-child(3)::before {
    content: "Prep";
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 4px;
  }
  .fees-multi td:nth-child(4)::before {
    content: "High School";
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 4px;
  }
}
