/*
Theme Name: AlexNews
Theme URI: https://www.alexnews.com.br
Author: Alexander Moraes
Author URI: https://www.allexxmoraes.com.br
Description: Tema jornalístico do AlexNews. Foco em qualidade de leitura, busca impecável e segmentação híbrida (editorias temáticas + geografia Estado/Cidade/Bairro de alcance nacional). Identidade sóbrio premium: muito branco, azul assinatura e tinta. Mobile-first. Construído do zero, standalone — estrutura visual inspirada em padrões de portais magazine, sem herança de código de terceiros.
Version: 1.0.0
Requires at least: 5.4
Tested up to: 7.0
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: alexnews
Tags: news, blog, magazine, custom-logo, custom-menu, featured-images, translation-ready, right-sidebar, footer-widgets, grid-layout, sticky-post
*/

/* ============================================================
   DESIGN TOKENS — AlexNews
   Identidade sóbrio premium: branco amplo, azul pontual, tinta.
   ============================================================ */
:root {
  /* Cores */
  --an-azul: #0B5FFF;          /* azul assinatura — links, CTAs, tags, o X */
  --an-azul-escuro: #0847C4;   /* hover */
  --an-azul-suave: #E8F0FF;    /* fundos de destaque leves */
  --an-tinta: #111827;         /* texto principal (nunca preto puro) */
  --an-tinta-media: #374151;   /* texto secundário */
  --an-cinza: #6B7280;         /* legendas, metadados */
  --an-papel: #FFFFFF;         /* fundo principal */
  --an-nuvem: #F5F7FA;         /* fundo de apoio, seções alternadas */
  --an-hairline: #E5E7EB;      /* bordas sutis */
  --an-urgente: #E8151B;       /* SÓ para AO VIVO / URGENTE (semântico) */

  /* Tipografia */
  --an-display: 'Libre Franklin', system-ui, -apple-system, sans-serif;
  --an-corpo: 'Inter', system-ui, -apple-system, sans-serif;

  /* Escala e ritmo */
  --an-max: 1180px;            /* largura máxima de conteúdo */
  --an-gap: 24px;
  --an-radius: 10px;
  --an-radius-sm: 6px;
  --an-shadow: 0 1px 3px rgba(17,24,39,.06);
  --an-shadow-hover: 0 6px 20px rgba(17,24,39,.10);

  /* Leitura (o que Alexander mais preza) */
  --an-leitura: 1.75;          /* line-height generoso no corpo */
  --an-artigo-max: 800px;      /* largura de leitura (equilibrada: mais texto, ainda confortável) */
}

/* ============================================================
   RESET LEVE
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--an-corpo);
  font-size: 17px;
  line-height: var(--an-leitura);
  color: var(--an-tinta);
  background: var(--an-papel);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--an-azul); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--an-azul-escuro); }
ul { list-style: none; }

/* Foco visível (acessibilidade — quality floor) */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--an-azul);
  outline-offset: 2px;
}

/* Respeita reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--an-display);
  color: var(--an-tinta);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: clamp(18px, 2vw, 21px); }
p { margin-bottom: 1.2em; }

.an-container { max-width: var(--an-max); margin: 0 auto; padding: 0 20px; }

/* Skip link */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 100000; background: var(--an-azul); color: #fff; padding: 10px 16px; border-radius: var(--an-radius-sm); }

/* ============================================================
   TOPBAR (data · sociais · botão Guia SN)
   ============================================================ */
.an-topbar {
  background: var(--an-tinta);
  color: #cbd5e1;
  font-size: 13px;
  font-family: var(--an-corpo);
}
.an-topbar .an-container { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.an-topbar__data { display: flex; align-items: center; gap: 8px; }
.an-topbar__right { display: flex; align-items: center; gap: 16px; }
.an-topbar__social { display: flex; gap: 10px; }
.an-topbar__social a { color: #94a3b8; font-size: 14px; }
.an-topbar__social a:hover { color: #fff; }
.an-guia-btn {
  background: var(--an-azul); color: #fff; padding: 5px 14px;
  border-radius: var(--an-radius-sm); font-weight: 600; font-size: 12px;
  letter-spacing: .3px;
}
.an-guia-btn:hover { background: var(--an-azul-escuro); color: #fff; }

/* ============================================================
   HEADER PRINCIPAL — logo CENTRALIZADO (Alexander gosta assim)
   Estrutura: [hambúrguer esq] --- [logo centro] --- [busca dir]
   ============================================================ */
.an-header {
  background: var(--an-papel);
  border-bottom: 1px solid var(--an-hairline);
  position: sticky; top: 0; z-index: 900;
}
.an-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 88px;
  gap: 16px;
}
.an-header__left { justify-self: start; }
.an-header__center { justify-self: center; }
.an-header__right { justify-self: end; display: flex; align-items: center; gap: 12px; }

/* Logo */
.an-logo img { max-height: 52px; width: auto; }
.an-logo__text {
  font-family: var(--an-display); font-weight: 800; font-size: 30px;
  color: var(--an-tinta); letter-spacing: -0.02em;
}
.an-logo__text .x { color: var(--an-azul); }

/* Botão hambúrguer (abre painel lateral) */
.an-burger {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  font-family: var(--an-corpo); font-size: 14px; font-weight: 600;
  color: var(--an-tinta); padding: 8px;
}
.an-burger__lines { display: inline-flex; flex-direction: column; gap: 4px; }
.an-burger__lines span { width: 22px; height: 2px; background: var(--an-tinta); border-radius: 2px; transition: .2s; }
.an-burger:hover .an-burger__lines span { background: var(--an-azul); }

/* Botão de busca no header */
.an-search-toggle {
  background: none; border: 1px solid var(--an-hairline); cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--an-tinta); font-size: 16px; transition: .2s;
}
.an-search-toggle:hover { border-color: var(--an-azul); color: var(--an-azul); }

/* ============================================================
   NAV PRINCIPAL (editorias) — abaixo do header
   ============================================================ */
.an-nav {
  background: var(--an-papel);
  border-bottom: 2px solid var(--an-tinta);
}
.an-nav__inner { display: flex; align-items: center; justify-content: center; }
.an-nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
.an-nav li a {
  display: block; padding: 14px 16px;
  font-family: var(--an-display); font-weight: 600; font-size: 15px;
  color: var(--an-tinta); text-transform: uppercase; letter-spacing: .3px;
  border-bottom: 3px solid transparent;
}
.an-nav li a:hover, .an-nav li.current-menu-item a {
  color: var(--an-azul); border-bottom-color: var(--an-azul);
}
.an-nav .sub-menu {
  display: none; position: absolute; background: #fff; min-width: 200px;
  box-shadow: var(--an-shadow-hover); border-radius: var(--an-radius-sm);
  padding: 8px 0; z-index: 950; flex-direction: column;
}
.an-nav li { position: relative; }
.an-nav li:hover > .sub-menu { display: flex; }
.an-nav .sub-menu li a { padding: 8px 16px; border: none; text-transform: none; }

/* ============================================================
   PAINEL LATERAL (off-canvas) — hambúrguer
   Conteúdo: Rádio Web · Editorias destacadas · Recentes · Busca
   (substitui o "gigantismo de redes sociais" da referência)
   ============================================================ */
.an-panel-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.5);
  opacity: 0; visibility: hidden; transition: .25s; z-index: 998;
}
body.an-panel-open .an-panel-overlay { opacity: 1; visibility: visible; }
.an-panel {
  position: fixed; top: 0; left: 0; height: 100%; width: 360px; max-width: 88vw;
  background: var(--an-papel); z-index: 999;
  transform: translateX(-100%); transition: transform .28s ease;
  overflow-y: auto; box-shadow: 4px 0 24px rgba(17,24,39,.12);
}
body.an-panel-open .an-panel { transform: translateX(0); }
.an-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--an-hairline);
}
.an-panel__close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--an-tinta); line-height: 1; }
.an-panel__section { padding: 20px; border-bottom: 1px solid var(--an-hairline); }
.an-panel__title {
  font-family: var(--an-display); font-weight: 800; font-size: 13px;
  text-transform: uppercase; letter-spacing: 1px; color: var(--an-azul);
  margin-bottom: 14px;
}
/* Rádio Web widget */
.an-radio { display: flex; align-items: center; gap: 12px; background: var(--an-nuvem); padding: 12px; border-radius: var(--an-radius-sm); }
.an-radio__btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--an-azul); color: #fff;
  border: none; cursor: pointer; font-size: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.an-radio__btn:hover { background: var(--an-azul-escuro); }
.an-radio__label { font-size: 13px; color: var(--an-tinta-media); }
.an-radio__label strong { display: block; color: var(--an-tinta); font-family: var(--an-display); }
/* Editorias destacadas */
.an-panel__cats { display: flex; flex-wrap: wrap; gap: 8px; }
.an-panel__cats a {
  padding: 6px 12px; background: var(--an-nuvem); border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--an-tinta);
}
.an-panel__cats a:hover { background: var(--an-azul); color: #fff; }
/* Recentes */
.an-panel__recent li { padding: 10px 0; border-bottom: 1px solid var(--an-hairline); }
.an-panel__recent li:last-child { border-bottom: none; }
.an-panel__recent a { font-family: var(--an-display); font-weight: 600; font-size: 14px; color: var(--an-tinta); line-height: 1.35; }
.an-panel__recent a:hover { color: var(--an-azul); }
.an-panel__recent .data { display: block; font-size: 11px; color: var(--an-cinza); margin-top: 4px; font-family: var(--an-corpo); font-weight: 400; }

/* ============================================================
   BUSCA (overlay) — filtro duplo: editoria E local
   ============================================================ */
.an-search-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.98);
  z-index: 1000; opacity: 0; visibility: hidden; transition: .2s;
  display: flex; flex-direction: column; align-items: center; padding-top: 12vh;
}
body.an-search-open .an-search-overlay { opacity: 1; visibility: visible; }
.an-search-box { width: 100%; max-width: 680px; padding: 0 20px; }
.an-search-box input[type="search"] {
  width: 100%; font-size: 24px; font-family: var(--an-display); font-weight: 600;
  padding: 16px 0; border: none; border-bottom: 3px solid var(--an-tinta);
  background: transparent; color: var(--an-tinta);
}
.an-search-box input:focus { outline: none; border-bottom-color: var(--an-azul); }
.an-search-filters { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.an-search-filters select {
  padding: 8px 12px; border: 1px solid var(--an-hairline); border-radius: var(--an-radius-sm);
  font-family: var(--an-corpo); font-size: 14px; color: var(--an-tinta); background: #fff;
}
.an-search-results { margin-top: 20px; max-height: 50vh; overflow-y: auto; }
.an-search-results__item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--an-hairline); }
.an-search-results__item img { width: 72px; height: 54px; object-fit: cover; border-radius: var(--an-radius-sm); flex-shrink: 0; }
.an-search-results__cat { font-size: 11px; font-weight: 700; color: var(--an-azul); text-transform: uppercase; }
.an-search-results__title { font-family: var(--an-display); font-weight: 600; font-size: 15px; color: var(--an-tinta); }
.an-search-close { position: absolute; top: 24px; right: 24px; background: none; border: none; font-size: 32px; cursor: pointer; color: var(--an-tinta); }
.an-search-hint { color: var(--an-cinza); font-size: 13px; margin-top: 10px; }

/* ============================================================
   HERO / HIGHLIGHT (slider de destaques → an-destaques)
   ============================================================ */
.an-highlight { padding: 28px 0; }
.an-highlight__grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--an-gap); }
.an-hl-lead { position: relative; border-radius: var(--an-radius); overflow: hidden; min-height: 420px; }
.an-hl-lead img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.an-hl-lead__body {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px; background: linear-gradient(to top, rgba(17,24,39,.85) 0%, rgba(17,24,39,.2) 60%, transparent 100%);
}
.an-hl-lead__cat, .an-card__cat {
  display: inline-block; align-self: flex-start; background: var(--an-azul); color: #fff;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 4px 10px; border-radius: var(--an-radius-sm); margin-bottom: 10px;
}
.an-hl-lead__title { color: #fff; font-size: clamp(22px, 3vw, 32px); }
.an-hl-lead__title a { color: #fff; }
.an-hl-lead__meta { color: #cbd5e1; font-size: 13px; margin-top: 8px; }
.an-hl-side { display: flex; flex-direction: column; gap: var(--an-gap); }
.an-hl-side .an-card { flex: 1; }

/* ============================================================
   CARDS DE NOTÍCIA
   ============================================================ */
.an-card { background: #fff; border: 1px solid var(--an-hairline); border-radius: var(--an-radius); overflow: hidden; transition: .2s; }
.an-card:hover { box-shadow: var(--an-shadow-hover); transform: translateY(-2px); }
.an-card__thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.an-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.an-card__body { padding: 16px; }
.an-card__title { font-size: 17px; line-height: 1.3; margin-bottom: 8px; }
.an-card__title a { color: var(--an-tinta); }
.an-card__title a:hover { color: var(--an-azul); }
.an-card__meta { font-size: 12px; color: var(--an-cinza); display: flex; gap: 10px; }
.an-card__local { color: var(--an-azul); font-weight: 600; }

/* Grid de seção */
.an-section { padding: 32px 0; }
.an-section__head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.an-section__head h2 { font-size: 22px; }
.an-section__head::after { content: ''; flex: 1; height: 2px; background: var(--an-hairline); }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--an-gap); }
.an-grid > * { min-width: 0; } /* fix CSS Grid blowout (lição do Sampa) */

/* ============================================================
   LAYOUT CONTEÚDO + SIDEBAR
   ============================================================ */
.an-main { padding: 32px 0; }
.an-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.an-layout > * { min-width: 0; }
.an-sidebar .widget { background: #fff; border: 1px solid var(--an-hairline); border-radius: var(--an-radius); padding: 20px; margin-bottom: 24px; }
.an-sidebar .widget-title { font-family: var(--an-display); font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; color: var(--an-tinta); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--an-azul); }

/* ============================================================
   ARTIGO (single) — leitura premium
   ============================================================ */
.an-article { max-width: var(--an-artigo-max); margin: 0 auto; }
.an-article__cat { display: inline-block; background: var(--an-azul); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 5px 12px; border-radius: var(--an-radius-sm); margin-bottom: 16px; }
.an-article__title { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; margin-bottom: 16px; }
.an-article__meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--an-cinza); padding-bottom: 20px; border-bottom: 1px solid var(--an-hairline); margin-bottom: 28px; }
.an-article__local { color: var(--an-azul); font-weight: 600; }
.an-article__content { font-size: 17px; line-height: 1.7; color: var(--an-tinta-media); }
.an-article__content p { margin-bottom: 1.5em; }
.an-article__content h2, .an-article__content h3 { color: var(--an-tinta); margin: 1.5em 0 .6em; }
.an-article__content a { color: var(--an-azul); text-decoration: underline; text-underline-offset: 2px; }
.an-article__content img { border-radius: var(--an-radius); margin: 1.5em 0; }
.an-article__content blockquote {
  border-left: 4px solid var(--an-azul); padding: 8px 0 8px 20px; margin: 1.5em 0;
  font-family: var(--an-display); font-size: 20px; font-weight: 600; color: var(--an-tinta); font-style: normal;
}
/* Barra de progresso de leitura */
#an-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--an-azul); width: 0; z-index: 1001; transition: width .1s; }

/* ============================================================
   URGENTE / AO VIVO (vermelho semântico, uso restrito)
   ============================================================ */
.an-urgente { background: var(--an-urgente); color: #fff; }
.an-badge-vivo { display: inline-flex; align-items: center; gap: 5px; background: var(--an-urgente); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }
.an-badge-vivo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: an-pulse 1.4s infinite; }
@keyframes an-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ============================================================
   FOOTER
   ============================================================ */
.an-footer { background: var(--an-tinta); color: #cbd5e1; margin-top: 48px; padding: 40px 0 24px; }
.an-footer a { color: #cbd5e1; }
.an-footer a:hover { color: #fff; }
.an-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.an-footer__title { font-family: var(--an-display); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: #fff; margin-bottom: 14px; }
.an-footer__title .x { color: var(--an-azul); }
.an-footer li { padding: 5px 0; font-size: 14px; }
.an-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; font-size: 13px; color: #94a3b8; }

/* ============================================================
   RESPONSIVO — mobile-first quality floor
   ============================================================ */
@media (max-width: 980px) {
  .an-layout { grid-template-columns: 1fr; }
  .an-highlight__grid { grid-template-columns: 1fr; }
  .an-hl-lead { min-height: 320px; }
}
@media (max-width: 768px) {
  .an-header__inner { height: 68px; grid-template-columns: auto 1fr auto; }
  .an-logo img { max-height: 40px; }
  .an-logo__text { font-size: 24px; }
  .an-nav { display: none; } /* nav vai pro painel lateral no mobile */
  .an-topbar__data span.hide-mobile { display: none; }
  body { font-size: 16px; }
  .an-article__content { font-size: 17px; }
}
@media (max-width: 480px) {
  .an-grid { grid-template-columns: 1fr; }
  .an-topbar__right .an-topbar__social { display: none; }
}
