/* ==========================================================================
   Inner pages (About, Football, Media, Foundation, Contact).
   Loaded after styles.css, which supplies the tokens, top bar, menu and footer.
   ========================================================================== */

.page {
  --accent: var(--orange);        /* fills: buttons, ticks, outlines */
  --accent-text: #c2550f;         /* orange text on white: 4.57:1 */
  --card-label: #7a3a0e;          /* card-back labels on tan: 5.71:1 */
  --text: var(--ink);
  --muted: rgb(21 16 12 / 0.62);
  --rule: rgb(21 16 12 / 0.16);
  --panel: rgb(255 255 255 / 0.72);
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: transparent;
  color: var(--text);
  overflow-x: clip; /* decorative layers may bleed past the edge; never scroll sideways */
  --paper: #fbf8f3;               /* photo-frame border */
  --card-back: #d8d2c4;           /* card-back tan */
  --panel-light: #f4efe8;         /* light panel on black pages */
  --photo-placeholder: #8a8580;
  --error: #b3261e;
}

.page--black {
  --accent-text: var(--orange);   /* bright orange on black: 6.91:1 */
  --text: var(--cream);
  --muted: rgb(255 246 234 / 0.62);
  --rule: rgb(255 246 234 / 0.16);
  --panel: rgb(20 16 13 / 0.78);
  background: transparent;
}

/* Foundation pages pick up the gold of the Everyday Legends mark */
.page--gold {
  --accent: #d6ad4f;
  --accent-text: #d6ad4f;         /* gold on black: 9.7:1 */
}

/* Light panels inside black pages need darker accent text */
.page--black .band {
  --accent-text: #b84a0c;         /* 4.56:1 on the cream panel */
}

.page--gold .band {
  --accent-text: #7a5c17;         /* 5.45:1 on the cream panel */
}

/* The leather stays still while the page scrolls over it */
/* The leather is drawn on an inner layer, so this fixed full-screen box has
   no background of its own for iOS 26 Safari to turn into a color bar. */
.page-bg {
  --page-tex: #fff url("/assets/white-bg.webp") center / cover no-repeat;
  position: fixed;
  inset: 0;
  z-index: -1;
}

.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--page-tex);
}

.page--black .page-bg {
  --page-tex: #050404 url("/assets/sections-bg.webp") center / cover no-repeat;
}

.page main {
  display: block;
}

/* Grid children may shrink below their content width (stops long words or
   no-wrap headlines from stretching the page sideways). */
.page-hero > *,
.split > *,
.press > *,
.pillars > * {
  min-width: 0;
}

.page-wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page-section {
  padding-block: clamp(72px, 12svh, 140px);
}

.page-section + .page-section {
  padding-top: 0;
}

/* ---------- Type ---------- */

.page p,
.page li {
  font-family: var(--body);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 0.55em 0.8em 0.5em;
  background: var(--text);
  color: var(--page-bg-ink, #fff);
  font-family: var(--font);
  font-variation-settings: "opsz" 10;
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.page--black .eyebrow {
  color: var(--ink);
}

/* Headline with the orange outline echo (see #echo-outline in each page) */
.echo {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 5.6vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.echo__line {
  position: relative;
  isolation: isolate;
  display: block;
  width: fit-content;
  white-space: nowrap; /* each line is written as one unit */
}

.echo__line::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: var(--accent);
  filter: url(#echo-outline);
  transform: translate(0.06em, 0.06em);
  transition: transform 700ms var(--ease-out) 250ms, opacity 500ms ease 250ms;
}

.echo:not(.is-in) .echo__line::before {
  transform: translate(0, 0);
  opacity: 0;
}

.page--gold .echo__line::before {
  filter: url(#echo-outline-gold);
}

.section-title {
  margin: 0 0 clamp(28px, 4svh, 48px);
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: clamp(2.25rem, 4.6vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.section-title span {
  color: var(--accent-text);
}

.lede {
  max-width: 34ch;
  margin: 24px 0 0;
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--muted);
}

.prose {
  max-width: 62ch;
}

.prose p {
  margin: 0 0 1.1em;
  font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
  line-height: 1.7;
}

.prose a,
.text-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 160ms ease;
}

.prose a:hover,
.text-link:hover {
  color: var(--accent-text);
}

.label {
  font-family: var(--font);
  font-variation-settings: "opsz" 10;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Page hero ---------- */

.page-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding-top: calc(var(--bar-h) + 4svh);
  padding-bottom: 6svh;
}

.page-hero--even {
  grid-template-columns: 1fr 1fr;
}

.page-hero__copy {
  position: relative;
  z-index: 1;
}

.page-hero__media {
  position: relative;
  align-self: end;
  justify-self: center;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

/* A transparent cutout of KJ standing on the page */
/* Height drives the size; object-fit keeps the proportions if the column is
   narrower than the photo (the width/height attributes would otherwise
   stretch it). The bottom fades out into the page. */
.cutout {
  display: block;
  height: min(84svh, 860px);
  width: auto;
  max-width: none; /* may spill past its column; the page clips sideways overflow */
  object-fit: contain;
  object-position: 50% 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 96%);
  filter: drop-shadow(-24px 22px 28px rgb(0 0 0 / 0.32));
}

.page--black .cutout {
  filter:
    drop-shadow(0 0 1px rgb(255 160 90 / 0.6))
    drop-shadow(0 0 40px rgb(240 113 33 / 0.28))
    drop-shadow(-24px 22px 28px rgb(0 0 0 / 0.7));
}

/* Big outlined jersey number sitting behind the hero cutout */
.page-hero__media::before {
  content: "";
  position: absolute;
  inset: 8% -10% 14%;
  z-index: -1;
  background: url("assets/forty.svg") center / contain no-repeat;
  opacity: 0.05;
  filter: brightness(0);
}

.page-hero__media--plain::before {
  display: none;
}

/* The logo sits level with the headline instead of at the bottom */
.page-hero__media--plain {
  height: auto;
  align-self: center;
  align-items: center;
  margin-top: -6svh;
}

.page--black .page-hero__media::before {
  filter: none;
  opacity: 0.07;
}

.scroll-hint {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(20px, 4svh, 40px);
  margin: 0;
}

/* ---------- Photo frames ---------- */

.frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: max(5px, 0.45vw) solid var(--paper);
  background: var(--photo-placeholder);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.35);
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0.5em 0.75em;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font);
  font-variation-settings: "opsz" 10;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Two-column split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.split--wide-left {
  grid-template-columns: 1.3fr 1fr;
}

/* ---------- Card-back style fact table ---------- */

.facts {
  position: relative;
  margin: 0;
  padding: clamp(20px, 2.4vw, 32px);
  background: var(--card-back);
  color: var(--ink);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgb(0 0 0 / 0.28);
}

.facts__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 12px 16px;
  background: var(--orange);
  border-radius: 8px;
}

.facts__no {
  display: grid;
  place-items: center;
  width: 52px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: var(--orange);
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: 1.5rem;
}

.facts__name {
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
  text-transform: uppercase;
}

.facts__row {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid rgb(21 16 12 / 0.16);
}

.facts__row:last-child {
  border-bottom: 0;
}

.facts dt {
  font-family: var(--font);
  font-variation-settings: "opsz" 10;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--card-label);
  padding-top: 0.25em;
}

.facts dd {
  margin: 0;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
}

/* ---------- Big numbers (rankings, stats) ---------- */

.numbers {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  border-top: 1px solid var(--rule);
}

.number {
  padding: clamp(20px, 3svh, 32px) clamp(12px, 2vw, 28px) clamp(20px, 3svh, 32px) 0;
  border-bottom: 1px solid var(--rule);
}

.number + .number {
  padding-left: clamp(12px, 2vw, 28px);
  border-left: 1px solid var(--rule);
}

.number__value {
  display: block;
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 0.85;
  color: var(--text);
}

.number__value small {
  font-size: 0.42em;
  color: var(--accent-text);
  vertical-align: 0.9em;
  margin-right: 0.08em;
}

.number__label {
  display: block;
  margin-top: 12px;
}

.source {
  margin: 16px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Timeline on a yard line ---------- */

.path {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0 clamp(12px, 1.6vw, 24px);
}

/* The yard line with its hash marks */
.path::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  height: 3px;
  background: var(--text);
}

.path::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  height: 15px;
  background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 28px);
  opacity: 0.55;
}

.path li {
  position: relative;
  padding-top: 64px;
}

/* Each stop gets a tall tick crossing the line */
.path li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 4px;
  height: 36px;
  background: var(--accent);
}

.path__when {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-text);
}

.path__what {
  margin: 0 0 8px;
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: clamp(1.4rem, 1.9vw, 1.9rem);
  line-height: 1;
  text-transform: uppercase;
}

.path p {
  margin: 0;
  font-size: 0.975rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Feature band (dark panel inside a light page, or vice versa) ---------- */

.band {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  background: var(--ink);
  color: var(--cream);
  border-radius: 24px;
}

.page--black .band {
  background: var(--panel-light);
  color: var(--ink);
}

.band .label {
  color: inherit;
  opacity: 0.6;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font);
  font-variation-settings: "opsz" 10;
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background 160ms ease, color 160ms ease;
}

.btn:hover {
  background: var(--text);
  color: var(--page-contrast, #fff);
}

.page--black .btn:hover {
  color: var(--ink);
}

.btn:active {
  transform: scale(0.97);
}

.btn--ghost {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 2px currentColor;
}

.btn--ghost:hover {
  background: var(--accent);
  color: var(--ink);
  box-shadow: none;
}

.btn:focus-visible,
.press-card:focus-visible,
.next-page:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* ---------- Press cards (Media) ---------- */

.press {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.4vw, 36px);
}

.press-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.press-card .frame {
  aspect-ratio: 4 / 3;
  transition: transform 260ms var(--ease-out);
}

.press-card .frame img {
  transition: transform 600ms var(--ease-out);
}

.press-card__outlet {
  margin: 22px 0 10px;
  color: var(--accent-text);
}

.press-card__title {
  margin: 0 0 14px;
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.press-card__cta {
  margin-top: auto;
}

@media (hover: hover) {
  .press-card:hover .frame {
    transform: translateY(-6px) rotate(-1deg);
  }

  .press-card:hover .frame img {
    transform: scale(1.05);
  }

  .press-card:hover .press-card__title {
    color: var(--accent-text);
  }
}

/* ---------- Gallery (Media) ---------- */

.gallery {
  columns: 3 280px;
  column-gap: clamp(14px, 1.6vw, 24px);
}

.gallery button {
  display: block;
  width: 100%;
  margin: 0 0 clamp(14px, 1.6vw, 24px);
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  break-inside: avoid;
}

.gallery .frame {
  transition: transform 260ms var(--ease-out);
}

.gallery button:nth-child(3n + 1) .frame { rotate: -0.8deg; }
.gallery button:nth-child(3n + 2) .frame { rotate: 0.6deg; }

@media (hover: hover) {
  .gallery button:hover .frame {
    transform: scale(1.02);
    rotate: 0deg;
  }
}

.gallery button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.lightbox {
  max-width: min(92vw, 1100px);
  max-height: 92svh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgb(5 4 4 / 0.88);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 86svh;
  border: 6px solid var(--paper);
}

.lightbox__close {
  position: absolute;
  top: -56px;
  right: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- Pillars (Foundation) ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px);
}

.pillar {
  position: relative;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--rule);
  background: var(--panel);
}

.pillar__num {
  display: block;
  margin-bottom: 36px;
  color: var(--accent-text);
}

.pillar h3 {
  margin: 0 0 12px;
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.pillar p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.quote {
  margin: 0;
  max-width: 22ch;
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 800;
  font-size: clamp(2.2rem, 4.8vw, 4.4rem);
  line-height: 1;
  text-transform: uppercase;
  text-wrap: balance;
}

.quote em {
  font-style: normal;
  color: var(--accent-text);
}

.el-logo {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin-inline: auto;
}

/* ---------- Contact form ---------- */

.form {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 3vw, 44px);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-family: var(--font);
  font-variation-settings: "opsz" 10;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 2px solid rgb(21 16 12 / 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 500 1rem/1.4 var(--body);
  transition: border-color 160ms ease;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.field [aria-invalid="true"] {
  border-color: var(--error);
}

.field__error {
  margin: 0;
  font-size: 0.875rem;
  color: var(--error);
}

.form__status {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ---------- Next-page link at the bottom of each page ---------- */

.next-page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 4svh, 44px) 0;
  border-top: 3px solid var(--text);
  color: inherit;
  text-decoration: none;
}

.next-page__name {
  font-family: var(--font);
  font-variation-settings: "opsz" 72;
  font-weight: 900;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 0.85;
  text-transform: uppercase;
  transition: color 180ms ease, transform 300ms var(--ease-out);
}

.next-page__arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(56px, 6vw, 88px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  transition: transform 300ms var(--ease-out);
}

.next-page__arrow svg {
  display: block;
  width: 42%;
  height: auto;
}

@media (hover: hover) {
  .next-page:hover .next-page__name {
    color: var(--accent-text);
    transform: translateX(10px);
  }

  .next-page:hover .next-page__arrow {
    transform: translateX(6px) rotate(-8deg);
  }
}

/* ---------- Scroll reveal ---------- */

[data-reveal] {
  opacity: 0;
  translate: 0 28px;
  transition: opacity 700ms ease, translate 800ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

[data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    translate: none;
    transition: opacity 300ms ease;
  }

  .echo__line::before {
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .path {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 48px;
  }

  .press {
    grid-template-columns: 1fr 1fr;
  }

  .pillars {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-hero,
  .page-hero--even {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    padding-top: calc(var(--bar-h) + 6svh);
    padding-bottom: 0;
  }

  .page-hero__media::before {
    inset: 8% 0 14%;
  }

  .page-hero__media--plain {
    margin-top: 12px;
  }

  .el-logo {
    width: min(80%, 340px);
  }

  .page-hero__media {
    height: auto;
    justify-self: stretch;
    justify-content: center;
  }

  /* On phones the width drives the size (cutouts are about 3:4) */
  .cutout {
    width: min(100%, 46svh);
    height: auto;
  }

  .echo {
    font-size: min(9.6vw, 3.4rem);
  }

  .scroll-hint {
    display: none;
  }

  .split,
  .split--wide-left {
    grid-template-columns: 1fr;
  }

  .numbers {
    --cols: 1 !important;
  }

  .number + .number {
    padding-left: 0;
    border-left: 0;
  }

  .numbers--compact {
    --cols: 2 !important;
  }

  .numbers--compact .number:nth-child(even) {
    padding-left: 16px;
    border-left: 1px solid var(--rule);
  }

  /* The timeline turns vertical: the yard line runs down the left */
  .path {
    grid-template-columns: 1fr;
    row-gap: 36px;
    padding-left: 36px;
  }

  .path::before {
    left: 10px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 3px;
    height: auto;
  }

  .path::after {
    left: 4px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 15px;
    height: auto;
    background: repeating-linear-gradient(180deg, var(--text) 0 2px, transparent 2px 28px);
  }

  .path li {
    padding-top: 0;
  }

  .path li::before {
    left: -38px;
    top: 4px;
    width: 34px;
    height: 4px;
  }

  .press {
    grid-template-columns: 1fr;
  }

  .facts__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ---------- Media hero: real X + Instagram posts, framed to fit one screen ---------- */

.page-hero--media {
  grid-template-columns: 0.72fr 1.28fr;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 620px;
  padding-bottom: 4svh;
}

/* The posts take most of the width here, so the headline steps down a size */
.page-hero--media .echo {
  font-size: clamp(2.4rem, 4.6vw, 4.6rem);
}

/* Until X's script upgrades a post, its text card sits centred in the frame */
.social:not(:has(iframe)) .social__inner {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
}

/* Three columns by two rows of framed tiles filling the right side */
.socials {
  --gap: clamp(12px, 1.4vw, 22px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--gap);
  height: 100%;
  min-height: 0;
  padding: 8px;
}

/* Each tile is a print-style frame. The embed inside renders at its natural
   width (EMBED_W in pages.js) and is scaled down to the frame (--s), so it
   never squishes; whatever runs past the frame fades out at the bottom. */
.social {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 5px solid var(--paper);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgb(0 0 0 / 0.2), 0 0 0 1px rgb(0 0 0 / 0.06);
  rotate: var(--r, 0deg);
  transition: rotate 260ms var(--ease-out), translate 260ms var(--ease-out), box-shadow 260ms ease;
}

.social::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 22%;
  background: linear-gradient(transparent, #fff);
  pointer-events: none;
}

.social__inner {
  width: 326px;
  transform-origin: 0 0;
  scale: var(--s, 0.75);
}

@media (hover: hover) {
  .social:hover {
    z-index: 2;
    rotate: 0deg;
    translate: 0 -6px;
    box-shadow: 0 24px 50px rgb(0 0 0 / 0.28), 0 0 0 2px var(--orange);
  }
}

/* Before the embed scripts load (or if they're blocked), the posts still
   read as cards with their real text and a link to the original. */
.social blockquote {
  margin: 0;
  padding: 18px 20px;
  background: #fff;
  color: var(--ink);
  font: 500 1rem/1.5 var(--body);
}

.social blockquote p {
  margin: 0 0 10px;
}

.social blockquote a {
  color: var(--orange);
}

.social .twitter-tweet,
.social .twitter-tweet-rendered,
.social iframe {
  margin: 0 !important;
}

.social .instagram-media {
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Tablets and phones: headline on top, the six tiles fill the rest of the screen */
@media (max-width: 1000px) {
  .page-hero--media {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .page-hero--media {
    height: 100svh;
    height: 100dvh;
    padding-top: calc(var(--bar-h) + 2svh);
    padding-bottom: 2svh;
  }

  .page-hero--media .lede {
    display: none;
  }

  .socials {
    --gap: 8px;
    padding: 4px;
  }

  .social {
    border-width: 3px;
    border-radius: 8px;
  }
}

/* ---------- White pages: black logo + menu buttons ---------- */

.page--white .logo,
.page--white .menu-btn {
  background: var(--ink);
}

.page--white .logo img {
  filter: brightness(0) invert(1); /* logo turns white on the black disc */
}

.page--white .menu-btn span {
  background: #fff;
}

/* While the dark menu is open, the button goes back to white so it shows */
.page--white .menu-btn.is-open {
  background: #fff;
}

.page--white .menu-btn.is-open span {
  background: var(--ink);
}

/* ---------- Phones: lighter background textures ---------- */

@media (max-width: 760px) {
  .page-bg { --page-tex: #fff url("/assets/white-bg-m.webp") center / cover no-repeat; }
  .page--black .page-bg { --page-tex: #050404 url("/assets/sections-bg-m.webp") center / cover no-repeat; }
}

/* Decorative layers may spill past the viewport; clip them, never scroll */
.page main {
  overflow-x: clip;
}

/* ---------- Media heading on phones: a swipe row of readable posts ---------- */

@media (max-width: 760px) {
  .socials {
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: min(80vw, 340px);
    gap: 14px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 6px var(--gutter) 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .socials::-webkit-scrollbar {
    display: none;
  }

  .social {
    rotate: 0deg;
    scroll-snap-align: start;
    border-width: 4px;
    border-radius: 12px;
  }

  .page-hero--media .page-hero__copy::after {
    content: "Swipe for more posts →";
    display: block;
    margin-top: 10px;
    font: 700 0.75rem/1 var(--font);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* Orange glow behind KJ on the About page, matching the Football page. The
   bottom fade moves to a wrapper so it doesn't clip the glow's edges. */
.page-hero__media--glow .cutout {
  -webkit-mask-image: none;
  mask-image: none;
  filter:
    drop-shadow(0 0 1px rgb(255 160 90 / 0.7))
    drop-shadow(0 0 40px rgb(240 113 33 / 0.5))
    drop-shadow(-24px 22px 28px rgb(0 0 0 / 0.22));
}

.page-hero__media--glow .cutout-wrap {
  display: block;
  padding: 60px 60px 0;
  margin: -60px -60px 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 66%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 66%, transparent 97%);
}

@media (max-width: 760px) {
  .page-hero__media--glow .cutout-wrap {
    padding: 40px 0 0;
    margin: -40px 0 0;
  }
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Gallery: mixed sizes that interlock into one block ---------- */

/* 4 columns x 3 rows of roughly square cells. Tall tiles take two rows,
   the wide one two columns, so the block always ends flush. */
.gallery {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-template-areas:
    "sjr    run    run      portrait"
    "sjr    grad   gameday  portrait"
    "helmet grad   practice seated";
  gap: clamp(14px, 1.6vw, 24px);
  aspect-ratio: 4 / 3;
}

.gallery button {
  margin: 0;
  min-height: 0;
}

.gallery .frame {
  width: 100%;
  height: 100%;
}

/* Phones: 2 columns x 6 rows, same idea */
@media (max-width: 760px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, 1fr);
    grid-template-areas:
      "run    run"
      "sjr    gameday"
      "sjr    practice"
      "helmet portrait"
      "grad   portrait"
      "grad   seated";
    aspect-ratio: 2 / 6;
    gap: 12px;
  }
}
