/* Testata e menu v2 (novembre 2026), su tutte le pagine. Desktop: mega-menu Sposa e Cerimonia con i nomi
   degli stilisti e una stampa che cambia; telefono: pannello a tutto schermo con la striscia degli stilisti.
   Sulle pagine con l'apertura a tutto schermo (home, alternative) la testata è fissa e trasparente sopra il
   video; altrove sta nel flusso della pagina, come la testata di prima. */
:root {
	--am2-m: clamp(20px, 5vw, 80px);
	--am2-gap: clamp(12px, 1.7vw, 24px);
	--am2-ease: cubic-bezier(.2, .7, .2, 1);
	--am2-display: var(--wp--preset--font-family--display);
	--am2-soft: var(--c-cenere);
}

.am2-bottone { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; background: var(--c-ink); color: var(--c-carta) !important; font-size: 14px; font-weight: 400; letter-spacing: .04em; text-decoration: none; white-space: nowrap; border-radius: 0; transition: background-color .35s, color .35s, transform .35s var(--am2-ease); }
.am2-bottone:hover { background: var(--c-oro-testo); }
.am2-bottone:active { transform: scale(.97); }
.am2 :focus-visible, .am2-header :focus-visible { outline: 2px solid var(--c-oro); outline-offset: 3px; }

/* ---------------------------------------------------------------- Testata v2 */
.am2-header { position: fixed; inset: 0 0 auto; z-index: 50; background: var(--c-carta); color: var(--c-ink); transition: background-color .5s, color .5s, transform .6s var(--am2-ease); }
.am2-header.is-nascosta:not(.is-mega) { transform: translateY(-100%); }
html.am2-menu-aperto .am2-header { transform: none; }
.am2-header__bar { display: flex; align-items: center; gap: 28px; padding: 14px var(--am2-m); }
.am2-header .am-logo { flex: none; position: static !important; transform: none !important; }
/* Il margine automatico di WordPress tra i blocchi spostava in basso menu e pulsante rispetto al logo. */
.am2-header__bar > * { margin-block: 0 !important; }
.am2-header .am-logo img { height: 42px; width: auto; max-width: none; }
.am2-header__azioni { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.am2-header__azioni > * { margin: 0 !important; }
.am2-header__cta { margin: 0; }
.am2-header .am-salvati-link, .am2-header .am-carrello-link { color: inherit; }
html:not(.am2-menu-aperto) .am2-header.is-scuro:not(.is-mega) { background: transparent; color: var(--c-carta); }
html:not(.am2-menu-aperto) .am2-header.is-scuro:not(.is-mega) .am-logo__scuro { display: none; }
html:not(.am2-menu-aperto) .am2-header.is-scuro:not(.is-mega) .am-logo__chiaro { display: block; }
html:not(.am2-menu-aperto) .am2-header.is-scuro:not(.is-mega) .am2-bottone { background: var(--c-carta); color: var(--c-ink) !important; }
html:not(.am2-menu-aperto) .am2-header.is-scuro:not(.is-mega) .am2-bottone:hover { background: var(--c-avorio); }
html.am2-menu-aperto .am2-header { background: var(--c-carta) !important; color: var(--c-ink) !important; }
html.am2-menu-aperto .am2-header .am-logo__scuro { display: block !important; }
html.am2-menu-aperto .am2-header .am-logo__chiaro { display: none !important; }
html.am2-menu-aperto .am2-header .am2-bottone { background: var(--c-ink) !important; color: var(--c-carta) !important; }

.am2-menu { flex: 1; display: flex; align-items: center; }
.am2-menu__voci { display: none; list-style: none; margin: 0; padding: 0; gap: clamp(18px, 2vw, 30px); }
.am2-menu__voce { position: relative; display: inline-flex; padding: 12px 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; font-size: 16px; font-weight: 400; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.am2-menu__voce { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 10px; text-decoration-thickness: 1px; transition: text-decoration-color .4s, text-underline-offset .4s var(--am2-ease); }
.am2-menu__voce:hover, .am2-menu__voce[aria-expanded="true"] { text-decoration-color: var(--c-oro); text-underline-offset: 6px; }

/* Mega-menu */
.am2-mega { display: none; }
.am2-mega:not([hidden])::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 100dvh; background: color-mix(in srgb, var(--c-ink) 38%, transparent); animation: am2-appare .5s var(--am2-ease) both; pointer-events: none; }
@media (min-width: 1024px) {
	.am2-menu__voci { display: flex; }
	.am2-mega:not([hidden]) { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--c-carta); color: var(--c-ink); animation: am2-tenda .55s var(--am2-ease) both; }
	.am2-mega__dentro { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--am2-gap); padding: 40px var(--am2-m) 56px; align-items: start; }
	.am2-mega__intro { grid-column: 1 / 4; display: flex; flex-direction: column; gap: 16px; }
	.am2-mega__titolo { font-family: var(--am2-display); font-size: 26px; line-height: 1.15; margin: 0; }
	.am2-mega__testo { margin: 0; font-size: 16px; line-height: 1.55; max-width: 30ch; }
	.am2-mega__tutti { align-self: start; font-size: 16px; font-weight: 400; text-decoration: underline; text-decoration-color: var(--c-oro); text-underline-offset: 6px; }
	.am2-mega__altro { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 8px; }
	.am2-mega__altro a { font-size: 16px; text-decoration: none; color: var(--am2-soft); transition: color .3s; }
	.am2-mega__altro a:hover { color: var(--c-ink); }
	.am2-mega__nomi { grid-column: 4 / 10; list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--am2-gap); }
	.am2-mega__nomi li { break-inside: avoid; animation: am2-sali .6s var(--am2-ease) both; }
	.am2-mega__nomi a { display: inline-block; padding: 5px 0; font-family: var(--am2-display); font-size: clamp(20px, 1.8vw, 26px); line-height: 1.25; text-decoration: none; color: var(--c-ink); transition: color .35s, transform .45s var(--am2-ease); }
	.am2-mega__nomi a span { margin-left: 6px; font-family: var(--wp--preset--font-family--sans); font-size: 14px; color: var(--am2-soft); }
	.am2-mega__nomi:hover a:not(.is-on), .am2-mega__nomi:focus-within a:not(.is-on) { color: var(--am2-soft); }
	.am2-mega__nomi a.is-on { text-decoration: underline; text-decoration-color: var(--c-oro); text-decoration-thickness: 1px; text-underline-offset: 7px; }
	.am2-mega__stampa { grid-column: 10 / 13; margin: 0; }
	.am2-mega__stampa { position: relative; display: grid; }
	.am2-mega__foto { position: relative; grid-area: 1 / 1; aspect-ratio: 4 / 5; overflow: hidden; opacity: 0; transition: opacity .9s var(--am2-ease); background: var(--c-avorio); }
	.am2-mega__foto.is-on { opacity: 1; }
	.am2-mega__foto img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transform: scale(1.06); transition: transform 1.6s var(--am2-ease); }
	.am2-mega__foto.is-on img { transform: scale(1); }
	.am2-mega__stampa figcaption { grid-area: 2 / 1; margin-top: 12px; font-size: 14px; color: var(--am2-soft); }
	.am2-menu__apri, .am2-pannello { display: none !important; }
	.am2-header .am-logo img { height: clamp(34px, calc(34px + (100vw - 1024px) * .08), 54px); }
}
@keyframes am2-tenda { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -100vh 0); } }
@keyframes am2-appare { from { opacity: 0; } to { opacity: 1; } }
@keyframes am2-sali { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Menu v2 mobile: pannello a tutto schermo */
.am2-menu__apri { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0 0 10px; border: 0; background: none; color: inherit; font: inherit; font-size: 16px; font-weight: 400; cursor: pointer; }
.am2-menu__apri-chiudi, html.am2-menu-aperto .am2-menu__apri-apri { display: none; }
html.am2-menu-aperto .am2-menu__apri-chiudi { display: inline; }
.am2-pannello { display: none; }
html.am2-menu-aperto, html.am2-menu-aperto body { overflow: hidden; }
@media (max-width: 1023px) {
	.am2-header__bar { gap: 10px; padding-block: 10px; }
	.am2-menu { flex: none; order: 3; }
	.am2-header__azioni { gap: 2px; }
	.am2-header .am-salvati-link__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.am2-header .am2-bottone { min-height: 38px; padding: 0 14px; font-size: 13px; }
	html.am2-menu-aperto .am2-pannello { display: flex; flex-direction: column; gap: 40px; position: fixed; inset: 64px 0 0; z-index: 60; overflow-y: auto; padding: 24px var(--am2-m) 48px; background: var(--c-carta); color: var(--c-ink); animation: am2-appare .4s var(--am2-ease) both; }
	.am2-pannello__voci { list-style: none; margin: 0; padding: 0; }
	.am2-pannello__voce { animation: am2-sali .7s var(--am2-ease) both; }
	.am2-pannello__voce:nth-child(2) { animation-delay: .05s; } .am2-pannello__voce:nth-child(3) { animation-delay: .1s; }
	.am2-pannello__voce:nth-child(4) { animation-delay: .15s; } .am2-pannello__voce:nth-child(5) { animation-delay: .2s; }
	.am2-pannello__voce:nth-child(6) { animation-delay: .25s; }
	.am2-pannello__voce > a, .am2-pannello__voce > button { display: flex; width: 100%; align-items: baseline; gap: 10px; padding: 6px 0; border: 0; background: none; color: var(--c-ink); font-family: var(--am2-display); font-size: clamp(34px, 10vw, 44px); line-height: 1.15; text-align: left; text-decoration: none; cursor: pointer; }
	.am2-pannello__voce > button span { font-family: var(--wp--preset--font-family--sans); font-size: 14px; color: var(--am2-soft); }
	.am2-pannello__voce > button::after { content: "+"; margin-left: auto; font-family: var(--wp--preset--font-family--sans); font-size: 24px; font-weight: 300; transition: transform .4s var(--am2-ease); }
	.am2-pannello__voce > button[aria-expanded="true"]::after { transform: rotate(45deg); }
	.am2-pannello__voce:nth-child(n+5) > a { font-size: 20px; padding: 8px 0; }
	.am2-pannello__voce:nth-child(5) { margin-top: 20px; }
	.am2-pannello__sub:not([hidden]) { display: block; padding: 8px 0 20px; animation: am2-appare .5s var(--am2-ease) both; }
	.am2-striscia { display: flex; gap: 8px; list-style: none; margin: 0 calc(-1 * var(--am2-m)) 0 0; padding: 0 var(--am2-m) 0 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.am2-striscia li { flex: none; width: 34vw; scroll-snap-align: start; animation: am2-sali .6s var(--am2-ease) both; }
	.am2-striscia li:nth-child(2) { animation-delay: .06s; } .am2-striscia li:nth-child(3) { animation-delay: .12s; } .am2-striscia li:nth-child(n+4) { animation-delay: .18s; }
	.am2-striscia a { display: block; text-decoration: none; color: var(--c-ink); }
	.am2-striscia img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 20%; background: var(--c-avorio); }
	.am2-striscia span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.3; }
	.am2-pannello__tutti { display: inline-block; margin-top: 14px; font-size: 16px; text-decoration: underline; text-decoration-color: var(--c-oro); text-underline-offset: 6px; color: var(--c-ink); }
	.am2-pannello__piede { display: grid; gap: 14px; animation: am2-sali .7s .3s var(--am2-ease) both; }
	.am2-pannello__piede p { margin: 0; }
	.am2-pannello__piede .am2-bottone { min-height: 52px; font-size: 16px; }
	.am2-pannello__contatti { display: flex; gap: 24px; font-size: 20px; }
	.am2-pannello__contatti a { color: var(--c-ink); text-underline-offset: 5px; }
	.am2-pannello__nota { font-size: 14px; color: var(--am2-soft); }
	.am2-pannello__cerca input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--c-filo); border-radius: 0; background: var(--c-carta); font: inherit; font-size: 16px; font-weight: 300; }
}
@media (max-width: 599px) { .am2-header .am-salvati-link, .am2-header .am-carrello-link { display: none !important; } .am2-header .am-logo img { height: clamp(26px, calc((100vw - 244px) / 3.967), 40px); } }
.am2-pannello__contatti--piccoli { font-size: 16px !important; }
@media (max-width: 350px) { .am2-header__cta { display: none; } .am2-header .am-logo img { height: 38px; } }

/* Nelle pagine normali la testata sta nel flusso; fissa solo sopra le aperture a tutto schermo. */
.am2-header { position: relative; }
body:has(.am2, .am3) .am2-header { position: fixed; }
html.am2-menu-aperto .am2-header { position: fixed; }
.wp-site-blocks > header.wp-block-template-part:has(.am2-header) { position: relative; z-index: 50; }

/* Tra 1024 e 1179 la scritta «Salvati» farebbe uscire il pulsante dal margine: resta il cuore. */
@media (min-width: 1024px) and (max-width: 1499px) { .am2-header .am-salvati-link__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
/* Con la voce Contatti, sotto 1160 px le voci si stringono. */
@media (min-width: 1024px) and (max-width: 1159px) { .am2-header__bar { gap: 20px; } .am2-menu__voci { gap: 13px; } .am2-menu__voce { font-size: 15px; } .am2-header .am2-header__cta .am2-bottone { padding-inline: 14px; } }
/* Barra più grande su desktop. */
@media (min-width: 1260px) {
	.am2-header__bar { padding-block: 20px; }
	.am2-menu__voce { font-size: 17px; }
	.am2-header .am-logo img { height: clamp(50px, calc(50px + (100vw - 1200px) * .035), 66px); }
	.am2-header .am2-header__cta .am2-bottone { font-size: 16px; min-height: 50px; padding-inline: 24px; }
	.am2-header .am2-header__azioni :is(.am-salvati-link, .am-carrello-link) svg { width: 20px; height: 20px; }
}
@media (min-width: 1400px) { .am2-menu__voce { font-size: 18px; } }
@media (min-width: 1700px) { .am2-menu__voce { font-size: 19px; } .am2-header__bar { padding-block: 24px; gap: 40px; } .am2-header .am2-header__cta .am2-bottone { font-size: 17px; min-height: 54px; padding-inline: 28px; } }
