/* ==========================================================================
   Ferramentas PHDA — estilos que o theme.json não cobre.
   Cores, fontes e espaçamentos vêm de theme.json (var(--wp--preset--*)).
   ========================================================================== */

:root {
	--fphda-radius-sm: var(--wp--custom--radius--small, 8px);
	--fphda-radius-md: var(--wp--custom--radius--medium, 16px);
	--fphda-radius-lg: var(--wp--custom--radius--large, 28px);
	--fphda-focus: 0 0 0 3px var(--wp--preset--color--base), 0 0 0 6px var(--wp--preset--color--secondary);
}

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

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

:where(a, button, input, select, textarea, .wp-element-button):focus-visible {
	outline: none;
	box-shadow: var(--fphda-focus);
	border-radius: 4px;
}

/* --- Cabeçalho ------------------------------------------------------------ */
.fphda-sticky {
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar .fphda-sticky { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .fphda-sticky { top: 0; } }

.fphda-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
	backdrop-filter: saturate(1.4) blur(8px);
}
.fphda-logo img { height: auto; max-height: 34px; width: auto; }
@media (max-width: 600px) { .fphda-logo img { max-height: 26px; } }

.fphda-header .wp-block-navigation-item__content { padding: 0.35rem 0; position: relative; }
.fphda-header .wp-block-navigation .wp-block-navigation-item:not(.fphda-nav-cta) .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -2px;
	height: 2px;
	background: var(--wp--preset--color--primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .2s ease;
}
.fphda-header .wp-block-navigation-item:hover > .wp-block-navigation-item__content::after,
.fphda-header .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }

.fphda-header .fphda-nav-cta > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--navy) !important;
	padding: 0.55rem 1.2rem;
	border-radius: 999px;
	font-weight: 600;
	transition: background .2s ease, color .2s ease;
}
.fphda-header .fphda-nav-cta > .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--base) !important;
}
/* Menu móvel aberto */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.25rem; }
.wp-block-navigation__responsive-container.is-menu-open .fphda-nav-cta > .wp-block-navigation-item__content { margin-top: 0.75rem; }

/* --- Botões --------------------------------------------------------------- */
.wp-element-button, .wp-block-button__link { transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); }

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--navy);
	border: 2px solid currentColor;
	padding: calc(0.95rem - 2px) calc(2rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--navy);
	border-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--base);
}
.wp-block-button.fphda-btn-light > .wp-block-button__link { color: var(--wp--preset--color--base); }
.wp-block-button.fphda-btn-light > .wp-block-button__link:hover {
	background: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--navy);
}
.wp-block-button.is-style-text-arrow > .wp-block-button__link {
	background: none; padding: 0; color: var(--wp--preset--color--primary-dark);
}
.wp-block-button.is-style-text-arrow > .wp-block-button__link::after { content: " →"; }

/* --- Separador de destaque ---------------------------------------------- */
.wp-block-separator.is-style-accent {
	border: 0;
	width: 64px;
	height: 4px !important;
	background: var(--wp--preset--color--secondary) !important;
	border-radius: 4px;
	margin-left: 0;
	opacity: 1;
}

/* --- Cartões ------------------------------------------------------------- */
.is-style-card, .is-style-card-lift {
	background: var(--wp--preset--color--base);
	border-radius: var(--fphda-radius-lg);
	padding: var(--wp--preset--spacing--50);
}
.is-style-card { border: 1px solid var(--wp--preset--color--line); }
.is-style-card-lift { box-shadow: var(--wp--preset--shadow--lift); }

/* --- Hero ---------------------------------------------------------------- */
.fphda-hero { border-bottom-right-radius: clamp(48px, 10vw, 150px); overflow: hidden; }
.fphda-hero h1 { text-wrap: balance; }
.fphda-hero p { text-wrap: pretty; max-width: 40rem; margin-left: auto; margin-right: auto; }

/* Cartões que sobrepõem o hero */
.fphda-overlap { margin-top: -5rem !important; position: relative; z-index: 2; }
@media (max-width: 781px) { .fphda-overlap { margin-top: -3rem !important; } }

.fphda-feature { transition: transform .2s ease, box-shadow .2s ease; position: relative; }
.fphda-feature:hover { transform: translateY(-4px); }
.fphda-feature h3 { margin-top: 1rem; margin-bottom: 0.4rem; }
.fphda-feature h3 a { color: var(--wp--preset--color--navy); text-decoration: none; }
/* Todo o cartão é clicável */
.fphda-feature h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.fphda-feature:hover h3 a { color: var(--wp--preset--color--primary-dark); }
.fphda-feature p:last-child { margin-bottom: 0; }

/* Ícones (máscaras SVG — mudam de cor com background-color) */
.fphda-icon {
	width: 52px; height: 52px; margin: 0;
	border-radius: 14px;
	background: var(--wp--preset--color--secondary-soft);
	position: relative;
}
.fphda-icon::before {
	content: "";
	position: absolute; inset: 12px;
	background: var(--wp--preset--color--secondary-dark);
	-webkit-mask: var(--fphda-icon) center / contain no-repeat;
	mask: var(--fphda-icon) center / contain no-repeat;
}
.fphda-icon--book   { --fphda-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6a4 4 0 0 1 4 4v13a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 4h-6a4 4 0 0 0-4 4v13a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.fphda-icon--wrench { --fphda-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94z'/%3E%3C/svg%3E"); }
.fphda-icon--link   { --fphda-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }
.fphda-icon--check  { --fphda-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E"); }
.fphda-icon--chat   { --fphda-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.fphda-icon--heart  { --fphda-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7z'/%3E%3C/svg%3E"); }
.fphda-icon--bulb   { --fphda-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4'/%3E%3Cpath d='M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14'/%3E%3C/svg%3E"); }

/* --- Faixa de chamada (teste) ------------------------------------------- */
.fphda-cta {
	border-radius: var(--fphda-radius-lg);
	position: relative;
	overflow: hidden;
	gap: var(--wp--preset--spacing--40);
}
.fphda-cta::before {
	content: "";
	position: absolute;
	width: 340px; height: 340px;
	right: -90px; top: -150px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(118,120,237,.55), rgba(118,120,237,0) 70%);
	pointer-events: none;
}
.fphda-cta > * { position: relative; }

/* --- Cartões de artigos -------------------------------------------------- */
.fphda-post-card {
	padding: 0;
	border-radius: var(--fphda-radius-md);
	overflow: hidden;
	box-shadow: var(--wp--preset--shadow--soft);
	transition: transform .2s ease, box-shadow .2s ease;
	height: 100%;
}
.fphda-post-card:hover { transform: translateY(-4px); box-shadow: var(--wp--preset--shadow--lift); }
.fphda-post-card .wp-block-post-featured-image { margin: 0; background: var(--wp--preset--color--secondary-soft); }
.fphda-post-card .wp-block-post-featured-image img { transition: transform .4s ease; }
.fphda-post-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.fphda-post-card .wp-block-post-title { margin: 0; }
.fphda-post-card .wp-block-post-excerpt { margin: 0; }
.fphda-post-card .wp-block-post-excerpt__excerpt { margin: 0; }
.fphda-post-card__body { flex-grow: 1; }
.fphda-read-more {
	margin-top: auto !important;
	padding-top: 0.5rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary-dark);
	text-decoration: none;
}
.fphda-read-more::after { content: " →"; transition: margin .2s ease; }
.fphda-read-more:hover::after { margin-left: 4px; }

.wp-block-post-terms a {
	color: var(--wp--preset--color--secondary-dark);
	background: var(--wp--preset--color--secondary-soft);
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
}
.wp-block-post-terms .wp-block-post-terms__separator { display: none; }
.wp-block-post-terms { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* --- Cabeçalho de páginas / arquivos ------------------------------------ */
.fphda-page-head { border-bottom-right-radius: clamp(40px, 8vw, 110px); }
.fphda-page-head h1 { margin: 0; text-wrap: balance; }

/* --- Artigo individual --------------------------------------------------- */
.fphda-prose { font-size: 1.125rem; line-height: 1.75; }
.fphda-prose > * + h2 { margin-top: 2.5rem; }
.fphda-prose > * + h3 { margin-top: 2rem; }
.fphda-prose li + li { margin-top: 0.35rem; }
.fphda-prose img { border-radius: var(--fphda-radius-md); }
.fphda-prose .wp-block-embed iframe { border-radius: var(--fphda-radius-md); }

.fphda-post-nav { gap: 1rem; }
.fphda-post-nav .post-navigation-link-previous,
.fphda-post-nav .post-navigation-link-next { max-width: 48%; font-weight: 600; }
.fphda-post-nav a { text-decoration: none; }
@media (max-width: 600px) {
	.fphda-post-nav .post-navigation-link-previous,
	.fphda-post-nav .post-navigation-link-next { max-width: 100%; }
}

/* --- Contacto ------------------------------------------------------------ */
.fphda-contact { border-radius: var(--fphda-radius-lg); box-shadow: var(--wp--preset--shadow--lift); text-align: left; }
.fphda-contact .wpforms-container { margin: 0 !important; }
.fphda-contact .wpforms-field-label {
	font-size: .8rem !important;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--wp--preset--color--muted) !important;
	font-weight: 600 !important;
}
.fphda-contact input[type="text"],
.fphda-contact input[type="email"],
.fphda-contact textarea {
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: var(--fphda-radius-sm) !important;
	padding: .7rem .9rem !important;
	font: inherit !important;
	background: var(--wp--preset--color--surface) !important;
}
.fphda-contact input:focus, .fphda-contact textarea:focus {
	border-color: var(--wp--preset--color--secondary) !important;
	background: var(--wp--preset--color--base) !important;
	box-shadow: 0 0 0 3px var(--wp--preset--color--secondary-soft) !important;
}
.fphda-contact .wpforms-submit {
	background: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--navy) !important;
	border: 0 !important;
	border-radius: 999px !important;
	padding: .9rem 2.2rem !important;
	font: 600 1rem/1.2 var(--wp--preset--font-family--body) !important;
	height: auto !important;
	cursor: pointer;
}
.fphda-contact .wpforms-submit:hover { background: var(--wp--preset--color--navy) !important; color: var(--wp--preset--color--base) !important; }

/* --- Rodapé -------------------------------------------------------------- */
.fphda-footer-heading { font-family: var(--wp--preset--font-family--body); font-size: .8rem !important; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.fphda-footer-links { list-style: none; padding: 0; margin: 0; }
.fphda-footer-links li { margin: .5rem 0; }
.fphda-footer-links a { text-decoration: none; color: #E4E6F0 !important; }
.fphda-footer-links a:hover { color: var(--wp--preset--color--primary) !important; }
.fphda-footer .wp-block-site-title a { text-decoration: none; }
.wp-block-separator.fphda-footer-sep { border: 0; height: 1px !important; opacity: 1; width: 100% !important; max-width: var(--wp--style--global--wide-size) !important; }

/* --- Pesquisa e paginação ------------------------------------------------ */
.wp-block-search__input { border-radius: 999px; border: 1px solid var(--wp--preset--color--line); padding: .7rem 1.1rem; }
.wp-block-search__button { margin-left: .5rem; }
.wp-block-query-pagination-numbers .page-numbers {
	display: inline-grid; place-items: center;
	min-width: 2.5rem; height: 2.5rem;
	border-radius: 999px; text-decoration: none;
}
.wp-block-query-pagination-numbers .page-numbers.current { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--base); }
.wp-block-query-pagination a { text-decoration: none; }

@media (max-width: 781px) {
	.fphda-contact { padding: var(--wp--preset--spacing--40) !important; }
	.fphda-cta { padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40) !important; }
	.fphda-hero { padding-top: var(--wp--preset--spacing--60) !important; }
}

/* --- Cabeçalho transparente sobre o hero (página inicial) ---------------- */
.fphda-overlay-wrap { position: fixed; left: 0; right: 0; }
.admin-bar .fphda-overlay-wrap { top: var(--wp-admin--admin-bar--height, 32px); }
.fphda-header--overlay { backdrop-filter: none; background: transparent !important; border-bottom-color: transparent; transition: background-color .25s ease, box-shadow .25s ease, border-color .25s ease; }
.fphda-header--overlay .wp-block-navigation-item:not(.fphda-nav-cta) > .wp-block-navigation-item__content,
.fphda-header--overlay .wp-block-navigation__responsive-container-open { color: rgba(255,255,255,.85) !important; }
.fphda-header--overlay .wp-block-navigation-item:not(.fphda-nav-cta) > .wp-block-navigation-item__content:hover { color: #fff !important; }
.is-scrolled .fphda-header--overlay { backdrop-filter: saturate(1.4) blur(8px); background: var(--wp--preset--color--base) !important; border-bottom-color: var(--wp--preset--color--line); box-shadow: 0 4px 20px -10px rgba(11,19,43,.2); }
.is-scrolled .fphda-header--overlay .wp-block-navigation-item:not(.fphda-nav-cta) > .wp-block-navigation-item__content,
.is-scrolled .fphda-header--overlay .wp-block-navigation__responsive-container-open { color: var(--wp--preset--color--ink) !important; }
/* Menu móvel aberto mantém texto claro sobre fundo escuro */
.fphda-header--overlay .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: #fff !important; }
.home .fphda-hero { padding-top: calc(var(--wp--preset--spacing--70) + 4.5rem) !important; }

/* --- Neutraliza larguras impostas por plugins (ex.: Kubio) --------------- */
.wp-block-post-content > .alignfull { max-width: none !important; width: auto; margin-left: 0 !important; margin-right: 0 !important; }
.wp-block-post-content > .alignwide { max-width: var(--wp--style--global--wide-size) !important; }
.wp-block-post-content.has-global-padding > .alignfull { margin-left: calc(var(--wp--style--root--padding-left) * -1) !important; margin-right: calc(var(--wp--style--root--padding-right) * -1) !important; }
