/* Primer News — portal público. Visual editorial: fundo claro, tipografia serifada nos títulos. */
:root {
  --accent: #b3141f;
  --accent-dark: #8c0f18;
  --ink: #161616;
  --muted: #5b6168;
  --line: #dedbd5;
  --soft: #f5f3ef;
  --bg: #ffffff;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Cabeçalho */
.topbar { border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.topbar .container { display: flex; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; }
.topbar .tagline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; padding-bottom: 16px; }
.brand { text-decoration: none; font-family: var(--serif); font-size: 40px; line-height: 1; letter-spacing: -0.02em; font-weight: 700; }
.brand-a { color: var(--ink); }
.brand-b { color: var(--accent); margin-left: 6px; font-style: italic; }
.search { display: flex; max-width: 360px; width: 100%; }
.search input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #b9b5ad; border-right: 0; border-radius: 2px 0 0 2px; font: inherit; font-size: 15px; background: #fff; }
.search button { padding: 9px 16px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 600 14px var(--sans); border-radius: 0 2px 2px 0; cursor: pointer; }
.search button:hover { background: var(--accent-dark); }
.main-nav { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); background: #fff; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav a { display: block; padding: 11px 14px; text-decoration: none; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.main { padding-top: 28px; padding-bottom: 56px; min-height: 55vh; }

/* Seções e tipografia */
.section-title { font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin: 0 0 14px; padding-top: 10px; border-top: 3px solid var(--accent); }
.section-title a { text-decoration: none; }
.kicker { display: inline-block; font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); text-decoration: none; margin-bottom: 4px; }
.kicker:hover { text-decoration: underline; }
.meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.byline { font-weight: 600; }

/* Cartões */
.card { display: block; }
.card-media { display: block; background: var(--soft); aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: 10px; }
.card-media img, .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { display: grid; place-items: center; background: var(--soft); color: #b9b5ad; font: italic 700 22px var(--serif); }
.card-title { font-family: var(--serif); font-weight: 700; line-height: 1.18; margin: 2px 0 4px; font-size: 20px; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-summary { margin: 6px 0 0; color: #33373b; font-size: 15px; }
.card-hero .card-title { font-size: 38px; line-height: 1.1; letter-spacing: -0.01em; }
.card-hero .card-summary { font-size: 18px; }
.card-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.card-row:first-of-type { border-top: 0; padding-top: 0; }
.card-row .card-media { margin: 0; aspect-ratio: 4 / 3; }
.card-row .card-title { font-size: 17px; }
.card-row .card-summary { display: none; }
.card-compact { padding: 10px 0; border-top: 1px solid var(--line); }
.card-compact .card-title { font-size: 17px; font-family: var(--serif); }

/* Grades */
.front { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.front:not(:has(.front-side)) { grid-template-columns: 1fr; }
.front-side { padding-left: 24px; border-left: 1px solid var(--line); }
.grid { display: grid; gap: 28px 24px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.latest, .related { margin-bottom: 36px; }
.category-blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 28px; border-top: 1px solid var(--line); padding-top: 28px; }
.cat-block .card-media { margin-bottom: 8px; }
.more { display: inline-block; margin-top: 8px; font-weight: 700; font-size: 14px; color: var(--accent); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* Página/listagem */
.page-head { border-bottom: 3px solid var(--ink); margin-bottom: 24px; padding-bottom: 12px; }
.page-head h1 { font: 700 34px/1.15 var(--serif); margin: 0; }
.lead { margin: 6px 0 0; color: var(--muted); }
.pagination ul { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination a, .pagination span { display: inline-block; min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; }
.pagination a:hover { border-color: var(--accent); }
.pagination .pg-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .pg-gap { border-color: transparent; }

.empty-state, .error-page { text-align: center; max-width: 560px; margin: 60px auto; padding: 36px 20px; border: 1px dashed #b9b5ad; background: var(--soft); }
.empty-state h2, .error-page h1 { font-family: var(--serif); margin: 0 0 8px; }
.error-code { font: 700 64px/1 var(--serif); color: var(--accent); margin: 0 0 8px; }
.btn { display: inline-block; padding: 10px 18px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; border-radius: 2px; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.pending-notice { background: #fff6d6; border-left: 4px solid #d6a400; padding: 10px 14px; font-size: 14px; }

/* Matéria */
.article { max-width: 760px; margin: 0 auto 40px; }
.article-head h1 { font: 700 42px/1.1 var(--serif); letter-spacing: -0.015em; margin: 4px 0 10px; }
.subtitle { font: 400 21px/1.35 var(--serif); color: #3b3f44; margin: 0 0 14px; }
.article-meta { padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-cover { margin: 22px -0px; }
.article-cover img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.article-cover figcaption { font-size: 13px; color: var(--muted); padding-top: 6px; }
.prose { font: 400 19px/1.7 var(--serif); }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--serif); line-height: 1.25; margin: 1.6em 0 .5em; }
.prose h2 { font-size: 28px; } .prose h3 { font-size: 23px; } .prose h4 { font-size: 20px; }
.prose a { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: #33373b; font-style: italic; }
.prose img { margin: 1.2em auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.static-page { max-width: 760px; margin: 0 auto; }
.contact-list { padding-left: 1.2em; }
.article-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.share span { font-weight: 700; margin-right: 4px; }
.share a { padding: 6px 12px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.share a:hover { border-color: var(--accent); }
.author-bio { font-size: 14px; color: var(--muted); }

/* Rodapé */
.site-footer { background: #111; color: #cfcfcf; padding: 36px 0 0; font-size: 14px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h2 { font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .1em; color: #fff; margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-brand { font: 700 28px var(--serif); margin: 0 0 8px; }
.footer-brand .brand-a { color: #fff; }
.footer-bottom { border-top: 1px solid #2c2c2c; margin-top: 28px; padding-top: 14px; padding-bottom: 20px; color: #9a9a9a; }

/* Responsivo */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .front { grid-template-columns: 1fr; }
  .front-side { padding-left: 0; border-left: 0; }
  .card-row .card-summary { display: block; }
}
@media (max-width: 640px) {
  .topbar .tagline { display: none; }
  .masthead { flex-direction: column; align-items: stretch; gap: 12px; }
  .brand { font-size: 34px; text-align: center; }
  .search { max-width: none; }
  .main { padding-top: 18px; }
  .grid-4, .grid-3, .category-blocks, .footer-grid { grid-template-columns: 1fr; }
  .card-hero .card-title { font-size: 28px; }
  .card-hero .card-summary { font-size: 16px; }
  .article-head h1 { font-size: 30px; }
  .subtitle { font-size: 18px; }
  .prose { font-size: 18px; }
  .page-head h1 { font-size: 27px; }
  .card-row { grid-template-columns: 96px 1fr; }
}
@media (prefers-reduced-motion: no-preference) { a, .btn { transition: color .15s; } }
@media print { .site-header, .site-footer, .share, .related { display: none; } }

/* Publicidade */
.ad { margin: 22px auto; text-align: center; max-width: 100%; }
.ad-label { display: block; font: 600 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #8a8f95; margin-bottom: 4px; }
.ad img { display: inline-block; max-width: 100%; height: auto; }
.ad-topo { margin: 14px auto 0; }
.ad-lateral { margin: 22px 0; }
.ad-lateral img { width: 300px; }
.front-side .ad-lateral { text-align: center; }

/* Modo manutenção */
.maint-bar { background: #fff6d6; border-bottom: 1px solid #ecd48a; color: #6b4e00; text-align: center; font-size: 13px; padding: 6px 12px; }
.maintenance-page { background: #fff; }
.maintenance { max-width: 520px; margin: 14vh auto 0; padding: 0 20px; text-align: center; }
.maintenance .brand { font-size: 44px; margin: 0 0 18px; display: block; }
.maintenance h1 { font: 700 26px var(--serif); margin: 0 0 10px; }
.maintenance p { color: var(--muted); }
