/* ==========================================================================
   layout.css — header, brand switch, navigation, hero, footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header
   Figma: 12px navy strip + 147px white bar, shadow 0 10px 17px rgba(0,0,0,.11)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  box-shadow: var(--shadow-header);
}

.site-header__topbar {
  position: relative;
  height: var(--topbar-h);
  background: var(--color-navy);
}

/* ---- Brand switch (SCHOOL / PUBLIC chrome tabs) ------------------------- */
.brand-switch {
  position: absolute;
  top: 0;
  left: 50%;
  display: none;
  transform: translateX(-50%);
}
@media (min-width: 1024px) { .brand-switch { display: flex; } }

.brand-switch__tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 274px;
  height: 41px;
  padding-bottom: 2px;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.brand-switch__tab + .brand-switch__tab { margin-left: -61px; }

.brand-switch__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.brand-switch__shape path { fill: currentColor; }

.brand-switch__label {
  position: relative;
  font-size: var(--fs-tab);
  font-weight: var(--fw-extrabold);
  line-height: 1.25;
  text-transform: uppercase;
}

/* inactive */
.brand-switch__tab {
  z-index: 1;
  color: #e5eff9;
}
.brand-switch__tab .brand-switch__label { color: var(--color-text); }
.brand-switch__tab:hover { color: #d3e5f6; }

/* active */
.brand-switch__tab.is-active {
  z-index: 2;
  color: var(--color-navy);
}
.brand-switch__tab.is-active .brand-switch__label { color: var(--color-white); }

/* ---- Header bar --------------------------------------------------------- */
.site-header__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-24);
  min-height: calc(var(--header-h-mobile) - var(--topbar-h));
}
@media (min-width: 1024px) {
  .site-header__bar { min-height: calc(var(--header-h) - var(--topbar-h)); }
}

.site-logo {
  flex: 0 0 auto;
  display: block;
  grid-column: 1;
  justify-self: start;
}
.site-logo img {
  width: auto;
  height: 38px;
  object-fit: contain;
}
@media (min-width: 420px)  { .site-logo img { height: 46px; } }
@media (min-width: 1024px) { .site-logo img { height: 74px; } }

/* Abrams & Son Books is a stacked 2:1 mark, so it needs more height than the
   4.7:1 Abrams Educational Solutions lockup to read at the same optical size. */
.site-logo--public img { height: 46px; }
@media (min-width: 420px)  { .site-logo--public img { height: 56px; } }
@media (min-width: 1024px) { .site-logo--public img { height: 88px; } }

/* The school nav has five items; compact header fits from 1024px up. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .site-header__bar { gap: var(--space-20); }
  .nav { gap: var(--space-20); }
}

/* ---- Primary navigation ------------------------------------------------- */
.nav { display: none; }
@media (min-width: 1024px) {
  .nav {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    justify-self: center;
    gap: clamp(1rem, -0.6rem + 2.2vw, 2.5rem);
  }
}

.nav__link {
  position: relative;
  padding-block: var(--space-8);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: 1.875;
  color: var(--color-navy-nav);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__link:hover { color: var(--color-brand); }
.nav__link:hover::after,
.nav__link:focus-visible::after { transform: scaleX(1); }
.nav__link[aria-current='page'] {
  color: var(--color-brand);
  font-weight: var(--fw-semibold);
}
.nav__link[aria-current='page']::after { transform: scaleX(1); }

/* Specificity must beat `.btn { display: inline-flex }` in components.css,
   which loads after this file. */
.site-header .site-header__cta {
  display: none;
  grid-column: 3;
  justify-self: end;
}
@media (min-width: 1024px) {
  .site-header .site-header__cta { display: inline-flex; }
}

/* ---- Nav dropdown ------------------------------------------------------- */
.nav__item { position: relative; }
.nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__caret {
  width: 10px;
  height: 6px;
  transition: transform var(--dur) var(--ease);
}
.nav__toggle[aria-expanded='true'] .nav__caret { transform: rotate(180deg); }

.nav__menu {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  z-index: 10;
  min-width: 264px;
  padding: var(--space-12);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
              visibility var(--dur) var(--ease);
}
.nav__toggle[aria-expanded='true'] + .nav__menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.nav__menu-link {
  display: block;
  padding: var(--space-12) var(--space-16);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--color-navy-nav);
  border-radius: 10px;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__menu-link:hover {
  color: var(--color-brand);
  background: var(--color-surface-pale);
}

/* ---- Mobile menu toggle ------------------------------------------------- */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  grid-column: 3;
  justify-self: end;
  border-radius: 10px;
  transition: background-color var(--dur) var(--ease);
}
.nav-toggle:hover { background: var(--color-surface-pale); }
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.nav-toggle__bars {
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--color-navy);
  border-radius: 2px;
  transition: background-color var(--dur) var(--ease);
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-navy);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease);
}
.nav-toggle__bars::before { top: -8px; }
.nav-toggle__bars::after { top: 8px; }

.nav-toggle[aria-expanded='true'] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded='true'] .nav-toggle__bars::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle__bars::after  { transform: translateY(-8px) rotate(-45deg); }

/* ---- Mobile drawer ------------------------------------------------------ */
.mobile-nav {
  display: block;
  overflow: hidden;
  max-height: 0;
  background: var(--color-white);
  border-top: 1px solid transparent;
  transition: max-height var(--dur-slow) var(--ease), border-color var(--dur) var(--ease);
}
.mobile-nav.is-open {
  max-height: 640px;
  border-top-color: var(--color-surface-pale);
}
@media (min-width: 1024px) { .mobile-nav { display: none; } }

.mobile-nav__inner { padding-block: var(--space-16) var(--space-24); }
.mobile-nav__link {
  display: block;
  padding: var(--space-16) 0;
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-medium);
  color: var(--color-navy-nav);
  border-bottom: 1px solid var(--color-surface-pale);
}
.mobile-nav__link:hover { color: var(--color-brand); }
.mobile-nav__link[aria-current='page'] {
  color: var(--color-brand);
  font-weight: var(--fw-semibold);
}
.mobile-nav__cta { margin-top: var(--space-24); }
.mobile-nav__switch {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-24);
}
.mobile-nav__switch a {
  flex: 1;
  padding: var(--space-12);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  text-align: center;
  text-transform: uppercase;
  color: var(--color-text);
  background: var(--color-surface-pale);
  border-radius: 10px;
}
.mobile-nav__switch a.is-active {
  color: var(--color-white);
  background: var(--color-navy);
}

/* --------------------------------------------------------------------------
   Split hero — interior pages (50/50 blue panel + photo, full-bleed)
   Used by About, Promotions, Publishers, Digital Resources, Schedule, etc.
   -------------------------------------------------------------------------- */
.split-hero,
.promotions-hero,
.publishers-hero,
.about-hero {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}
@media (min-width: 900px) {
  .split-hero,
  .promotions-hero,
  .publishers-hero,
  .about-hero {
    grid-template-columns: 1fr 1fr;
    /* One height for every interior hero, so Publishers, Promotions, About,
       Digital Resources and Schedule all match. The value is the tallest copy
       any of them needs at this width — below that a page would grow past the
       others and the set would look uneven. */
    min-height: 510px;
  }
}
@media (min-width: 1200px) {
  .split-hero,
  .promotions-hero,
  .publishers-hero,
  .about-hero {
    /* Wider panel, so the copy wraps shorter and they can all share less. */
    min-height: 460px;
  }
}

.split-hero__panel,
.promotions-hero__panel,
.publishers-hero__panel,
.about-hero__panel {
  display: flex;
  align-items: center;
  order: 2;
  padding: var(--space-48) var(--container-pad);
  color: var(--color-white);
  background: var(--color-brand);
}
@media (min-width: 900px) {
  .split-hero__panel,
  .promotions-hero__panel,
  .publishers-hero__panel,
  .about-hero__panel {
    order: 1;
    padding-block: var(--space-40);
    padding-inline: clamp(2.5rem, 3vw + 1rem, 5rem);
  }
}

.split-hero__content,
.promotions-hero__content,
.publishers-hero__content,
.about-hero__content {
  max-width: 573px;
}

.split-hero__title,
.promotions-hero__title,
.publishers-hero__title,
.about-hero__title {
  margin-bottom: var(--space-16);
  font-size: var(--fs-h1);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  color: var(--color-white);
}

.split-hero__subtitle,
.promotions-hero__subtitle {
  margin: 0 0 var(--space-24);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 2rem);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  color: var(--color-white);
}

.split-hero__text,
.promotions-hero__text,
.publishers-hero__text,
.about-hero__text {
  margin: 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-white);
}
.about-hero__title { margin-bottom: var(--space-24); }
.publishers-hero__title { margin-bottom: var(--space-24); }

.split-hero__media,
.promotions-hero__media,
.publishers-hero__media,
.about-hero__media {
  order: 1;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}
@media (min-width: 900px) {
  .split-hero__media,
  .promotions-hero__media,
  .publishers-hero__media,
  .about-hero__media {
    order: 2;
    min-height: 510px;
  }
}
@media (min-width: 1200px) {
  .split-hero__media,
  .promotions-hero__media,
  .publishers-hero__media,
  .about-hero__media {
    min-height: 460px;
  }
}

/* Absolutely positioned so the photo contributes nothing to layout. Left in
   flow, `height: 100%` resolved against an auto-height parent, the browser fell
   back to the image's own aspect ratio, and that set the hero height — which is
   why one page sat 15px taller than the rest. */
.split-hero__media img,
.promotions-hero__media img,
.publishers-hero__media img,
.about-hero__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* --------------------------------------------------------------------------
   Hero — legacy overlay (kept for any pages still using .hero)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--color-brand);
  color: var(--color-white);
}
.hero__media {
  position: absolute;
  inset: 0 0 0 auto;
  width: 53%;
  height: 100%;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--color-brand) 0%, rgba(14, 121, 177, 0.55) 40%, rgba(14, 121, 177, 0) 100%);
}
@media (max-width: 899px) {
  .hero__media { position: relative; width: 100%; height: 260px; }
  .hero__media::after {
    background: linear-gradient(to bottom, rgba(14, 121, 177, 0.15), var(--color-brand));
  }
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 534px;
  padding-block: var(--space-56);
}
@media (max-width: 899px) {
  .hero__inner { min-height: 0; padding-block: var(--space-48); }
}

.hero__content { max-width: 573px; }
.hero__title {
  margin-bottom: var(--space-24);
  font-size: var(--fs-h1);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  color: var(--color-white);
}
.hero__text {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-white);
}
.hero__actions { margin-top: var(--space-32); }

/* Wrapper that puts the photo behind the copy on mobile */
.hero--stack { display: flex; flex-direction: column; }
@media (max-width: 899px) {
  .hero--stack .hero__inner { order: 2; }
  .hero--stack .hero__media { order: 1; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding-block: var(--space-64) var(--space-32);
  background: var(--color-surface-pale);
  color: var(--color-text);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-40);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 640px)  { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 326px) 1fr 1fr minmax(0, 307px);
    column-gap: clamp(2rem, 4vw, 3.75rem);
    row-gap: var(--space-40);
  }
}

.site-footer__logo {
  display: inline-block;
}
.site-footer__logo img {
  display: block;
  width: auto;
  height: 4.625rem; /* Figma Group 1000011335: 74px */
  max-width: 20.375rem; /* 326px */
  object-fit: contain;
}
.site-footer__logo--school img {
  height: 4.625rem;
  max-width: 20.375rem;
}
.site-footer__logo--public img {
  height: 5.75rem;
  max-width: 12.5rem;
}

.site-footer__switch {
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 1023px) {
  .site-footer__switch { justify-content: flex-start; }
}

.footer-social {
  display: flex;
  gap: 0.6875rem; /* Figma: ~11px between 44px circles */
  margin-top: var(--space-16);
}
.footer-social__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-brand);
  border-radius: 50%;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.footer-social__link:hover {
  transform: translateY(-3px);
  background: var(--color-brand-dark);
}
.footer-social__link img { width: 20px; height: 20px; object-fit: contain; }
.footer-social__link img[width="8"] { width: 10px; height: 18px; }

.site-footer__title {
  margin-bottom: var(--space-16);
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
  line-height: 2.3;
}

.footer-links { display: flex; flex-direction: column; }
.footer-links a {
  padding-block: var(--space-4);
  font-size: var(--fs-body);
  line-height: 2.7;
  color: var(--color-text);
  transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}
.footer-links a:hover {
  color: var(--color-brand);
  padding-left: 4px;
}

.footer-contact__item { margin-bottom: var(--space-16); }
.footer-contact__label {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1.69;
}
.footer-contact__value {
  font-size: var(--fs-body);
  line-height: 1.69;
  color: var(--color-text);
}
a.footer-contact__value:hover { color: var(--color-brand); }

.site-footer__bottom {
  margin-top: var(--space-48);
  padding-top: var(--space-24);
  border-top: 1px solid rgba(31, 31, 31, 0.12);
  text-align: center;
}
.site-footer__copy {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: 1.875;
}

/* --------------------------------------------------------------------------
   Back to top
   -------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: var(--space-24);
  bottom: var(--space-24);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--color-white);
  background: var(--color-brand);
  border-radius: 50%;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
              visibility var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--color-brand-dark); }
