/* ============================================================
   ABSTRACTOS — Extracts from Ab.
   Editorial design system · Issue ink: PANTONE 19-4052 Classic Blue
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Base */
  --paper: #F7F1E6;
  --paper-2: #EFE7D7;
  --paper-3: #E9DFCC;
  --ink: #16150F;
  --ink-soft: #3A3830;

  /* Issue system — Vol. 01 ink is Classic Blue (PANTONE 19-4052) */
  --issue: #0F4C81;
  --issue-deep: #0B3A64;
  --issue-wash: #DCE4EA;

  /* Editorial accents (moodboard) */
  --lime: #C7D62E;
  --coral: #FF5A47;
  --peach: #FFC9A3;
  --violet: #7B244C;
  --charcoal: #333333;

  /* Type */
  --serif-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --serif-text: "Newsreader", Georgia, serif;
  --grotesk: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Scale */
  --step--1: clamp(0.72rem, 0.68rem + 0.2vw, 0.8rem);
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.4rem + 1vw, 2.2rem);
  --step-3: clamp(2.2rem, 1.8rem + 2vw, 3.4rem);
  --step-4: clamp(3rem, 2.2rem + 4vw, 5.4rem);
  --step-5: clamp(3.6rem, 2.4rem + 7vw, 8rem);
  --step-6: clamp(4.2rem, 2.6rem + 10vw, 11rem);

  --margin: clamp(1.25rem, 4vw, 4.5rem);
  --rule: 1px solid var(--ink);
  --rule-2: 2px solid var(--ink);
  --rule-3: 3px solid var(--ink);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
::selection { background: var(--issue); color: var(--paper); }

/* Paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: 0.35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.52 0 0 0 0 0.45 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Language switching ---------- */
html[data-lang="es"] [lang="en"] { display: none !important; }
html[data-lang="en"] [lang="es"] { display: none !important; }

/* ---------- Typographic utilities ---------- */
.label {
  font-family: var(--grotesk);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.label--issue { color: var(--issue); }
.small-caps { font-variant: all-small-caps; letter-spacing: 0.08em; }
.oldstyle { font-variant-numeric: oldstyle-nums; }
.sup-no { font-size: 0.45em; vertical-align: super; letter-spacing: 0.05em; }
.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Rules & ornaments */
.rule { border: none; border-top: var(--rule); }
.rule--thick { border-top: var(--rule-3); }
.rule--double { border-top: 3px double var(--ink); }
.rule--issue { border-top-color: var(--issue); }
.ornament { text-align: center; font-family: var(--serif-display); font-size: var(--step-1); letter-spacing: 0.6em; }

/* ---------- Editorial links ---------- */
.e-link {
  text-decoration: none;
  background-image: linear-gradient(var(--issue), var(--issue));
  background-size: 100% 1px;
  background-position: 0 96%;
  background-repeat: no-repeat;
  transition: background-size 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s;
}
.e-link:hover { background-size: 100% 88%; color: var(--paper); }

a.quiet { text-decoration: none; }
a.quiet:hover { font-style: italic; }

/* ---------- Masthead ---------- */
.masthead {
  font-family: var(--serif-display);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.015em;
  line-height: 0.86;
  text-transform: uppercase;
}
.monogram {
  font-family: var(--serif-display);
  font-weight: 900;
  display: inline-flex;
  align-items: baseline;
  border: var(--rule-2);
  padding: 0.1em 0.28em 0.16em;
  line-height: 1;
  text-decoration: none;
}
.monogram i { font-style: italic; color: var(--issue); }

/* ---------- Site header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: stretch; justify-content: space-between;
  background: var(--paper);
  border-bottom: var(--rule);
  height: 3.4rem;
}
.site-header > * { display: flex; align-items: center; }
.site-header .brand {
  gap: 0.7rem; padding: 0 var(--margin) 0 clamp(1rem, 3vw, 2rem);
  text-decoration: none;
}
.site-header .brand .monogram { font-size: 1rem; border-width: 1.5px; }
.site-header .brand .word {
  font-family: var(--serif-display); font-weight: 700; letter-spacing: 0.06em;
  font-size: 0.95rem; text-transform: uppercase;
}
.site-header .issue-slug {
  font-family: var(--grotesk); font-size: 0.62rem; letter-spacing: 0.2em;
  border-left: var(--rule); padding: 0 1.2rem; align-self: stretch;
  color: var(--ink-soft); text-transform: uppercase;
}
.header-right { margin-left: auto; }
.lang-toggle {
  font-family: var(--grotesk); font-size: 0.68rem; letter-spacing: 0.15em;
  border-left: var(--rule); align-self: stretch; padding: 0 1.1rem;
}
.lang-toggle span { opacity: 0.35; transition: opacity 0.2s; }
.lang-toggle span.on { opacity: 1; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--issue); }
.lang-toggle .slash { margin: 0 0.3em; opacity: 0.5; }

/* Section navigation — typographic, like a running head */
.site-nav {
  display: flex; align-items: stretch;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  display: flex; align-items: center;
  padding: 0 clamp(0.7rem, 1.6vw, 1.4rem);
  font-family: var(--serif-display); font-size: 1.02rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: color 0.2s;
}
.site-nav a:hover { font-style: italic; color: var(--issue); }
.site-nav a.active {
  color: var(--issue);
  box-shadow: inset 0 -3px 0 var(--issue);
}

/* ---------- FPO placeholder figures ---------- */
.fpo {
  position: relative;
  background:
    repeating-linear-gradient(45deg, transparent 0 34px, rgba(15, 76, 129, 0.16) 34px 35px),
    linear-gradient(160deg, var(--issue-wash), var(--paper-2));
  border: var(--rule);
  overflow: hidden;
  display: grid; place-items: center;
  isolation: isolate;
}
.fpo::before, .fpo::after {
  content: ""; position: absolute; background: var(--ink); opacity: 0.55;
}
.fpo::before { inset: 0; background:
  linear-gradient(to bottom right, transparent calc(50% - 0.5px), var(--ink) 50%, transparent calc(50% + 0.5px)),
  linear-gradient(to bottom left, transparent calc(50% - 0.5px), var(--ink) 50%, transparent calc(50% + 0.5px));
  opacity: 0.18;
}
.fpo::after { display: none; }
.fpo .stamp {
  position: relative; z-index: 1;
  font-family: var(--grotesk); font-size: 0.62rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--issue);
  border: 1.5px solid var(--issue);
  padding: 0.5em 1em 0.5em 1.3em;
  background: var(--paper);
  transform: rotate(-4deg);
}
.fpo[data-note]::marker { content: none; }
.fpo .note {
  position: absolute; bottom: 0.6rem; left: 0.8rem; z-index: 1;
  font-family: var(--grotesk); font-size: 0.55rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-soft);
}
.fpo--dark { background:
  repeating-linear-gradient(45deg, transparent 0 34px, rgba(247, 241, 230, 0.12) 34px 35px),
  linear-gradient(160deg, var(--issue-deep), #14263D); border-color: var(--paper); }
.fpo--dark .stamp { color: var(--paper); border-color: var(--paper); background: transparent; }
.fpo--dark .note { color: rgba(247, 241, 230, 0.6); }

/* Aspect helpers */
.ar-cover { aspect-ratio: 4 / 5; }
.ar-wide { aspect-ratio: 16 / 9; }
.ar-square { aspect-ratio: 1; }
.ar-tall { aspect-ratio: 3 / 4; }
.ar-band { aspect-ratio: 21 / 8; }

/* Figure + caption */
figure.ed-figure figcaption {
  font-family: var(--grotesk); font-size: 0.68rem; letter-spacing: 0.06em;
  color: var(--ink-soft); margin-top: 0.6rem; display: flex; gap: 0.8rem;
}
figure.ed-figure figcaption::before { content: "↳"; color: var(--issue); }

/* Hover caption reveal */
.cap-hover { position: relative; }
.cap-hover .cap {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  background: var(--ink); color: var(--paper);
  font-family: var(--grotesk); font-size: 0.65rem; letter-spacing: 0.1em;
  padding: 0.55rem 0.8rem;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cap-hover:hover .cap { transform: none; }

/* ---------- Article numbering plate ---------- */
.abstracto-no {
  display: inline-flex; flex-direction: column; align-items: center;
  font-family: var(--grotesk); letter-spacing: 0.25em; font-size: 0.6rem;
  text-transform: uppercase; gap: 0.3rem;
}
.abstracto-no b {
  font-family: var(--serif-display); font-weight: 900; letter-spacing: 0;
  font-size: 1.6rem; line-height: 1;
}

/* ---------- Folio (fixed page furniture) ---------- */
.folio {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 400;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem var(--margin);
  font-family: var(--grotesk); font-size: 0.6rem; letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(247, 241, 230, 0), var(--paper) 55%);
  padding-top: 1.4rem;
}
.folio .page-no b { font-size: 0.85rem; letter-spacing: 0.05em; }

/* Reading progress — a thin ink column on the page edge */
.progress-edge {
  position: fixed; top: 0; left: 0; bottom: 0; width: 4px; z-index: 600;
  background: transparent; pointer-events: none;
}
.progress-edge i {
  display: block; width: 100%; height: 0%;
  background: var(--issue);
  transition: height 0.1s linear;
}

/* ---------- Section label in margin ---------- */
.margin-label {
  position: absolute; top: 0; bottom: 0; left: 0; width: 3rem;
  border-right: var(--rule);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 1.5rem;
}
.margin-label span {
  writing-mode: vertical-rl;
  font-family: var(--grotesk); font-size: 0.62rem; letter-spacing: 0.35em;
  text-transform: uppercase;
}

/* ---------- Shared page scaffolding ---------- */
.page { padding-top: 3.4rem; min-height: 100vh; }
.section-cover {
  border-bottom: var(--rule-3);
  padding: clamp(2rem, 6vh, 4.5rem) var(--margin) clamp(1.5rem, 4vh, 3rem);
  position: relative;
}
.kicker-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 1rem;
}
.dept-no {
  font-family: var(--serif-display); font-weight: 900;
  font-size: var(--step-4); line-height: 0.8; color: var(--issue);
}
.section-title {
  font-family: var(--serif-display); font-weight: 900;
  font-size: var(--step-5); line-height: 0.9; text-transform: uppercase;
  letter-spacing: -0.01em;
}
.section-dek {
  font-family: var(--serif-text); font-style: italic;
  font-size: var(--step-1); max-width: 34rem; line-height: 1.4;
}

/* ---------- Story list rows (Works-in-Progress style) ---------- */
.story-row {
  display: grid; grid-template-columns: 5rem 1fr minmax(10rem, 16rem);
  gap: clamp(1rem, 3vw, 3rem);
  padding: 1.6rem 0; border-bottom: var(--rule);
  text-decoration: none; align-items: baseline;
  transition: background 0.25s;
}
.story-row:hover { background: rgba(15, 76, 129, 0.06); }
.story-row .no { font-family: var(--grotesk); font-size: 0.68rem; letter-spacing: 0.2em; color: var(--issue); }
.story-row h3 {
  font-family: var(--serif-display); font-weight: 600;
  font-size: var(--step-2); line-height: 1.05;
}
.story-row:hover h3 { font-style: italic; }
.story-row .meta { font-family: var(--grotesk); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-soft); text-align: right; }
.story-row .dek { font-style: italic; color: var(--ink-soft); margin-top: 0.4rem; font-size: var(--step-0); }

/* ---------- Pull quote ---------- */
.pull-quote {
  font-family: var(--serif-display); font-weight: 600; font-style: italic;
  font-size: var(--step-3); line-height: 1.1; text-align: center;
  padding: 2.5rem 0; margin: 3rem 0;
  border-top: var(--rule-3); border-bottom: var(--rule);
  position: relative;
}
.pull-quote::before {
  content: "“"; display: block; font-size: 1.6em; line-height: 0.4;
  color: var(--issue); margin-bottom: 0.35em; font-style: normal;
}
.pull-quote cite { display: block; font-family: var(--grotesk); font-style: normal; font-weight: 400; font-size: 0.62rem; letter-spacing: 0.25em; text-transform: uppercase; margin-top: 1.2rem; color: var(--ink-soft); }

/* ---------- Drop cap ---------- */
.drop-cap::first-letter {
  font-family: var(--serif-display); font-weight: 900;
  float: left; font-size: 4.6em; line-height: 0.78;
  padding: 0.06em 0.12em 0 0; color: var(--issue);
}

/* ---------- Footer / colophon ---------- */
.colophon {
  border-top: var(--rule-3);
  margin-top: 4rem;
  padding: 2.5rem var(--margin) 4.5rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem;
  background: var(--paper-2);
}
.colophon .masthead { font-size: var(--step-3); }
.colophon .col h4 { font-family: var(--grotesk); font-size: 0.62rem; letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 0.9rem; color: var(--issue); }
.colophon .col a { display: block; text-decoration: none; font-size: 0.95rem; padding: 0.2rem 0; }
.colophon .col a:hover { font-style: italic; color: var(--issue); }
.colophon .fineprint { font-family: var(--grotesk); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 1.4rem; line-height: 2; }

/* ---------- Marginalia card ---------- */
.margin-card {
  border: var(--rule); background: var(--paper);
  padding: 1.4rem 1.5rem 1.6rem;
  box-shadow: 4px 4px 0 rgba(22, 21, 15, 0.12);
  position: relative;
}
.margin-card .card-kicker {
  font-family: var(--grotesk); font-size: 0.58rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--issue);
  display: flex; justify-content: space-between; margin-bottom: 0.8rem;
}
.margin-card p { font-size: 0.98rem; }

/* ---------- Responsive ---------- */
/* Nav tightens before it clips: shed padding, then size, then the wordmark. */
@media (max-width: 1150px) {
  .site-nav a { padding: 0 0.75rem; font-size: 0.96rem; }
}
@media (max-width: 1000px) {
  .site-header .brand { padding-right: 1rem; }
  .site-nav a { padding: 0 0.55rem; font-size: 0.9rem; }
}
@media (max-width: 900px) {
  .colophon { grid-template-columns: 1fr; gap: 2rem; }
  .story-row { grid-template-columns: 3rem 1fr; }
  .story-row .meta { grid-column: 2; text-align: left; margin-top: 0.5rem; }
  .site-header .issue-slug { display: none; }
  .margin-label { display: none; }
  .site-header .brand .word { display: none; }
  .site-nav a { padding: 0 0.5rem; font-size: 0.88rem; }
}
/* Below this the six links genuinely cannot fit: scroll them, with a fade
   at the right edge so it reads as more-to-see rather than a clipped word. */
@media (max-width: 720px) {
  .header-right { position: relative; }
  .header-right::before {
    content: ""; position: absolute; left: -1.6rem; top: 0; bottom: 0;
    width: 1.6rem; pointer-events: none;
    background: linear-gradient(to right, rgba(247, 241, 230, 0), var(--paper));
  }
  .site-nav { padding-right: 0.4rem; }
  .site-nav a { padding: 0 0.6rem; font-size: 0.92rem; }
}
