/* ==========================================================================
   Guia Top 10 — "revista de consumo": papel, tinta e carimbo vermelho.
   Somente tema claro.
   ========================================================================== */
:root {
    color-scheme: light;
    --paper: #f5efe3;
    --paper-2: #ede4d2;
    --card: #fffdf8;
    --ink: #1a1714;
    --ink-2: #4a433b;
    --muted: #857a6c;
    --rule: #d9cdb7;
    --rule-strong: #1a1714;
    --red: #d6361f;
    --red-dark: #a92612;
    --gold: #f2b631;
    --green: #2f7d4f;
    --blue: #1f5fa8;

    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: "Figtree", "Segoe UI", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --radius: 4px;
    --shadow: 0 1px 0 var(--rule), 0 10px 30px -18px rgba(60, 40, 10, 0.35);
    --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background-color: var(--paper);
    /* grão de papel */
    background-image:
        radial-gradient(rgba(120, 90, 40, 0.07) 1px, transparent 1px),
        radial-gradient(rgba(120, 90, 40, 0.05) 1px, transparent 1px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 1px 2px;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.015em;
    font-variation-settings: "opsz" 72, "SOFT" 30;
    margin: 0 0 0.5em;
}

::selection { background: var(--gold); color: var(--ink); }

.container { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Masthead ---------- */
.site-header {
    background: var(--paper);
    border-bottom: 3px double var(--rule-strong);
    position: sticky;
    top: 0;
    z-index: 50;
}
.edition-bar {
    border-bottom: 1px solid var(--rule);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.edition-bar .container { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.35rem; padding-bottom: 0.35rem; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }

.logo a { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.logo-mark {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    background: var(--red); color: #fff;
    font-family: var(--serif); font-weight: 800; font-style: italic; font-size: 1.35rem;
    border-radius: 50%;
    transform: rotate(-8deg);
    box-shadow: 2px 2px 0 var(--ink);
}
.logo-title { display: block; font-family: var(--serif); font-weight: 800; font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1; }
.tagline { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

.main-nav ul { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; align-items: center; }
.main-nav a, .dropdown-toggle {
    display: block; padding: 0.45rem 0.8rem; border-radius: 999px;
    text-decoration: none; font-weight: 600; font-size: 0.95rem; color: var(--ink);
}
.dropdown-toggle { font-family: inherit; line-height: inherit; background: none; border: 0; cursor: pointer; }
.main-nav a:hover, .dropdown-toggle:hover { background: var(--paper-2); color: var(--ink); }
.dropdown { position: relative; }
/* ".main-nav ul" (display: flex) é mais específico que ".dropdown-menu":
   o seletor precisa do mesmo peso, senão o menu fica sempre aberto. */
.main-nav .dropdown-menu {
    display: none; position: absolute; right: 0; top: 100%; z-index: 20;
    min-width: 220px; max-height: 70vh; overflow-y: auto; padding: 0.5rem;
    background: var(--card); border: 1px solid var(--ink); border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--ink);
    flex-direction: column; align-items: stretch;
}
.main-nav .dropdown.open .dropdown-menu { display: flex; }
@media (hover: hover) {
    .main-nav .dropdown:hover .dropdown-menu { display: flex; }
}
.dropdown-menu a { border-radius: var(--radius); }

.header-search { display: flex; }
.header-search input {
    width: 190px; padding: 0.45rem 0.9rem; border: 1px solid var(--rule); border-radius: 999px;
    background: var(--card); font: inherit; font-size: 0.9rem; color: var(--ink);
    transition: width 0.25s, border-color 0.2s;
}
.header-search input:focus { width: 240px; border-color: var(--ink); outline: none; }

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 2.5rem; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 3rem; align-items: center; }
.kicker {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red);
}
.kicker::before { content: ""; width: 28px; height: 2px; background: var(--red); }
.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.035em;
    margin: 0.8rem 0 1.2rem;
}
.hero h1 em { font-style: italic; font-weight: 500; color: var(--red); }
.hero-lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34ch; margin: 0 0 1.8rem; }

.hero-numeral {
    font-family: var(--serif);
    font-weight: 900;
    font-size: clamp(12rem, 26vw, 22rem);
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 2px var(--ink);
    position: relative;
    text-align: center;
    user-select: none;
}
.hero-numeral::after {
    content: "Top";
    position: absolute; left: 50%; top: 42%;
    transform: translate(-50%, -50%) rotate(-10deg);
    font-size: 0.16em; font-style: italic; font-weight: 700; letter-spacing: 0;
    color: #fff; -webkit-text-stroke: 0;
    background: var(--red); padding: 0.1em 0.5em; border-radius: 999px;
    box-shadow: 3px 3px 0 var(--ink);
}

.search-bar form {
    display: flex; max-width: 520px;
    background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px;
    padding: 0.3rem; box-shadow: 4px 4px 0 var(--ink);
}
.search-bar input {
    flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.65rem 1rem;
    font: inherit; font-size: 1rem; color: var(--ink); outline: none;
}
.search-bar button {
    border: 0; border-radius: 999px; padding: 0.65rem 1.4rem; cursor: pointer;
    background: var(--ink); color: var(--paper); font: inherit; font-weight: 700;
    transition: background 0.2s;
}
.search-bar button:hover { background: var(--red); }

.niche-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.niche-strip a, .chip {
    display: inline-block; padding: 0.3rem 0.85rem; border: 1px solid var(--ink); border-radius: 999px;
    font-size: 0.85rem; font-weight: 600; text-decoration: none; text-transform: capitalize; background: var(--card);
}
.niche-strip a:hover { background: var(--ink); color: var(--paper); }

/* ---------- Section headings ---------- */
.section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
    border-top: 3px solid var(--ink); padding-top: 0.8rem; margin: 2.5rem 0 1.5rem;
}
.section-head h2, .section-head h3 { font-size: 1.9rem; margin: 0; }
.section-head .count { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Post cards ---------- */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2rem 1.75rem; margin-bottom: 2rem; }

.post-card { position: relative; animation: rise 0.6s cubic-bezier(.2,.7,.2,1) both; }
.post-card:nth-child(2) { animation-delay: 0.06s; }
.post-card:nth-child(3) { animation-delay: 0.12s; }
.post-card:nth-child(4) { animation-delay: 0.18s; }
.post-card:nth-child(5) { animation-delay: 0.24s; }
.post-card:nth-child(n+6) { animation-delay: 0.3s; }
.post-card > a { display: block; text-decoration: none; color: var(--ink); }

.post-cover {
    position: relative; aspect-ratio: 4 / 3; overflow: hidden;
    background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
    display: grid; place-items: center;
}
.post-cover img { width: 78%; height: 78%; object-fit: contain; transition: transform 0.5s cubic-bezier(.2,.7,.2,1); mix-blend-mode: multiply; }
.post-card:hover .post-cover img { transform: scale(1.06) rotate(-1.5deg); }
.post-cover .no-img { font-family: var(--serif); font-size: 5rem; font-weight: 900; color: var(--paper-2); }
/* guias: capa tipográfica quando não há foto de ranking ligado; selo "Guia" diferencia dos rankings */
.post-cover .guide-txt { padding: 2.2rem 1.4rem 1.4rem; font-family: var(--serif); font-size: 1.45rem; font-weight: 900; line-height: 1.15; color: var(--ink); text-align: center; }
.post-cover .guide-flag {
    position: absolute; bottom: 0.75rem; right: 0.75rem;
    background: var(--ink); color: var(--paper, #fff);
    padding: 0.15rem 0.6rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

.niche-badge {
    position: absolute; top: 0.75rem; left: 0.75rem;
    background: var(--gold); color: var(--ink);
    padding: 0.15rem 0.6rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.niche-badge.static { position: static; display: inline-block; }
a.niche-badge { text-decoration: none; }

.post-info { padding: 0.9rem 0.1rem 0; }
.post-info h4 { font-size: 1.3rem; margin: 0 0 0.4rem; transition: color 0.2s; }
.post-card:hover .post-info h4 { color: var(--red); }
.post-info time { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }

/* primeiro card da home em destaque */
.posts-grid.featured .post-card:first-child { grid-column: span 2; }
.posts-grid.featured .post-card:first-child > a { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.5rem; align-items: center; }
.posts-grid.featured .post-card:first-child .post-info h4 { font-size: 2rem; }

.pagination { text-align: center; margin: 2.5rem 0; }
.btn-load-more {
    font: inherit; font-weight: 700; cursor: pointer;
    padding: 0.8rem 2rem; background: transparent; color: var(--ink);
    border: 1.5px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-load-more:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn-load-more.htmx-request { opacity: 0.6; }

.empty-state { grid-column: 1 / -1; padding: 3rem; text-align: center; color: var(--muted); border: 1px dashed var(--rule); border-radius: var(--radius); font-family: var(--serif); font-size: 1.3rem; font-style: italic; }

/* ---------- Article ---------- */
.single-post { max-width: 860px; margin: 0 auto; padding-top: 2rem; min-width: 0; }
/* Coluna de anúncio à direita só em telas largas; abaixo disso some. */
.post-sidebar { display: none; }
@media (min-width: 1180px) {
    .post-layout.has-sidebar { display: grid; grid-template-columns: minmax(0, 820px) 300px; gap: 2.5rem; justify-content: center; }
    .post-layout.has-sidebar .single-post { margin: 0; }
    .post-layout.has-sidebar .post-sidebar { display: block; padding-top: 2rem; }
    .sidebar-sticky { position: sticky; top: 1.5rem; }
}
.breadcrumbs { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs span:last-child { color: var(--ink-2); }

.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 1rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; font-size: 0.88rem; color: var(--muted); padding: 0.8rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.post-meta > * + *::before { content: "·"; margin-right: 1rem; color: var(--rule); }
.post-meta .niche-badge + *::before { content: none; }

.social-share { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.share-btn {
    font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; text-decoration: none;
    padding: 0.35rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink);
}
.share-btn:hover { border-color: var(--ink); color: var(--ink); }

.post-cover-figure { margin: 2rem 0 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 2rem; }
.post-cover-figure img { max-height: 380px; margin: 0 auto; object-fit: contain; mix-blend-mode: multiply; }

.quick-list {
    background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius);
    padding: 1.4rem 1.8rem; margin: 0 0 2.5rem; box-shadow: 6px 6px 0 var(--gold);
}
.quick-list h2 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.quick-list ol { margin: 0; padding: 0; list-style: none; counter-reset: q; columns: 2; column-gap: 2rem; }
.quick-list li { counter-increment: q; break-inside: avoid; padding: 0.3rem 0; display: flex; gap: 0.6rem; font-size: 0.93rem; line-height: 1.35; }
.quick-list li::before { content: counter(q, decimal-leading-zero); font-family: var(--serif); font-weight: 700; color: var(--red); min-width: 1.6em; }
.quick-list a { text-decoration: none; }
.quick-list a:hover { text-decoration: underline; }

.post-content { font-size: 1.08rem; }
.post-intro > p:first-of-type::first-letter {
    float: left; font-family: var(--serif); font-weight: 800; font-size: 4.2em; line-height: 0.85;
    margin: 0.06em 0.1em 0 0; color: var(--red);
}
.post-content h2 { font-size: 2rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.post-content h3 { font-size: 1.35rem; margin-top: 1.8rem; }
.post-content ul { padding-left: 1.2rem; }
.post-content li { margin: 0.35rem 0; }
.post-content li::marker { color: var(--red); }
.post-content strong { background: linear-gradient(transparent 62%, rgba(242, 182, 49, 0.45) 62%); }

/* ---------- Ranking ---------- */
.product-comparison { margin-top: 3.5rem; }
.post-guide { margin-top: 1rem; }

/* ---------- Destaques (mais barato, custo-benefício, qualidade) ---------- */
.highlights { margin: 3rem 0 0; }
.highlights > h2 { font-size: 1.6rem; margin-bottom: 1rem; }
.highlight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.highlight-card {
    display: flex; flex-direction: column; gap: 0.5rem;
    background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius);
    padding: 1rem; box-shadow: 4px 4px 0 var(--rule);
}
.highlight-label {
    align-self: flex-start; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
    background: var(--ink); color: var(--paper); border-radius: 3px; padding: 0.15rem 0.5rem;
}
/* Caixa de tamanho fixo: a foto (quadrada, vertical ou horizontal) cabe inteira
   sem esticar a caixa. max-height:100% não funciona num grid sem altura definida. */
.highlight-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #fff; border-radius: var(--radius); }
.highlight-img img { position: absolute; inset: 0.5rem; width: calc(100% - 1rem); height: calc(100% - 1rem); max-width: none; object-fit: contain; mix-blend-mode: multiply; }
.highlight-card h3 { font-size: 1.05rem; margin: 0; }
.highlight-card h3 a { text-decoration: none; }
.highlight-hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.highlight-meta { display: flex; gap: 0.75rem; align-items: baseline; font-size: 0.88rem; color: var(--ink-2); margin-top: auto; }
.highlight-meta strong { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.btn-cta.btn-cta-sm { align-self: flex-start; padding: 0.5rem 1rem; font-size: 0.88rem; }
.product-comparison > h2 { font-size: 2.4rem; border-top: 3px solid var(--ink); padding-top: 1rem; }
.ranking-note { margin: -0.25rem 0 0.5rem; font-size: 0.92rem; color: var(--muted); }

.product-card {
    position: relative;
    display: grid; grid-template-columns: 5.5rem 170px 1fr; gap: 1.5rem; align-items: start;
    padding: 2rem 0; border-bottom: 1px solid var(--rule);
}
.product-rank {
    font-family: var(--serif); font-weight: 900; font-size: 5.5rem; line-height: 0.8;
    letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1.5px var(--ink);
    font-variant-numeric: lining-nums;
}
.product-card:first-child .product-rank, .product-card.is-top .product-rank { color: var(--red); -webkit-text-stroke: 0; }
/* Seta de posição em relação ao mês passado, abaixo do número. */
.product-rank-col { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.product-rank-col .rank-move { margin: 0; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.rank-move.is-up { color: var(--green); }
.rank-move.is-down { color: var(--red); }
.rank-move.is-same, .rank-move.is-pick { color: var(--muted); }
.rank-move.is-new { color: var(--ink); text-transform: uppercase; font-size: 0.7rem; }
.product-rank-col .rank-move.is-pick { white-space: normal; font-size: 0.68rem; text-transform: uppercase; line-height: 1.2; }
/* Links entre a página geral e as subpáginas (ex: Smart TV e Smart TV 50"). */
.family-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: baseline; margin: 1.5rem 0 0; font-size: 0.92rem; }
.hub { margin: 1.5rem 0; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.hub-card { display: flex; flex-direction: column; gap: 0.5rem; border: 1px solid var(--rule); border-radius: 8px; padding: 1rem; text-decoration: none; color: inherit; }
.hub-card:hover { border-color: var(--ink); }
.hub-card img { width: 100%; height: 160px; object-fit: contain; }
.hub-card h3 { margin: 0; font-size: 1.05rem; }
.hub-card p { margin: 0; font-size: 0.85rem; color: var(--ink-2); }
.family-nav > span { font-weight: 700; color: var(--ink-2); }
.family-nav a, .family-nav strong { border: 1px solid var(--rule); border-radius: 999px; padding: 0.2rem 0.75rem; text-decoration: none; }
.family-nav strong { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.product-image { position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); aspect-ratio: 1; overflow: hidden; }
.product-image img { position: absolute; inset: 0.8rem; width: calc(100% - 1.6rem); height: calc(100% - 1.6rem); max-width: none; object-fit: contain; mix-blend-mode: multiply; }
.product-details h3 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.product-details p { color: var(--ink-2); margin: 0.6rem 0 1rem; font-size: 0.98rem; }

.product-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.6rem; }
.product-tags .editor-stamp { margin-bottom: 0; }
.product-tag {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--green); border: 1.5px solid var(--green); border-radius: 3px; padding: 0.1rem 0.45rem;
}
.editor-stamp {
    display: inline-block; margin-bottom: 0.6rem;
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--red); border: 2px solid var(--red); border-radius: 3px; padding: 0.15rem 0.5rem;
    transform: rotate(-2deg);
}

.product-rating { display: flex; align-items: center; gap: 0.5rem; }
.stars { --percent: calc(var(--rating) / 5 * 100%); display: inline-block; font-size: 1.05rem; line-height: 1; letter-spacing: 2px; }
.stars::before {
    content: "★★★★★";
    background: linear-gradient(90deg, var(--gold) var(--percent), var(--rule) var(--percent));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rating-num { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.rating-num small { font-weight: 500; color: var(--muted); }
.product-price { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin-bottom: 0.8rem; }

/* Preço por loja (Mercado Livre x Amazon); a mais barata fica destacada. */
.offers { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.4rem; max-width: 360px; }
.offers li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 0.45rem 0.8rem; border: 1px solid var(--rule); border-radius: var(--radius);
    background: var(--card);
}
.offer-store { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); }
.offers strong { font-family: var(--serif); font-size: 1.2rem; }
.offers .is-best { border: 1.5px solid var(--green); }
.offers .is-best .offer-store::after {
    content: "menor preço"; margin-left: 0.5rem; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green);
}
.offer-note { font-size: 0.75rem !important; color: var(--muted) !important; margin: 0 0 0.8rem !important; }

.btn-cta {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--red); color: #fff !important; text-decoration: none;
    padding: 0.8rem 1.5rem; border-radius: 999px; font-weight: 800;
    border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn-cta::after { content: "→"; transition: transform 0.2s; }
.btn-cta:hover { background: var(--red-dark); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn-cta:hover::after { transform: translateX(3px); }
/* 4º filho do .product-card: sem posição explícita caía na coluna do número (5.5rem) e o botão quebrava em 3 linhas. */
.product-cta { grid-column: 3; display: flex; flex-direction: column; align-items: flex-start; }
.cta-alt { display: inline-block; margin-top: 0.6rem; font-size: 0.88rem; color: var(--ink-2); text-decoration: underline; }
.cta-alt:hover { color: var(--ink); }

/* Autoria / metodologia sob o H1 e tabela comparativa */
.post-byline { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--ink-2); }
.post-method { margin: 0.2rem 0 0.8rem; font-size: 0.85rem; color: var(--muted); }
.post-method a { color: var(--ink-2); }
.compare-table-wrap { margin: 1.5rem 0; }
.compare-table-wrap h2 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--card); }
.compare-table caption { text-align: left; font-size: 0.8rem; color: var(--muted); padding-bottom: 0.4rem; }
.compare-table th, .compare-table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.compare-table thead th { border-bottom: 2px solid var(--ink); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); white-space: nowrap; }
.compare-table tbody th { font-family: var(--serif); color: var(--red); white-space: nowrap; }
.compare-table a { text-decoration: none; font-weight: 600; }

/* Histórico de preço do Mercado Livre (registrado todo dia) e "Por que está na lista" */
.price-trend { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 0.8rem; max-width: 520px; color: var(--muted); }
.price-trend .price-spark { flex: none; }
.price-trend.is-low { color: var(--green); }
.price-trend.is-high { color: var(--red); }
.product-details .price-trend p { margin: 0; font-size: 0.82rem; line-height: 1.35; color: var(--ink-2); }
.price-trend.is-low strong { color: var(--green); }
.price-trend.is-high strong { color: var(--red); }
.product-why { margin: 0 0 1rem; padding: 0.6rem 0.8rem; border-left: 3px solid var(--gold); background: var(--card); font-size: 0.85rem; color: var(--ink-2); }
.product-why-title { display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); margin-bottom: 0.2rem; }
.product-why ul { margin: 0; padding-left: 1.1rem; }
.product-why li { margin: 0.1rem 0; }

/* Prós e contras do produto */
.pros-cons { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.6rem 1.2rem; margin: 0 0 1rem; font-size: 0.9rem; }
.pros-cons-title { display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.2rem; }
.pros .pros-cons-title { color: var(--green); }
.cons .pros-cons-title { color: var(--red); }
.pros-cons ul { list-style: none; margin: 0; padding: 0; }
.pros-cons li { position: relative; padding-left: 1.2rem; margin: 0.15rem 0; color: var(--ink-2); line-height: 1.35; }
.pros li::before { content: "+"; position: absolute; left: 0; font-weight: 800; color: var(--green); }
.cons li::before { content: "−"; position: absolute; left: 0; font-weight: 800; color: var(--red); }

/* O que mudou nesta edição */
.edition-changes { margin: 2.5rem 0 0; padding: 1.2rem 1.5rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.edition-changes h2 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.edition-changes h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.edition-changes p, .edition-changes li { font-size: 0.93rem; color: var(--ink-2); }
.edition-changes ul { margin: 0; padding-left: 1.1rem; }
.edition-leaders { list-style: none; padding-left: 0 !important; }
.edition-leaders span { display: inline-block; min-width: 9.5em; font-weight: 700; color: var(--ink); }
.compare-table a:hover { text-decoration: underline; }
.compare-table td.num { white-space: nowrap; }

.preview-banner {
    background: repeating-linear-gradient(-45deg, var(--gold), var(--gold) 14px, #f5c65a 14px, #f5c65a 28px);
    color: var(--ink); text-align: center; padding: 0.5rem; font-weight: 800; font-size: 0.85rem;
    letter-spacing: 0.08em; text-transform: uppercase;
}

.related-posts { margin-top: 4rem; }

/* ---------- Guias (seo-engine) ---------- */
.guides-related { margin: 3rem 0 0; padding: 1.2rem 1.6rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.guides-related h2 { font-size: 1.3rem; margin: 0 0 0.6rem; }
.guides-related ul { list-style: none; margin: 0; padding: 0; }
.guides-related li { padding: 0.45rem 0; }
.guides-related li a { font-weight: 700; }
.guides-related li span { display: block; font-size: 0.9rem; color: var(--muted); }
.guide-summary, .guide-toc, .guide-faq, .guide-readmore { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.6rem; margin: 0 0 2rem; }
.guide-summary { border: 1.5px solid var(--ink); box-shadow: 6px 6px 0 var(--gold); }
.guide-summary h2, .guide-toc h2, .guide-faq h2, .guide-readmore h2 { font-size: 1.3rem; margin: 0 0 0.6rem; }
.guide-summary ul, .guide-toc ol, .guide-readmore ul { margin: 0; padding-left: 1.2rem; }
.guide-faq details { border-top: 1px solid var(--rule); padding: 0.6rem 0; }
.guide-faq summary { font-weight: 700; cursor: pointer; }
.guide-faq details p { margin: 0.5rem 0 0; }
.guide-cta { margin: 2.5rem 0 0; text-align: center; }
.guide-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.guide-body th, .guide-body td { border: 1px solid var(--rule); padding: 0.4rem 0.7rem; text-align: left; }
.guide-body blockquote { margin: 1.2rem 0; padding: 0.2rem 1rem; border-left: 4px solid var(--gold); color: var(--ink-2); }
.guide-body h2, .guide-body h3, .guide-body h4 { scroll-margin-top: 1rem; }
.guide-pager { display: flex; justify-content: space-between; margin: 2rem 0; }

/* ---------- Static / 404 ---------- */
.static-page { max-width: 760px; padding-top: 3rem; }
.static-page h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.static-page h2 { font-size: 1.5rem; margin-top: 2rem; }

.not-found { text-align: center; padding: 4rem 1.25rem; }
.not-found h1 {
    font-size: clamp(8rem, 22vw, 14rem); line-height: 0.85; margin: 0;
    color: transparent; -webkit-text-stroke: 2px var(--ink); font-weight: 900; letter-spacing: -0.06em;
}
.not-found h2 { font-size: 2rem; }
.not-found .search-bar form { margin: 2rem auto 0; }
.btn-primary {
    display: inline-block; background: var(--ink); color: var(--paper) !important; text-decoration: none;
    padding: 0.7rem 1.5rem; border-radius: 999px; font-weight: 700;
}
.btn-primary:hover { background: var(--red); }

.search-header { padding-top: 2rem; }
.category-page { padding-top: 2rem; }
.category-title { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: -0.035em; text-transform: capitalize; }
.category-intro { max-width: 760px; margin: 0.5rem 0 0; font-size: 1.05rem; color: var(--ink-2); }
.category-intro p { margin: 0 0 0.8rem; }
.category-intro .category-method { font-size: 0.92rem; color: var(--muted); }

/* Home: "Como montamos os rankings" e últimos guias */
.how-grid { list-style: none; counter-reset: how; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.how-grid li { counter-increment: how; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.how-grid li::before { content: counter(how); display: block; font-family: var(--serif); font-size: 2.2rem; font-weight: 900; line-height: 1; color: var(--red); margin-bottom: 0.4rem; }
.how-grid h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.how-grid p { margin: 0; font-size: 0.95rem; color: var(--ink-2); }
.how-more { margin: 1rem 0 0; font-weight: 700; }
.section-head a.count { text-decoration: none; }
.home-guides-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.home-guides-list li { border-top: 2px solid var(--ink); padding-top: 0.8rem; }
.home-guides-list a { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.home-guides-list a:hover { color: var(--red); }
.home-guides-list p { margin: 0.4rem 0 0; font-size: 0.92rem; color: var(--muted); }

/* Espaços de anúncio: a altura mínima evita que a página "pule" quando o
   AdSense carrega. ADS_PLACEHOLDER=true desenha as caixas vazias. */
.ad-slot { margin: 2rem auto; text-align: center; min-height: 100px; }
.ad-slot.ad-inline, .ad-slot.ad-inlist { min-height: 250px; }
.ad-slot.ad-sidebar { min-height: 600px; margin: 0; }
.ad-label { display: block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.ad-slot.is-placeholder {
    display: grid; place-items: center;
    border: 1.5px dashed var(--muted); border-radius: var(--radius);
    background: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(133, 122, 108, 0.07) 10px, rgba(133, 122, 108, 0.07) 20px);
}
.product-comparison .ad-slot { margin: 1.5rem 0; }
/* Sem anúncio para mostrar (data-ad-status="unfilled", p.ex. com o site ainda em análise no
   AdSense): o bloco some, em vez de deixar uma caixa vazia de 250px com "Publicidade". */
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 5rem; background: var(--ink); color: #cfc6b8; padding: 3rem 0 2rem; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.footer-brand .logo-title { color: var(--paper); font-size: 2rem; }
.footer-brand p { max-width: 42ch; font-size: 0.92rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.footer-links a { color: var(--paper); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.disclaimer { grid-column: 1 / -1; font-size: 0.82rem; border-top: 1px solid #3a342d; padding-top: 1.2rem; }
.disclaimer p { margin: 0 0 0.3rem; }
.copyright { font-size: 0.8rem; color: #8f8578; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-numeral { display: none; }
    .header-search { display: none; }
    .posts-grid.featured .post-card:first-child { grid-column: auto; }
    .posts-grid.featured .post-card:first-child > a { display: block; }
    .posts-grid.featured .post-card:first-child .post-info h4 { font-size: 1.3rem; }
    .product-card { grid-template-columns: 3.5rem 1fr; }
    .product-rank { font-size: 3.6rem; }
    .product-image { grid-column: 2; max-width: 220px; }
    .product-details { grid-column: 1 / -1; }
    .product-cta { grid-column: 1 / -1; }
    .quick-list ol { columns: 1; }
    .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    body { font-size: 16px; }
    .edition-bar .ed-right { display: none; }
    .tagline { display: none; }
    .header-inner { gap: 0.75rem; }
    .main-nav a { padding: 0.4rem 0.55rem; font-size: 0.88rem; }
    .posts-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Admin — mesma identidade, tema claro, mais denso.
   ========================================================================== */
.admin-body { background: var(--paper); color: var(--ink); font-size: 15px; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--rule); padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; align-self: flex-start; }
.admin-logo { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.5rem; }
.admin-logo .logo-mark { width: 36px; height: 36px; font-size: 1.1rem; }
.admin-logo h2 { font-size: 1.2rem; margin: 0; }
.admin-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.admin-nav a { display: block; padding: 0.55rem 0.8rem; border-radius: var(--radius); text-decoration: none; font-weight: 600; color: var(--ink-2); }
.admin-nav a:hover { background: var(--paper); color: var(--ink); }
.admin-nav a.active { background: var(--ink); color: var(--paper); }

.admin-main { flex: 1; min-width: 0; }
.admin-header { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 2rem; background: var(--card); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 50; }
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; color: var(--ink-2); text-decoration: none; }
.notif-bell:hover { background: var(--paper); color: var(--ink); }
.notif-bell.has-unread { color: var(--ink); }
.notif-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red-dark, #b3261e); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center; }
.notification.is-unread { border-left: 4px solid var(--ink); }
.notification.is-unread.priority-critical { border-left-color: var(--red-dark, #b3261e); }
.notification.is-unread.priority-high { border-left-color: #b26a00; }
.notification:not(.is-unread) { opacity: 0.7; }
.notification-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.notification-body { white-space: pre-wrap; margin: 0.5rem 0; }
.header-title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.admin-content { padding: 2rem 1.5rem; max-width: none; }
.admin-content > div > h2 { font-size: 2.2rem; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat-card h4 { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.3rem; font-weight: 700; }
.stat-value { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; line-height: 1.1; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.5rem; }
.card h3 { font-size: 1.3rem; margin-top: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.dashboard-grid > .card { margin-bottom: 1.5rem; }

.admin-table { width: 100%; border-collapse: collapse; margin-bottom: 0.5rem; font-size: 0.92rem; }
.admin-table th { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; text-align: left; padding: 0.6rem; border-bottom: 2px solid var(--ink); }
.admin-table td { padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin-table tbody tr:hover { background: var(--paper); }
.admin-table a { text-decoration: none; }
.admin-table th a { color: inherit; }
.admin-table th a.sorted { color: var(--ink); border-bottom: 2px solid var(--red); }

.badge { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: var(--paper-2); color: var(--ink-2); }
.badge-success { background: #dcefe2; color: var(--green); }
.badge-warning { background: #fbe9c0; color: #8a5a00; }
.badge-danger { background: #f8d7d0; color: var(--red-dark); }
.badge-ai { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; font-size: 0.72rem; padding: 0.1rem 0.5rem; }

.admin-body input, .admin-body select, .admin-body textarea {
    font: inherit; color: var(--ink); background: #fff;
    border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.5rem 0.7rem;
    max-width: 100%;
}
.admin-body input:focus, .admin-body select:focus, .admin-body textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(242, 182, 49, 0.35); }
.admin-body select { text-overflow: ellipsis; }
.admin-body textarea { width: 100%; font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; }
.admin-body code { font-family: var(--mono); font-size: 0.85em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 3px; }

.btn, .btn-small {
    display: inline-block; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
    border: 1px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink);
    padding: 0.5rem 1.1rem;
}
.btn-small { padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.btn:hover, .btn-small:hover { background: var(--paper-2); color: var(--ink); }
.admin-body .btn-primary { background: var(--ink); color: var(--paper) !important; border-color: var(--ink); padding: 0.5rem 1.1rem; }
.admin-body .btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-success, .btn-small.btn-success { background: var(--green); border-color: var(--green); color: #fff !important; }
.btn-success:hover { background: #256640 !important; }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red) !important; }
.btn-danger:hover { background: var(--red) !important; color: #fff !important; }
.btn-outline { border: 1px solid var(--rule); padding: 0.4rem 0.9rem; border-radius: 999px; color: var(--ink) !important; background: var(--card); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.btn-outline:hover { border-color: var(--ink); }
.btn-logout { margin-left: 0.5rem; color: var(--red) !important; font-weight: 700; text-decoration: none; }
.btn-icon { background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); padding: 0.15rem 0.35rem; text-decoration: none; border-radius: 3px; }
.btn-icon:hover { background: var(--paper-2); }

.text-green { color: var(--green) !important; }
.text-orange { color: #b26a00 !important; }
.text-red { color: var(--red) !important; }
.text-blue { color: var(--blue) !important; }
.text-muted { color: var(--muted); }

.posts-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.posts-header h2 { margin: 0; font-size: 2.2rem; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.posts-filters { display: flex; gap: 0.4rem; margin: 0 0 1rem; }
.filter-link { padding: 0.35rem 0.9rem; border-radius: 999px; text-decoration: none; font-weight: 600; border: 1px solid var(--rule); background: var(--card); }
.filter-link.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.actions { white-space: nowrap; }

.chart-bar-container { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 1rem; border-bottom: 2px solid var(--ink); }
.chart-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart-bar { width: 100%; background: var(--red); border-radius: 2px 2px 0 0; min-height: 2px; transition: background 0.2s; }
.chart-bar:hover { background: var(--ink); }
.chart-bar-item small { font-size: 0.6rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }

.log-output { max-height: 380px; overflow: auto; font-family: var(--mono); font-size: 0.74rem; background: var(--paper); border: 1px solid var(--rule); padding: 1rem; border-radius: var(--radius); white-space: pre-wrap; word-break: break-word; margin: 0; }

.form-row { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; min-width: 0; }
.form-row label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.form-row input:not([type=checkbox]):not([type=radio]),
.form-row select,
.form-row textarea { width: 100%; max-width: 100%; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form input[type=text] { flex: 1; min-width: 200px; }

.alert { padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem; border-left: 4px solid; }
.alert-warning { background: #fdf3da; border-color: var(--gold); }
.alert-success { background: #e4f3e9; border-color: var(--green); }

.amazon-form { margin-top: 0.5rem; flex-wrap: wrap; align-items: center; }
.product-edit-card img { width: 84px; height: 84px; object-fit: contain; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; padding: 4px; }
.admin-body details summary { cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 0.9rem; }
/* Escolha de foto (produto e capa): a escolhida fica com borda vermelha. */
.pic-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.pic-option { position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer; }
.pic-option input { position: absolute; opacity: 0; pointer-events: none; }
.pic-picker .pic-option img { display: block; width: 64px; height: 64px; object-fit: contain; background: #fff; border: 2px solid var(--rule); border-radius: var(--radius); padding: 2px; }
.pic-option input:checked + img, .pic-option.is-picked img { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.rank-move { font-size: 0.78rem; font-weight: 700; margin-left: 0.3rem; }
.edit-save-bar { position: sticky; bottom: 0; margin: 0; padding: 0.75rem 0; background: var(--paper); border-top: 1px solid var(--rule); }
.skip-item { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }

@media (max-width: 900px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 0.75rem 1rem; position: static; height: auto; overflow-y: visible; align-self: auto; }
    .admin-logo { margin-bottom: 0.5rem; }
    .admin-nav ul { flex-direction: row; flex-wrap: wrap; }
    .dashboard-grid, .form-grid { grid-template-columns: 1fr; }
    .admin-content { padding: 1rem; overflow-x: auto; }
    .admin-header { padding: 0.75rem 1rem; }
}

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.login-box { width: 100%; max-width: 400px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 2.2rem; box-shadow: 8px 8px 0 var(--ink); }
.login-box .logo-mark { margin: 0 auto 1rem; }
.login-box h1 { text-align: center; font-size: 1.8rem; margin-bottom: 1.5rem; }
.login-box .form-row input { width: 100%; }
.login-box .btn-primary { width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 800; padding: 0.8rem; }
.error-msg { color: var(--red); margin-top: 1rem; text-align: center; font-weight: 600; min-height: 1.2em; }

/* Admin: .env form */
.env-form fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 0 0 1rem; }
.env-form legend { font-weight: 600; padding: 0 0.3rem; }
.env-form label { display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.7rem; }
.env-form input[type=text], .env-form input[type=password] { width: 100%; box-sizing: border-box; }
.env-form .env-clear { display: flex; align-items: center; gap: 0.3rem; margin: 0; }

/* --- Pagination & Data Tables --- */
.pager {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 0; font-size: 0.9rem;
}
.pager-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pager-btns { display: flex; align-items: center; gap: 0.25rem; }
.pager-btns button {
    background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
    padding: 0.3rem 0.6rem; cursor: pointer; color: var(--ink); font-weight: 700;
}
.pager-btns button:hover:not(:disabled) { background: var(--paper-2); border-color: var(--ink); }
.pager-btns button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager-page-info { font-weight: 600; margin: 0 0.5rem; color: var(--ink-2); }
.pager-select { padding: 0.3rem 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; }
.pg-off { display: none !important; }

@media (max-width: 600px) {
    .pager { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .pager-controls { width: 100%; justify-content: space-between; }
}

/* Ajustes Sticky Table Header */
.admin-table thead th { position: sticky; top: 64px; background: var(--card); z-index: 5; }

/* Table scroll wrapper (overflow-x remove sticky no header) */
.table-scroll { overflow-x: visible; }
@media (max-width: 1099px) {
    .table-scroll { overflow-x: auto; }
}

/* Task Status Dropdown */
.task-status { position: relative; }
.task-status .task-dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 300px; max-width: 90vw; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 100; }
.task-status.open .task-dropdown-menu { display: block; }

/* Task status button, spinner and toasts */
.task-status-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--rule); background: var(--card); color: var(--ink); max-width: 320px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.task-status-btn:hover { background: var(--paper-2); }
.task-status-btn.in-progress { border-color: var(--ink); }
.task-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--rule); border-top-color: var(--ink); border-radius: 50%; animation: task-spin 1s linear infinite; flex-shrink: 0; }
@keyframes task-spin { to { transform: rotate(360deg); } }
.task-dropdown-menu { padding: 0.5rem 0; max-height: 400px; overflow-y: auto; }
.task-dropdown-group { padding: 0.4rem 1rem 0.2rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.task-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 1rem; font-size: 0.85rem; }
.task-item .task-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item .task-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.75rem; }
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 9999; }
.toast { background: var(--card); border: 1px solid var(--ink); border-radius: var(--radius); padding: 0.7rem 1.1rem; font-size: 0.9rem; font-weight: 600; box-shadow: 4px 4px 0 var(--ink); transition: opacity 0.3s; }
.toast-success { border-left: 4px solid var(--green); }
.toast-error { border-left: 4px solid var(--red); }
.toast.fade-out { opacity: 0; }

/* ==========================================================================
   Tema noturno (html[data-theme="dark"]), escolhido pelo botão do cabeçalho
   (site e admin) e lembrado em localStorage. Padrão: preferência do sistema.
   Anúncios (AdSense): nenhuma regra aqui toca em .ad-slot / <ins> / iframes.
   ========================================================================== */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] {
    --edge: #4b4337;
    --paper: #15130f;
    --paper-2: #26221c;
    --card: #1e1b16;
    --ink: #ece4d4;
    --ink-2: #c4b9a6;
    --muted: #92877a;
    --rule: #3a342b;
    --rule-strong: #ece4d4;
    --red: #ef5a43;
    --red-dark: #ff7a64;
    --gold: #f2b631;
    --green: #5cc283;
    --blue: #6aa6ec;
    --shadow: 0 1px 0 var(--rule), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
}
html[data-theme="dark"] body { background-image: none; }
html[data-theme="dark"] .admin-body input,
html[data-theme="dark"] .admin-body select,
html[data-theme="dark"] .admin-body textarea { background: #12100d; }
html[data-theme="dark"] .admin-body input:focus,
html[data-theme="dark"] .admin-body select:focus,
html[data-theme="dark"] .admin-body textarea:focus { box-shadow: 0 0 0 3px rgba(242, 182, 49, 0.3); }
html[data-theme="dark"] .admin-body .badge-success { background: #1d3a2a; }
html[data-theme="dark"] .admin-body .badge-warning { background: #4a3912; color: #f2c766; }
html[data-theme="dark"] .admin-body .badge-danger { background: #4a2019; }
html[data-theme="dark"] .admin-body .badge-ai { background: #25285a; color: #c7d2fe; border-color: #3b3f8a; }
html[data-theme="dark"] .admin-body .alert-warning { background: #3a2f12; }
html[data-theme="dark"] .admin-body .alert-success { background: #17301f; }
html[data-theme="dark"] .admin-body .text-orange,
html[data-theme="dark"] .admin-body .notification.is-unread.priority-high { color: #f0a431 !important; border-left-color: #f0a431; }
html[data-theme="dark"] .admin-body .btn-danger { background: transparent; }
html[data-theme="dark"] .admin-body .btn-success:hover { background: #4aa86d !important; }
html[data-theme="dark"] .admin-body .btn-primary { color: #15130f !important; }
html[data-theme="dark"] .admin-body .btn-primary:hover { color: #fff !important; }
html[data-theme="dark"] .admin-body .product-edit-card img,
html[data-theme="dark"] .admin-body .pic-picker .pic-option img { background: #fff; }
/* estilos inline de topics.html / links.html */
html[data-theme="dark"] .admin-body [style*="border: 1px solid #ccc"] { border-color: var(--rule) !important; }
html[data-theme="dark"] .admin-body [style*="border-color: #0d6efd"] { border-color: var(--blue) !important; }

/* ---- site público ---- */
/* Fotos de produto têm fundo branco e usam multiply: caixa branca em vez de preta. */
html[data-theme="dark"] .post-cover,
html[data-theme="dark"] .post-cover-figure,
html[data-theme="dark"] .product-image,
html[data-theme="dark"] .highlight-img,
html[data-theme="dark"] .hub-card img { background: #fff; }
html[data-theme="dark"] .hub-card img { border-radius: var(--radius); }
html[data-theme="dark"] .post-cover { border-color: var(--rule); }
/* Sombras "carimbo": em vez de cream sólido, um tom de borda discreto. */
html[data-theme="dark"] .logo-mark,
html[data-theme="dark"] .hero-numeral::after,
html[data-theme="dark"] .search-bar form,
html[data-theme="dark"] .btn-load-more,
html[data-theme="dark"] .main-nav .dropdown-menu,
html[data-theme="dark"] .btn-cta { box-shadow: 3px 3px 0 var(--edge); }
html[data-theme="dark"] .btn-load-more:hover,
html[data-theme="dark"] .btn-cta:hover { box-shadow: 5px 5px 0 var(--edge); }
html[data-theme="dark"] .login-box { box-shadow: 8px 8px 0 var(--edge); }
html[data-theme="dark"] .search-bar form,
html[data-theme="dark"] .highlight-card,
html[data-theme="dark"] .quick-list,
html[data-theme="dark"] .main-nav .dropdown-menu { border-color: var(--edge); }
html[data-theme="dark"] .btn-cta { background: #c93a25; border-color: var(--edge); }
html[data-theme="dark"] .btn-cta:hover { background: #e04830; }
html[data-theme="dark"] .quick-list { box-shadow: 6px 6px 0 rgba(242, 182, 49, 0.55); }
html[data-theme="dark"] .post-content strong { background: linear-gradient(transparent 62%, rgba(242, 182, 49, 0.28) 62%); }
html[data-theme="dark"] .niche-badge { color: #1a1714; }
html[data-theme="dark"] .niche-strip a,
html[data-theme="dark"] .chip { border-color: var(--edge); }
html[data-theme="dark"] .niche-strip a:hover { background: var(--ink); color: var(--paper); }
html[data-theme="dark"] .preview-banner { color: #1a1714; }
html[data-theme="dark"] .site-header { border-bottom-color: var(--edge); }
html[data-theme="dark"] .section-head,
html[data-theme="dark"] .product-comparison > h2 { border-top-color: var(--edge); }
html[data-theme="dark"] .site-footer { background: #0d0b08; color: #b5ab9b; border-top: 1px solid var(--rule); }
html[data-theme="dark"] .disclaimer { border-top-color: var(--rule); }
html[data-theme="dark"] .copyright { color: #857a6c; }
html[data-theme="dark"] .footer-brand .logo-title,
html[data-theme="dark"] .footer-links a { color: var(--ink); }
html[data-theme="dark"] .ad-slot.is-placeholder { background: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(146, 135, 122, 0.08) 10px, rgba(146, 135, 122, 0.08) 20px); }

.theme-toggle { background: var(--card); border: 1px solid var(--rule); border-radius: 999px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ink); }
.theme-toggle:hover { border-color: var(--ink); }
.deals-cta { margin: 1rem 0; font-size: .95rem; }
