/*
Theme Name:   PagaGiusto
Theme URI:    https://pagagiusto.online
Description:  Tema child di Astra per PagaGiusto: prezzi reali pagati e controllo del preventivo. Tutto modificabile da Aspetto → Personalizza → PagaGiusto (colori, caratteri, testi e ordine delle sezioni) e dagli Header/Footer Builder di Astra (logo, menu, footer). Da usare con i plugin PagaGiusto Core e PagaGiusto SEO.
Author:       AdecPC di Antonio De Cosmi
Author URI:   https://adecpc.pro
Template:     astra
Version:      1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  pagagiusto
*/

/* ==========================================================================
   Base: caratteri e colori (le variabili arrivano da Personalizza)
   ========================================================================== */

body,
button,
input,
select,
textarea,
.ast-button,
.ast-custom-button {
	font-family: var(--pg-font-body);
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.site-title,
.pgt-h2,
.pg-h1 {
	font-family: var(--pg-font-heading);
	letter-spacing: -0.015em;
}

body.pgt {
	color: #1e293b;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.pgt ::selection { background: var(--pg-primary); color: #fff; }

.pg-btn { border-radius: var(--pg-btn-radius, 999px); }
.pgt .wp-block-button__link,
.pgt .ast-button,
.pgt .ast-custom-button,
.pgt button[type=submit]:not(.pg-btn),
.pgt input[type=submit] {
	border-radius: var(--pg-btn-radius, 999px);
}
.pg-btn--light { background: #fff; color: var(--pg-dark) !important; }
.pg-btn--light:hover { background: var(--pg-light); }

.pgt-wrap {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

/* ==========================================================================
   Barra in alto
   ========================================================================== */

.pgt-topbar {
	background: var(--pgt-topbar-bg, var(--pg-dark));
	color: #e2e8f0;
	font-size: 0.875rem;
	line-height: 1.4;
}
.pgt-topbar .pgt-wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 4px 14px;
	padding-top: 9px;
	padding-bottom: 9px;
	text-align: center;
}
.pgt-topbar a {
	color: var(--pg-primary-soft, #d1fae5);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.pgt-topbar a:hover { text-decoration: underline; }

/* ==========================================================================
   Home: contenitore a tutta larghezza
   ========================================================================== */

.pgt-home #content > .ast-container,
.pgt-home .site-content > .ast-container {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
	display: block;
}
.pgt-home #primary,
.pgt-home .pgt-home-main {
	margin: 0 !important;
	padding: 0 !important;
	width: 100%;
	border: 0;
	background: transparent;
}
.pgt-home .site-main { margin: 0; }

.pgt-section {
	padding: clamp(56px, 8vw, 104px) 0;
}
.pgt-h2 {
	font-size: clamp(1.7rem, 3.6vw, 2.5rem);
	line-height: 1.12;
	margin: 0 0 12px;
	font-weight: 800;
	color: var(--pg-dark);
}
.pgt-sub {
	color: #64748b;
	font-size: 1.1rem;
	margin: 0 0 28px;
	max-width: 640px;
}
.pgt-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}
.pgt-head .pg-link { margin-bottom: 30px; }
.pgt-kicker {
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--pg-primary);
	margin: 0 0 14px;
}

/* ---------- Apertura ---------- */
.pgt-hero {
	position: relative;
	overflow: hidden;
	padding-top: clamp(48px, 7vw, 96px);
}
.pgt-hero--soft {
	background:
		radial-gradient(900px 480px at 88% 8%, var(--pg-primary-soft) 0%, transparent 62%),
		radial-gradient(600px 400px at 0% 100%, color-mix(in srgb, var(--pg-primary-soft) 60%, transparent) 0%, transparent 70%),
		var(--pg-light);
}
.pgt-hero--plain { background: var(--pgt-hero-bg, var(--pg-light)); }
.pgt-hero--dark { background: var(--pg-dark); }
.pgt-hero--image { background-color: var(--pg-dark); background-size: cover; background-position: center; }

.pgt-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: clamp(32px, 5vw, 64px);
	align-items: center;
}
.pgt-hero--solo .pgt-hero__grid { grid-template-columns: minmax(0, 820px); }
.pgt-hero__title {
	font-size: clamp(2.3rem, 5.6vw, 4rem);
	line-height: 1.04;
	letter-spacing: -0.035em;
	font-weight: 800;
	margin: 0 0 20px;
	color: var(--pg-dark);
}
.pgt-hero__title span { display: block; color: var(--pg-primary); }
.pgt-hero__lead {
	font-size: clamp(1.05rem, 1.8vw, 1.25rem);
	line-height: 1.55;
	color: #334155;
	margin: 0 0 28px;
	max-width: 560px;
}
.pgt-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pgt-hero__counter { margin: 22px 0 0; color: #475569; font-size: 0.95rem; }
.pgt-hero__counter strong { font-size: 1.35rem; color: var(--pg-dark); font-variant-numeric: tabular-nums; margin-right: 4px; }
.pgt-hero__form .pg-card { box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 24px 60px -12px rgba(15,23,42,.22); border: 0; }

.pgt-hero--dark .pgt-hero__title,
.pgt-hero--image .pgt-hero__title,
.pgt-hero--dark .pgt-hero__counter strong,
.pgt-hero--image .pgt-hero__counter strong { color: #fff; }
.pgt-hero--dark .pgt-hero__lead,
.pgt-hero--image .pgt-hero__lead,
.pgt-hero--dark .pgt-hero__counter,
.pgt-hero--image .pgt-hero__counter { color: #cbd5e1; }
.pgt-hero--dark .pg-btn--ghost,
.pgt-hero--image .pg-btn--ghost { color: #fff !important; border-color: rgba(255,255,255,.4); }
.pgt-hero--dark .pg-btn--ghost:hover,
.pgt-hero--image .pg-btn--ghost:hover { border-color: #fff; }

/* ---------- Come funziona ---------- */
.pgt-steps { background: #fff; }
.pgt-steps .pgt-h2 { text-align: center; margin-bottom: 40px; }
.pgt-steps__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	counter-reset: none;
}
.pgt-steps__list li {
	margin: 0;
	padding: 28px;
	border-radius: var(--pg-radius);
	background: var(--pg-light);
	border: 1px solid #e2e8f0;
}
.pgt-steps__n {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--pg-primary);
	color: #fff;
	font-weight: 800;
	font-size: 1.15rem;
	margin-bottom: 16px;
}
.pgt-steps__list h3 { font-size: 1.2rem; margin: 0 0 8px; }
.pgt-steps__list p { margin: 0; color: #475569; line-height: 1.55; }

/* ---------- Più cercati / categorie / ultimi ---------- */
.pgt-top { background: var(--pg-light); }
.pgt-cats { background: #fff; }
.pgt-last { background: var(--pg-light); }
.pgt-cats .pgt-h2 { margin-bottom: 28px; }
.pgt-cats .pgt-sub { margin-top: -16px; }
.pgt-last .pgt-h2 { margin-bottom: 24px; }

/* ---------- Fiducia ---------- */
.pgt-trust { background: var(--pg-dark); color: #cbd5e1; }
.pgt-trust .pgt-h2 { color: #fff; margin-bottom: 36px; }
.pgt-trust__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.pgt-trust__icon {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--pg-primary) 22%, transparent);
	color: var(--pg-primary-soft, #a7f3d0);
	margin-bottom: 16px;
}
.pgt-trust__icon .pg-icon { width: 26px; height: 26px; }
.pgt-trust__item h3 { color: #fff; font-size: 1.2rem; margin: 0 0 8px; }
.pgt-trust__item p { margin: 0; line-height: 1.6; }

/* ---------- Invito finale ---------- */
.pgt-cta { background: #fff; }
.pgt-cta__box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	flex-wrap: wrap;
	max-width: 1160px;
	padding: clamp(32px, 5vw, 56px);
	border-radius: calc(var(--pg-radius) * 1.6);
	background:
		radial-gradient(600px 300px at 100% 0%, rgba(255,255,255,.18), transparent 60%),
		var(--pg-primary);
	color: #fff;
}
.pgt-cta__box .pgt-h2 { color: #fff; }
.pgt-cta__box p { margin: 0; font-size: 1.1rem; max-width: 620px; color: rgba(255,255,255,.92); }

.pgt-content { padding-top: 0; }

/* ==========================================================================
   Avviso sopra il footer
   ========================================================================== */

.pgt-disclaimer {
	background: var(--pg-light);
	border-top: 1px solid #e2e8f0;
	font-size: 0.85rem;
	color: #64748b;
}
.pgt-disclaimer p { margin: 0; padding: 18px 0; line-height: 1.55; text-align: center; }

/* ==========================================================================
   Pagine con i moduli (Segnala, Controlla)
   ========================================================================== */

.pgt-formpage .entry-content,
.pgt-formpage .entry-header {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}
.pgt-formpage .entry-header { text-align: center; }
.pgt-formpage .entry-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.pgt-formpage .entry-content > p:first-child { font-size: 1.1rem; text-align: center; color: #475569; }

/* ==========================================================================
   Pulsante fisso su mobile
   ========================================================================== */

.pgt-sticky { display: none; }
@media (max-width: 767px) {
	.pgt-sticky {
		display: block;
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom));
		z-index: 999;
		transform: translateY(140%);
		transition: transform .25s ease;
	}
	.pgt-sticky.is-visible { transform: none; }
	.pgt-sticky .pg-btn {
		width: 100%;
		min-height: 52px;
		box-shadow: 0 10px 30px rgba(15,23,42,.28);
	}
	.pgt-has-sticky .site-footer { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
	.pgt-sticky { transition: none; }
}

/* ==========================================================================
   Pattern dell'editor
   ========================================================================== */

.pgt-p-hero {
	padding: clamp(40px, 6vw, 80px) 20px;
	background:
		radial-gradient(900px 480px at 88% 8%, var(--pg-primary-soft) 0%, transparent 62%),
		var(--pg-light);
}
.pgt-p-steps .pgt-p-step {
	padding: 24px;
	border-radius: var(--pg-radius);
	background: var(--pg-light);
	border: 1px solid #e2e8f0;
}
.pgt-p-cta {
	padding: clamp(28px, 5vw, 48px);
	border-radius: calc(var(--pg-radius) * 1.6);
	background: var(--pg-primary);
	color: #fff;
}
.pgt-p-cta h2,
.pgt-p-cta p { color: #fff; }
.pgt-p-cta .wp-block-button__link { background: #fff; color: var(--pg-dark); }
.pgt-p-trust {
	padding: clamp(28px, 5vw, 48px);
	border-radius: calc(var(--pg-radius) * 1.6);
	background: var(--pg-dark);
	color: #cbd5e1;
}
.pgt-p-trust h2,
.pgt-p-trust h3 { color: #fff; }

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 921px) {
	.pgt-hero__grid,
	.pgt-hero--solo .pgt-hero__grid { grid-template-columns: minmax(0, 1fr); }
	/* Su telefono il modulo sale subito sotto il titolo: il pulsante secondario è già nella barra in alto e nell'invito finale. */
	.pgt-hero:not(.pgt-hero--solo) .pgt-hero__actions { display: none; }
	.pgt-hero:not(.pgt-hero--solo) .pgt-hero__lead { margin-bottom: 8px; }
	.pgt-hero__counter { margin-top: 12px; }
	.pgt-steps__list,
	.pgt-trust__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.pgt-trust__grid { gap: 28px; }
}
@media (max-width: 544px) {
	.pgt-wrap { padding: 0 16px; }
	.pgt-hero__actions .pg-btn { width: 100%; }
	.pgt-cta__box .pg-btn { width: 100%; }
	.pgt-steps__list li { padding: 22px; }
}
