/* ============================================================
   THE ECONOMIC GAZETTE
   A broadsheet. Deliberately a different world from the main site:
   newsprint, black ink, hairline rules, columns, drop caps.
   Loads AFTER main.css and overrides it.
   ============================================================ */

.gz {
  /* ---- Newsprint palette ---- */
  --paper:     #F1EDE1;
  --paper-2:   #E6E1D2;
  --paper-3:   #DBD5C3;
  --ink:       #14120C;
  --ink-soft:  #4A463A;
  --ink-faint: #5F5A4B;   /* 5.3:1 on the tinted panel, 6.4:1 on newsprint */
  --rule:      #14120C;
  --rule-thin: rgba(20,18,12,.22);

  --red:       #C1121F;   /* masthead red — 6.1:1 on newsprint */
  --blue:      #17369E;   /* deep press blue — 8.9:1 on newsprint */

  /* ---- Broadsheet type ---- */
  --f-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-text: "Source Serif 4", Georgia, serif;

  --gz-max: 1400px;
}

/* ---------- Page shell ---------- */
body.gz {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 1.0625rem;
  line-height: 1.62;
}
.gz::before {
  /* newsprint grain */
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .28; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.55'/%3E%3C/svg%3E");
}
.gz > * { position: relative; z-index: 2; }

.gz h1, .gz h2, .gz h3, .gz h4 {
  font-family: var(--f-head);
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.04;
  font-weight: 700;
}
.gz ::selection { background: var(--red); color: var(--paper); }
.gz :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.gz .noise, .gz .progress { display: none; }

.gz-wrap {
  width: 100%; max-width: var(--gz-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.5vw, 3rem);
}

/* ---------- Rules ---------- */
.rule       { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule--thick{ border-top-width: 4px; }
.rule--dbl  { height: 5px; border: 0; border-top: 1px solid var(--rule); border-bottom: 3px solid var(--rule); }
.rule--hair { border-top: 1px solid var(--rule-thin); }
.rule--red  { border-top: 3px solid var(--red); }

/* Animated rule draw-in */
.rule-draw { transform: scaleX(0); transform-origin: left; transition: transform 900ms var(--e-out); }
.rule-draw.is-in { transform: scaleX(1); }

/* ---------- Top bar (back to AUES) ---------- */
.gz-top {
  background: var(--ink); color: var(--paper);
  font-family: var(--f-text); font-size: .9rem;
}
.gz-top__in {
  max-width: var(--gz-max); margin-inline: auto;
  padding: .6rem clamp(1rem,3.5vw,3rem);
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem;
  align-items: center; justify-content: space-between;
}
.gz-top a { color: var(--paper); border-bottom: 1px solid transparent; transition: border-color 180ms ease; }
.gz-top a:hover { border-color: var(--paper); }
.gz-top nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }

/* ---------- Dateline ---------- */
.dateline {
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem;
  justify-content: space-between; align-items: center;
  padding-block: .7rem;
  font-family: var(--f-text); font-size: .9rem;
  color: var(--ink-soft);
}
.dateline b { color: var(--ink); font-weight: 600; }

/* ---------- Masthead ---------- */
.masthead { text-align: center; padding-block: clamp(1.2rem, 3vw, 2.4rem); }
.masthead__orn {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  font-family: var(--f-text); font-style: italic; font-size: .95rem; color: var(--red);
  margin-bottom: .6rem;
}
.masthead__orn::before, .masthead__orn::after {
  content: ""; height: 1px; width: clamp(30px, 12vw, 150px); background: var(--red);
}
/* A masthead sits on one line and fills the measure — that is what makes it
   read as a newspaper rather than a heading. Sized in vw so it always fits. */
.masthead__t {
  font-family: var(--f-head);
  font-weight: 900;
  font-size: clamp(1.6rem, 8.7vw, 7.7rem);
  line-height: 1;
  letter-spacing: -0.025em;
  white-space: nowrap;
  margin: 0;
  overflow: hidden;
}
@media (max-width: 640px) {
  /* Narrow screens stack it, as broadsheets do on their tabloid editions */
  .masthead__t { white-space: normal; font-size: clamp(2.4rem, 13.5vw, 4rem); line-height: .95; }
}
/* Driven by CSS, not JS — the masthead must never be able to hang hidden. */
.masthead__t > span {
  display: block;
  animation: press-in 1100ms var(--e-out) 140ms both;
}
@keyframes press-in {
  from { transform: translateY(103%); }
  to   { transform: none; }
}
.masthead__sub {
  margin-top: .9rem;
  font-family: var(--f-text); font-style: italic;
  font-size: clamp(.98rem, 1.3vw, 1.12rem); color: var(--ink-soft);
}

/* ---------- Section flags ---------- */
.flag {
  display: inline-block;
  font-family: var(--f-text); font-size: 1rem; font-weight: 600;
  color: var(--red);
}
.flag--blue { color: var(--blue); }
.flag--ink { color: var(--ink-soft); }

/* Section flags double as real headings so the document outline has no gaps.
   Needs explicit overrides — `.gz h2` outranks `.flag` on specificity. */
.gz h2.flag, .gz h3.flag {
  font-family: var(--f-text);
  font-size: 1rem; font-weight: 600;
  letter-spacing: 0; line-height: 1.3;
  color: var(--red);
}
.gz h2.flag--blue, .gz h3.flag--blue { color: var(--blue); }
.gz h2.flag--ink,  .gz h3.flag--ink  { color: var(--ink-soft); }

.secbar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding-bottom: .6rem; flex-wrap: wrap;
}
.secbar h2 {
  font-family: var(--f-head); font-weight: 900;
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  letter-spacing: -.01em;
}
.secbar .more {
  font-family: var(--f-text); font-size: .95rem; color: var(--blue);
  border-bottom: 1px solid currentColor;
}

/* ---------- Front page grid ---------- */
.frontpage { display: grid; gap: 0; }
@media (min-width: 900px) {
  .frontpage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr) minmax(0, 1fr);
  }
  .frontpage > * + * {
    border-left: 1px solid var(--rule-thin);
    padding-left: clamp(1rem, 2vw, 2rem);
  }
  .frontpage > * { padding-right: clamp(1rem, 2vw, 2rem); }
  .frontpage > *:last-child { padding-right: 0; }
}
@media (max-width: 899px) {
  .frontpage > * + * {
    border-top: 1px solid var(--rule-thin);
    margin-top: 2rem; padding-top: 2rem;
  }
}

/* ---------- Article blocks ---------- */
.art { display: grid; gap: .7rem; }
.art__kick { font-family: var(--f-text); font-size: .95rem; font-weight: 600; color: var(--red); }
.art__h {
  font-family: var(--f-head); font-weight: 900;
  letter-spacing: -.02em; line-height: 1.02;
  text-wrap: balance;
}
.art__h a { color: inherit; background-image: linear-gradient(var(--red), var(--red));
  background-size: 0% 2px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 380ms var(--e-out); }
.art__h a:hover, .art__h a:focus-visible { background-size: 100% 2px; }

.art--lead .art__h { font-size: clamp(1.85rem, 3.5vw, 3.1rem); }
.art--major .art__h { font-size: clamp(1.5rem, 2.8vw, 2.3rem); }
.art--minor .art__h { font-size: clamp(1.15rem, 1.7vw, 1.4rem); }
.art--brief .art__h { font-size: 1.02rem; line-height: 1.25; }

.art__deck {
  font-family: var(--f-text); font-style: italic;
  font-size: clamp(1rem, 1.5vw, 1.28rem); line-height: 1.5;
  color: var(--ink-soft); text-wrap: pretty;
}
.art__by {
  font-family: var(--f-text); font-style: italic; font-size: .92rem; color: var(--ink-faint);
  display: flex; flex-wrap: wrap; gap: .3rem .6rem;
}
.art__by b { color: var(--ink); font-weight: 600; font-style: normal; }
.art__x { color: var(--ink-soft); }
.art__x p + p { margin-top: .9rem; }

/* Multi-column body — justified WITH hyphenation, as broadsheets are set */
.cols {
  column-count: 2;
  column-gap: clamp(1.2rem, 2.4vw, 2.2rem);
  column-rule: 1px solid var(--rule-thin);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
@media (max-width: 700px) { .cols { column-count: 1; text-align: left; hyphens: manual; } }
.cols p + p { margin-top: 0; text-indent: 1.3em; }

/* Drop cap */
.dropcap::first-letter {
  float: left;
  font-family: var(--f-head); font-weight: 900;
  font-size: 4.1em; line-height: .78;
  padding: .04em .09em 0 0;
  color: var(--red);
}

/* ---------- Woodcut / halftone art ---------- */
.cut {
  position: relative; overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  aspect-ratio: 3 / 2;
  display: grid; place-items: center;
}
.cut::after {
  /* halftone dots */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--ink) 1px, transparent 1.4px);
  background-size: 5px 5px; opacity: .16;
}
.cut svg { width: 100%; height: 100%; }
.cut--tall { aspect-ratio: 3 / 4; }
.cut--wide { aspect-ratio: 21 / 9; }
.cut__cap {
  position: absolute; inset: auto 0 0 0; z-index: 3;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-text); font-style: italic; font-size: .85rem;
  padding: .4rem .7rem;
}

/* ---------- Briefs list ---------- */
.briefs { display: grid; gap: 0; }
.briefs li { padding-block: .85rem; border-bottom: 1px solid var(--rule-thin); display: grid; gap: .3rem; }
.briefs li:first-child { padding-top: 0; }
.briefs .n {
  font-family: var(--f-text); font-size: .88rem; font-weight: 600;
  color: var(--red);
}

/* ---------- Pull quote ---------- */
.pull {
  margin-block: 1.6rem;
  padding: 1.4rem 0;
  border-block: 3px double var(--rule);
  font-family: var(--f-head); font-weight: 700; font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  line-height: 1.22; letter-spacing: -.01em;
  color: var(--ink); text-align: center;
  break-inside: avoid;
}
.pull cite {
  display: block; margin-top: .8rem;
  font-family: var(--f-text); font-style: normal; font-weight: 400;
  font-size: .92rem; color: var(--ink-faint);
}

/* ---------- Markets table ---------- */
.mkt { width: 100%; border-collapse: collapse; font-family: var(--f-text); font-size: .95rem; }
.mkt caption {
  text-align: left; padding-bottom: .6rem;
  font-size: 1rem; font-weight: 600; color: var(--red);
}
.mkt th, .mkt td { padding: .5rem .4rem; border-bottom: 1px solid var(--rule-thin); text-align: right; }
.mkt th:first-child, .mkt td:first-child { text-align: left; }
.mkt thead th {
  font-size: .85rem; font-weight: 600;
  color: var(--ink-faint); border-bottom: 1px solid var(--rule);
}
.mkt td { font-variant-numeric: tabular-nums; color: var(--ink); }
.mkt .up { color: #17693A; } /* 5.4:1 on newsprint */
.mkt .dn { color: var(--red); }

/* ---------- Opinion column ---------- */
.opinion {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: clamp(1.2rem, 2.6vw, 2rem);
}
.opinion__who { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.opinion__av {
  width: 52px; height: 52px; flex: none; border: 1px solid var(--rule);
  background: var(--paper-3); display: grid; place-items: center;
  font-family: var(--f-head); font-weight: 900; font-size: 1.1rem; color: var(--ink);
}

/* ---------- Category strip ---------- */
.cats { display: flex; flex-wrap: wrap; gap: .5rem; }
.cats a {
  font-family: var(--f-text); font-size: .95rem;
  padding: .4rem .85rem; border: 1px solid var(--rule);
  color: var(--ink);
  transition: background 200ms ease, color 200ms ease;
}
.cats a:hover, .cats a:focus-visible { background: var(--ink); color: var(--paper); }
.cats a[aria-current="true"] { background: var(--red); border-color: var(--red); color: var(--paper); }

/* ---------- Grids ---------- */
.gz-grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.gz-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.gz-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.gz-grid--ruled > * { border-top: 1px solid var(--rule-thin); padding-top: 1.2rem; }

.gz-sec { padding-block: clamp(2.2rem, 5vw, 3.6rem); }

/* ---------- Pitch box ---------- */
.pitch {
  border: 4px double var(--rule);
  padding: clamp(1.4rem, 3.5vw, 2.6rem);
  display: grid; gap: 1.2rem;
}
.pitch h2 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); font-weight: 900; }

.gz-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 1.6rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-text); font-size: 1rem; font-weight: 600;
  border: 1px solid var(--ink);
  transition: background 220ms ease, color 220ms ease, transform 200ms var(--e-out);
  touch-action: manipulation;
}
.gz-btn:hover, .gz-btn:focus-visible { background: var(--red); border-color: var(--red); transform: translateY(-2px); }
.gz-btn--out { background: transparent; color: var(--ink); }
.gz-btn--out:hover, .gz-btn--out:focus-visible { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Classifieds footer ---------- */
.gz-foot { background: var(--ink); color: var(--paper-2); margin-top: clamp(3rem,6vw,5rem); }
.gz-foot a { color: var(--paper); }
.gz-foot__grid {
  display: grid; gap: clamp(1.8rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
.gz-foot h3 {
  font-family: var(--f-text); font-size: 1rem; color: #A9A292;
  margin-bottom: .8rem; font-weight: 600;
}
.gz-foot ul { display: grid; gap: .55rem; font-size: .92rem; }
.gz-foot ul a { border-bottom: 1px solid transparent; transition: border-color 180ms ease; }
.gz-foot ul a:hover { border-color: var(--paper); }
.gz-foot__bot {
  border-top: 1px solid rgba(241,237,225,.22);
  padding-block: 1.2rem;
  font-family: var(--f-text); font-size: .9rem; color: #A9A292;
  display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: space-between;
}

/* ---------- Reveal tuned for print feel ---------- */
.gz [data-reveal] { transform: translateY(18px); }

/* ---------- Touch comfort ---------- */
@media (pointer: coarse) {
  .gz-top a { display: inline-flex; align-items: center; min-height: 40px; }
  .gz-top__in { padding-block: .2rem; }
  .cats a { padding-block: .75rem; }
  .gz-foot ul a { display: inline-flex; align-items: center; min-height: 40px; }
  .gz-foot ul { gap: .15rem; }
  .secbar .more { display: inline-flex; align-items: center; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .masthead__t > span { animation: none !important; transform: none !important; }
  .rule-draw { transform: none !important; }
}
