/*
Theme Name: Edil Domus
Description: Tema di Edil Domus, materiali edili e vernici ad Aprilia: mockup «Il tetto». Telefono, orari e indirizzo arrivano da Dati azienda.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.0
Author: Valerio
License: GPL-2.0-or-later
Text Domain: edildomus
Update URI: https://kit.wpfactory/edildomus
*/

:root {
	--notte: #141348;
	--notte-2: #1E1D5E;
	--verde: #83C341;
	--verde-scuro: #4E7F1E;
	--calce: #F2F2EC;
	--bianco: #FFFFFF;
	--inchiostro: #1B1B2F;
	--grigio: #55566B;
	--filetto: #D9D9D0;
	--display: "Big Shoulders Display", "Arial Narrow", sans-serif;
	--testo: "Hanken Grotesk", "Segoe UI", sans-serif;
	--margine: clamp(20px, 5vw, 72px);
	/* Contratto coi pezzi comuni di Fabbrica */
	--fc-accento: var(--verde);
	--fc-scuro: var(--notte);
	--fc-chiaro: var(--calce);
	--fc-su-scuro: var(--bianco);
	--fc-display: var(--display);
	--fc-testo: var(--testo);
	--fc-raggio: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bianco); color: var(--inchiostro); font: 400 clamp(16px, 1.1vw, 17px)/1.6 var(--testo); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.ed-gabbia { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--margine); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: .94; letter-spacing: .002em; }
h2 { font-size: clamp(36px, 3.8vw, 56px); line-height: 1; color: var(--notte); }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; }

/* --- Pulsanti (core/button: il pulsante vero è il link interno) --- */
.ed-btn .wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 10px 22px; border: 2px solid transparent; border-radius: 0; font: 800 clamp(19px, 1.4vw, 21px)/1 var(--display); letter-spacing: .03em; text-transform: uppercase; text-decoration: none; transition: transform .16s ease, background-color .16s ease, color .16s ease; }
.ed-btn .wp-block-button__link:hover { transform: translateY(-2px); }
.ed-btn--verde .wp-block-button__link { background: var(--verde); color: var(--notte); }
.ed-btn--verde .wp-block-button__link:hover { background: #95D453; color: var(--notte); }
.ed-btn--filo .wp-block-button__link { background: transparent; border-color: var(--bianco); color: var(--bianco); }
.ed-btn--filo .wp-block-button__link:hover { background: var(--bianco); color: var(--notte); }
.ed-btn--notte .wp-block-button__link { background: var(--notte); color: var(--bianco); }
.ed-btn--notte .wp-block-button__link:hover { background: var(--notte-2); color: var(--bianco); }
.ed-btn--chiama .wp-block-button__link::before { content: ""; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: url("assets/img/telefono.svg") center/contain no-repeat; mask: url("assets/img/telefono.svg") center/contain no-repeat; }

/* --- Testata --- */
.ed-testata { background: var(--bianco); border-bottom: 1px solid var(--filetto); }
.ed-testata__riga { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; }
.ed-logo { display: block; }
.ed-logo img { width: 108px; }
.ed-testata__info { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); font-size: 16px; }
.ed-telefono { font: 900 clamp(26px, 2.4vw, 34px)/1 var(--display); color: var(--notte); text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.ed-telefono:hover { color: var(--verde-scuro); }

/* Stato «Aperto ora» in una riga: rombo, parola e frase */
.ed-testata .fc-aperto--pillola { flex-direction: row; align-items: center; gap: 6px; width: auto; padding: 0; background: none; border-radius: 0; color: var(--notte); font-size: 16px; font-weight: 600; white-space: nowrap; }
.ed-testata .fc-aperto__stato { font-size: 16px; line-height: 1.2; letter-spacing: 0; gap: 9px; font-weight: 600; }
.ed-testata .fc-aperto__punto { width: 10px; height: 10px; border-radius: 0; background: var(--grigio); box-shadow: none; transform: rotate(45deg); animation: none; }
.ed-testata .is-aperto .fc-aperto__punto, .ed-testata .fc-aperto.is-aperto .fc-aperto__punto { background: var(--verde); }
.ed-testata .fc-aperto__dettaglio { display: block; font-size: 16px; opacity: 1; }
.ed-testata .fc-aperto__frase { display: inline-block; font-weight: 400; }
.ed-testata .fc-aperto__frase::first-letter { text-transform: lowercase; }

/* --- Apertura --- */
.ed-apertura { position: relative; background: var(--notte); color: var(--bianco); overflow: hidden; }
.ed-apertura__griglia { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: end; gap: clamp(28px, 4vw, 64px); padding-top: clamp(40px, 4.5vw, 68px); }
.ed-apertura__testi { padding-bottom: clamp(40px, 4.5vw, 68px); }
.ed-apertura h1 { font-size: clamp(52px, 6vw, 88px); color: var(--bianco); }
.ed-apertura h1 .ed-riga { display: block; white-space: nowrap; }
.ed-apertura h1 em { font-style: normal; color: var(--verde); }
.ed-apertura .ed-apertura__sotto { max-width: 34em; margin-top: 28px; font-size: clamp(18px, 1.45vw, 22px); line-height: 1.5; color: #E6E6F2; }
.ed-azioni.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* La casa: la foto del deposito dentro il profilo del logo */
.ed-apertura .ed-casa { position: relative; width: 100%; max-width: 600px; justify-self: end; aspect-ratio: 680 / 520; }
.ed-apertura .ed-casa::before { content: ""; position: absolute; z-index: 1; inset: -22px -22px 0 -22px; background: var(--verde); clip-path: polygon(0 100%, 0 27%, 68% 0, 100% 18%, 100% 20.8%, 68% 2.8%, 2.05% 28.9%, 2.05% 100%); pointer-events: none; }
.ed-apertura .ed-casa figure { position: absolute; inset: 0; margin: 0; clip-path: polygon(0 30%, 68% 0, 100% 20%, 100% 100%, 0 100%); }
.ed-apertura .ed-casa img { width: 100%; height: 100% !important; object-fit: cover; object-position: 60% 100%; }
@keyframes ed-sale { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.ed-apertura h1, .ed-apertura .ed-apertura__sotto, .ed-apertura .ed-azioni, .ed-apertura .ed-casa { animation: ed-sale .6s ease both; }
.ed-apertura .ed-apertura__sotto { animation-delay: .12s; }
.ed-apertura .ed-azioni { animation-delay: .22s; }
.ed-apertura .ed-casa { animation-duration: .7s; animation-delay: .1s; }

/* --- Fascia verde con la tacca --- */
.ed-fascia { position: relative; background: var(--verde); color: var(--notte); }
.ed-fascia::before { content: ""; position: absolute; top: -1px; left: 50%; width: 56px; height: 18px; margin-left: -28px; background: var(--notte); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.ed-fascia .ed-fascia__lista { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 auto; padding: 0; list-style: none; }
.ed-fascia__lista li { padding: 20px clamp(14px, 2vw, 32px); font: 800 clamp(21px, 1.8vw, 26px)/1.05 var(--display); text-transform: uppercase; text-align: center; }
.ed-fascia__lista li + li { border-left: 2px solid rgba(20, 19, 72, .28); }

/* --- Sezioni con foto --- */
.ed-sezione { padding-block: clamp(52px, 6vw, 88px); }
.ed-sezione--calce { background: var(--calce); }
.ed-doppia { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: center; gap: clamp(36px, 6vw, 96px); }
.ed-doppia--rovescia { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.ed-doppia--rovescia .ed-foto { order: 2; justify-self: end; }
.ed-sezione .ed-foto { position: relative; max-width: 680px; margin: 0 16px 16px 0; }
.ed-foto::after { content: ""; position: absolute; z-index: 0; inset: 16px -16px -16px 16px; background: var(--verde); }
.ed-foto img { position: relative; z-index: 1; width: 100%; }
.ed-sezione .ed-etichetta { display: inline-block; margin-bottom: 18px; padding: 5px 12px; background: var(--notte); color: var(--bianco); font: 800 18px/1.1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.ed-sezione p.ed-corpo { max-width: 32em; margin-top: 22px; color: var(--inchiostro); }
.ed-sezione .wp-block-buttons { margin-top: 30px; }

/* Materiali: frase grande senza foto */
.ed-frase h2 { font-size: clamp(38px, 5vw, 72px); max-width: 15em; }
.ed-frase__sotto { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 48px; margin-top: 30px; }
.ed-sezione .ed-frase__sotto .ed-corpo, .ed-sezione .ed-frase__sotto .wp-block-buttons { margin-top: 0; }

/* --- Dove siamo --- */
.ed-dove { background: var(--notte); color: var(--bianco); padding-block: clamp(52px, 6vw, 88px); }
.ed-dove h2 { color: var(--bianco); }
.ed-dove__griglia { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.ed-dove .ed-indirizzo { max-width: 12em; margin-top: 24px; font-size: clamp(20px, 1.7vw, 25px); line-height: 1.4; }
.ed-dove .ed-dintorni { max-width: 30em; margin-top: 14px; color: #D5D5E6; }
.ed-dove__telefono.wp-block-buttons { margin-top: 24px; }
.ed-dove__telefono .wp-block-button__link { padding: 0; background: none; border-radius: 0; color: var(--verde); font: 900 clamp(40px, 4.2vw, 60px)/1 var(--display); letter-spacing: .01em; text-decoration: none; }
.ed-dove__telefono .wp-block-button__link:hover { color: #A2DE63; }
.ed-dove .ed-azioni { margin-top: 24px; }

/* Tabella «Orari della settimana» */
.ed-dove .fc-settimana__tabella caption { padding-bottom: 14px; font: 800 clamp(24px, 1.9vw, 28px)/1 var(--display); text-transform: uppercase; }
.ed-dove .fc-settimana__tabella th, .ed-dove .fc-settimana__tabella td { padding: 13px 0; border-top: 1px solid rgba(255, 255, 255, .24); font-weight: 400; }
.ed-dove .fc-settimana__tabella tr.is-oggi th, .ed-dove .fc-settimana__tabella tr.is-oggi td { color: var(--verde); font-weight: 700; }
.ed-dove .fc-settimana__chiusura { padding: 12px 14px; background: var(--verde); color: var(--notte); }
.ed-dove .fc-settimana__nota { color: var(--bianco); }

/* --- Piè di pagina --- */
.ed-piede { background: #0D0C33; color: #C9C9DE; font-size: 15px; padding-block: 36px; }
.ed-piede__riga { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.ed-piede .ed-logo img { width: 92px; }
.ed-piede__link { display: flex; gap: 22px; }
.ed-piede a { color: var(--bianco); text-underline-offset: 3px; }

/* --- Barra fissa sul telefono --- */
.ed-barra { display: none; }

/* --- Pagine interne (privacy) --- */
.ed-pagina { padding-block: clamp(44px, 6vw, 80px); }
.ed-pagina .wp-block-post-title { color: var(--notte); font-size: clamp(38px, 5vw, 64px); margin-bottom: 28px; }
.ed-pagina .wp-block-post-content { max-width: 46em; }
.ed-pagina h2 { margin: 1.4em 0 .4em; font-size: clamp(26px, 2.6vw, 34px); }
.ed-pagina p { margin-bottom: 1em; }

/* --- Comparsa allo scorrimento, leggera --- */
@supports (animation-timeline: view()) {
	.ed-foto, .ed-testi { animation: ed-sale linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --- Tablet --- */
@media (max-width: 960px) {
	.ed-apertura__griglia { grid-template-columns: 1fr; }
	.ed-apertura__testi { padding-bottom: 0; }
	.ed-apertura .ed-casa { justify-self: center; }
	.ed-doppia, .ed-doppia--rovescia, .ed-dove__griglia { grid-template-columns: 1fr; }
	.ed-doppia--rovescia .ed-foto { order: 0; justify-self: start; }
}

/* --- Telefono --- */
@media (max-width: 640px) {
	body { padding-bottom: 68px; }
	.ed-testata__riga { min-height: 74px; }
	.ed-testata .ed-logo img { width: 84px; }
	.ed-testata .ed-telefono { display: none; }
	.ed-testata .fc-aperto--pillola { flex-wrap: wrap; justify-content: flex-end; white-space: normal; text-align: right; gap: 0 6px; font-size: 14px; }
	.ed-testata .fc-aperto__stato, .ed-testata .fc-aperto__dettaglio { font-size: 14px; }
	.ed-apertura h1 { font-size: clamp(46px, 13.5vw, 62px); }
	.ed-apertura h1 .ed-riga { display: inline; white-space: normal; }
	.ed-apertura .ed-azioni { display: none; }
	.ed-apertura .ed-casa::before { inset: -14px -14px 0 -14px; }
	.ed-fascia .ed-fascia__lista { grid-template-columns: 1fr; }
	.ed-fascia__lista li { padding: 18px 12px; }
	.ed-fascia__lista li + li { border-left: 0; border-top: 2px solid rgba(20, 19, 72, .28); }
	.ed-fascia::before { display: none; }
	.ed-sezione .ed-btn, .ed-sezione .ed-btn .wp-block-button__link { width: 100%; }
	.ed-frase__sotto .wp-block-buttons { width: 100%; }
	.ed-barra { position: fixed; z-index: 20; inset: auto 0 0 0; display: grid; grid-template-columns: 3fr 2fr; box-shadow: 0 -4px 18px rgba(13, 12, 51, .3); }
	.ed-barra .wp-block-button__link { width: 100%; min-height: 60px; padding-inline: 10px; font-size: 22px; }
	.ed-barra .wp-block-button__link:hover { transform: none; }
	.ed-barra .ed-btn { width: 100%; }
	.ed-piede__riga { flex-direction: column; align-items: flex-start; }
}

/* --- Nell'editor --- */
.editor-visual-editor__post-title-wrapper { display: none; }
.editor-styles-wrapper .ed-apertura h1 { white-space: normal !important; }
.editor-styles-wrapper .ed-apertura, .editor-styles-wrapper .ed-fascia, .editor-styles-wrapper .ed-sezione, .editor-styles-wrapper .ed-dove { margin-block: 0 !important; }
.editor-styles-wrapper .ed-apertura .ed-casa img { height: 100% !important; }
.editor-styles-wrapper .ed-foto .components-resizable-box__container { width: 100% !important; height: auto !important; }
.editor-styles-wrapper .ed-foto, .editor-styles-wrapper .ed-testi { animation: none; }
