/* Jornal moderno e claro: papel branco, tinta quase preta, fios finos, a navegação numa
   faixa escura e uma cor por editoria. A capa é uma lista só; a posição de cada história
   decide o seu papel. */
:root {
  color-scheme: light;
  --bg: #fff;
  --text: #121212;
  --muted: #55585e;
  --soft: #3d3f44;
  --border: #e4e4e4;
  --chip: #f0f0f0;
  --accent: #c4170c; /* o vermelho do topo; títulos da capa também */
  --accent-dark: #a6130a;
  --bar: 4.625rem; /* altura da faixa vermelha */
  --read: 54rem; /* coluna de leitura das páginas de notícia e de história */
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
header.site, main { max-width: 72rem; margin: 0 auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { letter-spacing: -0.025em; }

/* Faixa vermelha no topo, de ponta a ponta, com o nome do jornal em branco no centro. */
header.site {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--bar);
  background: var(--accent);
  box-shadow: 0 0 0 100vmax var(--accent);
  clip-path: inset(0 -100vmax);
}
header.site a { color: #fff; font: 750 2.25rem/1 var(--sans); letter-spacing: -0.045em; }
header.site a:hover { color: #fff; }

/* Data da edição, logo abaixo do nome do jornal. */
p.edition { margin: 0.75rem 0 0; text-align: center; font-size: 0.85rem; color: var(--muted); }

/* Barra de navegação branca sob a faixa vermelha, com fios cinza de ponta a ponta:
   abas Notícias/Artigos numa linha, seções (em vermelho) na de baixo. */
.navbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0;
  /* fios de largura total sem rolagem lateral: o fundo branco (a 1ª sombra, por cima)
     se estende para os lados e deixa 1px das outras duas aparecer em cima e embaixo */
  box-shadow: 0 0 0 100vmax #fff, 0 -1px 0 100vmax var(--border), 0 1px 0 100vmax var(--border);
  clip-path: inset(-1px -100vmax);
  font-size: 0.9rem;
}
nav.tabs { display: flex; gap: 1.25rem; }
nav.tabs a { font-weight: 650; color: var(--muted); }
nav.tabs a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
nav.sections { max-width: 100%; color: var(--muted); text-align: center; }
.navbar a:hover { color: var(--accent-dark); }
/* Edições de antes da barra: abas e índice soltos no main. */
main > nav.tabs { justify-content: center; margin-top: 0.75rem; }
main > nav.sections { margin-top: 0.4rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--text); text-align: center; font-size: 0.9rem; }
nav.sections a { color: var(--text); }
.navbar nav.sections a { color: var(--accent); font-weight: 550; }
main > h1[id] { scroll-margin-top: 1rem; }

/* Rótulos: chapéu da seção, linha de dados, selos. */
.kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
/* Uma cor por editoria de notícia; as demais ficam no vermelho. Contraste >= 4.5:1 no
   branco (teste em test_static_site). */
.kicker.s-politica { color: #c8102e; }
.kicker.s-economia { color: #0a7d4f; }
.kicker.s-mundo { color: #0b5ea8; }
.kicker.s-rio-grande-do-sul { color: #b35900; }
.meta { margin: 0.3rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--muted); }
.ai, .badge {
  display: inline-block;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
}
.ai { background: var(--chip); color: var(--text); }
.badge { border: 1px solid var(--border); background: #fff; color: var(--text); }
.badge::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.05em;
}
.summary { margin: 0.4rem 0 0; color: var(--soft); font-size: 0.92rem; }
.story-list .summary, ol.articles .summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.story-sources { margin: 0.4rem 0 0; font-size: 0.78rem; color: var(--muted); }
.story-sources a { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
/* Leia também: outros fatos do mesmo tema, sob a história. */
.related { margin: 0.6rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.related-label { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.related ul { margin: 0.25rem 0 0; padding: 0; list-style: none; }
.related li { margin: 0.2rem 0; font-size: 0.88rem; line-height: 1.35; }
.related li::before { content: "› "; color: var(--muted); }
.story .related { margin: 2rem 0; }
.story .related ul { padding: 0; }
.story .related li { font-size: 1.15rem; }
.story .related-label { font-size: 0.85rem; }
.thumb { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }

/* Cabeçalho de faixa: rótulo em maiúsculas sobre um fio. */
main > h1, .stories > h1 {
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--text);
  font-size: 1.3rem;
  font-weight: 650;
  text-transform: uppercase;
}
.stories > h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
main > h1#todas-as-noticias {
  margin-top: 4rem;
  padding: 1.25rem 0 0;
  border-top: 3px solid var(--text);
  border-bottom: 0;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
main > h1#todas-as-noticias + h1 { margin-top: 1rem; }

/* Histórias do dia: manchete (1ª), chamadas (2ª–5ª), notas (6ª em diante). */
.story-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.story-list > li { grid-column: span 4; min-width: 0; }
.story-list h2 { margin: 0; font-size: 1.05rem; font-weight: 650; line-height: 1.3; }
.story-list h2 a, ol.articles h2 a { color: var(--accent); }
.story-list h2 a:hover, ol.articles h2 a:hover { color: var(--accent-dark); }

.story-list > li:first-child figure { margin: 0 0 1rem; }
.story-list > li:first-child .photo { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--radius); }
.story-list figcaption { margin-top: 0.4rem; font-size: 0.75rem; line-height: 1.4; color: var(--muted); }
.story-list > li:first-child h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1.12; }
.story-list > li:first-child .summary { font-size: 1.05rem; color: var(--text); -webkit-line-clamp: 4; max-width: 48rem; }
.story-list > li:first-child:not(:has(img)) h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
.story-list > li:first-child:not(:has(img)) .summary { font-size: 1.15rem; -webkit-line-clamp: 6; }

.story-list > li:nth-child(n+2):nth-child(-n+5) { grid-column: span 1; }
.story-list > li:nth-child(n+2):nth-child(-n+5) .thumb { margin-bottom: 0.6rem; }
.story-list > li:nth-child(n+6) {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.story-list > li:nth-child(n+6) > * { grid-column: 1; }
.story-list > li:nth-child(n+6) .thumb { grid-column: 2; grid-row: 1 / span 5; width: 7.5rem; }
.story-list > li:nth-child(n+6) .summary { -webkit-line-clamp: 2; }

/* Faixas de seção: itens em grade de cards. */
ol.articles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
ol.articles li { min-width: 0; }
ol.articles .thumb { margin-bottom: 0.6rem; }
ol.articles h2 { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.35; }
ol.articles li:not(:has(img)) .summary { -webkit-line-clamp: 6; }
ol.articles .summary.warmup { display: block; } /* AI text: shown whole */

/* Aba Artigos: cards horizontais, miniatura à esquerda. */
ol.articles.artigo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
ol.articles.artigo li:has(> img) { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 1rem; align-content: start; }
ol.articles.artigo li > img { grid-row: 1 / span 4; aspect-ratio: 1; margin: 0; }
ol.articles.artigo li > :not(img) { grid-column: 2; }
ol.articles.artigo li:not(:has(> img)) > * { grid-column: auto; }

/* Páginas de notícia e de história: uma coluna de leitura. */
article, main > p:not(.edition), main > ul.editions { max-width: var(--read); margin-left: auto; margin-right: auto; }
article { padding-top: 2.5rem; }
article h1 { margin: 0.5rem 0 0.75rem; font-size: clamp(2.2rem, 5vw, 3.1rem); font-weight: 700; line-height: 1.15; }
article p { font-size: 1.3rem; line-height: 1.65; }
article .meta { font-size: 0.95rem; }
article .kicker { font-size: 0.85rem; }
article figure { margin: 1.5rem 0; }
article .photo { display: block; border-radius: var(--radius); } /* nunca maior que o original */
article figcaption { margin-top: 0.5rem; font-size: 0.95rem; line-height: 1.5; color: var(--muted); }
.credit { font-size: 0.72rem; letter-spacing: 0.02em; white-space: nowrap; }
article .warmup { margin: 1.5rem 0; padding: 1rem 1.25rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); }
article .warmup p { margin: 0; }
article .warmup p.ai { margin-bottom: 0.5rem; }
article .body { margin: 1.5rem 0; }
article .body h2, article .body h3, article .body h4 { margin: 2rem 0 0.5rem; font-size: 1.55rem; font-weight: 650; line-height: 1.3; }
article .body blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--border); color: var(--muted); }
article .body img { display: block; margin: 1.5rem 0; border-radius: var(--radius); }
article .body figure img { margin: 0; }
article .body pre { overflow-x: auto; padding: 0.75rem 1rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); font: 1rem/1.5 var(--mono); }
article .body code { font: 0.9em var(--mono); }
article .body a, article p.source a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
article p.source a, main > p:not(.edition) a { font-weight: 650; font-size: 1.05rem; }
main > p:not(.edition) { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Página da história. */
.story .meta .ai { margin-right: 0.25rem; }
.story .meta a { text-decoration: underline; text-decoration-color: var(--border); }
.story .cites { font-size: 0.95rem; color: var(--muted); white-space: nowrap; }
.story .cites a { text-decoration: underline; text-decoration-color: var(--border); }
.story h2 { margin: 2rem 0 0.75rem; font-size: 1.45rem; font-weight: 650; }
.story .divergences { margin: 2rem 0; padding: 0.25rem 1.25rem 0.75rem; border-left: 3px solid #b35900; background: #fbf4ec; border-radius: 0 var(--radius) var(--radius) 0; }
.story .divergences h2 { margin-top: 0.75rem; color: #8a4500; }
/* Fontes: linhas entre fios, como o rodapé de um jornal. */
.story ul.story-items { list-style: none; padding: 0; }
.story ul.story-items li { margin: 0; padding: 0.7rem 0; border-top: 1px solid var(--border); font-size: 1.15rem; }
.story ul.story-items a[target] { color: var(--accent); font-weight: 600; white-space: nowrap; }
.story ul { padding-left: 1.25rem; }
.story li { margin: 0.35rem 0; font-size: 1.15rem; }

/* Arquivo de edições. */
main > h1:not([id]) { max-width: var(--read); margin-left: auto; margin-right: auto; }
ul.editions { list-style: none; padding: 0; }
ul.editions li { padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-weight: 550; }
ul.editions .meta { font-weight: 400; }

/* Menu de edições, como nos portais: o botão faz parte da faixa vermelha e rola com
   ela; a gaveta abre à esquerda, logo abaixo da faixa, com rolagem própria, e o ícone
   vira um X. Abre e fecha por uma caixa de seleção escondida (o site não usa scripts). */
.visually-hidden, .menu-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.menu-button {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--bar);
  padding: 0 1.5rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.menu-button:hover { background: var(--accent-dark); }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block;
  width: 1.5rem;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.menu-icon { position: relative; margin: 7px 0; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }
.menu-icon, .menu-icon::before, .menu-icon::after { transition: transform 0.15s, background-color 0.15s; }
.menu-toggle:checked + .menu-button .menu-icon { background-color: transparent; }
.menu-toggle:checked + .menu-button .menu-icon::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle:checked + .menu-button .menu-icon::after { transform: translateY(-7px) rotate(-45deg); }
.menu-label { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1; }
.menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--accent); outline-offset: 2px; }
nav.editions-menu {
  display: none;
  position: absolute;
  top: var(--bar);
  left: 0;
  z-index: 2;
  width: 16rem;
  height: calc(100vh - var(--bar));
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
  border-right: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 0 2rem rgb(0 0 0 / 0.12);
  clip-path: inset(0 -3rem -3rem 0); /* a sombra não sobe na faixa vermelha */
  font-size: 0.88rem;
  line-height: 1.6;
}
.menu-toggle:checked ~ nav.editions-menu { display: block; }
/* O menu vem de menu.html, num iframe: o mesmo para todas as páginas, sempre atual. */
nav.editions-menu:has(> iframe) { padding: 0; }
nav.editions-menu iframe { display: block; width: 100%; height: 100%; border: 0; }
body.menu-frame { margin: 0; padding: 1.25rem 1.5rem 1.5rem; background: #fff; font-size: 0.88rem; line-height: 1.6; }
.menu-frame p, nav.editions-menu p { margin: 0; font-weight: 650; }
.menu-frame ol, nav.editions-menu ol { list-style: none; margin: 0.75rem 0; padding: 0; }
.menu-frame li, nav.editions-menu li { padding: 0.15rem 0; }
.menu-frame a, nav.editions-menu a { display: block; color: var(--muted); }
.menu-frame a:hover, nav.editions-menu a:hover { color: var(--accent); }
.menu-frame li:target a, nav.editions-menu a[aria-current="page"] {
  margin-left: -0.6rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-weight: 650;
}

/* Tablet: duas colunas. */
@media (max-width: 60rem) {
  .story-list, ol.articles, ol.articles.artigo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-list > li { grid-column: span 2; }
  .story-list > li:nth-child(n+2):nth-child(-n+5) { grid-column: span 1; }
}

/* Celular: uma coluna; chamadas, notas e cards viram linhas com miniatura à direita. */
@media (max-width: 40rem) {
  body { padding: 0 1rem 3rem; }
  :root { --bar: 3.125rem; }
  header.site a { font-size: 1.75rem; }
  .menu-button { padding: 0 1rem; gap: 0.5rem; }
  .menu-label { font-size: 0.75rem; }
  article p { font-size: 1.15rem; }
  .navbar { align-items: stretch; }
  nav.tabs { justify-content: center; }
  nav.sections { overflow-x: auto; white-space: nowrap; }
  .story-list, ol.articles, ol.articles.artigo { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .story-list > li, .story-list > li:nth-child(n+2):nth-child(-n+5), .story-list > li:nth-child(n+6) { grid-column: 1; }
  .story-list > li:first-child .photo { aspect-ratio: 3 / 2; }
  .story-list > li:nth-child(n+2), ol.articles.noticia li:has(> img) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6rem;
    column-gap: 0.9rem;
    align-content: start;
  }
  .story-list > li:nth-child(n+2), ol.articles li { padding-top: 1.25rem; border-top: 1px solid var(--border); }
  .story-list > li:nth-child(n+2) > *, ol.articles.noticia li:has(> img) > * { grid-column: 1; }
  .story-list > li:nth-child(n+2) .thumb, ol.articles.noticia li > .thumb { grid-column: 2; grid-row: 1 / span 5; width: 6rem; aspect-ratio: 1; margin: 0; }
  ol.articles.artigo li:has(> img) { grid-template-columns: 5rem minmax(0, 1fr); }
  .story-list > li:nth-child(n+2) .summary, ol.articles .summary { -webkit-line-clamp: 2; }
}
