/*
Theme Name: Pauta
Theme URI: https://example.com/pauta
Author: Pauta Studio
Author URI: https://example.com
Description: Tema editorial para portais de notícias. Tipografia forte, modo claro e escuro, cabeçalho mobile com menu à esquerda, logo centralizada e busca à direita.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pauta
Tags: news, blog, two-columns, custom-logo, custom-menu, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Tokens — claro e escuro
   ========================================================================== */
:root {
  --paper: #FAF8F4;
  --surface: #FFFFFF;
  --ink: #16181D;
  --ink-soft: #4B5563;
  --caption: #6B7280;
  --rule: #E5E1D8;
  --accent: #D7263D;
  --accent-ink: #FFFFFF;
  --kicker: #B01E32;
  --shadow: 0 1px 2px rgba(22, 24, 29, .06), 0 8px 24px rgba(22, 24, 29, .07);
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --radius: 10px;
  --header-h: 64px;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #121419;
  --surface: #1A1D24;
  --ink: #ECEAE4;
  --ink-soft: #B7BCC6;
  --caption: #8B919D;
  --rule: #2A2E37;
  --accent: #FF4D5E;
  --accent-ink: #16181D;
  --kicker: #FF6B79;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background-color .25s ease, color .25s ease;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   3. Barra de últimas (ticker)
   ========================================================================== */
.ticker {
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  overflow: hidden;
}
[data-theme="dark"] .ticker { background: #000; color: #ECEAE4; }
.ticker__inner { display: flex; align-items: center; gap: 14px; height: 36px; }
.ticker__label {
  flex: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 3px;
}
.ticker__track { overflow: hidden; white-space: nowrap; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker__list { display: inline-block; animation: ticker 40s linear infinite; padding-left: 100%; }
.ticker__list a { text-decoration: none; opacity: .9; margin-right: 48px; }
.ticker__list a:hover { opacity: 1; text-decoration: underline; }
@keyframes ticker { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__list { animation: none; padding-left: 0; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   4. Cabeçalho
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.header-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  gap: 12px;
}
.header-left  { display: flex; justify-content: flex-start; align-items: center; gap: 6px; }
.header-right { display: flex; justify-content: flex-end;  align-items: center; gap: 6px; }

.brand { display: flex; align-items: center; justify-content: center; text-decoration: none; min-width: 0; }
.brand img.custom-logo { max-height: 38px; width: auto; }
.brand__text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.brand__text::after { content: "."; color: var(--accent); }

.icon-btn {
  appearance: none;
  background: none;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: background-color .15s ease;
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Alternância claro/escuro: mostra o ícone do modo oposto */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

/* Navegação desktop (faixa abaixo da barra) */
.desktop-nav { border-top: 1px solid var(--rule); display: block; }
.desktop-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.desktop-nav a {
  display: block;
  padding: 11px 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.desktop-nav a:hover,
.desktop-nav .current-menu-item > a,
.desktop-nav .current_page_item > a { color: var(--ink); border-bottom-color: var(--accent); }
.desktop-nav .sub-menu { display: none; } /* simplicidade: subitens aparecem no menu mobile */

/* ==========================================================================
   5. Menu mobile (off-canvas) e busca
   ========================================================================== */
.mobile-only { display: none; }

.offcanvas {
  position: fixed;
  inset: 0;
  z-index: 90;
  visibility: hidden;
  pointer-events: none;
}
.offcanvas.is-open { visibility: visible; pointer-events: auto; }
.offcanvas__backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 11, 14, .5);
  opacity: 0;
  transition: opacity .25s ease;
}
.offcanvas.is-open .offcanvas__backdrop { opacity: 1; }
.offcanvas__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(320px, 85vw);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.offcanvas.is-open .offcanvas__panel { transform: translateX(0); }
.offcanvas__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.offcanvas__title { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; color: var(--caption); }
.offcanvas nav ul { list-style: none; margin: 0; padding: 8px 0; }
.offcanvas nav a {
  display: block;
  padding: 13px 22px;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  border-left: 3px solid transparent;
}
.offcanvas nav a:hover { border-left-color: var(--accent); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.offcanvas nav .sub-menu a { font-weight: 500; font-size: 15px; padding-left: 38px; color: var(--ink-soft); }
.offcanvas__foot { margin-top: auto; padding: 16px 22px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--caption); }

/* Busca em overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 18vh 20px 0;
}
.search-overlay.is-open { display: flex; }
.search-overlay__box { width: min(640px, 100%); }
.search-overlay__close { position: absolute; top: 18px; right: 18px; }
.search-form { display: flex; gap: 0; border-bottom: 3px solid var(--accent); }
.search-form input[type="search"] {
  flex: 1;
  background: none; border: 0; outline: none;
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 700;
  color: var(--ink);
  padding: 10px 4px;
}
.search-form input::placeholder { color: var(--caption); }
.search-form button { background: none; border: 0; cursor: pointer; color: var(--accent); }
.search-form button svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.search-overlay__hint { margin-top: 14px; font-size: 13px; color: var(--caption); }

/* ==========================================================================
   6. Home — manchete e grade
   ========================================================================== */
.section-label {
  display: flex; align-items: center; gap: 12px;
  margin: 40px 0 22px;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 14px;
}
.section-label::before { content: ""; width: 10px; height: 10px; background: var(--accent); }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  padding-top: 28px;
}
.hero-card { position: relative; }
.hero-card a { text-decoration: none; }
.hero-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--rule);
}
.hero-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.hero-card a:hover .hero-card__media img { transform: scale(1.03); }
.kicker {
  display: inline-block;
  margin: 14px 0 8px;
  color: var(--kicker);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.06;
  font-size: clamp(28px, 4.2vw, 48px);
}
.hero-card a:hover .hero-card__title { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.hero-card__excerpt { color: var(--ink-soft); margin: 12px 0 0; font-size: 17px; max-width: 60ch; }

.hero-side { display: flex; flex-direction: column; gap: 22px; }
.hero-side .hero-card__title { font-size: clamp(18px, 2vw, 23px); line-height: 1.18; }
.hero-side .hero-card__media { aspect-ratio: 16 / 10; }

/* Grade de cards */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
  padding-bottom: 56px;
}
.card { display: flex; flex-direction: column; }
.card a { text-decoration: none; }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: var(--rule); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card a:hover .card__media img { transform: scale(1.04); }
.card__title {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  font-size: 19px;
}
.card a:hover .card__title { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.card__meta { margin-top: 8px; font-size: 13px; color: var(--caption); }

/* Paginação */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 8px 0 56px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700; font-size: 14px;
}
.pagination .page-numbers.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pagination a.page-numbers:hover { border-color: var(--ink); }

/* ==========================================================================
   7. Matéria (single) e páginas
   ========================================================================== */
.article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding: 36px 0 56px; }
.article-header { padding-top: 36px; }
.article-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.08;
  font-size: clamp(30px, 5vw, 52px);
  max-width: 22ch;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--caption); font-size: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.article-meta strong { color: var(--ink); font-weight: 700; }
.article-thumb { margin: 28px 0 0; }
.article-thumb img { border-radius: var(--radius); width: 100%; }
.article-thumb figcaption { font-size: 13px; color: var(--caption); margin-top: 8px; }

.entry-content {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.75;
  max-width: 70ch;
}
.entry-content > * + * { margin-top: 1.2em; }
.entry-content h2, .entry-content h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.2; margin-top: 1.8em; }
.entry-content a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.1em;
}
.entry-content img { border-radius: var(--radius); }
.entry-content .wp-caption { max-width: 100%; }
.entry-content .wp-caption-text { font-size: 13px; color: var(--caption); font-family: var(--font-body); }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.article-tags a {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 14px;
}
.article-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* Sidebar */
.sidebar { font-size: 15px; }
.widget { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 22px; }
.widget__title, .widget-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--caption);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.widget li:last-child { border-bottom: 0; }
.widget a { text-decoration: none; font-weight: 600; }
.widget a:hover { color: var(--accent); }

/* Comentários */
.comments-area { max-width: 70ch; padding: 36px 0 56px; }
.comments-area .comment-list { list-style: none; padding: 0; }
.comments-area .comment { border-top: 1px solid var(--rule); padding: 18px 0; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
}
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.comment-form .submit, .button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0; cursor: pointer;
  font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
  padding: 13px 26px;
  border-radius: 8px;
}
.comment-form .submit:hover, .button:hover { filter: brightness(1.08); }

/* Cabeçalho de arquivo / busca / 404 */
.archive-header { padding: 40px 0 6px; }
.archive-header .kicker { margin-top: 0; }
.archive-title { margin: 0; font-family: var(--font-display); font-weight: 900; letter-spacing: -0.025em; font-size: clamp(28px, 4.5vw, 44px); }
.archive-description { color: var(--ink-soft); max-width: 65ch; }
.no-results { padding: 60px 0 90px; text-align: center; }
.no-results h2 { font-family: var(--font-display); font-weight: 900; font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.02em; }
.error-code { font-family: var(--font-display); font-weight: 900; font-size: clamp(90px, 18vw, 180px); line-height: 1; color: var(--accent); letter-spacing: -0.04em; }

/* ==========================================================================
   8. Rodapé
   ========================================================================== */
.site-footer { background: var(--ink); color: var(--paper); margin-top: auto; }
[data-theme="dark"] .site-footer { background: #0B0C10; border-top: 1px solid var(--rule); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding: 48px 0 36px; }
.footer-brand { font-family: var(--font-display); font-weight: 900; font-size: 26px; text-transform: uppercase; letter-spacing: -0.02em; }
.footer-brand::after { content: "."; color: var(--accent); }
.footer-grid p { color: color-mix(in srgb, var(--paper) 65%, transparent); font-size: 14px; max-width: 38ch; }
.site-footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: color-mix(in srgb, var(--paper) 55%, transparent); margin: 4px 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 5px 0; }
.site-footer a { color: var(--paper); text-decoration: none; font-size: 14.5px; opacity: .85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
  padding: 18px 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px;
  color: color-mix(in srgb, var(--paper) 55%, transparent);
}

/* ==========================================================================
   9. Responsivo
   ========================================================================== */
@media (max-width: 980px) {
  .article-wrap { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 58px; }

  /* Cabeçalho mobile: menu à esquerda — logo no centro — busca à direita */
  .desktop-nav { display: none; }
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex; }

  .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 20px; }
  .hero-side { gap: 20px; }
  .post-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding: 36px 0 28px; }
  .entry-content { font-size: 17.5px; }
  .ticker__inner { height: 34px; }
}

@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}
