/* ==========================================================================
   eraora Village 0.3.0 – identità visiva comune a tutte le pagine
   Si appoggia ai token di main.css (stessi nomi, nuovi valori) e ridisegna:
   1. Tipografia  2. Pulsanti ed etichette  3. Testata flottante  4. Menu mobile
   5. Footer e barra mobile  6. Rifiniture delle pagine interne
   ========================================================================== */

/* 1. Tipografia ------------------------------------------------------------ */
/* 0.3.1: DM Serif al posto di Bodoni Moda. Display per i titoli grandi, Text (tratti più spessi)
   per i titoli sotto i 3rem circa, dove i filetti sottili si perdevano. Un solo peso: niente grassetto finto. */
h1, h2, h3, h4 { font-synthesis: none; }
h3, h4,
.tessera__titolo, .alternato__titolo, .coppia__titolo, .colonna__nome, .tappa__titolo,
.capitolo__titolo, .camera__nome, .offerta__titolo, .momenti__nome, .domande summary {
	font-family: var(--font-titoli-medio);
}
body { font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem); line-height: 1.6; }
h1, h2, h3 { font-weight: 400; letter-spacing: -0.005em; line-height: 1.04; }
h1 em, h2 em, h3 em { font-style: italic; }
.titolo-sezione, .titolo-sezione--grande, .apertura__titolo, .chiusura__titolo, .pagina__titolo,
.tessera__titolo, .alternato__titolo, .coppia__titolo, .colonna__nome, .tappa__titolo,
.capitolo__titolo, .camera__nome, .offerta__titolo { font-weight: 400; }
.titolo-sezione { font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.6rem); line-height: 1; }
.apertura__titolo, .hero__titolo--pagina { line-height: 0.96; }
.fatti__valore, .eventi__valore { font-weight: 400; }

.etichetta {
	margin: 0;
	font-family: var(--font-misura); font-size: 0.8rem; font-weight: 500;
	letter-spacing: 0.12em; text-transform: uppercase;
}

/* 2. Pulsanti -------------------------------------------------------------- */
.pulsante { border-radius: 999px; font-size: 0.95rem; letter-spacing: 0; }
.pulsante--sole:hover { background: var(--sole-chiaro); }
.pulsante--notte:hover { background: var(--mare-scuro); }
.link-freccia { color: var(--notte); border-bottom-width: 1px; }
.link-freccia:hover { color: var(--mare); }

/* 3. Testata classica a tutta larghezza (0.3.2) ------------------------------
   Sopra la foto di apertura: trasparente, testo e logo chiari, velo scuro in alto.
   Scorrendo, sulle pagine senza foto o con il riquadro aperto: barra calce piena.
   I sottomenu diventano un riquadro a tutta larghezza con le foto delle pagine. */
.testata {
	padding: 0;
	isolation: isolate;
	transition: background-color 300ms ease, color 300ms ease, box-shadow 300ms ease, transform 450ms var(--ease-out);
}
.testata::before {
	content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none;
	background: linear-gradient(180deg, rgba(8, 29, 36, 0.6), rgba(8, 29, 36, 0));
	transition: opacity 300ms ease;
}
.testata.is-piena::before, body:not(.ha-hero) .testata::before { opacity: 0; }
.testata.is-piena,
body:not(.ha-hero) .testata,
body.ha-hero .testata:has(.menu-item-has-children:hover),
body.ha-hero .testata:has(.is-aperto) {
	background: var(--sabbia); color: var(--notte);
	box-shadow: 0 1px 0 var(--linea), 0 10px 30px -18px rgba(13, 42, 51, 0.4);
}
body.ha-hero .testata:has(.menu-item-has-children:hover)::before, body.ha-hero .testata:has(.is-aperto)::before { opacity: 0; }
.testata.is-nascosta { transform: translateY(-110%); }
.testata.is-nascosta:has(.is-aperto) { transform: none; }

.testata__barra {
	position: static;
	gap: clamp(16px, 2.2vw, 40px);
	height: var(--testata-h);
	max-width: calc(var(--larghezza) + 2 * var(--gutter));
	padding-inline: var(--gutter);
}
.testata__logo { margin-right: 0; }
.testata__logo .logo { height: clamp(40px, 3.8vw, 52px); }
/* Logo sopra la foto: quello per sfondi scuri se caricato, altrimenti il logo principale in bianco. */
body.ha-hero .testata:not(.is-piena):not(:has(.menu-item-has-children:hover)):not(:has(.is-aperto)) .logo--principale:only-child { filter: brightness(0) invert(1) drop-shadow(0 1px 8px rgba(8, 29, 36, 0.4)); }
body.ha-hero .testata:is(.is-piena, :has(.menu-item-has-children:hover), :has(.is-aperto)) .logo--chiaro { opacity: 0; }
body.ha-hero .testata:is(.is-piena, :has(.menu-item-has-children:hover), :has(.is-aperto)) .testata__logo:has(.logo--chiaro) .logo--principale { opacity: 1; }

.testata__nav { flex: 1; }
.testata__nav .menu { justify-content: center; gap: clamp(10px, 1.5vw, 26px); }
.testata__nav .menu > li { position: static; }
.testata__nav .menu > li > a { padding-block: 10px; font-size: 0.95rem; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; }
.testata__nav .current-menu-item > a::after,
.testata__nav .current-menu-ancestor > a::after,
.testata__nav .current-menu-parent > a::after { transform: scaleX(1); }
.testata__prenota { flex: none; min-height: 44px; }
.testata__apri { margin-left: auto; }
body.ha-hero .testata:not(.is-piena) .testata__apri { border-color: rgba(255, 255, 255, 0.7); }

/* Riquadro dei sottomenu con le foto */
.testata__nav .sub-menu.mega {
	position: absolute; left: 0; right: 0; top: 100%; min-width: 0;
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px;
	max-width: calc(var(--larghezza) + 2 * var(--gutter)); margin-inline: auto;
	padding: 24px var(--gutter) 32px;
	border-radius: 0 0 var(--raggio) var(--raggio);
	background: var(--sabbia); color: var(--notte);
	box-shadow: 0 1px 0 var(--linea) inset, 0 30px 50px -30px rgba(13, 42, 51, 0.45);
}
.testata__nav .sub-menu.mega::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 26px; } /* ponte per il mouse */
.testata__nav .mega li { min-width: 0; }
.testata__nav .mega .mega__voce { display: grid; gap: 10px; padding: 0; border-radius: 12px; white-space: normal; background: none; }
.testata__nav .mega .mega__voce:hover, .testata__nav .mega .mega__voce:focus-visible { background: none; }
.testata__nav .mega:has(> li:nth-child(9)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.testata__nav .mega:not(:has(> li:nth-child(4))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mega__foto { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: var(--sabbia-2); }
.mega__foto img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.mega__nome { font-family: var(--font-titoli-medio); font-size: 1.2rem; line-height: 1.15; }
.mega__testo { margin-top: -4px; font-size: 0.88rem; color: var(--grigio); }
@media (hover: hover) and (pointer: fine) {
	.mega__voce:hover .mega__foto img { transform: scale(1.05); }
	.mega__voce:hover .mega__nome { color: var(--mare); }
}
.mega__voce[aria-current="page"] .mega__nome { color: var(--mare); }
@media (min-width: 1100px) and (max-width: 1279px) {
	.testata__nav .menu > li > a { font-size: 0.9rem; }
	.testata__barra { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.testata.is-nascosta { transform: none; }
}

/* 4. Menu mobile ------------------------------------------------------------ */
.menu-mobile { background: var(--notte); }
.menu-mobile__voci a { font-weight: 400; }
.menu-mobile__voci a:hover { color: var(--sole); }

/* 5. Footer e barra mobile -------------------------------------------------- */
.piede { background: var(--notte); }
.piede__logo { background: var(--sabbia); border-radius: 14px; padding: 10px 14px; height: 76px; }
.piede__titolo { font-family: var(--font-misura); font-weight: 400; letter-spacing: 0.14em; }
.piede a:hover { color: var(--sole); }
.ha-barra-mobile .barra-mobile {
	background: rgba(245, 246, 242, 0.94);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-top: 1px solid var(--linea);
}

/* 6. Pagine interne --------------------------------------------------------- */
.apertura__foto, .intro__foto, .camera__foto, .alternato__foto, .coppia__foto, .colonna__foto,
.percorso__foto, .capitolo__foto, .eventi__foto, .ristorante__foto, .mosaico__link, .offerta { border-radius: var(--raggio); }
.tappa__valore, .fatti__etichetta, .destinazioni__distanza { font-variant-numeric: tabular-nums; }
.tappa__valore { font-family: var(--font-misura); font-size: 1rem; letter-spacing: 0.06em; }
.chiusura { background: var(--sabbia-2); }
.ricerca__riepilogo { flex-basis: 100%; margin: 0 0 4px; font-weight: 600; color: var(--notte); }
