/* The STEM Squad — thesquadbooks.com
   Colours and type are taken from the book covers. */

/* ---------- Fonts (served from this site) ---------- */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/lato-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/lato-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/assets/fonts/lato-latin-900-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/lato-latin-700-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url('/assets/fonts/lato-latin-900-italic.woff2') format('woff2');
}

/* Fallback faces: the system's Arial, resized to take up the same room as Lato.
   The page is drawn with these until Lato arrives, so nothing jumps when it does.
   size-adjust values are Lato's measured width divided by Arial's at each weight. */
@font-face {
  font-family: 'Lato Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial'), local('ArialMT'), local('Liberation Sans');
  size-adjust: 96.8%;
  ascent-override: 102%;
  descent-override: 22%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Lato Fallback';
  font-style: normal;
  font-weight: 700;
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold');
  size-adjust: 92%;
  ascent-override: 107.3%;
  descent-override: 23.2%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Lato Fallback';
  font-style: normal;
  font-weight: 900;
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold');
  size-adjust: 93.9%;
  ascent-override: 105.1%;
  descent-override: 22.7%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Lato Fallback';
  font-style: italic;
  font-weight: 700;
  src: local('Arial Bold Italic'), local('Arial-BoldItalicMT'), local('Liberation Sans Bold Italic');
  size-adjust: 85.4%;
  ascent-override: 115.6%;
  descent-override: 24.9%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Lato Fallback';
  font-style: italic;
  font-weight: 900;
  src: local('Arial Bold Italic'), local('Arial-BoldItalicMT'), local('Liberation Sans Bold Italic');
  size-adjust: 87.2%;
  ascent-override: 113.2%;
  descent-override: 24.4%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  --brown: #382113;
  --gold: #ECC05F;
  --gold-dark: #7A5A12;
  --cream: #F2EEE1;
  --white: #FFFFFF;

  --sofia-tint: #E3EEDD;
  --sofia-ink: #2F5A2B;
  --tariq-tint: #DCEBF8;
  --tariq-ink: #0F4F8A;
  --elena-tint: #F8E3D6;
  --elena-ink: #8F3515;
  --maya-tint: #EADDF6;
  --maya-ink: #5B2A94;

  --radius-card: 20px;
  --radius-cover: 6px;
  --gutter: 24px;
  --column: 1200px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--brown);
  color: var(--brown);
  font-family: 'Lato', 'Lato Fallback', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem; /* 17px */
  font-weight: 400;
  line-height: 1.55;
}

main {
  display: block;
  background: var(--cream);
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
}

h3 {
  font-size: 1.5rem;
}

img,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brown);
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible,
.band--brown :focus-visible {
  outline-color: var(--gold);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--brown);
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  outline-color: var(--white);
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  max-width: 1008px;
}

.band {
  padding: 88px 0;
}

.band--brown {
  background: var(--brown);
  color: var(--white);
}

.band--white {
  background: var(--white);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------- Type treatments ---------- */
.eyebrow {
  color: var(--gold-dark);
  font-size: 1.125rem;
  font-style: italic;
  font-weight: 700;
}

.eyebrow--on-brown {
  color: var(--gold);
}

.book-title {
  font-size: 1.6875rem;
  font-style: italic;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.btn--small {
  min-height: 44px;
  padding: 0 22px;
  font-size: 1rem;
}

.btn--large {
  min-height: 54px;
  padding: 0 30px;
  font-size: 1.125rem;
}

.btn--gold {
  background: var(--gold);
  color: var(--brown);
}

.btn--brown {
  background: var(--brown);
  color: var(--gold);
}

.btn--outline {
  border-color: var(--white);
  color: var(--white);
}

.btn:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--brown);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 32px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  font-size: 1.625rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-link:hover,
.nav-link[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brown);
  color: var(--white);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-top: 36px;
  padding-bottom: 36px;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-footer__name {
  font-size: 1.375rem;
  font-weight: 900;
}

.site-footer .eyebrow {
  font-size: 0.9375rem;
}

.site-footer__legal {
  font-size: 0.9375rem;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}

.site-footer a {
  color: var(--white);
}

.site-footer .nav-link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Section spacing variants ---------- */
.band--tight-bottom {
  padding-bottom: 40px;
}

.band--tight-top {
  padding-top: 40px;
  padding-bottom: 96px;
}

.stack--close {
  gap: 28px;
}

.h2--small {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column-reverse; /* phone: art on top, brown panel below, like a cover */
  background: var(--brown);
  color: var(--white);
}

.hero__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 56px clamp(24px, 5vw, 80px);
}

.hero .eyebrow {
  font-size: 1.25rem;
}

.hero__title {
  font-size: clamp(4rem, 8.5vw, 7.75rem);
  line-height: 0.94;
  letter-spacing: -0.015em;
}

.hero__title span {
  display: block;
}

.hero__promise {
  max-width: 460px;
  font-size: 1.3125rem;
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.hero__art {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 560px;
  overflow: hidden;
}

.hero__picture,
.hero__picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__picture img {
  object-fit: cover;
  object-position: 50% 62%;
}

@media (min-width: 960px) {
  .hero {
    flex-direction: row; /* desktop: panel beside the art, art fills the full height */
  }

  .hero__panel {
    flex: 1 1 44%;
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .hero__art {
    flex: 1.25 1 56%;
    aspect-ratio: auto;
    min-height: 600px;
    max-height: none;
  }
}

/* ---------- Books ---------- */
.book-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media (min-width: 1000px) {
  .book-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* an odd last card keeps its half-row size */
  }
}

.book-card {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  min-width: 0;
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--white);
}

.book-card__cover {
  flex: 0 0 200px;
  width: 200px;
}

.book-card__cover img,
.book-tile__cover img {
  width: 100%;
  border-radius: var(--radius-cover);
}

.book-card__body {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.book-card__number,
.book-tile__number {
  font-size: 1rem;
}

.book-card__teaches {
  font-size: 0.9375rem;
}

.book-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: 6px;
}

.coming-soon {
  margin-top: auto;
  padding-top: 6px;
  color: var(--gold-dark);
  font-style: italic;
  font-weight: 700;
}

.lead-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.lead-tag__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

.lead-tag--sofia { color: var(--sofia-ink); }
.lead-tag--tariq { color: var(--tariq-ink); }
.lead-tag--elena { color: var(--elena-ink); }
.lead-tag--maya { color: var(--maya-ink); }

/* Covers keep one size however many books are still to come. */
.book-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 216px));
  gap: 28px 20px;
}

@media (min-width: 560px) {
  .book-tiles {
    grid-template-columns: repeat(auto-fill, 216px);
    gap: 32px;
  }
}

.book-tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.book-tile__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-tile__number {
  font-size: 0.9375rem;
}

.book-title--small {
  font-size: 1.125rem;
  line-height: 1.2;
}

/* ---------- Squad cards ---------- */
.squad-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.squad-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 28px;
  border-radius: var(--radius-card);
}

.squad-card__portrait img {
  width: 148px;
  height: 148px;
  border: 4px solid currentColor;
  border-radius: 50%;
  object-fit: cover;
}

.squad-card__heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.squad-card__name {
  font-size: 1.875rem;
  line-height: 1.1;
}

.squad-card__subject {
  font-size: 0.9375rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.squad-card__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  font-weight: 900;
}

.squad-card--sofia { background: var(--sofia-tint); }
.squad-card--tariq { background: var(--tariq-tint); }
.squad-card--elena { background: var(--elena-tint); }
.squad-card--maya { background: var(--maya-tint); }

.squad-card--sofia .squad-card__subject,
.squad-card--sofia .squad-card__portrait { color: var(--sofia-ink); }
.squad-card--tariq .squad-card__subject,
.squad-card--tariq .squad-card__portrait { color: var(--tariq-ink); }
.squad-card--elena .squad-card__subject,
.squad-card--elena .squad-card__portrait { color: var(--elena-ink); }
.squad-card--maya .squad-card__subject,
.squad-card--maya .squad-card__portrait { color: var(--maya-ink); }

/* ---------- What your child learns ---------- */
.learn-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 32px;
}

.learn-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.learn-item__letter {
  color: var(--gold);
  font-size: 4.75rem;
  font-weight: 900;
  line-height: 1;
}

.learn-item h3 {
  font-size: 1.375rem;
  letter-spacing: 0;
}

/* ---------- Page headings (inner pages) ---------- */
h1 {
  font-size: clamp(2.75rem, 5.5vw, 4.25rem);
}

.page-head {
  margin-bottom: 4px;
}

.h2--spaced {
  margin-top: 28px;
}

/* ---------- Squad page ---------- */
.squad-profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 24px;
}

.squad-card__leads {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.squad-card__leads-label {
  font-size: 0.9375rem;
  font-style: italic;
  font-weight: 700;
}

.squad-card__books {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  padding: 0;
  list-style: none;
}

.squad-card__books a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 900;
}

/* ---------- Text pages (Parents & Teachers, About) ---------- */
.container--text {
  max-width: 780px;
}

.band--flush {
  padding-top: 0;
  padding-bottom: 56px;
}

.band--last {
  padding-bottom: 96px;
}

.lede {
  font-size: 1.25rem;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-card);
  background: var(--white);
}

.teaches-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.teaches-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.teaches-table th,
.teaches-table td {
  padding: 16px 20px;
  vertical-align: top;
}

.teaches-table thead th {
  background: var(--brown);
  color: var(--white);
  font-weight: 900;
}

.teaches-table tbody th {
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
}

.teaches-table tbody tr + tr th,
.teaches-table tbody tr + tr td {
  border-top: 1px solid var(--cream);
}

.activity {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 28px;
  border-radius: var(--radius-card);
  background: var(--white);
}

.activity h3 {
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0;
}

/* ---------- About ---------- */
.prose {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prose--lede {
  font-size: 1.1875rem;
}

.author {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
}

.author__photo {
  flex: 0 0 auto;
}

.author__photo img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
}

.author .bio {
  flex: 1 1 320px;
  min-width: 0;
}

.contact-link,
.site-footer__mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

.nowrap {
  white-space: nowrap;
}

/* Cover thumbnail beside each book title. */
.teaches-table__book {
  display: flex;
  align-items: center;
  gap: 14px;
}

.teaches-table__cover {
  flex: 0 0 48px;
  width: 48px;
}

.teaches-table__cover img {
  width: 100%;
  border-radius: 4px;
}

.teaches-table tbody td {
  vertical-align: middle;
}

/* Narrow screens: each book becomes its own block so nothing is cut off. */
@media (max-width: 640px) {
  .teaches-table,
  .teaches-table tbody,
  .teaches-table tr,
  .teaches-table th,
  .teaches-table td {
    display: block;
  }

  .teaches-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .teaches-table tbody tr {
    padding: 18px 20px;
  }

  .teaches-table tbody tr + tr {
    border-top: 1px solid var(--cream);
  }

  .teaches-table tbody th,
  .teaches-table tbody td,
  .teaches-table tbody tr + tr th,
  .teaches-table tbody tr + tr td {
    padding: 0;
    border-top: 0;
  }

  .teaches-table tbody td:first-of-type {
    color: var(--gold-dark);
    font-style: italic;
    font-weight: 700;
  }

  /* Line the subject and "teaches" text up under the title, clear of the thumbnail. */
  .teaches-table tbody td,
  .teaches-table tbody tr + tr td {
    padding-left: 62px;
  }

  .teaches-table tbody th {
    margin-bottom: 4px;
  }
}
