/* Sistema visual do N1: toda cor, fonte e medida do portal sai daqui. */
:root {
  color-scheme: light;

  --c-bg: #f6f5f1;
  --c-surface: #ffffff;
  --c-surface-2: #eeece6;
  --c-ink: #0f1b25;
  --c-ink-2: #3b4853;
  --c-muted: #66717b;
  --c-line: #dcd8cf;
  --c-line-strong: #0f1b25;
  --c-accent: #c8102e;
  --c-accent-text: #b00e28;
  --c-brand: #0b1824;
  --c-brand-2: #12263a;
  --c-on-brand: #f2f5f7;
  --c-on-brand-muted: #9db0bd;
  --c-alert: #3b1219;
  --c-confirmed: #2b7357;
  --c-provisional: #9a5f08;
  --c-disputed: #b3261e;
  --c-focus: #2c6fdb;
  --c-overlay: rgb(6 14 20 / 0.72);

  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
  --c-paper: #fbf8ef;
  --c-paper-ink: #1d1a14;
  --c-paper-line: #e3dccb;

  --fs-2xs: 0.6875rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.3125rem;
  --fs-2xl: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  --fs-3xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --fs-4xl: clamp(2.125rem, 1.4rem + 2.6vw, 3.5rem);

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  --radius: 2px;
  --shadow: 0 1px 2px rgb(15 27 37 / 0.06), 0 4px 16px rgb(15 27 37 / 0.06);
  --shadow-lg: 0 24px 64px rgb(6 14 20 / 0.28);
  --header-h: 72px;
  --content: 1320px;
  --measure: 680px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --c-bg: #0b141b;
  --c-surface: #111e28;
  --c-surface-2: #172833;
  --c-ink: #e7ecef;
  --c-ink-2: #b9c5cd;
  --c-muted: #8b9ba6;
  --c-line: #243641;
  --c-line-strong: #c9d3da;
  --c-accent: #e3263f;
  --c-accent-text: #ff6b7a;
  --c-brand: #060e14;
  --c-brand-2: #0f1f2c;
  --c-alert: #2a0e13;
  --c-confirmed: #5cc49a;
  --c-provisional: #e2a54a;
  --c-disputed: #ff7a70;
  --c-focus: #7fb0ff;
  --c-paper: #e9e4d6;
  --c-paper-ink: #1d1a14;
  --c-paper-line: #cfc6b1;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font: 400 var(--fs-md) / 1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
p,
figure,
blockquote,
ul {
  margin: 0;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

.view[hidden],
[hidden] {
  display: none !important;
}

.shell {
  width: min(var(--content), 100% - 2 * var(--s-6));
  margin-inline: auto;
}

.page-shell {
  padding-block: var(--s-6) var(--s-8);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Rótulos curtos em caixa alta: editoria, chapéu, metadados. */
.eyebrow,
.label {
  font: 600 var(--fs-xs) / 1.2 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--c-accent-text);
}

.headline {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  color: var(--c-muted);
  font: 500 var(--fs-xs) / 1.3 var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-meta .category {
  color: var(--c-accent-text);
  font-weight: 700;
}

.story-meta > span + span::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-right: var(--s-3);
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  opacity: 0.6;
}

/* Estado da informação no arquivo (confirmado, provisório, contestado). */
.canon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-confirmed);
  font: 600 var(--fs-2xs) / 1 var(--font-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.canon-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.canon-chip.disputed {
  color: var(--c-disputed);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 0 var(--s-4);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-ink);
  font: 600 var(--fs-sm) / 1 var(--font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.btn:hover {
  border-color: var(--c-ink);
}

.btn[aria-pressed='true'],
.btn.is-active {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-bg);
}

.btn-primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--c-accent);
  filter: brightness(1.08);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--c-accent-text);
  font: 700 var(--fs-xs) / 1 var(--font-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.text-link .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}

.text-link:hover .icon {
  transform: translateX(3px);
}

/* Título de seção: texto com fio fino até o fim da linha. */
.section-rule {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  font: 700 var(--fs-sm) / 1 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-line);
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-6);
  border-bottom: 2px solid var(--c-line-strong);
}

.section-heading h1 {
  margin-top: var(--s-2);
  font: 600 var(--fs-3xl) / 1.05 var(--font-serif);
  letter-spacing: -0.015em;
}

.edition-note {
  color: var(--c-muted);
  font: 500 var(--fs-xs) / 1.4 var(--font-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  max-width: 46ch;
}

.edition-note #editionLabel,
.edition-note #updatedTime {
  color: var(--c-ink);
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  color: var(--c-muted);
  font: 600 var(--fs-xs) / 1 var(--font-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.back-link:hover {
  color: var(--c-ink);
}

.empty-state,
.small-empty,
.loading-card {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.empty-state {
  padding: var(--s-7) var(--s-5);
  border: 1px dashed var(--c-line);
  text-align: center;
}

.empty-state b {
  display: block;
  margin-bottom: var(--s-2);
  color: var(--c-ink);
  font: 600 var(--fs-xl) / 1.2 var(--font-serif);
}

.loading-card {
  padding: var(--s-8) 0;
  text-align: center;
}

@media (max-width: 840px) {
  .shell {
    width: calc(100% - 2 * var(--s-4));
  }

  .page-shell {
    padding-block: var(--s-5) var(--s-7);
  }

  .section-heading {
    margin-bottom: var(--s-5);
  }
}

@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;
  }
}
