/*
Theme Name: PortalNews
Theme URI:
Description: Tema profissional de notícias dinâmico e moderno
Author: Seu Nome
Version: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: portalnews
Tags: news, blog, custom-logo, custom-menu, featured-images, responsive-layout
*/

:root {
    --pn-primary: #1A202C;
    --pn-secondary: #3182CE;
    --pn-accent: #E53E3E;
    --pn-bg: #F7FAFC;
    --pn-surface: #FFFFFF;
    --pn-surface-muted: #EDF2F7;
    --pn-text: #1A202C;
    --pn-text-muted: #718096;
    --pn-border: #E2E8F0;
    --pn-shadow: 0 12px 30px rgba(26, 32, 44, .08);
    --pn-radius: 14px;
    --pn-container: 1180px;
    --pn-transition: 180ms ease;
}

html { box-sizing: border-box; scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; background: var(--pn-bg); color: var(--pn-text); font-family: 'Roboto', system-ui, sans-serif; font-size: 16px; line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--pn-secondary); text-decoration: none; transition: color var(--pn-transition), opacity var(--pn-transition); }
a:hover { color: var(--pn-accent); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .65em; color: var(--pn-text); font-family: 'Inter', system-ui, sans-serif; line-height: 1.2; }
p { margin: 0 0 1.25em; }
blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--pn-secondary); background: var(--pn-surface-muted); }
figure { margin: 0; }

body.dark-mode {
    --pn-primary: #F7FAFC;
    --pn-bg: #1A202C;
    --pn-surface: #2D3748;
    --pn-surface-muted: #4A5568;
    --pn-text: #F7FAFC;
    --pn-text-muted: #CBD5E0;
    --pn-border: #4A5568;
    --pn-shadow: 0 12px 30px rgba(0, 0, 0, .24);
}

.container { width: min(calc(100% - 2rem), var(--pn-container)); margin-inline: auto; }
.row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.col { flex: 1 1 0; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { z-index: 100000; top: 5px; left: 5px; width: auto; height: auto; padding: .75rem 1rem; margin: 0; clip: auto; background: var(--pn-surface); color: var(--pn-text); }
.text-muted { color: var(--pn-text-muted); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin-bottom: 0; font-size: clamp(1.45rem, 2vw, 2rem); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .65rem 1rem; border: 1px solid transparent; border-radius: 999px; background: var(--pn-secondary); color: #fff; font-weight: 700; transition: transform var(--pn-transition), background var(--pn-transition), box-shadow var(--pn-transition); }
.button:hover, .button:focus { background: var(--pn-accent); color: #fff; transform: translateY(-2px); box-shadow: var(--pn-shadow); }
.button--ghost { border-color: var(--pn-border); background: transparent; color: var(--pn-text); }
.button--ghost:hover, .button--ghost:focus { border-color: var(--pn-secondary); background: var(--pn-secondary); }
:focus-visible { outline: 3px solid var(--pn-accent); outline-offset: 3px; }

.site-header { position: sticky; z-index: 20; top: 0; background: color-mix(in srgb, var(--pn-surface) 94%, transparent); border-bottom: 1px solid var(--pn-border); backdrop-filter: blur(14px); }
.header-main { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.site-branding { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.custom-logo { max-height: 48px; width: auto; }
.site-title { color: var(--pn-text); font-family: 'Inter', sans-serif; font-size: 1.35rem; font-weight: 900; letter-spacing: -.04em; }
.site-description { display: none; }
.main-navigation { display: none; }
.main-navigation ul { display: flex; align-items: center; gap: 1.1rem; margin: 0; padding: 0; list-style: none; }
.main-navigation a { color: var(--pn-text); font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 700; }
.main-navigation a:hover { color: var(--pn-secondary); }
.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-button, .menu-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--pn-border); border-radius: 50%; background: transparent; color: var(--pn-text); font-size: 1.1rem; transition: background var(--pn-transition), color var(--pn-transition), transform var(--pn-transition); }
.icon-button:hover, .menu-toggle:hover { background: var(--pn-secondary); color: #fff; transform: translateY(-2px); }
.menu-toggle { display: inline-grid; }
.mobile-menu { display: none; padding: 1rem 0; border-top: 1px solid var(--pn-border); }
.mobile-menu.is-open { display: block; animation: pn-fade-in .2s ease; }
.mobile-menu ul { margin: 0; padding: 0; list-style: none; }
.mobile-menu li + li { border-top: 1px solid var(--pn-border); }
.mobile-menu a { display: block; padding: .7rem 0; color: var(--pn-text); font-weight: 700; }
.search-panel { display: none; padding: 1rem 0; border-top: 1px solid var(--pn-border); }
.search-panel.is-open { display: block; }
.search-panel form { display: flex; gap: .5rem; }
.search-panel input, .search-form input, .filter-form select { width: 100%; min-height: 44px; padding: .65rem .8rem; border: 1px solid var(--pn-border); border-radius: 8px; background: var(--pn-bg); color: var(--pn-text); }
.live-search-results { position: absolute; z-index: 5; width: min(100% - 2rem, 700px); margin-top: .4rem; border: 1px solid var(--pn-border); border-radius: 10px; background: var(--pn-surface); box-shadow: var(--pn-shadow); }
.live-search-results:empty { display: none; }
.live-search-results a { display: block; padding: .65rem .8rem; color: var(--pn-text); }
.live-search-results a:hover { background: var(--pn-surface-muted); }

.site-main { min-height: 60vh; padding: 2rem 0 4rem; }
.hero { margin-bottom: 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.hero-card { position: relative; min-height: 300px; overflow: hidden; border-radius: var(--pn-radius); background: var(--pn-primary); box-shadow: var(--pn-shadow); }
.hero-card::after { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(0, 0, 0, .78)); content: ''; }
.hero-card img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; transition: transform .5s ease; }
.hero-card:hover img { transform: scale(1.04); }
.hero-card__body { position: absolute; z-index: 1; right: 1.25rem; bottom: 1.25rem; left: 1.25rem; color: #fff; }
.hero-card__body h2 { max-width: 700px; margin: .35rem 0; color: #fff; font-size: clamp(1.45rem, 4vw, 2.8rem); }
.hero-card__body a { color: #fff; }
.hero-card__meta, .post-meta { display: flex; flex-wrap: wrap; gap: .45rem .8rem; color: var(--pn-text-muted); font-size: .83rem; }
.hero-card__meta { color: rgba(255, 255, 255, .82); }
.hero-dots { display: flex; justify-content: center; gap: .4rem; margin-top: .8rem; }
.hero-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--pn-border); }
.hero-dot.is-active { width: 24px; border-radius: 999px; background: var(--pn-secondary); }

.content-with-sidebar { display: grid; gap: 2rem; }
.news-grid, .archive-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.post-card { overflow: hidden; border: 1px solid var(--pn-border); border-radius: var(--pn-radius); background: var(--pn-surface); box-shadow: 0 4px 16px rgba(26, 32, 44, .04); transition: transform var(--pn-transition), box-shadow var(--pn-transition); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--pn-shadow); }
.post-card__image { aspect-ratio: 16 / 10; overflow: hidden; background: var(--pn-surface-muted); }
.image-placeholder { width: 100%; height: 100%; min-height: 180px; background: linear-gradient(135deg, var(--pn-secondary), var(--pn-primary)); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.post-card:hover .post-card__image img { transform: scale(1.05); }
.post-card__body { padding: 1rem; }
.post-card__body h3 { margin: .35rem 0 .5rem; font-size: 1.12rem; }
.post-card__body h3 a { color: var(--pn-text); }
.post-card__body h3 a:hover { color: var(--pn-secondary); }
.post-card__excerpt { margin-bottom: 0; color: var(--pn-text-muted); font-size: .92rem; }
.post-card--featured { grid-column: span 1; }
.post-card--featured h3 { font-size: 1.45rem; }
.sidebar { display: grid; align-content: start; gap: 1rem; }
.widget, .ad-placeholder { padding: 1.1rem; border: 1px solid var(--pn-border); border-radius: var(--pn-radius); background: var(--pn-surface); }
.widget-title { margin-bottom: .8rem; font-size: 1.05rem; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li + li { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--pn-border); }
.widget a { color: var(--pn-text); font-weight: 700; }
.popular-list a { display: flex; gap: .7rem; align-items: start; }
.popular-list__number { color: var(--pn-accent); font-family: 'Inter', sans-serif; font-size: 1.4rem; font-weight: 900; line-height: 1; }
.ad-placeholder { display: grid; min-height: 180px; place-items: center; border-style: dashed; color: var(--pn-text-muted); text-align: center; }
.infinite-loader { min-height: 24px; margin: 1.5rem; text-align: center; color: var(--pn-text-muted); }

.archive-header { margin-bottom: 1.5rem; }
.archive-header h1 { margin-bottom: .35rem; font-size: clamp(2rem, 5vw, 3.5rem); }
.filter-form { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }
.filter-form select { width: auto; min-width: 180px; }
.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination a, .pagination span { display: inline-grid; min-width: 40px; min-height: 40px; place-items: center; padding: .3rem .65rem; border: 1px solid var(--pn-border); border-radius: 8px; background: var(--pn-surface); color: var(--pn-text); }
.pagination .current, .pagination a:hover { border-color: var(--pn-secondary); background: var(--pn-secondary); color: #fff; }

.article-header { max-width: 850px; margin: 0 auto 1.5rem; }
.article-header h1 { font-size: clamp(2.15rem, 5vw, 4rem); }
.article-featured-image { max-width: 1000px; margin: 0 auto 2rem; overflow: hidden; border-radius: var(--pn-radius); }
.article-featured-image img { width: 100%; }
.article-layout { display: grid; gap: 2rem; }
.article-content { min-width: 0; font-size: 1.06rem; }
.article-content > * { max-width: 760px; margin-right: auto; margin-left: auto; }
.article-content > .alignwide { max-width: 1000px; }
.article-content > .alignfull { max-width: none; }
.article-content .wp-block-image img { border-radius: 10px; }
.article-stats { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }
.stat-chip { padding: .45rem .7rem; border-radius: 999px; background: var(--pn-surface-muted); color: var(--pn-text-muted); font-size: .86rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0; }
.share-buttons a { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .8rem; border-radius: 8px; background: var(--pn-surface-muted); color: var(--pn-text); font-size: .9rem; font-weight: 700; }
.share-buttons a:hover { background: var(--pn-secondary); color: #fff; }
.author-box { display: flex; gap: 1rem; align-items: center; margin: 2rem 0; padding: 1rem; border: 1px solid var(--pn-border); border-radius: var(--pn-radius); background: var(--pn-surface); }
.author-box .avatar { border-radius: 50%; }
.author-box h2 { margin-bottom: .25rem; font-size: 1.15rem; }
.author-box p { margin-bottom: 0; color: var(--pn-text-muted); font-size: .9rem; }
.related-posts { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--pn-border); }
.comments-area { max-width: 760px; margin: 2.5rem auto 0; padding-top: 2rem; border-top: 1px solid var(--pn-border); }
.comment-list { margin: 0; padding: 0; list-style: none; }
.comment-list .comment { margin: 1rem 0; padding: 1rem; border: 1px solid var(--pn-border); border-radius: 10px; background: var(--pn-surface); }
.comment-author { display: flex; gap: .7rem; align-items: center; }
.comment-author .avatar { border-radius: 50%; }
.comment-metadata { font-size: .8rem; }
.comment-content { margin-top: .6rem; }
.comment-reply-link { font-size: .85rem; font-weight: 700; }
.comment-form input, .comment-form textarea { width: 100%; margin-bottom: .75rem; padding: .65rem .8rem; border: 1px solid var(--pn-border); border-radius: 8px; background: var(--pn-bg); color: var(--pn-text); }

.site-footer { padding: 3rem 0 1.25rem; background: var(--pn-primary); color: #CBD5E0; }
.site-footer h2, .site-footer a, .site-footer .site-title { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; }
.footer-widgets { min-height: 80px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .16); font-size: .88rem; }
.social-menu ul { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0; padding: 0; list-style: none; }

@keyframes pn-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 700px) {
    .main-navigation { display: block; }
    .menu-toggle { display: none; }
    .hero-grid { grid-template-columns: 1.45fr 1fr; }
    .hero-card:first-child { grid-row: span 2; }
    .hero-card:first-child img, .hero-card:first-child { min-height: 420px; }
    .news-grid, .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-card--featured { grid-column: span 2; }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
    .content-with-sidebar { grid-template-columns: minmax(0, 1fr) 300px; }
    .news-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .post-card--featured { grid-column: span 2; }
    .archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .article-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .article-layout .article-content { grid-column: 1; }
    .article-layout .sidebar { grid-column: 2; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
