/*
Theme Name: Poweredu
Theme URI: https://blog.poweredu.com.br
Description: Tema do Blog Poweredu, no design system Poweredu Web. Leve, sem jQuery. SEO e dados estruturados ficam no plugin Poweredu Core.
Author: Poweredu
Version: 1.0.7
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: poweredu
License: Proprietária
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; scroll-behavior: smooth; }
body { overflow-x: clip; margin: 0; background: var(--pd-bg-page); color: var(--pd-fg-default); font-family: var(--pd-font-sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--pd-fg-brand); text-decoration: none; }
a:hover { color: var(--pd-fg-brand-hover); }
:focus-visible { outline: 2px solid var(--pd-focus-ring); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.005em; margin: 0; }
.screen-reader-text, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 9999; width: auto; height: auto; clip: auto; padding: 8px 16px; background: var(--pd-bg-elevated); border-radius: var(--pd-radius-sm); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
.section { padding-top: var(--pd-space-2xl); padding-bottom: var(--pd-space-2xl); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: var(--pd-space-md); }
.section__title { font-size: 28px; font-weight: 600; }
@media (min-width: 768px) { .section__title { font-size: 32px; } }
.muted { color: var(--pd-fg-secondary); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: var(--pd-z-header); background: var(--pd-bg-page); box-shadow: 0 1px 0 0 var(--pd-stroke-default); }
.site-header__inner { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.site-header .pd-logo { color: var(--pd-fg-default); }
.site-header .pd-logo__icon { color: var(--pd-fg-brand); }
.pd-logo__text small { font-weight: 500; color: var(--pd-fg-secondary); margin-left: 6px; font-size: .7em; letter-spacing: 0; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav li a, .site-nav__parent { display: flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 12px; border: 0; border-radius: var(--pd-radius-md); background: transparent; color: var(--pd-fg-default); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.site-nav li a:hover, .site-nav__parent:hover, .site-nav .current-cat a { background: var(--pd-bg-hover); }
/* Submenu "Categorias": abre no hover ou no clique/toque (classe is-open via JS). */
.has-sub { position: relative; }
.site-nav .sub-menu { display: flex; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; position: absolute; top: 100%; left: 0; z-index: var(--pd-z-dropdown); min-width: 280px; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--pd-radius-lg); background: var(--pd-bg-elevated); box-shadow: 0 0 0 1px var(--pd-stroke-default), var(--pd-shadow-2); }
.has-sub:hover .sub-menu, .has-sub.is-open .sub-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.site-nav__parent svg { transition: transform .2s ease; }
.has-sub:hover .site-nav__parent svg, .has-sub.is-open .site-nav__parent svg { transform: rotate(180deg); }
.site-header__actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--pd-radius-full); background: transparent; color: var(--pd-fg-default); cursor: pointer; }
.icon-btn:hover { background: var(--pd-bg-hover); }
.theme-icon-dark, [data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
.menu-toggle { display: none; }
.header-cta { margin-left: 8px; }
@media (max-width: 1199px) { .site-header__actions .header-cta { display: none; } }
@media (max-width: 991px) {
	.menu-toggle { display: inline-flex; }
	.site-header__actions .header-cta { display: none; }
	/* Gaveta escondida com display (e não com transform fora da tela, que criava rolagem horizontal). */
	.site-nav { display: none; position: fixed; inset: 72px 0 0 0; margin: 0; background: var(--pd-bg-page); padding: 16px; overflow-y: auto; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; }
	.site-nav li a, .site-nav__parent { font-size: 18px; padding: 14px 12px; }
	.site-nav__parent { pointer-events: none; color: var(--pd-fg-secondary); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
	.site-nav__parent svg { display: none; }
	.site-nav .sub-menu { display: flex; opacity: 1; visibility: visible; transform: none; transition: none; position: static; min-width: 0; padding: 0; box-shadow: none; background: none; }
	.site-nav .header-cta { display: inline-flex; margin: 16px 0 0; width: 100%; }
	.site-header__actions { margin-left: auto; }
}
@media (min-width: 992px) { .site-nav .header-cta { display: none; } }

/* Busca */
.search-panel { display: none; padding: 16px 0 20px; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form .pd-input { flex: 1 1 260px; }
.search-form select { min-height: 48px; padding: 0 12px; border: 0; border-radius: var(--pd-radius-sm); box-shadow: 0 0 0 1px var(--pd-stroke-default); background: var(--pd-bg-page); color: var(--pd-fg-default); font: inherit; font-size: 14px; }

/* Progresso de leitura */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--pd-gradient-brand); z-index: calc(var(--pd-z-header) + 1); }

/* ---------- Slider ---------- */
.hero { padding-top: var(--pd-space-md); }
.slider { position: relative; }
.slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; gap: 16px; scrollbar-width: none; border-radius: var(--pd-radius-lg); }
.slider__track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; border-radius: var(--pd-radius-lg); overflow: hidden; background: var(--pd-gradient-night); color: var(--pd-neutral-0); min-height: 420px; display: flex; align-items: flex-end; }
.slide__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(47,5,73,.92) 100%); }
.slide__body { position: relative; z-index: 1; padding: var(--pd-space-md); max-width: 760px; }
@media (min-width: 768px) { .slide { min-height: 480px; } .slide__body { padding: var(--pd-space-2xl); } }
.slide__title { font-size: 28px; font-weight: 600; margin: 12px 0; }
.slide__title a { color: inherit; }
@media (min-width: 992px) { .slide__title { font-size: 40px; } }
.slide__excerpt { margin: 0 0 20px; opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slider__nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.slider__dots { display: flex; gap: 6px; margin-right: auto; }
.slider__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: var(--pd-radius-full); background: var(--pd-stroke-default); cursor: pointer; }
.slider__dot[aria-current="true"] { background: var(--pd-bg-brand); width: 28px; }

/* ---------- Chips de categoria ---------- */
.cat-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip .pd-chip { white-space: nowrap; color: var(--pd-fg-default); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: var(--pd-space-md); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--pd-radius-lg); background: var(--pd-bg-elevated); box-shadow: 0 0 0 1px var(--pd-stroke-default); overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: 0 0 0 1px var(--pd-stroke-default), var(--pd-shadow-2); transform: translateY(-2px); }
.card__media { aspect-ratio: 16/9; background: var(--pd-gradient-deep); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: var(--pd-space-md); flex: 1; }
.card__title { font-size: 20px; font-weight: 600; line-height: 28px; }
.card__title a { color: var(--pd-fg-default); }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* card inteiro clicável */
.card__excerpt { margin: 0; color: var(--pd-fg-secondary); font-size: 14px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .pd-badge { position: relative; z-index: 1; align-self: flex-start; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--pd-fg-secondary); font-size: 13px; margin-top: auto; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.slide .pd-badge { background: rgba(255,255,255,.18); color: var(--pd-neutral-0); }
.slide .meta { color: rgba(255,255,255,.85); margin: 0 0 20px; }

/* Paginação */
.pagination { margin-top: var(--pd-space-xl); }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: var(--pd-radius-md); color: var(--pd-fg-default); font-weight: 600; box-shadow: 0 0 0 1px var(--pd-stroke-default); }
.pagination .page-numbers.current { background: var(--pd-bg-brand); color: var(--pd-fg-on-brand); box-shadow: none; }
.pagination a.page-numbers:hover { background: var(--pd-bg-hover); }

/* Cabeçalho de arquivo */
.archive-head { padding-top: var(--pd-space-2xl); padding-bottom: var(--pd-space-md); }
.archive-head h1 { font-size: 32px; font-weight: 600; margin: 8px 0; }
@media (min-width: 768px) { .archive-head h1 { font-size: 46px; } }
.archive-head__intro { max-width: 720px; color: var(--pd-fg-secondary); font-size: 18px; }
.archive-head__intro p { margin: 0 0 8px; }
.archive-head .search-form { margin-top: 16px; max-width: 720px; }
.empty { padding: var(--pd-space-2xl) 0; text-align: center; color: var(--pd-fg-secondary); }

/* ---------- CTA ---------- */
.cta { border-radius: var(--pd-radius-lg); background: var(--pd-gradient-brand); color: var(--pd-neutral-0); padding: var(--pd-space-lg) var(--pd-space-md); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
@media (min-width: 768px) { .cta { padding: var(--pd-space-2xl); } }
.cta h2 { font-size: 26px; font-weight: 600; margin: 0 0 6px; }
.cta p { margin: 0; opacity: .9; max-width: 560px; }

/* ---------- Artigo ---------- */
.article { padding-top: var(--pd-space-lg); padding-bottom: var(--pd-space-2xl); }
/* Artigo ocupa a largura toda da tela, com 20px de respiro nas laterais. */
.article.container { max-width: none; padding-left: 20px; padding-right: 20px; }
.article__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
@media (min-width: 1200px) { .article__layout.has-toc { grid-template-columns: minmax(0, 1fr) 280px; } }
.breadcrumbs { font-size: 13px; color: var(--pd-fg-secondary); margin-bottom: 16px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; }
.breadcrumbs a { color: var(--pd-fg-secondary); }
.article__title { font-size: 34px; line-height: 42px; font-weight: 600; margin: 12px 0 16px; }
@media (min-width: 992px) { .article__title { font-size: 44px; line-height: 52px; } }
.article__byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--pd-fg-secondary); font-size: 14px; margin-bottom: 24px; }
.article__byline .author-mini { display: inline-flex; align-items: center; gap: 8px; color: var(--pd-fg-default); font-weight: 600; }
.article__byline img { width: 32px; height: 32px; border-radius: var(--pd-radius-full); }
.article__cover { margin: 0 0 24px; border-radius: var(--pd-radius-lg); overflow: hidden; aspect-ratio: 16/9; background: var(--pd-gradient-deep); }
.article__cover img { width: 100%; height: 100%; object-fit: cover; }
.summary-box { margin: 0 0 24px; }
.summary-box .pd-card__title { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--pd-fg-brand); }
.summary-box p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--pd-fg-default); }

/* Sumário */
.toc { border-radius: var(--pd-radius-lg); box-shadow: 0 0 0 1px var(--pd-stroke-default); margin: 0 0 32px; }
.toc summary { cursor: pointer; padding: 14px 20px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 0; padding: 0 20px 16px 40px; font-size: 15px; }
.toc li { margin: 6px 0; }
.toc a { color: var(--pd-fg-secondary); }
.toc a.is-active { color: var(--pd-fg-brand); font-weight: 600; }
.toc--side { display: none; }
@media (min-width: 1200px) {
	.toc--side { display: block; position: sticky; top: var(--pd-toc-top, 104px); align-self: start; box-shadow: none; } /* --pd-toc-top vem do JS: índice longo rola até o fim e só então trava */
	.toc--side summary { pointer-events: none; padding-left: 0; }
	.toc--side ol { padding-left: 18px; }
	.toc--inline { display: none; }
}

/* Conteúdo do artigo (prosa) */
.prose { font-size: 18px; line-height: 1.75; }
.prose > * { margin: 0 0 1.2em; }
.prose h2 { font-size: 28px; line-height: 36px; font-weight: 600; margin: 2em 0 .6em; }
.prose h3 { font-size: 22px; line-height: 30px; font-weight: 600; margin: 1.6em 0 .5em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--pd-fg-brand); }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; box-shadow: inset 3px 0 0 var(--pd-bg-brand); font-size: 20px; }
.prose img, .prose figure { border-radius: var(--pd-radius-lg); }
.prose figcaption { font-size: 14px; color: var(--pd-fg-secondary); text-align: center; margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; text-align: left; box-shadow: inset 0 -1px 0 var(--pd-stroke-default); }
.prose th { background: var(--pd-bg-secondary); font-weight: 600; }
.prose code { font-family: var(--pd-font-mono); font-size: .9em; background: var(--pd-bg-secondary); padding: 2px 6px; border-radius: var(--pd-radius-xs); }
.prose pre { overflow-x: auto; padding: 16px; border-radius: var(--pd-radius-sm); background: var(--pd-bg-secondary); }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; height: 1px; background: var(--pd-stroke-default); margin: 2.5em 0; }
.prose details { border-radius: var(--pd-radius-md); box-shadow: 0 0 0 1px var(--pd-stroke-default); padding: 0 20px; margin: 0 0 12px; }
.prose details summary { cursor: pointer; padding: 16px 0; font-weight: 600; }
.prose details[open] summary { box-shadow: 0 1px 0 var(--pd-stroke-default); margin-bottom: 12px; }
.prose .alignwide { margin-left: calc(50% - min(560px, 50vw - 16px)); margin-right: calc(50% - min(560px, 50vw - 16px)); }
.prose .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; border-radius: 0; }
.prose .aligncenter { margin-left: auto; margin-right: auto; }
.wp-block-image img { border-radius: var(--pd-radius-lg); }

/* Rodapé do artigo */
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 24px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 0; box-shadow: 0 1px 0 var(--pd-stroke-default), 0 -1px 0 var(--pd-stroke-default); margin-bottom: 32px; }
.share strong { margin-right: auto; font-size: 14px; }
.article__cta { margin: 0 0 32px; }
.author-box { display: flex; gap: 20px; align-items: flex-start; margin: 0 0 40px; }
.author-box img { width: 80px; height: 80px; border-radius: var(--pd-radius-full); flex-shrink: 0; object-fit: cover; }
.author-box h2 { font-size: 20px; margin: 0; }
.author-box__role { color: var(--pd-fg-secondary); font-size: 14px; margin: 2px 0 8px; }
.author-box p { margin: 0 0 8px; font-size: 15px; }
.author-box__links { display: flex; gap: 12px; font-size: 14px; font-weight: 600; }
.related { padding: var(--pd-space-2xl) 0; background: var(--pd-bg-secondary); }

/* Comentários */
.comments { margin-top: 8px; }
.comments h2 { font-size: 24px; margin-bottom: 16px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; box-shadow: 0 1px 0 var(--pd-stroke-default); }
.comment-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comment-meta img { border-radius: var(--pd-radius-full); }
.comment-metadata a { color: var(--pd-fg-secondary); }
.comment-content { font-size: 16px; }
.reply a { font-size: 14px; font-weight: 600; }
.comment-form { display: grid; gap: 16px; }
.comment-form p { margin: 0; }
.comment-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea { width: 100%; padding: 12px 16px; border: 0; border-radius: var(--pd-radius-sm); box-shadow: 0 0 0 1px var(--pd-stroke-default); background: var(--pd-bg-page); color: var(--pd-fg-default); font: inherit; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--pd-focus-ring); }
.comment-form .form-submit input { font: inherit; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.comment-form-cookies-consent label { font-weight: 400; }
.comment-notes, .logged-in-as { font-size: 14px; color: var(--pd-fg-secondary); }

/* ---------- Rodapé ---------- */
.site-footer { background: var(--pd-bg-strongest); color: var(--pd-neutral-0); padding: var(--pd-space-3xl) 0 var(--pd-space-md); margin-top: var(--pd-space-2xl); }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--pd-neutral-0); }
.site-footer .pd-logo, .site-footer .pd-logo__icon { color: var(--pd-neutral-0); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; color: rgba(255,255,255,.7); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.footer-about { max-width: 380px; color: rgba(255,255,255,.8); font-size: 15px; }
.footer-bottom { margin-top: 48px; padding-top: 20px; box-shadow: 0 -1px 0 rgba(255,255,255,.15); font-size: 13px; color: rgba(255,255,255,.7); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Aviso de cookies ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: var(--pd-z-modal); max-width: 560px; margin: 0 auto; padding: 20px; border-radius: var(--pd-radius-lg); background: var(--pd-bg-elevated); box-shadow: 0 0 0 1px var(--pd-stroke-default), var(--pd-shadow-3); font-size: 14px; }
.cookie-banner p { margin: 0 0 12px; }
.cookie-banner div { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* 404 */
.not-found { text-align: center; padding-top: var(--pd-space-4xl); padding-bottom: var(--pd-space-4xl); }
.not-found h1 { font-size: 46px; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
