/*
Theme Name: Quattro
Theme URI: https://example.com/quattro
Author: Il tuo nome
Description: Tema moderno a 4 aree con menu di navigazione fisso in basso, in stile app. Ogni area (titolo, testo, pulsante, immagine, icona, colore) si personalizza da Aspetto › Personalizza › Tema Quattro. Modalità scura e chiara.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quattro
Tags: one-page, custom-menu, custom-logo, featured-images, dark, block-styles, wide-blocks
*/

/* ---------- Variabili ---------- */
:root {
	--bg: #0d0f14;
	--surface: #151922;
	--surface-2: #1c2130;
	--text: #f2f4f8;
	--muted: #9aa4b5;
	--line: rgba(255, 255, 255, .08);
	--glass: rgba(21, 25, 34, .72);
	--accent: #7c5cff;
	--radius: 24px;
	--nav-h: 76px;
	--maxw: 1160px;
	--font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.theme-light {
	--bg: #f5f6fa;
	--surface: #ffffff;
	--surface-2: #eceef5;
	--text: #12141a;
	--muted: #5d6676;
	--line: rgba(15, 20, 30, .09);
	--glass: rgba(255, 255, 255, .78);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 100;
	top: 12px; left: 12px; padding: 12px 18px;
	background: var(--surface); border-radius: 12px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Barra superiore ---------- */
.site-top {
	position: fixed; top: 0; left: 0; right: 0; z-index: 40;
	display: flex; justify-content: space-between; align-items: center;
	padding: 18px 24px; pointer-events: none;
}
.admin-bar .site-top { top: 32px; }
.site-top > * { pointer-events: auto; }
.brand {
	display: inline-flex; align-items: center; gap: 10px;
	font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; text-decoration: none;
	padding: 10px 18px; border-radius: 999px;
	background: var(--glass); border: 1px solid var(--line);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand img { max-height: 28px; width: auto; }
.brand--logo { padding: 8px 14px; }
.brand-dot {
	width: 10px; height: 10px; border-radius: 50%;
	background: linear-gradient(135deg, var(--accent), #22d3ee);
}

/* ---------- Le 4 aree ---------- */
.area {
	--c: var(--accent);
	position: relative;
	min-height: 100vh; min-height: 100svh;
	display: flex; align-items: center;
	padding: 120px 24px 150px;
	overflow: hidden;
}
.area::before {
	content: ""; position: absolute; pointer-events: none;
	width: 60vmax; height: 60vmax; border-radius: 50%;
	top: -22vmax; right: -22vmax;
	background: radial-gradient(circle, color-mix(in srgb, var(--c) 32%, transparent), transparent 65%);
	filter: blur(20px); opacity: .75;
}
.area:nth-child(even)::before { right: auto; top: auto; left: -22vmax; bottom: -22vmax; }
.area + .area { border-top: 1px solid var(--line); }

.area__inner {
	position: relative; width: 100%; max-width: var(--maxw); margin: 0 auto;
	display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
}
.area__inner--stack { grid-template-columns: 1fr; gap: 40px; }
.area:nth-child(even) .area__media { order: -1; }

.area__eyebrow {
	display: inline-flex; align-items: center; gap: 10px;
	font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
	color: var(--c); padding: 8px 14px; border-radius: 999px;
	background: color-mix(in srgb, var(--c) 14%, transparent);
}
.area__eyebrow svg { width: 16px; height: 16px; }
.area__title {
	font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.02;
	letter-spacing: -.035em; font-weight: 800; margin: 22px 0 18px;
}
.area__text { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin: 0 0 32px; }
.area__text p { margin: 0 0 1em; }

.btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 15px 26px; border-radius: 999px; border: 0;
	background: var(--c, var(--accent)); color: #fff;
	font: 700 1rem var(--font); text-decoration: none; cursor: pointer;
	box-shadow: 0 10px 30px -10px var(--c, var(--accent));
	transition: transform .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; transition: transform .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px var(--c, var(--accent)); }
.btn:hover svg { transform: translateX(3px); }

.area__media {
	position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
	display: grid; place-items: center;
	background: linear-gradient(145deg, color-mix(in srgb, var(--c) 42%, var(--surface)), var(--surface-2));
	border: 1px solid var(--line);
}
.area__media img { width: 100%; height: 100%; object-fit: cover; }
.big-num {
	font-size: clamp(8rem, 20vw, 16rem); font-weight: 800; line-height: 1; letter-spacing: -.06em;
	color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--c) 65%, #fff);
}

.area__widgets {
	grid-column: 1 / -1;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
}
.widget {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: 18px; padding: 24px;
}
.widget-title { font-size: 1.05rem; margin: 0 0 10px; }
.widget ul { margin: 0; padding-left: 1.1em; }

/* ---------- Card articoli ---------- */
.card-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px;
}
.card {
	display: flex; flex-direction: column; text-decoration: none;
	background: var(--surface); border: 1px solid var(--line);
	border-radius: 20px; overflow: hidden;
	transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c, var(--accent)) 55%, transparent); }
.card__thumb { aspect-ratio: 16 / 10; background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--accent)) 35%, var(--surface-2)), var(--surface-2)); overflow: hidden; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 20px 22px 24px; }
.card__meta { font-size: .8rem; color: var(--muted); }
.card__title { font-size: 1.2rem; line-height: 1.25; margin: 6px 0 8px; }
.card__excerpt { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- Pagine, articoli, archivi ---------- */
.page-wrap { max-width: var(--maxw); margin: 0 auto; padding: 130px 24px 40px; }
.page-head { margin-bottom: 36px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.03em; line-height: 1.05; margin: 0; }
.page-head p { color: var(--muted); margin: 10px 0 0; }

.entry { max-width: 740px; margin: 0 auto; font-size: 1.1rem; }
.entry-head { max-width: 740px; margin: 0 auto 32px; }
.entry-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.03em; line-height: 1.05; margin: 0 0 12px; }
.entry-meta { color: var(--muted); font-size: .9rem; }
.entry-hero { max-width: 1000px; margin: 0 auto 40px; border-radius: var(--radius); overflow: hidden; }
.entry a { color: var(--accent); }
.entry img { border-radius: 14px; }
.entry blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); color: var(--muted); }
.entry pre { background: var(--surface); padding: 18px; border-radius: 14px; overflow: auto; }
.entry .alignwide { max-width: 1000px; margin-left: 50%; transform: translateX(-50%); width: 100vw; max-width: min(1000px, 100vw - 48px); }
.entry .alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); max-width: none; }
.entry .wp-block-button__link { background: var(--accent); color: #fff; border-radius: 999px; }

.pagination, .comments { max-width: 740px; margin: 48px auto 0; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
	padding: 10px 16px; border-radius: 12px; text-decoration: none;
	background: var(--surface); border: 1px solid var(--line);
}
.pagination .current { background: var(--accent); color: #fff; }
.comment-list { padding-left: 0; list-style: none; }
.comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.comment-form input:not([type=submit]):not([type=checkbox]), .comment-form textarea, .search-field {
	width: 100%; padding: 13px 16px; border-radius: 12px; font: inherit;
	background: var(--surface); color: var(--text); border: 1px solid var(--line);
}
.comment-form .submit, .search-submit { padding: 13px 24px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 700 1rem var(--font); cursor: pointer; }

.site-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 28px 24px 8px; }

/* ---------- Menu in basso (dock) ---------- */
.dock {
	position: fixed; z-index: 50; left: 50%;
	bottom: calc(16px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	width: min(560px, calc(100% - 24px));
}
.dock__list {
	--n: 4;
	position: relative; list-style: none; margin: 0; padding: 8px;
	display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px;
	background: var(--glass); border: 1px solid var(--line); border-radius: 26px;
	backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
	box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .55);
}
.dock__indicator {
	position: absolute; top: 8px; bottom: 8px; left: 8px; pointer-events: none;
	width: calc((100% - 16px - (var(--n) - 1) * 4px) / var(--n));
	border-radius: 20px; background: var(--ind, var(--accent)); opacity: 0;
	transform: translateX(calc(var(--i, 0) * (100% + 4px)));
	transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s, background-color .3s;
}
.dock__list.has-active .dock__indicator { opacity: .2; }
.dock__link {
	position: relative; z-index: 1;
	display: flex; flex-direction: column; align-items: center; gap: 3px;
	padding: 10px 6px; border-radius: 20px; text-decoration: none;
	color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .02em;
	transition: color .25s;
}
.dock__link svg { width: 24px; height: 24px; transition: transform .3s, color .3s; }
.dock__link:hover, .dock__link.is-active { color: var(--text); }
.dock__link.is-active svg { color: var(--c); transform: translateY(-2px); }
.dock__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dock-no-labels .dock__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.dock-no-labels .dock__link { padding: 14px 6px; }

/* ---------- Animazioni ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .area__media.reveal { transition-delay: .12s; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .reveal { opacity: 1; transform: none; transition: none; }
	.dock__indicator, .card, .btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	.area { min-height: auto; padding: 110px 20px 120px; }
	.area__inner { grid-template-columns: 1fr; gap: 36px; }
	.area:nth-child(even) .area__media { order: 0; }
	.area__media { aspect-ratio: 16 / 11; }
	.page-wrap { padding: 110px 20px 32px; }
}
@media (max-width: 782px) { .admin-bar .site-top { top: 46px; } }
@media (max-width: 480px) {
	body { font-size: 16px; }
	.site-top { padding: 14px 16px; }
	.dock { bottom: 0; width: 100%; }
	.dock__list {
		border-radius: 22px 22px 0 0; border-bottom: 0;
		padding-bottom: calc(8px + env(safe-area-inset-bottom));
	}
	.dock__indicator { bottom: calc(8px + env(safe-area-inset-bottom)); }
}
