/* ==========================================================================
   mobile.css — responsive tweaks for content, images, and heroes
   Load last on every page.
   ========================================================================== */

/* ---- Global: keep images inside the viewport -------------------------------- */
/* Hero media is deliberately absent here: those photos fill a fixed-height
   column via object-fit, and `height: auto` let each page's image aspect ratio
   set its own hero height. mobile.css loads last, so listing them here beat the
   `height: 100%` in layout.css. */
main img,
footer img,
.section img,
.intro__figure img,
.k12-schools__figure img,
.memoriam__figure img {
  max-width: 100%;
  height: auto;
}

/* ---- Index / splash (stacked panels on phone) ------------------------------- */
@media (max-width: 899px) {
  .splash-panel {
    min-height: min(100dvh, 680px);
    padding-block: clamp(2rem, 5vh, 3rem);
  }

  .splash-panel__art {
    padding-top: clamp(2rem, 5vh, 3.5rem);
  }

  .splash-panel--school .splash-panel__deco--school {
    width: min(92%, 22rem);
  }

  .splash-panel--public .splash-panel__deco--map {
    width: min(88%, 20rem);
  }

  .splash-logo {
    min-height: 72px;
    margin-bottom: clamp(1.25rem, 4vw, 2rem);
    padding: 0.625rem 1rem;
  }

  .splash-logo img {
    height: 44px;
    max-width: min(100%, 260px);
  }

  .splash-logo--public img {
    height: 56px;
    max-width: min(100%, 180px);
  }

  .splash-panel__title {
    font-size: clamp(1.875rem, 1.4rem + 3.5vw, 2.75rem);
    margin-bottom: var(--space-16);
  }

  .splash-panel__text {
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: clamp(1.25rem, 4vw, 2rem);
  }

  .splash-cta {
    min-height: 64px;
    gap: var(--space-16);
    padding: 0 var(--space-24);
  }

  .splash-cta::before {
    inset: -5px;
  }
}

@media (max-width: 480px) {
  .splash-panel {
    min-height: 0;
    padding-block: clamp(1.75rem, 4vh, 2.5rem);
  }

  .splash-panel--school .splash-panel__deco--school {
    width: min(94%, 17rem);
  }

  .splash-panel--public .splash-panel__deco--map {
    width: min(90%, 15rem);
  }

  .splash-panel__eyebrow {
    font-size: var(--fs-small);
  }
}

/* ---- Interior split heroes ------------------------------------------------ */
@media (max-width: 899px) {
  .promotions-hero__panel,
  .publishers-hero__panel,
  .about-hero__panel,
  .split-hero__panel {
    padding: var(--space-24) var(--container-pad);
  }

  /* Photo is set dressing on a phone — give the copy the screen instead. */
  .promotions-hero__media,
  .publishers-hero__media,
  .about-hero__media,
  .split-hero__media {
    min-height: clamp(150px, 30vw, 210px);
  }

  /* Height belongs on the container now that the photo is absolutely positioned. */
  .promotions-hero__media,
  .publishers-hero__media,
  .about-hero__media,
  .split-hero__media {
    height: clamp(160px, 32vw, 220px);
  }

  .promotions-hero__title,
  .publishers-hero__title,
  .about-hero__title,
  .split-hero__title {
    font-size: clamp(1.75rem, 1.25rem + 2.5vw, 2.25rem);
  }

  .promotions-hero__subtitle {
    font-size: clamp(1.125rem, 1rem + 1vw, 1.5rem);
  }

  .promotions-hero__text,
  .publishers-hero__text,
  .about-hero__text {
    font-size: var(--fs-body);
    line-height: 1.6;
  }
}

/* ---- Home pages ----------------------------------------------------------- */
@media (max-width: 899px) {
  .home-hero__grid {
    padding-block: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    gap: var(--space-24);
  }

  .home-hero__title {
    font-size: clamp(1.75rem, 1.2rem + 2.8vw, 2.5rem);
    margin-bottom: var(--space-16);
  }

  .home-hero__cta {
    margin-top: var(--space-20);
  }

  .hero-stats {
    gap: var(--space-12);
  }

  .home-hero__text,
  .home-hero__note {
    font-size: var(--fs-body);
    line-height: 1.6;
  }

  .intro__figure img {
    min-height: 0;
    max-height: 520px;
    aspect-ratio: 585 / 841;
  }

  /* Blue corner accent + 35+ plate — smaller on mobile */
  .intro__figure::before {
    top: -10px;
    left: -10px;
    width: 48px;
    height: 48px;
  }

  .intro__figure .story-stats__plate {
    width: min(152px, 50%);
    height: auto;
    min-height: 0;
    padding: var(--space-16) var(--space-20);
  }

  .intro__figure .story-stats__plate .story-stats__value {
    font-size: clamp(1.25rem, 1.05rem + 1.2vw, 1.625rem);
  }

  .intro__figure .story-stats__plate .story-stats__label {
    margin-top: var(--space-4);
    font-size: var(--fs-small);
    line-height: 1.3;
  }

  .intro__body,
  .k12-schools__body,
  .about-publishers__body {
    font-size: var(--fs-body);
    line-height: 1.6;
  }

  .section__title {
    font-size: clamp(1.5rem, 1.15rem + 1.8vw, 2rem);
  }

  .section__lead {
    font-size: var(--fs-body);
    line-height: 1.6;
  }
}

@media (max-width: 599px) {
  .home-hero--cards .hero-stat {
    padding: var(--space-16);
  }

  .hero-stat__value,
  .hero-stat__value--sm {
    font-size: clamp(1.25rem, 1.1rem + 1vw, 1.5rem);
  }

  .hero-stat__text,
  .hero-stat__label {
    font-size: var(--fs-small);
    line-height: 1.45;
  }

  .intro__figure::before {
    top: -8px;
    left: -8px;
    width: 40px;
    height: 40px;
  }

  .intro__figure .story-stats__plate {
    width: min(132px, 46%);
    padding: var(--space-12) var(--space-16);
  }

  .intro__figure .story-stats__plate .story-stats__value {
    font-size: clamp(1.125rem, 1rem + 0.8vw, 1.375rem);
  }

  .intro__figure .story-stats__plate .story-stats__label {
    font-size: 0.75rem;
  }
}

/* ---- Buttons & CTAs ------------------------------------------------------- */
@media (max-width: 599px) {
  .btn-row--center,
  .cta-band__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .btn-row--center .btn,
  .cta-band__actions .btn {
    width: 100%;
    max-width: 100%;
  }

  .cta-band__title {
    font-size: clamp(1.375rem, 1.1rem + 1.5vw, 1.75rem);
  }
}

/* ---- Header tabs on narrow phones ----------------------------------------- */
@media (max-width: 519px) {
  .brand-switch__tab {
    width: min(240px, 46vw);
    height: 32px;
  }

  .brand-switch__tab + .brand-switch__tab {
    margin-left: -44px;
  }

  .brand-switch__label {
    font-size: 0.8125rem;
  }
}

/* ---- Publisher / promo grids ---------------------------------------------- */
@media (max-width: 599px) {
  .publisher-card-grid,
  .promo-grid {
    gap: var(--space-16);
  }

  .promo-card__panel {
    padding: var(--space-20);
  }
}
