/* Radar design tokens. Values are documented in DESIGN.md; text/surface pairs are contrast-checked by tests. */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --lime: #d4ff4f;
  --lime-hover: #e1ff85;
  --lime-tint: rgba(212, 255, 79, .12);
  --mint: #9ce8da;
  --mint-tint: rgba(156, 232, 218, .12);
  --canvas: #070908;
  --surface: #0f1211;
  --surface-raised: #151917;
  --surface-hover: #1c201e;
  --line: #262a28;
  --line-strong: #3c403e;
  --ink: #eef3e7;
  --ink-prose: #e2e6df;
  --ink-soft: #c9cfc8;
  --muted: #9ba39d;
  --ink-tint: rgba(238, 243, 231, .07);
  --on-accent: #10160f;
  --scrim: rgba(0, 0, 0, .62);
  --shadow-pop: 0 24px 56px -16px rgba(0, 0, 0, .75), 0 4px 14px rgba(0, 0, 0, .4);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --font-display: "Newsreader", ui-serif, Georgia, serif;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail-width: 84px;
  --masthead-height: 64px;
  --topics-height: 44px;
  --content-max: 1240px;
  --gutter: 16px;
  --reading-size: 1.05rem;
  --measure: 68ch;
  --z-topics: 29;
  --z-masthead: 30;
  --z-mega: 31;
  --z-rail: 40;
  --z-flyout: 41;
  --z-scrim: 50;
  --z-drawer: 60;
  --z-skip: 70;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

@media (min-width: 1024px) {
  :root { --gutter: 32px; }
}

html[data-reading-size="small"] { --reading-size: .94rem; }
html[data-reading-size="normal"] { --reading-size: 1.05rem; }
html[data-reading-size="large"] { --reading-size: 1.24rem; }
/* Base: reset, typography, links, focus, shared utilities. */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--canvas);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--masthead-height) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }

a {
  color: var(--lime);
  text-decoration-thickness: .08em;
  text-underline-offset: .22em;
}

a:hover { text-decoration-thickness: .14em; }

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.12;
  text-wrap: balance;
}

p {
  max-width: 72ch;
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input { font: inherit; }

button { cursor: pointer; }

/* The ring follows each element's own radius, so pills and cards keep their shape when focused. */
:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--canvas);
}

main [id],
main h1,
main h2 { scroll-margin-top: calc(var(--masthead-height) + var(--topics-height) + 16px); }

::selection {
  background: var(--lime);
  color: var(--on-accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.skip {
  position: fixed;
  z-index: var(--z-skip);
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--lime);
  color: var(--on-accent);
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus { transform: translateY(0); }

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: none;
  margin: 0;
  padding: 8px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--lime);
  font-size: .74rem;
  font-weight: 760;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}

.preview-banner::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
}

@media (max-width: 559px) {
  .preview-banner {
    font-size: .68rem;
    letter-spacing: .04em;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--ink-tint);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.badge-noticia {
  background: var(--lime-tint);
  color: var(--lime);
}

.badge-guia {
  background: var(--mint-tint);
  color: var(--mint);
}

.badge-example {
  border-color: var(--line-strong);
  border-style: dashed;
  background: transparent;
  color: var(--ink-soft);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--lime);
  border-radius: var(--radius-pill);
  background: var(--lime);
  color: var(--on-accent);
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.button:hover {
  background: var(--lime-hover);
  transform: translateY(-1px);
}

.button.secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--ink-soft);
  background: var(--surface-hover);
  color: var(--ink);
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .button:hover { transform: none; }
}
/* Shell: icon rail with hover submenus, masthead, topic bar with mega-menus, drawer, footer. */
.shell { min-height: 100vh; }
.frame { min-width: 0; }

main {
  display: block;
  max-width: var(--content-max);
  min-height: 60vh;
  margin: 0 auto;
  padding: 24px var(--gutter) 64px;
}

main:focus { outline: none; }

/* Rail: icons with short labels from 1024px. */
.rail { display: none; }

@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: var(--z-rail);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100vh;
    height: 100dvh;
    padding: 8px 0 12px;
    border-right: 1px solid var(--line);
    background: var(--canvas);
  }
}

.rail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
}

.rail-toggle:hover { background: var(--surface-hover); }

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0 8px;
}

.rail-bottom { margin-top: auto; }
.rail-item { position: relative; }

.rail-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 68px;
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 4px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.rail-label {
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.rail-link:hover,
.rail-item.is-open > .rail-link {
  background: var(--surface-hover);
  color: var(--ink);
}

.rail-link[aria-current] {
  background: var(--surface-raised);
  color: var(--ink);
}

.rail-link[aria-current] .icon { color: var(--lime); }

.rail-link[aria-current]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  width: 3px;
  height: 22px;
  margin-top: -11px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
}

/* Submenu beside the rail: hover opens only this section's panel, never the full menu. */
.flyout {
  position: absolute;
  z-index: var(--z-flyout);
  top: 0;
  left: calc(100% + 8px);
  display: none;
  width: 280px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
}

.flyout::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -9px;
  width: 9px;
}

.rail-bottom .flyout {
  top: auto;
  bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.js) .rail-item:hover > .flyout { display: block; }
}

html:not(.js) .rail-item:focus-within > .flyout { display: block; }

.rail-item.is-open > .flyout {
  display: block;
  animation: panel-in .12s ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.flyout-title {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

.flyout ul {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.flyout ul a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
}

.flyout a:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.flyout a[aria-current="page"] { color: var(--lime); }

/* Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-masthead);
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--masthead-height);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.masthead-toggle,
.masthead-search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.masthead-search-link { margin-left: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

/* Radar logo (sitegen/logo.py): the symbols live in the page sprite and take their colours from here. */
.brand-logo {
  display: block;
  width: auto;
  height: 24px;
}

.brand-logo-mark { color: var(--lime); }
.brand-logo-word { color: var(--ink); }
.logo-sweep-stop { stop-color: var(--lime); }

/* Search: a pill field with the submit button inside it. */
.masthead-search {
  position: relative;
  display: none;
}

.masthead-search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 52px 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}

.masthead-search input:hover,
.masthead-search input:focus { border-color: var(--line-strong); }

.masthead-search input:focus { background: var(--surface-raised); }
.masthead-search input::placeholder { color: var(--muted); }

.masthead-search button {
  position: absolute;
  top: 50%;
  right: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  transform: translateY(-50%);
}

.masthead-search button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.masthead.search-open .masthead-search {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  display: flex;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.masthead.search-open .masthead-search button { right: calc(var(--gutter) + 3px); }

@media (min-width: 1024px) {
  .masthead-toggle,
  .masthead-search-link { display: none; }

  .masthead-search {
    display: flex;
    flex: 0 1 560px;
    margin: 0 auto;
  }
}

/* Topic bar: scrolls horizontally without JS; with JS, overflow moves into "Mais". */
.topics {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.topic-list {
  display: flex;
  gap: 4px;
  max-width: var(--content-max);
  min-height: var(--topics-height);
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-list::-webkit-scrollbar { display: none; }

.topic,
.topic-more { flex: none; }

.topic-more { position: static; }
.topic[hidden],
.topic-more[hidden] { display: none; }

.topic-link,
.topic-more-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--topics-height);
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* The chip is drawn inside the 44px target, so the bar keeps its height and touch size. */
.topic-link::before,
.topic-more-button::before {
  content: "";
  position: absolute;
  inset: 6px 0;
  z-index: -1;
  border-radius: var(--radius-pill);
  transition: background .15s ease;
}

.topic-link:hover,
.topic.is-open > .topic-link,
.topic-more-button:hover { color: var(--ink); }

.topic-link:hover::before,
.topic.is-open > .topic-link::before,
.topic-more-button:hover::before { background: var(--surface-hover); }

.topic-link[aria-current="page"] { color: var(--lime); }
.topic-link[aria-current="page"]::before { background: var(--lime-tint); }

/* The list scrolls horizontally and clips anything drawn outside it, so the ring sits inside the link. */
.topic-link:focus-visible,
.topic-more-button:focus-visible {
  outline-offset: -4px;
  box-shadow: none;
}

.topic-more-panel {
  position: absolute;
  z-index: var(--z-mega);
  top: calc(100% + 8px);
  right: max(var(--gutter), calc((100% - var(--content-max)) / 2 + var(--gutter)));
  display: none;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
}

.topic-more.is-open .topic-more-panel { display: block; }

.topic-more-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
}

.topic-more-panel a:hover { background: var(--surface-hover); }
.topic-more-panel a[aria-current="page"] { color: var(--lime); }

.mega {
  position: absolute;
  z-index: var(--z-mega);
  top: calc(100% + 8px);
  right: max(var(--gutter), calc((100% - var(--content-max)) / 2 + var(--gutter)));
  left: max(var(--gutter), calc((100% - var(--content-max)) / 2 + var(--gutter)));
  display: none;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.4fr);
  gap: 32px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
}

/* Bridges the gap under the bar, so the pointer keeps the panel while moving into it. */
.mega::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 9px;
}

@media (min-width: 1024px) {
  .topics {
    position: sticky;
    top: var(--masthead-height);
    z-index: var(--z-topics);
  }

  html:not(.js) .topic:focus-within > .mega { display: grid; }

  .topic.is-open > .mega {
    display: grid;
    animation: panel-in .12s ease-out;
  }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  html:not(.js) .topic:hover > .mega { display: grid; }
}

@media (max-width: 1023px) {
  .topics::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(270deg, var(--canvas), transparent);
    pointer-events: none;
  }

  .topic-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x proximity;
  }

  .topic { scroll-snap-align: start; }

  .mega { display: none !important; }
}

.mega-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.mega-text {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: .92rem;
}

.mega-all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--lime-tint);
  color: var(--lime);
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.mega-all:hover {
  background: var(--lime);
  color: var(--on-accent);
}

.mega-kinds a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.mega-kinds a:hover { color: var(--lime); }

.mega-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mega-recent-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.mini-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.mini-card:hover .mini-title { color: var(--lime); }

.mini-media {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.mini-media .cover {
  width: 56px;
  height: 56px;
}

.mini-title {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.25;
}

/* Drawer: a normal block at the end of the page without JS; an off-canvas dialog with JS. */
.drawer {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
}

.drawer-head { display: none; }

.drawer-label {
  margin: 16px 0 4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.drawer-sections > li > a,
.drawer-sections summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.drawer-sections summary { list-style: none; }
.drawer-sections summary::-webkit-details-marker { display: none; }

.drawer-sections summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.drawer-sections details[open] > summary { color: var(--lime); }

.drawer-sections details[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.drawer-sections details a,
.drawer-topics a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px 0 28px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
}

.drawer-topics a { padding-left: 12px; }

.drawer-nav a:hover,
.drawer-nav summary:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.drawer a[aria-current="page"] { color: var(--lime); }
.drawer-search { margin-top: 20px; }
.drawer-search label { color: var(--muted); }

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
}

.drawer-close:hover { background: var(--surface-hover); }

.drawer-close[hidden],
.scrim[hidden] { display: none; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: var(--scrim);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.js .drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(320px, 85vw);
  max-width: none;
  margin: 0;
  padding: 12px 16px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 0;
  border-right: 1px solid var(--line);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}

.js .drawer.is-open {
  transform: none;
  visibility: visible;
  transition: transform .2s ease;
}

.js .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
}

html.drawer-open { overflow: hidden; }

/* Footer */
.site-footer {
  display: grid;
  gap: 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
}

@media (min-width: 768px) {
  .site-footer { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
}

.footer-brand p { margin-top: 8px; }

.footer-label {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

.site-footer nav a:hover,
.site-footer a[aria-current="page"] { color: var(--lime); }
/* Components: covers, cards, highlight grid, modules, forms, sources, reading tools, breadcrumb, pager. */
.cover {
  width: 100%;
  height: auto;
}

.cover-wide { aspect-ratio: 16 / 9; }
.cover-square { aspect-ratio: 1; }
.cover-bg { fill: var(--surface); }

.cover-rings circle {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: .07;
  stroke-width: 1;
}

/* Neutral sweep: the lime stays in the small mark, so large covers do not tint the page green. */
.cover-sweep {
  fill: var(--ink);
  opacity: .06;
}

/* The 8px mark becomes a round blip, echoing the logo. */
.cover-mark {
  fill: var(--lime);
  rx: 4px;
}

.cover-kicker {
  fill: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .12em;
}

.cover-label {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

/* Cards: the title link stretches over the whole card; secondary links sit above it. */
.card {
  position: relative;
  display: grid;
  gap: 12px;
  align-content: start;
}

.card-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease;
}

.card-media .cover { transition: transform .45s ease; }
.card:hover .card-media { border-color: var(--line-strong); }
.card:hover .card-media .cover { transform: scale(1.025); }
.card-lead .card-media { border-radius: var(--radius-lg); }

.card-body {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  max-width: none;
  color: var(--muted);
  font-size: .78rem;
}

.kicker-topic {
  color: var(--ink-soft);
  font-weight: 600;
}

a.kicker-topic {
  position: relative;
  z-index: 1;
  text-decoration: none;
}

a.kicker-topic:hover { color: var(--lime); }

.card-title {
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.card-title a {
  color: var(--ink);
  text-decoration: none;
}

.card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card-title a:hover { color: var(--lime); }

.card-dek {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  max-width: none;
  color: var(--muted);
  font-size: .78rem;
}

.card-cta,
.card-link {
  position: relative;
  z-index: 1;
  justify-self: start;
}

.card-cta { margin-top: 8px; }

.card-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .84rem;
  font-weight: 760;
}

.card-lead .card-title {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.1;
}

.card-lead .card-dek {
  font-size: 1.02rem;
  -webkit-line-clamp: 4;
}

.card-feature .card-title { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.card-feature .card-dek { -webkit-line-clamp: 3; }

.card-compact,
.card-row {
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.card-compact .card-title { font-size: 1rem; }
.card-compact .card-body { gap: 6px; }

.card-row {
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.card-row .card-title { font-size: 1.25rem; }

@media (max-width: 559px) {
  .card-row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
  }

  .card-row .card-title { font-size: 1.08rem; }
}

/* Highlight grid (Yahoo "Today in tech"): lead, two secondary stories, then the side column. */
.hero {
  display: grid;
  gap: 24px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.hero-secondary {
  display: grid;
  gap: 24px;
  align-content: start;
}

.hero-side { min-width: 0; }

@media (min-width: 768px) {
  .hero-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }

  .hero-lead {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-side {
    grid-column: 2;
    grid-row: 1;
  }

  .hero-secondary {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (min-width: 1280px) {
  .hero { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); }

  .hero-secondary {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-side {
    grid-column: 3;
    grid-row: 1;
  }

  .hero-n1 .hero-lead { grid-column: 1 / span 2; }
}

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

@media (min-width: 1024px) {
  .hero-listing { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }

  .hero-listing .hero-secondary {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
  }
}

.list-title {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

.list-stack {
  display: grid;
  gap: 16px;
}

/* "Veio de um post?" sits on a raised panel, like the source panel. */
.utility {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}

.utility > * { min-width: 0; }

.utility h2 {
  color: var(--ink);
  font-size: 1.5rem;
}

.utility > p {
  color: var(--ink-soft);
  font-size: .95rem;
}

.utility-card .input-row { flex-direction: column; }

.utility-band { margin-top: 32px; }

@media (min-width: 768px) {
  .utility-band {
    grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr);
    column-gap: 32px;
    align-items: center;
  }

  .utility-band .keyword-form {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: .78rem;
  font-weight: 760;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color .15s ease;
}

.input-row input[type="search"]::placeholder { color: var(--muted); }
.input-row input[type="search"]:hover { border-color: var(--muted); }

.input-row button {
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid var(--lime);
  border-radius: var(--radius-sm);
  background: var(--lime);
  color: var(--on-accent);
  font-size: .84rem;
  font-weight: 760;
  transition: background .15s ease;
}

.input-row button:hover { background: var(--lime-hover); }

@media (max-width: 559px) {
  .input-row { flex-direction: column; }
  .input-row button { width: 100%; }
}

.search-status:empty { display: none; }
.search-status p { margin-top: 12px; }

.search-status a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--lime);
  font-weight: 800;
}

.direct-link {
  margin-top: 10px;
  color: var(--muted);
  font-size: .83rem;
}

.direct-link a { color: var(--lime); }

/* Source panel: raised panel, always before the article body. */
.sources {
  margin: 0 0 28px;
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}

.sources h2 {
  margin-bottom: 14px;
  color: var(--mint);
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sources ul {
  display: grid;
  gap: 10px;
}

@media (min-width: 768px) {
  .sources ul { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

.sources li a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color .15s ease, background .15s ease;
}

.sources li a:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.sources small {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.source-open {
  margin-top: auto;
  color: var(--lime);
  font-size: .78rem;
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: .18em;
}

/* Reading tools appear only with JS. */
.reading-tools {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.js .reading-tools { display: flex; }

.reading-tools span {
  margin-right: 4px;
  color: var(--muted);
  font-size: .75rem;
}

.reading-tools button {
  min-width: 44px;
  min-height: 44px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.reading-tools button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.reading-tools button[aria-pressed="true"] {
  border-color: transparent;
  background: var(--lime-tint);
  color: var(--lime);
}

.reading-progress {
  display: none;
  height: 4px;
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--line);
}

.js .reading-progress { display: block; }

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--lime);
}

.prose {
  max-width: var(--measure);
  color: var(--ink-prose);
  font-size: var(--reading-size);
  line-height: 1.85;
}

.prose h2 {
  margin: 34px 0 10px;
  font-size: 1.35em;
  letter-spacing: -.025em;
}

.prose p { margin: 0 0 19px; }

.reading-note {
  max-width: var(--measure);
  margin: 32px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--mint);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: .86rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Breadcrumb */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  color: var(--muted);
  font-size: .8rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--muted);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumb a[aria-current="page"] {
  display: inline-block;
  max-width: 36ch;
  overflow: hidden;
  color: var(--ink-soft);
  line-height: 44px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modules */
.module {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 20px;
}

.section-head h2 { font-size: 1.6rem; }

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: .84rem;
  font-weight: 750;
  white-space: nowrap;
}

.row-scroller {
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.row-list {
  display: grid;
  grid-auto-columns: minmax(240px, 80%);
  grid-auto-flow: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .row-list { grid-auto-columns: calc((100% - 40px) / 3); }
}

@media (min-width: 1280px) {
  .row-list { grid-auto-columns: calc((100% - 60px) / 4); }
}

.row-list > li { scroll-snap-align: start; }

.row-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.row-controls[hidden] { display: none; }

.row-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}

.row-controls button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.row-controls button:disabled {
  cursor: default;
  opacity: .4;
}

.feature-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}

.feature-list {
  display: grid;
  gap: 16px;
  align-content: start;
}

.grid-list {
  display: grid;
  gap: 18px 32px;
}

@media (min-width: 768px) {
  .grid-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.module-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  max-width: none;
  margin-top: 16px;
}

/* Listings */
.row-stack { display: grid; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
}

.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.pager a:hover {
  border-color: var(--ink-soft);
  background: var(--surface-hover);
}

.pager-status {
  color: var(--muted);
  font-size: .84rem;
}

.empty-state {
  margin: 24px 0;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.listing-note {
  margin-top: 24px;
  color: var(--muted);
  font-size: .86rem;
}
/* Page layouts: page heads, article, documents, search, link-in-bio, disabled form. */
.page-head {
  display: grid;
  gap: 8px;
  padding: 8px 0 24px;
}

.page-head h1 { font-size: clamp(2rem, 3.2vw, 2.6rem); }

.page-dek {
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.article-head {
  display: grid;
  gap: 12px;
  padding: 0 0 24px;
}

.article-head h1 {
  max-width: 22ch;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -.03em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.55;
}

.article-meta {
  color: var(--muted);
  font-size: .82rem;
}

.article-layout {
  display: grid;
  gap: 40px;
}

.article-main { min-width: 0; }

.article-aside {
  display: grid;
  gap: 20px;
  align-content: start;
}

@media (min-width: 1280px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
  }

  .article-aside {
    position: sticky;
    top: calc(var(--masthead-height) + var(--topics-height) + 24px);
  }
}

.aside-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.aside-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.aside-card ul {
  display: grid;
  gap: 14px;
}

.keyword-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-token {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--lime-tint);
  color: var(--lime);
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.aside-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: .86rem;
}

.module-continue { border-bottom: 0; }

.continue-list {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .continue-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .continue-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.document { max-width: 760px; }
.document .article-head h1 { max-width: 18ch; }

.legal-notice {
  max-width: max-content;
  margin-bottom: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--lime);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 700;
}

.bio {
  max-width: 760px;
  padding: 16px 0 48px;
}

.bio h1 {
  max-width: 14ch;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.02;
}

.bio h1 em,
.lookup-head h1 em {
  color: var(--lime);
  font-style: normal;
}

.bio .lead,
.bio > p { margin-top: 14px; }

.bio-buttons {
  display: grid;
  gap: 12px;
  max-width: 540px;
  margin-top: 28px;
}

@media (min-width: 560px) {
  .bio-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.bio-buttons .button {
  justify-content: space-between;
  min-height: 56px;
}

.disabled-form {
  max-width: 560px;
  margin-top: 24px;
}

.disabled-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.disabled-form fieldset {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.disabled-form fieldset label {
  display: inline;
  margin: 0 20px 0 6px;
}

.disabled-form button {
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--ink);
}

.disabled-form :disabled {
  cursor: not-allowed;
  opacity: .65;
}

.disabled-form p {
  margin-top: 12px;
  color: var(--muted);
  font-size: .88rem;
}

.lookup-head h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1;
}

.search-panel {
  display: grid;
  gap: 16px;
  margin: 8px 0 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}

.search-panel h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.search-panel p { color: var(--ink-soft); }

.search-results {
  display: grid;
  gap: 10px;
}

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

.search-results h3 {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.search-results ol {
  display: grid;
  gap: 6px;
}

.search-results a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--lime);
  font-weight: 700;
}

.status-note {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: .84rem;
}

.keyword-index-section,
.all-content,
.topic-group { padding: 24px 0; }

.keyword-index-section h2,
.all-content h2,
.topic-group h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.keyword-index li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.keyword-index a {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.keyword-index a:hover { color: var(--lime); }
