/* =============================================================================
   SOCIAL 360 — SISTEMA VISUAL
   Paleta institucional: petróleo #073d57 e dourado #d6b85e (retirados dos logótipos).
   Organização: 1 Tokens · 2 Base · 3 Tipografia · 4 Utilitários · 5 Cabeçalho
   6 Ticker · 7 Hero · 8 Secções · 9 Cartões · 10 Mais lidas · 11 Opinião
   12 Publicidade · 13 Edição impressa · 14 Newsletter · 15 Rodapé
   16 Artigo · 17 Sobre · 18 Movimento · 19 Responsivo · 20 Impressão
   ============================================================================= */

/* ============== 1. TOKENS ============== */
:root {
  /* Marca */
  --navy-900: #03202e;
  --navy-800: #042b40;
  --navy-700: #073d57;
  --navy-600: #0b5a80;
  --gold-400: #e6d093;
  --gold-500: #d6b85e;
  --gold-600: #b7973f;
  --gold-700: #7a5c12;
  --flame: #b93d22;

  /* Superfícies e texto — tema claro */
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-alt: #ece7dc;
  --surface-invert: var(--navy-800);
  --text: #10222d;
  --text-soft: #4f5f6a;
  --text-faint: #78848c;
  --line: #ded7c8;
  --line-soft: #eae4d8;
  --accent: var(--navy-700);
  --accent-hover: var(--navy-600);
  --on-accent: #ffffff;
  --gold-text: var(--gold-700);
  --gold-rule: var(--gold-600);

  /* Escala tipográfica fluida */
  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0: clamp(0.98rem, 0.95rem + 0.14vw, 1.06rem);
  --step-1: clamp(1.12rem, 1.06rem + 0.3vw, 1.3rem);
  --step-2: clamp(1.32rem, 1.2rem + 0.6vw, 1.72rem);
  --step-3: clamp(1.6rem, 1.35rem + 1.15vw, 2.4rem);
  --step-4: clamp(2rem, 1.5rem + 2.2vw, 3.4rem);
  --step-5: clamp(2.4rem, 1.55rem + 3.6vw, 4.6rem);

  /* Ritmo */
  --gap: clamp(1.1rem, 0.8rem + 1.1vw, 2rem);
  --band: clamp(3.2rem, 2.2rem + 3.4vw, 5.8rem);
  --radius: 4px;
  --radius-lg: 10px;

  /* Profundidade e movimento */
  --shadow-sm: 0 1px 2px rgb(4 34 47 / 0.06), 0 2px 8px rgb(4 34 47 / 0.05);
  --shadow-md: 0 12px 32px -12px rgb(4 34 47 / 0.28);
  --shadow-lg: 0 30px 64px -28px rgb(4 34 47 / 0.45);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.4s;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #071219;
  --surface: #0d1e29;
  --surface-alt: #123040;
  --surface-invert: #030d13;
  --text: #edf2f4;
  --text-soft: #a4b4be;
  --text-faint: #7d8e99;
  --line: #1c3746;
  --line-soft: #162c38;
  --accent: var(--gold-500);
  --accent-hover: var(--gold-400);
  --on-accent: var(--navy-900);
  --gold-text: #e2c883;
  --gold-rule: var(--gold-500);

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 12px 32px -12px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 30px 64px -28px rgb(0 0 0 / 0.75);

  color-scheme: dark;
}

/* ============== 2. BASE ============== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  background: var(--surface-alt);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold-rule);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--gold-500);
  color: var(--navy-900);
}

/* Barra de progresso de leitura (apenas na página de artigo). */
.reading-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--navy-600), var(--gold-500));
  z-index: 90;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 200;
  padding: 0.7rem 1.2rem;
  background: var(--navy-700);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* ============== 3. TIPOGRAFIA ============== */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Etiqueta de secção: versaletes dourados precedidos de filete. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  flex: none;
  background: var(--gold-rule);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--step--1);
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.meta > * + *::before {
  content: "·";
  margin-right: 0.55rem;
}

.byline {
  font-weight: 600;
  color: var(--text-soft);
}

/* Ligação de texto cuja seta avança no hover. */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.text-link span {
  transition: transform var(--dur) var(--ease);
}

a:hover .text-link span,
.text-link:hover span {
  transform: translateX(5px);
}

/* ============== 4. UTILITÁRIOS ============== */
.wrap {
  width: min(100% - 2.5rem, 1280px);
  margin-inline: auto;
}

.band {
  padding-block: var(--band);
}

.band--dark {
  background: var(--surface-invert);
  color: #f2f5f7;
}

.band--dark .eyebrow {
  color: var(--gold-500);
}

.band--dark .meta {
  color: rgb(255 255 255 / 0.55);
}

.band--dark .text-link {
  color: var(--gold-500);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button--gold {
  background: var(--gold-500);
  color: var(--navy-900);
}

.button--gold:hover {
  background: var(--gold-600);
}

/* ============== 5. CABEÇALHO ============== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur) var(--ease);
}

.masthead.is-stuck {
  box-shadow: var(--shadow-sm);
}

/* Ao descer a página o cabeçalho encolhe: a fita recolhe e a marca diminui. */
.masthead.is-stuck .masthead__utility {
  max-height: 0;
  opacity: 0;
}

.masthead.is-stuck .masthead__main {
  padding-block: 0.55rem;
}

.masthead.is-stuck .brand__mark {
  width: 1.9rem;
}

.masthead.is-stuck .brand__word {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
}

/* Fita superior: data, edição e ferramentas. */
.masthead__utility {
  max-height: 3rem;
  overflow: hidden;
  background: var(--navy-800);
  color: rgb(255 255 255 / 0.72);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: max-height var(--dur) var(--ease), opacity 0.25s var(--ease);
}

.masthead__utility .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.4rem;
}

.masthead__utility strong {
  color: var(--gold-500);
  font-weight: 700;
}

.utility-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-button:hover {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
}

.icon-button svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

/* Do interruptor de tema só um ícone fica visível de cada vez. */
.theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* Linha principal: pesquisa, marca ao centro, acções. */
.masthead__main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-block: clamp(0.9rem, 0.5rem + 1.2vw, 1.6rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: center;
}

.brand__mark {
  width: clamp(2rem, 1.6rem + 1.2vw, 2.7rem);
  height: auto;
  flex: none;
  background: none;
  transition: transform 0.7s var(--ease), width var(--dur) var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(180deg);
}

.brand__word {
  font-family: var(--font-ui);
  font-size: clamp(1.4rem, 1.05rem + 1.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--navy-700);
  white-space: nowrap;
  transition: font-size var(--dur) var(--ease);
}

[data-theme="dark"] .brand__word {
  color: #fff;
}

.brand__word b {
  color: var(--gold-600);
  font-weight: 800;
}

[data-theme="dark"] .brand__word b {
  color: var(--gold-500);
}

.masthead__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 15rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.masthead__search:focus-within {
  border-color: var(--gold-rule);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-500) 25%, transparent);
}

.masthead__search svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: var(--text-faint);
}

.masthead__search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  font-size: var(--step--1);
}

.masthead__search input:focus {
  outline: none;
}

/* Resultados da pesquisa, ancorados ao campo. */
.search-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  z-index: 90;
  width: min(28rem, calc(100vw - 2.5rem));
  max-height: min(26rem, 60vh);
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-panel[hidden] {
  display: none;
}

.search-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-panel a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  transition: background var(--dur) var(--ease);
}

.search-panel a:hover,
.search-panel a:focus-visible,
.search-panel [aria-selected="true"] a {
  background: var(--surface-alt);
}

.search-panel h3 {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.search-panel mark {
  padding: 0 0.1em;
  border-radius: 2px;
  background: color-mix(in srgb, var(--gold-500) 45%, transparent);
  color: inherit;
}

.search-panel .meta {
  margin-top: 0.2rem;
}

.search-panel__empty {
  padding: 1rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.search-panel__footer {
  padding: 0.55rem 0.75rem 0.3rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.masthead__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.menu-button {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* Navegação por secções. */
.primary-nav {
  border-top: 1px solid var(--line-soft);
}

.primary-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.6rem, 0.1rem + 1.6vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav a {
  position: relative;
  display: block;
  padding: 0.85rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  transition: color var(--dur) var(--ease);
}

.primary-nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--gold-rule);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur) var(--ease);
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--text);
}

.primary-nav a:hover::after,
.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ============== 6. TICKER DE ÚLTIMA HORA ============== */
.ticker {
  display: flex;
  align-items: stretch;
  background: var(--navy-700);
  color: #fff;
  overflow: hidden;
}

[data-theme="dark"] .ticker {
  background: var(--surface-alt);
  color: var(--text);
}

.ticker__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  padding: 0.6rem clamp(0.9rem, 0.5rem + 1.5vw, 1.6rem);
  background: var(--flame);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ticker__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.8s var(--ease) infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.2;
    transform: scale(0.6);
  }
}

/* min-width: 0 é obrigatório — sem ele a faixa de largura máxima
   impede o item flexível de encolher e alarga a página inteira. */
.ticker__viewport {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding-left: 3rem;
  overflow: hidden;
}

/* A lista está duplicada no HTML: deslocar 50% devolve-a ao ponto de partida. */
.ticker__track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  animation: ticker 46s linear infinite;
}

.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
  animation-play-state: paused;
}

.ticker__track a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  white-space: nowrap;
  color: inherit;
  opacity: 0.9;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.ticker__track a::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
  background: var(--gold-500);
}

.ticker__track a:hover {
  color: var(--gold-500);
  opacity: 1;
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

/* ============== 7. HERO ============== */
.hero {
  padding-block: clamp(1.6rem, 1rem + 2vw, 3rem);
}

.hero__grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
}

/* Destaque principal: imagem em cima e chamada editorial abaixo. */
.hero__lead {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--ink-900);
  box-shadow: var(--shadow-lg);
}

.hero__lead img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.hero__lead::after {
  content: none;
}

.hero__lead > div {
  padding: clamp(1.3rem, 1rem + 1.8vw, 2.4rem);
}

.hero__lead:hover img {
  transform: scale(1.05);
}

.hero__lead .eyebrow {
  color: var(--gold-500);
}

.hero__lead h1 {
  margin-block: 0.8rem 0.7rem;
  font-size: var(--step-5);
  font-weight: 700;
  color: var(--ink-900);
  max-width: 18ch;
}

/* Sublinhado dourado que cresce ao passar o rato. */
.hero__lead h1 a {
  background-image: linear-gradient(var(--gold-500), var(--gold-500));
  background-repeat: no-repeat;
  background-size: 0% 3px;
  background-position: 0 100%;
  transition: background-size 0.5s var(--ease);
}

.hero__lead h1 a:hover {
  background-size: 100% 3px;
}

.hero__lead p:not(.meta) {
  max-width: 52ch;
  font-size: var(--step-1);
  color: var(--ink-600);
}

.hero__lead .meta {
  margin-top: 1.1rem;
  color: var(--ink-500);
}

.hero__lead .byline {
  color: var(--ink-700);
}

/* Coluna lateral com as chamadas secundárias. */
.hero__rail {
  display: grid;
  gap: var(--gap);
  align-content: start;
}

.rail-card {
  display: grid;
  grid-template-columns: 1fr 6.5rem;
  gap: 1rem;
  align-items: start;
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--line);
}

.hero__rail > .rail-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rail-card__figure {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1;
}

.rail-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.rail-card:hover img {
  transform: scale(1.07);
}

.rail-card h3 {
  margin-block: 0.35rem;
  font-size: var(--step-1);
  transition: color var(--dur) var(--ease);
}

.rail-card:hover h3 {
  color: var(--accent);
}

.rail-card p {
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* ============== 8. CABEÇALHOS DE SECÇÃO ============== */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 1rem + 1.6vw, 2.6rem);
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--text);
}

.band--dark .section-head {
  border-bottom-color: rgb(255 255 255 / 0.25);
}

.section-head h2 {
  font-size: var(--step-3);
  line-height: 1;
}

.section-head__intro {
  font-size: 0.95rem;
  color: var(--text-soft);
  max-width: 42ch;
}

.band--dark .section-head__intro {
  color: rgb(255 255 255 / 0.7);
}

/* ============== 9. CARTÕES EDITORIAIS ============== */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Grelha do País: destaque grande + lista das mais lidas. */
.grid--feature-rail {
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  align-items: start;
}

.story {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.story:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.story__figure {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.story__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.story:hover .story__figure img {
  transform: scale(1.06);
}

/* Etiqueta de categoria pousada sobre a imagem. */
.story__tag {
  position: absolute;
  left: 0.9rem;
  top: 0.9rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgb(3 32 46 / 0.82);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story__tag--gold {
  background: var(--gold-500);
  color: var(--navy-900);
}

.story__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 clamp(1rem, 0.8rem + 0.6vw, 1.5rem) clamp(1.2rem, 1rem + 0.6vw, 1.6rem);
}

.story__body h3 {
  font-size: var(--step-2);
  transition: color var(--dur) var(--ease);
}

.story:hover .story__body h3 {
  color: var(--accent);
}

.story__body p {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.story--feature .story__figure {
  aspect-ratio: 16 / 9;
}

.story--feature .story__body h3 {
  font-size: var(--step-3);
}

.story--compact .story__figure {
  aspect-ratio: 3 / 2;
}

.story--compact .story__body h3 {
  font-size: var(--step-1);
}

/* Variante sem moldura, para grelhas mais leves. */
.story--bare {
  background: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.story--bare:hover {
  transform: none;
  box-shadow: none;
}

.story--bare .story__figure {
  border-radius: var(--radius);
}

.story--bare .story__body {
  padding: 0;
}

/* ============== 10. MAIS LIDAS ============== */
.ranked {
  position: sticky;
  top: 7.5rem;
  align-self: start;
  padding: clamp(1.2rem, 1rem + 1vw, 1.8rem);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}

.ranked h2 {
  font-size: var(--step-2);
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--text);
}

.ranked ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rank;
}

.ranked li {
  counter-increment: rank;
  border-bottom: 1px solid var(--line-soft);
}

.ranked li:last-child {
  border-bottom: 0;
}

.ranked a {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.9rem;
  align-items: baseline;
  padding-block: 0.95rem;
}

/* Numeral vazado em dourado que se preenche no hover. */
.ranked a::before {
  content: counter(rank, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-rule);
  transition: color var(--dur) var(--ease);
}

.ranked a:hover::before {
  color: var(--gold-rule);
}

.ranked h3 {
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  transition: color var(--dur) var(--ease);
}

.ranked a:hover h3 {
  color: var(--accent);
}

.ranked .meta {
  margin-top: 0.3rem;
}

/* ============== 11. OPINIÃO ============== */
.opinion-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15.5rem, 1fr);
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-600) transparent;
}

.opinion-rail::-webkit-scrollbar {
  height: 4px;
}

.opinion-rail::-webkit-scrollbar-thumb {
  background: var(--gold-600);
  border-radius: 99px;
}

.opinion {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-snap-align: start;
  padding: clamp(1.2rem, 1rem + 0.8vw, 1.7rem);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.04);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.opinion:hover {
  background: rgb(255 255 255 / 0.08);
  border-color: var(--gold-500);
  transform: translateY(-4px);
}

.opinion__portrait {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-500);
  padding: 3px;
  background: var(--surface-invert);
}

.opinion h3 {
  font-size: var(--step-1);
  color: #fff;
  transition: color var(--dur) var(--ease);
}

.opinion:hover h3 {
  color: var(--gold-500);
}

.opinion p {
  flex: 1;
  font-size: 0.9rem;
  color: rgb(255 255 255 / 0.7);
}

.opinion__author {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-500);
}

/* ============== 12. PUBLICIDADE ============== */
/* Menos folga do que uma banda editorial: a publicidade separa, não interrompe. */
.ad-slot {
  margin-block: clamp(2rem, 1.4rem + 2vw, 3.4rem);
}

.ad-slot__label {
  margin-bottom: 0.5rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-faint);
}

/* Carrossel de campanhas: todos os painéis ocupam a mesma célula da grelha,
   por isso a troca é um verdadeiro cruzamento de opacidades — sem saltos. */
.ad-carousel {
  position: relative;
  display: grid;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--navy-800);
}

.ad-slide {
  grid-area: 1 / 1;
  display: flex;
  align-items: flex-end;
  min-height: clamp(15rem, 12rem + 12vw, 22rem);
  padding: clamp(1.4rem, 1rem + 2vw, 2.8rem);
  color: #fff;
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.9s var(--ease), visibility 0.9s var(--ease);
}

.ad-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

/* O texto sobe ligeiramente à entrada; a imagem faz uma aproximação lenta. */
.ad-slide > div {
  transform: translateY(1.2rem);
  transition: transform 0.9s var(--ease);
}

.ad-slide.is-active > div {
  transform: none;
  transition-delay: 0.12s;
}

.ad-slide.is-active .ad-slide__bg {
  animation: slow-zoom 9s var(--ease) forwards;
}

@keyframes slow-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.ad-slide__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.ad-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgb(4 43 64 / 0.95) 12%, rgb(4 43 64 / 0.42) 78%);
}

.ad-slide__logo {
  height: 2.6rem;
  width: auto;
  margin-bottom: 0.9rem;
  background: none;
}

.ad-slide h3 {
  max-width: 20ch;
  font-size: var(--step-3);
  color: #fff;
}

.ad-slide .eyebrow {
  color: var(--gold-500);
}

.carousel-controls {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: rgb(3 32 46 / 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.carousel-controls button {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.carousel-controls button:hover {
  background: var(--gold-500);
  color: var(--navy-900);
}

.carousel-controls svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

/* Faixa de patrocínio institucional. */
.sponsor-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.6rem;
  padding: clamp(1.1rem, 0.9rem + 1vw, 1.8rem);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--dur) var(--ease);
}

.sponsor-strip:hover {
  border-color: var(--gold-rule);
  border-style: solid;
}

.sponsor-strip__mark {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  flex: none;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--gold-500);
  font-size: 1.3rem;
}

.sponsor-strip strong {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.sponsor-strip span {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ============== 13. EDIÇÃO IMPRESSA ============== */
.print-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}

.print-intro h2 {
  font-size: var(--step-4);
  color: #fff;
}

.print-intro p {
  margin-block: 1rem 1.8rem;
  max-width: 44ch;
  color: rgb(255 255 255 / 0.72);
}

.print-stage {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  min-height: clamp(20rem, 16rem + 14vw, 28rem);
  perspective: 1200px;
}

/* As capas partilham a mesma célula: a altura do palco é a da capa mais alta
   e a passagem de uma para a outra não desloca nada. */
.print-slide {
  grid-area: 1 / 1;
  width: min(100%, 17rem);
  opacity: 0;
  visibility: hidden;
  transform: translateY(1.5rem) scale(0.92) rotateY(14deg);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease),
    visibility 0.7s var(--ease);
  pointer-events: none;
}

.print-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  z-index: 2;
}

.print-slide img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgb(255 255 255 / 0.1);
  transition: transform var(--dur) var(--ease);
}

.print-slide:hover img {
  transform: translateY(-6px);
}

.print-slide__caption {
  margin-top: 1.2rem;
  text-align: center;
}

.print-slide__caption h3 {
  margin-block: 0.4rem 0.3rem;
  font-size: var(--step-2);
  color: #fff;
}

.print-slide__caption p {
  font-size: 0.9rem;
  color: rgb(255 255 255 / 0.68);
}

.print-stage .carousel-controls {
  position: static;
  grid-row: 2;
  margin-top: 1.5rem;
}

/* ============== 14. NEWSLETTER ============== */
.newsletter {
  background: linear-gradient(120deg, var(--gold-500), #e8d193 55%, var(--gold-500));
  color: var(--navy-900);
}

.newsletter .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: center;
}

.newsletter h2 {
  font-size: var(--step-4);
}

.newsletter > .wrap > div > p {
  margin-top: 0.8rem;
  max-width: 46ch;
  color: rgb(3 32 46 / 0.78);
}

.newsletter form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.newsletter input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.8rem 1.2rem;
  border: 1px solid rgb(3 32 46 / 0.25);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.8);
}

.newsletter input:focus {
  outline: none;
  border-color: var(--navy-700);
  background: #fff;
}

.newsletter .button {
  background: var(--navy-800);
  color: #fff;
}

.newsletter .button:hover {
  background: var(--navy-900);
}

.newsletter small {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: rgb(3 32 46 / 0.65);
}

/* ============== 15. RODAPÉ ============== */
.site-footer {
  padding-top: var(--band);
  background: var(--navy-900);
  color: rgb(255 255 255 / 0.72);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 1rem + 2.5vw, 3.5rem);
  padding-bottom: var(--band);
}

.site-footer h2 {
  margin-bottom: 1rem;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.site-footer p + p {
  margin-top: 0.9rem;
}

.site-footer strong {
  display: block;
  color: #fff;
  font-weight: 600;
}

.site-footer a {
  transition: color var(--dur) var(--ease);
}

.site-footer a:hover {
  color: var(--gold-500);
}

.footer-brand .brand {
  justify-self: start;
  margin-bottom: 1.2rem;
}

.footer-brand .brand__word {
  color: #fff;
}

.footer-brand .brand__word b {
  color: var(--gold-500);
}

.footer-brand__note {
  max-width: 34ch;
}

.footer-lce {
  height: 3.4rem;
  width: auto;
  margin-top: 1.6rem;
  opacity: 0.85;
  background: none;
}

.footer-social {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 50%;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.footer-social a:hover {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--navy-900);
  transform: translateY(-3px);
}

.footer-social svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.footer-links {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-bottom {
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

.footer-bottom .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-block: 1.5rem;
  font-size: 0.8rem;
  color: rgb(255 255 255 / 0.5);
}

/* ============== 16. PÁGINA DE ARTIGO ============== */
.breadcrumb {
  padding-top: 1.5rem;
  font-size: var(--step--1);
  color: var(--text-faint);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.article-hero {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem) clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  text-align: center;
}

.article-hero .eyebrow {
  justify-content: center;
}

.article-hero h1 {
  max-width: 20ch;
  margin: 1rem auto;
  font-size: var(--step-5);
}

.article-hero__lead {
  max-width: 58ch;
  margin-inline: auto;
  font-size: var(--step-1);
  color: var(--text-soft);
}

.article-hero .meta {
  justify-content: center;
  margin-top: 1.5rem;
}

.article-figure {
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.article-figure figcaption {
  margin-top: 0.8rem;
  font-size: 0.84rem;
  color: var(--text-faint);
  text-align: center;
}

/* Corpo do artigo com coluna de partilha fixa à esquerda. */
.article-layout {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: clamp(1.5rem, 1rem + 2vw, 3rem);
  padding-bottom: var(--band);
}

.share-rail {
  position: sticky;
  top: 8.5rem;
  align-self: start;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
}

.share-rail__label {
  writing-mode: vertical-rl;
  margin-bottom: 0.4rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.share-rail a,
.share-rail button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.share-rail a:hover,
.share-rail button:hover {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: #fff;
  transform: translateY(-2px);
}

.share-rail svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* Confirmação visual depois de copiar a ligação. */
.share-rail .is-copied {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--navy-900);
}

/* Coluna de leitura: o corpo e as etiquetas partilham a mesma medida. */
.article-column {
  min-width: 0;
}

.article-body {
  max-width: 68ch;
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.16rem);
  line-height: 1.78;
}

.article-body > * + * {
  margin-top: 1.4rem;
}

.article-body h2 {
  margin-top: 2.6rem;
  font-size: var(--step-3);
}

/* Capitular na abertura do texto. */
.article-body > p:first-of-type::first-letter {
  float: left;
  margin: 0.12em 0.1em 0 0;
  font-family: var(--font-display);
  font-size: 3.9em;
  font-weight: 700;
  line-height: 0.78;
  color: var(--navy-700);
}

[data-theme="dark"] .article-body > p:first-of-type::first-letter {
  color: var(--gold-500);
}

.article-body blockquote {
  margin-block: 2.4rem;
  padding-left: clamp(1.2rem, 1rem + 1vw, 2rem);
  border-left: 3px solid var(--gold-rule);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-style: italic;
  line-height: 1.35;
}

.article-body a:not(.button) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--gold-rule);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.article-tags a {
  display: block;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.article-tags a:hover {
  border-color: var(--gold-rule);
  color: var(--accent);
}

/* ============== 17. PÁGINA SOBRE ============== */
.about-hero {
  position: relative;
  display: grid;
  align-content: center;
  min-height: clamp(20rem, 16rem + 16vw, 30rem);
  padding-block: var(--band);
  isolation: isolate;
  color: #fff;
  text-align: center;
}

.about-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.about-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(4 43 64 / 0.82), rgb(3 32 46 / 0.94));
}

.about-hero .eyebrow {
  color: var(--gold-500);
  justify-self: center;
}

.about-hero h1 {
  margin-block: 1rem;
  font-size: var(--step-5);
  color: #fff;
}

.about-hero p {
  max-width: 56ch;
  margin-inline: auto;
  font-size: var(--step-1);
  color: rgb(255 255 255 / 0.8);
}

.prose {
  max-width: 68ch;
  font-size: clamp(1.02rem, 1rem + 0.2vw, 1.12rem);
  line-height: 1.78;
}

.prose > * + * {
  margin-top: 1.3rem;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.pillar {
  padding: clamp(1.3rem, 1rem + 1vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-top: 3px solid var(--gold-rule);
  border-radius: var(--radius-lg);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.pillar:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pillar__number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-rule);
}

.pillar h3 {
  margin-block: 0.8rem 0.5rem;
  font-size: var(--step-2);
}

.pillar p {
  font-size: 0.93rem;
  color: var(--text-soft);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.contact-card {
  padding: clamp(1.3rem, 1rem + 1vw, 1.9rem);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.04);
}

.contact-card h3 {
  margin-bottom: 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.contact-card a,
.contact-card p {
  display: block;
  padding-block: 0.15rem;
  color: rgb(255 255 255 / 0.85);
  transition: color var(--dur) var(--ease);
}

.contact-card a:hover {
  color: var(--gold-500);
}

.masthead-credits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.credit-block h3 {
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.credit-block p + p {
  margin-top: 0.8rem;
}

.credit-block strong {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ============== 18. MOVIMENTO ============== */
/* Escondido só quando o JS está activo, para o conteúdo nunca desaparecer sem ele. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .ticker__track {
    animation: none;
  }
}

/* ============== 19. RESPONSIVO ============== */
@media (max-width: 1080px) {
  .hero__grid,
  .grid--feature-rail,
  .print-layout,
  .newsletter .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rail-card {
    grid-template-columns: minmax(0, 1fr);
    border-bottom: 0;
    padding-bottom: 0;
  }

  .rail-card__figure {
    aspect-ratio: 3 / 2;
    order: -1;
  }

  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranked {
    position: static;
  }
}

@media (max-width: 860px) {
  /* A pesquisa passa a ocupar uma linha própria em vez de desaparecer. */
  .masthead__main {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand actions"
      "search search";
    row-gap: 0.7rem;
  }

  .brand {
    grid-area: brand;
    justify-self: start;
  }

  .masthead__actions {
    grid-area: actions;
  }

  .masthead__search {
    grid-area: search;
    max-width: none;
  }

  .menu-button {
    display: inline-flex;
  }

  /* A navegação passa a painel deslizante. */
  .primary-nav {
    display: none;
    border-top: 1px solid var(--line);
  }

  .primary-nav.is-open {
    display: block;
    animation: slide-down 0.35s var(--ease);
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 0.5rem;
  }

  .primary-nav li + li {
    border-top: 1px solid var(--line-soft);
  }

  .primary-nav a {
    padding: 0.9rem 0.2rem;
    font-size: 0.9rem;
  }

  .primary-nav a::after {
    display: none;
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Em ecrãs pequenos a partilha passa a linha horizontal. */
  .share-rail {
    position: static;
    grid-auto-flow: column;
    justify-content: start;
    justify-items: start;
  }

  .share-rail__label {
    writing-mode: horizontal-tb;
    align-self: center;
    margin: 0 0.4rem 0 0;
  }

  .pillars,
  .contact-grid,
  .masthead-credits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@media (max-width: 640px) {
  .masthead__utility .wrap {
    justify-content: center;
  }

  .masthead__utility p {
    display: none;
  }

  /* Em ecrãs estreitos o menu tem prioridade sobre o botão de subscrição. */
  .masthead__actions .button {
    display: none;
  }

  .hero__rail,
  .grid--2,
  .grid--3,
  .grid--4,
  .footer-grid,
  .pillars,
  .contact-grid,
  .masthead-credits {
    grid-template-columns: minmax(0, 1fr);
  }

  .ranked a {
    grid-template-columns: 2.2rem 1fr;
  }

  .sponsor-strip {
    flex-direction: column;
    text-align: center;
  }

  .article-body > p:first-of-type::first-letter {
    font-size: 3.2em;
  }
}

/* ============== 20. IMPRESSÃO ============== */
@media print {
  .masthead,
  .ticker,
  .ad-slot,
  .newsletter,
  .share-rail,
  .reading-progress,
  .site-footer,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
