/*
 * GLORIOOUS Token Override
 * Remaps Magzin CSS variables to the GLORIOOUS editorial palette.
 * Loaded AFTER magzin-base.css so these take precedence.
 *
 * Palette reference (DESIGN_SPEC + FRONT_VISUAL_GOVERNANCE):
 *   --background : warm ivory   #FAF8F5
 *   --surface    : soft blush   #F5F0EB
 *   --ink        : ink black    #1A1A1A
 *   --accent     : oxblood      #8B2500
 *   --plum       : noir plum    #4B1D29
 *   --stone      : muted stone  #A89F96
 *   --line       : subtle line  #E8E3DD
 *
 * Typography:
 *   Display/Serif : Fraunces
 *   Body/Sans     : Manrope
 */

:root {
  /* ── Typography ─────────────────────────────────────── */
  --tc-body-font-family: 'Manrope', sans-serif;
  --tc-heading-font-family: 'Fraunces', serif;
  --tc-body-font-size: 16px;
  --tc-body-line-height: 1.6;
  --tc-heading-line-height: 1.15;

  /* ── Neutral scale — warm ivory axis ────────────────── */
  --tc-neutral-50:  #FAF8F5;   /* background — warm ivory */
  --tc-neutral-100: #F5F0EB;   /* surface — soft blush */
  --tc-neutral-200: #E8E3DD;   /* line */
  --tc-neutral-300: #D4CFC8;
  --tc-neutral-400: #A89F96;   /* stone */
  --tc-neutral-500: #7A746D;
  --tc-neutral-600: #5A554F;
  --tc-neutral-700: #3A3632;
  --tc-neutral-800: #2A2725;
  --tc-neutral-900: #1A1A1A;   /* ink */

  /* ── Dark mode neutral (kept for Magzin compat) ─────── */
  --tc-neutral-dark-50:  #1A1715;
  --tc-neutral-dark-100: #1E1B19;
  --tc-neutral-dark-200: #2A2725;
  --tc-neutral-dark-300: #3A3632;
  --tc-neutral-dark-400: #5A554F;
  --tc-neutral-dark-500: #7A746D;
  --tc-neutral-dark-600: #A89F96;
  --tc-neutral-dark-700: #D4CFC8;
  --tc-neutral-dark-800: #E8E3DD;
  --tc-neutral-dark-900: #F5F0EB;

  /* ── System colors — GLORIOOUS editorial ────────────── */
  --tc-system-white: #FAF8F5;
  --tc-system-dark:  #1A1A1A;
  --tc-system-muted: #A89F96;

  /* ── Background accents ─────────────────────────────── */
  --tc-bg-1: #F5F0EB;           /* blush surface */
  --tc-bg-2: #F0E8E0;           /* warm highlight */
  --tc-bg-3: #FAF8F5;           /* ivory */
  --tc-bg-4: #4B1D29;           /* noir plum */
  --tc-bg-5: #8B2500;           /* oxblood */

  /* ── GLORIOOUS semantic tokens ──────────────────────── */
  --gl-background: #FAF8F5;
  --gl-surface:    #F5F0EB;
  --gl-ink:        #1A1A1A;
  --gl-accent:     #8B2500;
  --gl-plum:       #4B1D29;
  --gl-stone:      #A89F96;
  --gl-line:       #E8E3DD;
  --gl-blush:      #F0E8E0;
}

/* ── Global overrides ────────────────────────────────── */

body {
  background-color: var(--gl-background);
  color: var(--gl-ink);
  font-family: var(--tc-body-font-family);
}

h1, h2, h3, h4, h5, h6,
.ds-1, .ds-2, .ds-3, .ds-4, .ds-5, .ds-6 {
  font-family: var(--tc-heading-font-family);
}

/* Badge overrides — GLORIOOUS editorial territories */
.badge.bg-1 { background-color: var(--gl-plum) !important; color: var(--gl-background); }
.badge.bg-2 { background-color: var(--gl-accent) !important; color: var(--gl-background); }
.badge.bg-3 { background-color: var(--gl-stone) !important; color: var(--gl-ink); }

/* Link and accent color */
a { color: var(--gl-ink); }
a:hover { color: var(--gl-accent); }

/* Section backgrounds */
.bg-100 { background-color: var(--gl-surface) !important; }
.bg-900 { background-color: var(--gl-ink) !important; }

/* Cards — softer shadows for editorial feel */
.article.card-1,
.article.card-2,
.article.card-3 {
  border-radius: 12px;
  overflow: hidden;
}

/* Section padding — generous editorial breathing room */
.sec-padding {
  padding-top: 80px;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .sec-padding {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

/* Article fallback pages */
.gl-page-shell {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(250, 248, 245, 0.98) 0%, rgba(245, 240, 235, 0.92) 58%, rgba(250, 248, 245, 1) 100%),
    var(--gl-background);
  color: var(--gl-ink);
}

.gl-page-shell #content {
  background: transparent;
}

.gl-article-page {
  padding: clamp(2.4rem, 4vw, 4.5rem) clamp(1rem, 3vw, 3rem) clamp(5rem, 8vw, 8rem);
}

.gl-article-wrap {
  display: block;
  width: min(100%, 1640px);
  margin: 0 auto;
}

.gl-article-hero {
  display: grid;
  grid-template-columns: minmax(20rem, 0.42fr) minmax(0, 0.58fr);
  gap: clamp(1.2rem, 2.4vw, 2.8rem);
  align-items: stretch;
  min-height: min(78vh, 820px);
  border-top: 1px solid rgba(26, 26, 26, 0.24);
  border-bottom: 1px solid rgba(26, 26, 26, 0.24);
}

.gl-article-kicker,
.gl-article-issue,
.gl-article-meta,
.gl-article-rail,
.gl-article-aside > span,
.gl-article-related__head > span,
.gl-article-related-card > span {
  color: var(--gl-accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-transform: uppercase;
}

.gl-article-kicker {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 0.7rem 1rem;
  align-items: center;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--gl-line);
}

.gl-article-kicker span::before {
  content: "/";
  margin-right: 1rem;
  color: rgba(26, 26, 26, 0.28);
}

.gl-article-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(34rem, 52vw, 46rem);
  padding: clamp(1.25rem, 2.4vw, 2.5rem) clamp(1rem, 2.4vw, 2.4rem) clamp(1.5rem, 3vw, 3rem) 0;
}

.gl-article-issue {
  display: inline-flex;
  width: fit-content;
  margin-bottom: auto;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(26, 26, 26, 0.24);
  color: rgba(26, 26, 26, 0.66);
}

.gl-article-hero h1 {
  max-width: 9.4ch;
  margin: clamp(2.6rem, 7vw, 7rem) 0 0;
  color: var(--gl-ink);
  font-family: var(--tc-heading-font-family);
  font-size: clamp(4.2rem, 8.6vw, 11.8rem);
  font-weight: 650;
  letter-spacing: -0.085em;
  line-height: 0.82;
  text-wrap: balance;
}

.gl-article-deck {
  max-width: 31rem;
  margin: clamp(1.3rem, 2.2vw, 2rem) 0 0;
  color: rgba(26, 26, 26, 0.66);
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.5;
}

.gl-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-top: clamp(1.4rem, 2.4vw, 2.2rem);
  padding-top: 1rem;
  border-top: 1px solid var(--gl-line);
  color: rgba(26, 26, 26, 0.62);
}

.gl-article-meta span + span::before {
  content: "";
  display: inline-block;
  width: 0.28rem;
  height: 0.28rem;
  margin-right: 0.72rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.36);
  vertical-align: middle;
}

.gl-article-cover {
  position: relative;
  min-height: clamp(34rem, 52vw, 46rem);
  margin: 0;
  overflow: hidden;
  background: var(--gl-surface);
}

.gl-article-cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transform: scale(1.01);
}

.gl-article-cover figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(24rem, 72%);
  margin: 0;
  padding: 1rem 1.15rem;
  background: rgba(250, 248, 245, 0.92);
  color: rgba(26, 26, 26, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.gl-article-content {
  display: grid;
  grid-template-columns: minmax(8rem, 0.16fr) minmax(0, 0.56fr) minmax(15rem, 0.28fr);
  gap: clamp(1.5rem, 3.5vw, 4rem);
  align-items: start;
  padding-top: clamp(3rem, 6vw, 6.5rem);
}

.gl-article-rail,
.gl-article-aside {
  position: sticky;
  top: 7.5rem;
}

.gl-article-rail {
  display: grid;
  gap: 0.8rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(26, 26, 26, 0.24);
  color: rgba(26, 26, 26, 0.58);
}

.gl-article-rail a {
  width: fit-content;
  color: rgba(26, 26, 26, 0.66);
  text-decoration: none;
}

.gl-article-rail a:hover {
  color: var(--gl-accent);
}

.gl-article-aside {
  padding: 1.35rem 1.35rem 1.55rem;
  border-top: 2px solid var(--gl-ink);
  background: rgba(245, 240, 235, 0.76);
}

.gl-article-aside ul {
  display: grid;
  gap: 0;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.gl-article-aside li {
  padding: 0.9rem 0;
  border-top: 1px solid rgba(26, 26, 26, 0.12);
  color: rgba(26, 26, 26, 0.7);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.45;
}

.gl-article-body {
  width: min(100%, 720px);
}

.gl-article-body p {
  margin: 0 0 1.35rem;
  color: rgba(26, 26, 26, 0.74);
  font-size: clamp(1.02rem, 1.12vw, 1.14rem);
  font-weight: 520;
  letter-spacing: -0.015em;
  line-height: 1.84;
  text-wrap: pretty;
}

.gl-article-body .gl-article-lede {
  color: var(--gl-ink);
  font-family: var(--tc-heading-font-family);
  font-size: clamp(1.55rem, 2.2vw, 2.55rem);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 1.18;
}

.gl-article-body blockquote {
  margin: clamp(2rem, 4vw, 3.8rem) 0;
  padding: clamp(1.4rem, 2.6vw, 2.6rem) 0;
  border-top: 1px solid var(--gl-line);
  border-bottom: 1px solid var(--gl-line);
}

.gl-article-body blockquote p {
  max-width: 15ch;
  margin: 0;
  color: var(--gl-ink);
  font-family: var(--tc-heading-font-family);
  font-size: clamp(2.2rem, 4.2vw, 4.7rem);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.gl-article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.gl-article-page .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.8rem 1.05rem;
  border: 1px solid var(--gl-ink);
  border-radius: 0;
  background: var(--gl-ink);
  color: var(--gl-background);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.gl-article-page .button--ghost {
  background: transparent;
  color: var(--gl-ink);
}

.gl-article-page .button:hover {
  background: var(--gl-accent);
  border-color: var(--gl-accent);
  color: var(--gl-background);
}

.gl-article-page .button--ghost:hover {
  color: var(--gl-background);
}

.gl-article-related {
  margin-top: clamp(4rem, 8vw, 8rem);
  padding-top: clamp(1.2rem, 2vw, 2rem);
  border-top: 1px solid rgba(26, 26, 26, 0.24);
}

.gl-article-related__head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: clamp(1.2rem, 2.5vw, 2rem);
}

.gl-article-related__head h2 {
  max-width: 13ch;
  margin: 0;
  color: var(--gl-ink);
  font-family: var(--tc-heading-font-family);
  font-size: clamp(2.6rem, 4.8vw, 5.6rem);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.gl-article-related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
}

.gl-article-related-card {
  display: grid;
  grid-template-rows: auto min-content min-content;
  gap: 0.74rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.18);
  background: transparent;
  text-decoration: none;
  transition:
    color 220ms ease,
    transform 220ms ease,
    opacity 220ms ease;
}

.gl-article-related-card:hover {
  color: var(--gl-accent);
  opacity: 0.92;
  transform: translateY(-0.18rem);
}

.gl-article-related-card img {
  width: 100%;
  aspect-ratio: 1.12 / 1;
  object-fit: cover;
}

.gl-article-related-card strong {
  color: var(--gl-ink);
  font-family: var(--tc-heading-font-family);
  font-size: clamp(1.45rem, 2.1vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.gl-page-footer {
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 3vw, 3rem);
  border-top: 1px solid var(--gl-line);
  background: rgba(250, 248, 245, 0.92);
}

.gl-page-footer__inner,
.gl-page-footer__bottom {
  width: min(100%, 1560px);
  margin: 0 auto;
}

.gl-page-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(18rem, 0.3fr);
  gap: 2rem;
  align-items: start;
}

.gl-page-footer__brand {
  display: inline-block;
  color: var(--gl-ink);
  font-family: var(--tc-heading-font-family);
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  font-weight: 650;
  letter-spacing: -0.08em;
  line-height: 0.9;
  text-decoration: none;
}

.gl-page-footer p {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: rgba(26, 26, 26, 0.62);
  font-weight: 650;
  line-height: 1.6;
}

.gl-page-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  justify-content: flex-end;
}

.gl-page-footer nav a,
.gl-page-footer__bottom {
  color: rgba(26, 26, 26, 0.66);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gl-page-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3.4rem);
  padding-top: 1rem;
  border-top: 1px solid var(--gl-line);
}

@media (max-width: 980px) {
  .gl-article-hero,
  .gl-article-content,
  .gl-page-footer__inner {
    grid-template-columns: 1fr;
  }

  .gl-article-hero {
    min-height: auto;
  }

  .gl-article-hero__copy,
  .gl-article-cover {
    min-height: clamp(24rem, 70vw, 38rem);
  }

  .gl-article-hero h1 {
    max-width: 11ch;
  }

  .gl-article-rail,
  .gl-article-aside {
    position: static;
  }

  .gl-article-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
  }

  .gl-article-related__grid {
    grid-template-columns: 1fr;
  }

  .gl-page-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .gl-article-page {
    padding-inline: 1rem;
  }

  .gl-article-hero__copy,
  .gl-article-cover {
    min-height: auto;
  }

  .gl-article-hero__copy {
    padding-right: 0;
  }

  .gl-article-hero h1 {
    max-width: 100%;
    font-size: clamp(3.8rem, 18vw, 5.8rem);
    letter-spacing: -0.08em;
  }

  .gl-article-cover img {
    min-height: 22rem;
  }

  .gl-article-cover figcaption {
    position: static;
    width: 100%;
  }

  .gl-article-kicker {
    gap: 0.55rem 0.75rem;
  }

  .gl-article-meta {
    display: grid;
    gap: 0.45rem;
  }

  .gl-article-meta span + span::before {
    display: none;
  }

  .gl-page-footer__bottom {
    flex-direction: column;
  }
}
