/*
Theme Name: Porecatu Nativo
Theme URI: https://porecatu.pr.gov.br/
Author: Prefeitura Municipal de Porecatu
Description: Tema institucional leve, responsivo e independente de Elementor, integrado aos módulos nativos do Porecatu Suite.
Version: 1.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: porecatu-nativo
*/

:root {
	--pn-purple: #4625A9;
	--pn-purple-dark: #301576;
	--pn-purple-soft: #f2efff;
	--pn-ink: #172641;
	--pn-muted: #5b6478;
	--pn-line: #e2e7f0;
	--pn-paper: #fff;
	--pn-canvas: #f5f7fb;
	--pn-green: #16874F;
	--pn-radius: 20px;
	--pn-shadow: 0 18px 52px rgba(24, 34, 66, .08);
	--pn-content: 1320px;
}

html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; }
body {
	margin: 0;
	background: var(--pn-canvas);
	color: var(--pn-ink);
	font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
a { color: var(--pn-purple); text-underline-offset: .18em; }
a:hover { color: var(--pn-purple-dark); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #77b7ff; outline-offset: 3px; }
.pn-skip-link {
	position: fixed; z-index: 100000; top: 10px; left: 10px; transform: translateY(-150%);
	padding: 10px 16px; border-radius: 10px; background: var(--pn-ink); color: #fff;
}
.pn-skip-link:focus { transform: translateY(0); color: #fff; }
.pn-site-main { min-height: 46vh; }
.pn-content-wrap { width: min(var(--pn-content), calc(100% - 48px)); margin-inline: auto; }
.pn-page-shell, .pn-archive-shell, .pn-search-shell, .pn-single-shell {
	width: min(var(--pn-content), calc(100% - 48px)); margin: clamp(28px, 5vw, 72px) auto;
}
.pn-page-shell, .pn-article, .pn-archive-card, .pn-search-card {
	border: 1px solid var(--pn-line); border-radius: var(--pn-radius); background: var(--pn-paper); box-shadow: var(--pn-shadow);
}
.pn-page-shell { padding: clamp(24px, 4vw, 56px); }
.pn-page-title, .pn-archive-title, .pn-search-title {
	margin: 0 0 26px; color: var(--pn-ink); font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.08; letter-spacing: -.04em;
}
.pn-entry-content { color: #34415a; }
.pn-entry-content > :first-child { margin-top: 0; }
.pn-entry-content > :last-child { margin-bottom: 0; }
.pn-entry-content h2, .pn-entry-content h3, .pn-entry-content h4 { color: var(--pn-ink); line-height: 1.25; letter-spacing: -.025em; }
.pn-entry-content h2 { margin-top: 2em; font-size: clamp(1.45rem, 2.5vw, 2.1rem); }
.pn-entry-content h3 { margin-top: 1.7em; font-size: 1.35rem; }
.pn-entry-content p, .pn-entry-content li { color: #46536a; }
.pn-entry-content ul, .pn-entry-content ol { padding-left: 1.35em; }
.pn-entry-content blockquote { margin: 1.8em 0; padding: 1.2em 1.5em; border-left: 4px solid var(--pn-purple); border-radius: 0 14px 14px 0; background: var(--pn-purple-soft); }
.pn-entry-content table { width: 100%; border-collapse: collapse; }
.pn-entry-content th, .pn-entry-content td { padding: 12px 14px; border: 1px solid var(--pn-line); text-align: left; }
.pn-entry-content th { background: var(--pn-purple-soft); }
.pn-entry-content figure { margin: 1.5em 0; }
.pn-entry-content .alignwide { width: min(1440px, calc(100vw - 48px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.pn-entry-content .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }

/* Home page: modules keep their own settings and data; the theme only provides structure. */
/* Home: the module owns its background. The theme owns only the section structure.
   The previous theme background + top padding created a purple empty stripe above
   the light service cards after Porecatu Suite 0.9.4 enabled the new home palette. */
.pn-home { overflow: clip; background: var(--pn-canvas); }
.pn-home-section { position: relative; min-width: 0; }
.pn-home-section--hero { display: flow-root; background: #182e72; }
.pn-home-section--hero > * { width: 100%; }
/* Banners Porecatu sets margin-bottom:1.5rem on .bp-area; that margin should
   only space a banner within articles, not separate the homepage sections. */
.pn-home-section--hero .bp-area { margin-block: 0; }
/* Let .pgs-section (and the home identity configuration) draw the background,
   including its own comfortable inner padding. No second colored wrapper. */
.pn-home-section--services { display: flow-root; padding: 0; background: transparent; }
.pn-home-section--news, .pn-home-section--transparency { padding: clamp(24px, 4vw, 56px) 0; }
.pn-home-section--news { background: #fff; }
.pn-home-section--transparency { background: #f4f1ff; }
.pn-home-section--news > *, .pn-home-section--transparency > * {
	width: min(var(--pn-content), calc(100% - 48px)); margin-right: auto; margin-left: auto;
}
/* Elementor's Theme Builder can still inject global parts while its plugin is active. */
body.pn-native-home .elementor-location-header,
body.pn-native-home .elementor-location-footer { display: none !important; }
body.pn-native-home .hpref-header { left: 0 !important; right: auto !important; width: 100vw !important; max-width: 100vw !important; }
.pn-module-missing { width: min(1000px, calc(100% - 40px)); margin: 24px auto; padding: 18px 22px; border: 1px dashed #c6cbe0; border-radius: 14px; color: var(--pn-muted); background: #fff; }

.pn-archive-intro, .pn-search-intro { margin-bottom: 30px; }
.pn-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.pn-archive-card, .pn-search-card { overflow: hidden; }
.pn-card-image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #e8eaf2; }
.pn-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.pn-archive-card:hover .pn-card-image img, .pn-search-card:hover .pn-card-image img { transform: scale(1.035); }
.pn-card-body { padding: 22px; }
.pn-card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px; color: var(--pn-muted); font-size: .84rem; }
.pn-card-title { margin: 0 0 10px; font-size: clamp(1.15rem, 1.6vw, 1.45rem); line-height: 1.3; letter-spacing: -.02em; }
.pn-card-title a { color: var(--pn-ink); text-decoration: none; }
.pn-card-title a:hover { color: var(--pn-purple); }
.pn-card-excerpt { margin: 0; color: var(--pn-muted); }
.pn-pagination { margin-top: 34px; }
.pn-pagination .page-numbers { display: inline-flex; min-width: 42px; min-height: 42px; align-items: center; justify-content: center; margin: 0 4px 4px 0; padding: 8px 12px; border: 1px solid var(--pn-line); border-radius: 12px; background: #fff; text-decoration: none; }
.pn-pagination .current { border-color: var(--pn-purple); background: var(--pn-purple); color: #fff; }

.pn-article { overflow: hidden; }
.pn-article-header { padding: clamp(24px, 4vw, 52px); padding-bottom: 28px; }
.pn-article-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--pn-purple); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pn-article-title { max-width: 1000px; margin: 0 0 18px; color: var(--pn-ink); font-size: clamp(2rem, 5vw, 4rem); line-height: 1.06; letter-spacing: -.045em; }
.pn-article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--pn-muted); font-size: .92rem; }
.pn-article-featured { margin: 0; background: #eceef5; }
.pn-article-featured img { display: block; width: 100%; max-height: 680px; object-fit: contain; background: #f1f2f7; }
.pn-article-content { max-width: 900px; margin: 0 auto; padding: clamp(24px, 5vw, 64px); }
.pn-article-content .pn-entry-content { font-size: 1.08rem; }
.pn-article-content .pn-entry-content p { margin-block: 0 1.3em; }
.pn-article-footer { padding: 0 clamp(24px, 4vw, 52px) 32px; color: var(--pn-muted); }
.pn-article-footer a { font-weight: 700; }
.pn-back-link { display: inline-flex; margin-bottom: 18px; color: var(--pn-purple); font-weight: 700; text-decoration: none; }
.pn-empty-state { padding: 32px; border: 1px dashed var(--pn-line); border-radius: 16px; background: #fff; color: var(--pn-muted); }
.pn-search-form { display: flex; gap: 10px; max-width: 780px; margin: 0 0 34px; }
.pn-search-form input[type="search"] { flex: 1; min-width: 0; min-height: 54px; padding: 12px 16px; border: 1px solid var(--pn-line); border-radius: 14px; background: #fff; }
.pn-search-form button { min-height: 54px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--pn-purple); color: #fff; font-weight: 750; cursor: pointer; }
.pn-search-form button:hover { background: var(--pn-purple-dark); }
.pn-404 { width: min(900px, calc(100% - 48px)); margin: 10vh auto; padding: clamp(32px, 6vw, 72px); border: 1px solid var(--pn-line); border-radius: 28px; background: #fff; text-align: center; box-shadow: var(--pn-shadow); }
.pn-404-code { margin: 0; color: var(--pn-purple); font-size: clamp(4rem, 15vw, 9rem); font-weight: 850; line-height: .9; letter-spacing: -.07em; }
.pn-404-title { margin: 18px 0 8px; font-size: clamp(1.5rem, 4vw, 2.5rem); }
.pn-404-link { display: inline-flex; margin-top: 14px; padding: 12px 20px; border-radius: 12px; background: var(--pn-purple); color: #fff; font-weight: 750; text-decoration: none; }
.pn-404-link:hover { background: var(--pn-purple-dark); color: #fff; }

@media (max-width: 900px) {
	.pn-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	body { font-size: 16px; }
	.pn-content-wrap, .pn-page-shell, .pn-archive-shell, .pn-search-shell, .pn-single-shell { width: min(100% - 28px, var(--pn-content)); }
	.pn-page-shell { margin-block: 20px; padding: 22px 18px; border-radius: 16px; }
	.pn-home-section--news, .pn-home-section--transparency { padding-block: 24px; }
	.pn-home-section--news > *, .pn-home-section--transparency > * { width: calc(100% - 28px); }
	.pn-post-grid { grid-template-columns: 1fr; gap: 16px; }
	.pn-card-body { padding: 18px; }
	.pn-article-header { padding: 24px 20px 18px; }
	.pn-article-featured img { max-height: 520px; }
	.pn-article-content { padding: 24px 20px; }
	.pn-article-footer { padding-inline: 20px; }
	.pn-search-form { flex-direction: column; }
	.pn-search-form button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Porecatu Nativo 1.1.0 - integração com a Suíte (sem regras globais em outros temas) */
body.porecatu-home-identity { --pn-purple:var(--phi-primary,#4625A9); --pn-ink:var(--phi-ink,#172641); --pn-green:var(--phi-green,#16874F); --pn-canvas:var(--phi-background,#F6F7FB); }
body.pn-native-home .pn-home .porecatu-home-manager { width:100%; }
body.pn-native-home .pn-home .porecatu-home-manager > .porecatu-home-section + .porecatu-home-section { margin-block-start:0; }
body.pn-native-home .pn-home .porecatu-home-section { position:relative; min-width:0; }
body.pn-native-home .pn-home .porecatu-home-section--banners { background:#182E72; }
body.pn-native-home .pn-home .porecatu-home-section--banners .bp-area { margin-block:0; }
body.pn-native-home .pn-home .porecatu-home-section--servicos { background:transparent; }
body.pn-native-home .pn-home :is(.porecatu-home-section--noticias,.porecatu-home-section--transparencia,.porecatu-home-section--eventos,.porecatu-home-section--guia,.porecatu-home-section--secretarias) { padding-block:clamp(28px,calc(var(--phi-spacing,72px) * .8),80px); }
body.pn-native-home .pn-home .porecatu-home-section--noticias { background:#fff; }
body.pn-native-home .pn-home .porecatu-home-section--transparencia { background:#F3F0FB; }
body.pn-native-home .pn-home .porecatu-home-section--eventos,body.pn-native-home .pn-home .porecatu-home-section--secretarias { background:#fff; }
body.pn-native-home .pn-home .porecatu-home-section--guia { background:#F6F7FB; }
/* Arquivos, notícias e pesquisa do tema: mesmas variáveis institucionais. */
.pn-article, .pn-archive-card, .pn-search-card, .pn-category-card { transition:box-shadow .18s ease,border-color .18s ease; }
.pn-archive-card:hover,.pn-search-card:hover,.pn-category-card:hover { border-color:#CEC4F2;box-shadow:0 16px 35px rgba(34,27,75,.11); }
.pn-category-toolbar {display:flex; flex-wrap:wrap; align-items:flex-end; gap:14px; margin-bottom:26px; padding:18px; background:#fff; border:1px solid var(--pn-line); border-radius:16px;}
.pn-category-toolbar label {display:grid; gap:5px; font-weight:700; font-size:.82rem; flex:1 1 180px;}
.pn-category-toolbar :is(input,select) {width:100%; min-height:46px; border:1px solid #D7DDEB; padding:8px 12px; border-radius:10px; background:#fff;}
.pn-category-toolbar button {min-height:46px; padding:9px 22px; border:0; border-radius:10px; background:var(--pn-purple); color:#fff; font-weight:700; cursor:pointer;}
.pn-category-toolbar a {min-height:46px; padding:10px; display:flex; align-items:center;}
.pn-card-type {color:var(--pn-purple); font-size:.72rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase;}
.pn-card-image--empty {display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#F2EFFF,#E9EDF7); color:#5349A1; font-size:.8rem; font-weight:750;}
.pn-card-image--empty span {padding:18px; text-align:center;}
.pn-post-grid .pn-card-title {margin-top:7px;}
.pn-article-share {display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:24px; }
.pn-article-share a {display:inline-flex; padding:10px 16px; background:#F2EFFF; border:1px solid #DED8F2; border-radius:10px; text-decoration:none; font-weight:700;}
.pn-article-related {margin-top:32px;}
.pn-article-related h2 {margin-bottom:20px;font-size:1.6rem;}
.pn-article-related .pn-post-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
.pn-404-actions {display:flex; flex-wrap:wrap; justify-content:center; gap:12px; align-items:center;}
.pn-404 .pn-search-form {margin:24px auto 0;}
.pn-404-quick {display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-top:24px;}
.pn-404-quick a {padding:9px 13px;border:1px solid var(--pn-line);border-radius:12px;background:#fff;text-decoration:none;}
.pn-page-shell--institutional .pn-page-header {padding-bottom:22px;margin-bottom:30px;border-bottom:1px solid var(--pn-line);}
.pn-institution-kicker {font-size:.76rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--pn-purple);}
@media(max-width:900px) { .pn-article-related .pn-post-grid {grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:640px) {
  body.pn-native-home .pn-home :is(.porecatu-home-section--noticias,.porecatu-home-section--transparencia,.porecatu-home-section--eventos,.porecatu-home-section--guia,.porecatu-home-section--secretarias) {padding-block:32px;}
  .pn-article-related .pn-post-grid {grid-template-columns:1fr;}
  .pn-category-toolbar {padding:12px;gap:10px;}
  .pn-category-toolbar label {flex-basis:100%;}
  .pn-404-actions>* {width:100%; justify-content:center;}
}

/* Header/rodapé de contingência, exibidos apenas sem o módulo Header Porecatu. */
.pn-fallback-header {background:#fff;border-top:4px solid var(--pn-purple);box-shadow:0 6px 24px rgba(20,31,57,.07)}
.pn-fallback-header__inner {display:flex;align-items:center;justify-content:space-between;gap:28px;min-height:96px;flex-wrap:wrap;padding-block:16px}
.pn-fallback-brand {font-size:1.2rem;font-weight:850;color:var(--pn-purple);text-decoration:none}
.pn-fallback-brand img {max-width:245px;height:auto}
.pn-fallback-header nav ul {display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;list-style:none;padding:0;margin:0}
.pn-fallback-header nav a {color:var(--pn-ink);font-weight:700;text-decoration:none}
.pn-fallback-footer {background:#1E164A;color:white;padding:35px 0;margin-top:30px}
.pn-fallback-footer .pn-content-wrap {display:flex;align-items:center;justify-content:space-between;gap:18px}
.pn-fallback-footer a{color:#EEE8FF}
@media(max-width:640px){.pn-fallback-header__inner{gap:16px}.pn-fallback-header nav ul{gap:10px}.pn-fallback-footer .pn-content-wrap{flex-wrap:wrap}}
