/* =========================================================
   La Dimora di Nonna Dora — style.css
   ========================================================= */

/* RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
svg,
canvas,
iframe {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

ul[class],
ol[class] {
    list-style: none;
    padding: 0;
}

address {
    font-style: normal;
}

/* VARIABLES */
:root {
    /* Palette terracotta e sabbia */
    --color-background: #EEE3D2;
    --color-surface: #F7EFE3;
    --color-sand: #E4D3BA;
    --color-line: #D8C5A9;
    --color-stone: #C4AD8C;
    --color-primary: #A44F33;
    --color-text: #3B2A20;
    --color-muted: #6B5545;
    --color-dark: #3B2A20;
    --color-ivory: #F8F1E6;
    --color-error: #A3321F;
    --color-success: #4F6B3A;

    --font-serif: "Cormorant Garamond", "Times New Roman", serif;
    --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

    --radius: 4px;
    --radius-arch: 999px 999px 0 0;
    --container: 1200px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --header-h: 80px;
    --section-space: clamp(5rem, 11vw, 9rem);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* TYPOGRAPHY */
body {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: -0.005em;
    color: var(--color-text);
    background: var(--color-background);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.1;
    color: var(--color-text);
}

h1 em {
    font-style: italic;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
}

.section-title {
    font-size: clamp(3rem, 7.5vw, 6.2rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.02em;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.lead {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    line-height: 1.45;
}

a {
    color: var(--color-primary);
    text-underline-offset: 3px;
}

/* GLOBAL */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    overflow-x: hidden;
}

body.is-locked {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-space);
}

.section + .section {
    border-top: 1px solid var(--color-line);
}

.section-head {
    margin-bottom: clamp(3.5rem, 8vw, 6rem);
}

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Pulsanti */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 50px;
    padding: 0.85rem 1.9rem;
    border: 1px solid transparent;
    border-radius: 0;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn-sm {
    min-height: 42px;
    padding: 0.6rem 1.25rem;
    font-size: 0.68rem;
}

.btn-block {
    width: 100%;
}

.btn-primary,
.btn-dark {
    background: var(--color-dark);
    color: var(--color-ivory);
}

.btn-primary:hover,
.btn-dark:hover {
    background: var(--color-primary);
}

.btn-outline {
    border-color: var(--color-text);
    color: var(--color-text);
}

.btn-outline:hover {
    background: var(--color-text);
    color: var(--color-ivory);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-text);
}

.link-arrow .icon {
    transition: transform 0.3s var(--ease);
}

.link-arrow:hover {
    color: var(--color-primary);
}

.link-arrow:hover .icon {
    transform: translateX(4px);
}

/* HEADER */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: var(--header-h);
    color: var(--color-text);
    transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.site-header.is-scrolled,
.site-header.is-open {
    background: rgba(238, 227, 210, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--color-line);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 2;
}


.brand-text {
    display: flex;
    flex-direction: column;
    font-family: var(--font-serif);
    line-height: 1;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.brand-sub {
    font-size: 1.05rem;
    font-style: italic;
    margin-top: 0.15rem;
    color: var(--color-muted);
}

.nav-list {
    display: flex;
    align-items: center;
    gap: clamp(1.1rem, 2.2vw, 2.25rem);
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: inherit;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

.nav-link.is-active {
    color: var(--color-primary);
}

.nav-mobile-extra {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
}

.header-icon {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nav-toggle-bar {
    width: 24px;
    height: 1px;
    background: currentColor;
    transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* HERO */
.hero {
    position: relative;
}

.hero-sticky {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: var(--header-h);
    overflow: hidden;
}

/* Modalità "volo": spazio di scroll per entrare nell'arco (attivata da script.js) */
.hero.is-fly {
    height: 300vh;
}

.hero.is-fly .hero-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
}

/* Bagliore caldo dietro l'arco (posizione e intensità aggiornate da script.js) */
.hero-sticky::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle min(46vw, 520px) at var(--glow-x, 72%) var(--glow-y, 55%), rgba(226, 200, 162, 0.4), rgba(226, 200, 162, 0.12) 55%, rgba(226, 200, 162, 0) 100%);
    opacity: var(--glow, 1);
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.hero-title {
    font-size: clamp(3.2rem, 7vw, 6.4rem);
    line-height: 0.98;
    letter-spacing: -0.01em;
}

.hero-title .word {
    display: inline-block;
    white-space: nowrap;
}

.hero-title.is-split .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.35em);
    filter: blur(8px);
    animation: char-in 1.1s var(--ease) forwards;
    animation-delay: calc(var(--i) * 38ms + 250ms);
}

@keyframes char-in {
    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

.hero-title em {
    display: block;
    margin-top: 0.12em;
    font-size: 0.7em;
    color: var(--color-muted);
}

.hero-tagline {
    max-width: 30ch;
    margin-top: 1.75rem;
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2.2vw, 1.55rem);
    font-style: italic;
    line-height: 1.45;
    color: var(--color-muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem 2rem;
    margin-top: 2.75rem;
}

.hero-anim {
    animation: hero-in 1.1s var(--ease) both;
    animation-delay: calc(var(--d, 0ms) + 150ms);
}

.hero-visual {
    position: relative;
    height: min(78vh, 720px);
    min-height: 420px;
}

/* Foto ad arco: visibile finché la scena 3D non è pronta, o se WebGL non è disponibile */
.hero-fallback {
    position: absolute;
    left: 50%;
    bottom: 6%;
    width: min(62%, 380px);
    height: 80%;
    transform: translateX(-50%);
    border-radius: var(--radius-arch);
    overflow: hidden;
    background: var(--color-sand);
    transition: opacity 1s var(--ease);
}

.hero-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s var(--ease);
}

.hero.is-3d .hero-canvas {
    opacity: 1;
}

.hero.is-3d .hero-fallback {
    opacity: 0;
    visibility: hidden;
}

/* Foto nitida del volo: ritagliata nella forma del vano dell'arco e allineata alla scena 3D (script.js) */
.hero-reveal {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    opacity: var(--reveal, 0);
    clip-path: var(--reveal-clip, inset(50%));
    visibility: hidden;
    pointer-events: none;
}

.hero.is-fly .hero-reveal,
.hero.is-dom-photo .hero-reveal {
    visibility: visible;
}

.hero-reveal img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--img-w, 100%);
    height: var(--img-h, 100%);
    max-width: none;
    transform: translate(-50%, -50%) translate(var(--img-x, 0px), var(--img-y, 0px)) scale(var(--img-s, 1));
}

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 1.5rem;
    z-index: 4;
    transform: translateX(-50%);
    min-width: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--color-text);
    text-decoration: none;
}

.scroll-cue-text {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.scroll-cue-line {
    position: relative;
    width: 1px;
    height: 44px;
    background: var(--color-line);
    overflow: hidden;
}

.scroll-cue-line::after {
    content: "";
    position: absolute;
    left: 0;
    top: -40%;
    width: 1px;
    height: 40%;
    background: var(--color-text);
    animation: scroll-cue 2.4s var(--ease) infinite;
}

@keyframes hero-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: none; }
}

@keyframes scroll-cue {
    0% { top: -40%; }
    100% { top: 100%; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* LA NOSTRA STRUTTURA: tre schede affiancate con foto ad arco */
.room-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.25rem, 2.6vw, 2.5rem);
}

.room {
    display: flex;
    flex-direction: column;
}

.room-media {
    margin: 0;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-arch);
    overflow: hidden;
    background: var(--color-sand);
}

.room-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
}

.room:hover .room-media img {
    transform: scale(1.04);
}

.room-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-top: 1.75rem;
}

.room-index {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--color-primary);
}

.room-title {
    font-size: clamp(1.7rem, 2.4vw, 2.2rem);
    margin-bottom: 0.75rem;
}

.room-text {
    color: var(--color-muted);
    font-size: 0.98rem;
}

.room-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.6rem;
    margin-top: auto;
    padding-top: 1.1rem;
    border-top: 1px solid var(--color-line);
    font-family: var(--font-serif);
    font-size: 1.3rem;
}

.room-text + .room-price {
    margin-top: 1.5rem;
}

.room-price span {
    font-family: var(--font-sans);
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-muted);
}

/* CHI SIAMO: foto a tutta larghezza, riquadro ad arco sovrapposto */
.about {
    position: relative;
    border-top: 1px solid var(--color-line);
}

.about-photo {
    margin: 0;
    height: clamp(560px, 92vh, 880px);
    background: var(--color-sand);
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
}

.about-card {
    width: min(100%, 470px);
    padding: clamp(4.5rem, 7vw, 6rem) clamp(2rem, 3.5vw, 3rem) clamp(2.25rem, 3.5vw, 3rem);
    text-align: center;
    background: rgba(247, 239, 227, 0.94);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 999px 999px 6px 6px;
    box-shadow: 0 50px 80px -40px rgba(45, 34, 22, 0.55);
    pointer-events: auto;
}

.about-card .section-title {
    font-size: clamp(2.6rem, 4.4vw, 3.8rem);
}

.about-card .lead {
    margin-top: 1.4rem;
    font-size: clamp(1.3rem, 1.9vw, 1.55rem);
    line-height: 1.4;
}

.about-more {
    margin-top: 1.1rem;
    color: var(--color-muted);
    font-size: 0.98rem;
}

.about-card .link-arrow {
    margin-top: 1.75rem;
}

/* SERVICES */
.services {
    background: var(--color-background);
}

.services-layout {
    display: block;
}

.services-head {
    margin-bottom: clamp(3rem, 7vw, 5rem);
}

.services-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 2vw, 1.75rem);
}

/* Lastre di calcare con sommità ad arco (stessa texture della pietra 3D) */
.service {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    padding: clamp(4.5rem, 8vw, 6.5rem) clamp(1.5rem, 3vw, 2.25rem) clamp(2.25rem, 4vw, 3rem);
    text-align: center;
    background:
        linear-gradient(180deg, rgba(246, 242, 235, 0.72), rgba(238, 231, 220, 0.6)),
        #efe9df var(--stone-url, none) center / 900px;
    border-radius: 999px 999px 6px 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -24px 40px -28px rgba(90, 70, 45, 0.28),
        0 34px 46px -36px rgba(60, 45, 30, 0.45);
}

.service-icon {
    display: inline-flex;
    color: #9c8463;
    font-size: 2.1rem;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.85));
}

.service-title {
    font-size: 1.65rem;
    margin-bottom: 0.4rem;
}

.service p {
    max-width: 30ch;
    margin-inline: auto;
    color: #5f584f;
}

.service .service-note {
    margin-top: 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-text);
}

/* GALLERY */
.gallery {
    padding-top: var(--section-space);
    border-top: 1px solid var(--color-line);
}

.gallery-head {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 2rem;
}

.gallery-all {
    padding-block: clamp(3rem, 6vw, 4.5rem) var(--section-space);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: clamp(150px, 17vw, 220px);
    grid-auto-flow: dense;
    gap: clamp(0.5rem, 1vw, 0.875rem);
    margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.gallery-grid[hidden] {
    display: none;
}

.g-item.is-hidden {
    display: none;
}

/* Mosaico: blocchi da 7 foto (una grande, una alta, una larga); ogni secondo blocco ha la foto grande a destra */
.g-item:nth-child(7n + 1) {
    grid-column: span 2;
    grid-row: span 2;
}

.g-item:nth-child(14n + 8) {
    grid-column: 3 / span 2;
}

.g-item:nth-child(7n + 3) {
    grid-row: span 2;
}

.g-item:nth-child(7n + 6) {
    grid-column: span 2;
}

.g-btn {
    position: relative;
    display: block;
    border-radius: 3px;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--color-sand);
    cursor: zoom-in;
}

.g-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s var(--ease), opacity 0.5s var(--ease);
}

.g-btn:hover img,
.g-btn:focus-visible img {
    transform: scale(1.04);
    opacity: 0.88;
}

.gallery-more {
    display: flex;
    justify-content: center;
}

.gallery-more[hidden] {
    display: none;
}

/* LOCATION */
.location-grid {
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    align-items: center;
    gap: clamp(3rem, 8vw, 8rem);
}

.location-media {
    margin: 0;
    aspect-ratio: 3 / 4;
    max-height: 82vh;
    border-radius: var(--radius-arch);
    overflow: hidden;
    background: var(--color-sand);
}

.location-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.location-step + .location-step {
    margin-top: 2.5rem;
}

.location-intro {
    margin-top: 2rem;
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    line-height: 1.35;
}

.location-address {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin: 2rem 0;
    padding: 1.25rem 0;
    border-block: 1px solid var(--color-line);
    font-weight: 700;
}

.location-address .icon {
    margin-top: 0.25rem;
    color: var(--color-primary);
}

.location-directions {
    margin-bottom: 2.25rem;
}

.location-directions h3 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.location-directions p {
    color: var(--color-muted);
}

/* CONTACT */
.contact {
    background: var(--color-sand);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    align-items: start;
    gap: clamp(3rem, 7vw, 7rem);
}

.contact-heading {
    font-size: 1.9rem;
    margin-bottom: 1.5rem;
}

.contact-list {
    border-top: 1px solid var(--color-stone);
}

.contact-item {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 1rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--color-stone);
    text-decoration: none;
    color: var(--color-text);
    transition: color 0.3s var(--ease), padding-left 0.4s var(--ease);
}

.contact-item:hover {
    padding-left: 0.5rem;
    color: var(--color-primary);
}

.contact-label {
    padding-top: 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.contact-value {
    min-width: 0;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.hours-card {
    margin-top: 3rem;
}

.hours-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.hours-list div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--color-stone);
}

.hours-list dt {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.hours-list dd {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    line-height: 1.2;
}

.hours-note {
    margin-top: 1rem;
    font-size: 0.92rem;
    font-style: italic;
    color: var(--color-muted);
}

.contact {
    overflow-x: clip;
}

.form-card {
    position: relative;
    padding: clamp(2rem, 5vw, 3.5rem);
    background: var(--color-surface);
}

.form-title {
    font-size: 2.2rem;
}

.form-hint {
    margin: 0.35rem 0 2.25rem;
    font-size: 0.88rem;
    color: var(--color-muted);
}

.contact-form {
    display: grid;
    gap: 1.6rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
}

.field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.field label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.req {
    color: var(--color-primary);
}

/* Campi a linea sottile */
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.55rem 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--color-stone);
    border-radius: 0;
    font-size: 1.05rem;
    line-height: 1.4;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
    -webkit-appearance: none;
    appearance: none;
}

.field select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236F685F' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 18px;
}

.field input[type="date"] {
    min-width: 0;
}

.field textarea {
    resize: vertical;
    min-height: 100px;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-bottom-color: var(--color-muted);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-bottom-color: var(--color-text);
    box-shadow: 0 1px 0 0 var(--color-text);
}

.field.has-error input,
.field.has-error select {
    border-bottom-color: var(--color-error);
    box-shadow: 0 1px 0 0 var(--color-error);
}

.field-error {
    font-size: 0.82rem;
    color: var(--color-error);
}

.field-error:not(:empty) {
    margin-top: 0.4rem;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form button[type="submit"] {
    margin-top: 0.75rem;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(238, 227, 210, 0.35);
    border-top-color: var(--color-ivory);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.is-loading .spinner {
    display: inline-block;
}

.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-status:empty {
    display: none;
}

.form-status {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
}

.form-status.is-success {
    background: #EEF2E7;
    color: var(--color-success);
}

.form-status.is-error {
    background: #FBEDE9;
    color: var(--color-error);
}

.form-status .icon {
    margin-top: 0.15rem;
}

/* FOOTER */
.site-footer {
    background: var(--color-sand);
    color: var(--color-text);
    padding-bottom: 1.5rem;
    font-size: 0.9rem;
    overflow-x: clip;
}

.footer-stage {
    position: relative;
}

.footer-canvas {
    display: none;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 640px;
    margin-inline: auto;
    padding: clamp(4rem, 9vw, 6rem) var(--gutter) 2.5rem;
    text-align: center;
}

.footer-name {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1.05;
}

.footer-name em {
    display: block;
    font-style: italic;
    color: var(--color-muted);
}

.footer-address,
.footer-contacts {
    color: var(--color-muted);
    line-height: 1.55;
}

.footer-codes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.15rem 1rem;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    color: var(--color-muted);
}

.site-footer a {
    color: var(--color-text);
    text-decoration-color: var(--color-stone);
}

.site-footer a:hover {
    color: var(--color-primary);
}

.sep {
    margin-inline: 0.35rem;
    opacity: 0.5;
}

.footer-social {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--color-stone);
    border-radius: 50%;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.footer-social a:hover {
    background: var(--color-text);
    border-color: var(--color-text);
    color: var(--color-ivory);
}

/* Arco 3D: tutto il contenuto si dispone nel vano (posizione e misure da script.js) */
.site-footer.is-3d .footer-stage {
    height: max(680px, 100vh);
    height: max(680px, 100svh);
}

.site-footer.is-3d .footer-canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.site-footer.is-3d .footer-content {
    position: absolute;
    left: var(--fx, 0);
    top: var(--fy, 0);
    width: var(--fw, 100%);
    height: var(--fh, 100%);
    max-width: none;
    justify-content: center;
    gap: 0.5em;
    padding: calc(var(--fw, 400px) * 0.32) 7% 6%;
    font-size: clamp(0.72rem, calc(var(--fw, 400px) * 0.032), 0.98rem);
    opacity: var(--fo, 0);
    background: radial-gradient(ellipse at 50% 70%, rgba(247, 239, 227, 0.92), rgba(228, 211, 186, 0) 75%);
}

.site-footer.is-3d .footer-codes {
    font-size: 0.9em;
}

.site-footer.is-3d .footer-name {
    font-size: 2.3em;
}

/* Sotto l'arco: social e note legali */
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-block: 1.5rem 0.5rem;
    border-top: 1px solid var(--color-line);
    font-size: 0.8rem;
    color: var(--color-muted);
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.5rem;
}

.footer-link {
    padding: 0.25em 0;
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-color: var(--color-stone);
    text-underline-offset: 3px;
    font-size: inherit;
}

.footer-link:hover {
    color: var(--color-primary);
}

/* Elementi fissi: WhatsApp, barra rapida mobile, cookie */
.wa-float {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-dark);
    color: var(--color-ivory);
    font-size: 1.25rem;
    transition: background-color 0.3s var(--ease);
}

.wa-float:hover {
    background: var(--color-primary);
}

.call-float {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-ivory);
    font-size: 1.2rem;
    box-shadow: 0 12px 26px -12px rgba(59, 42, 32, 0.6);
    transition: background-color 0.3s var(--ease);
}

.call-float:hover {
    background: var(--color-dark);
}

.cookie-banner {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 95;
    max-width: 400px;
    padding: 1.25rem 1.4rem;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    font-size: 0.85rem;
    color: var(--color-muted);
    animation: fade-in 0.6s var(--ease) both;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.policy {
    width: min(760px, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    margin: auto;
    padding: 0;
    border: 0;
    background: var(--color-background);
    color: var(--color-text);
}

.policy::backdrop {
    background: rgba(35, 32, 29, 0.6);
}

.policy-inner {
    position: relative;
    padding: clamp(2rem, 5vw, 3.25rem);
}

.policy h2 {
    font-size: 2.4rem;
    padding-right: 3rem;
}

.policy h3 {
    font-size: 1.45rem;
    margin: 1.75rem 0 0.5rem;
}

.policy p,
.policy li {
    color: var(--color-muted);
    margin-bottom: 0.6rem;
}

.policy ul {
    padding-left: 1.25rem;
}

.policy-date {
    font-size: 0.85rem;
    font-style: italic;
}

.policy .policy-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    color: var(--color-text);
    background: var(--color-sand);
}

/* DOMANDE FREQUENTI */
.faq-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
    gap: clamp(2.5rem, 7vw, 7rem);
}

.faq-head .section-title {
    font-size: clamp(2.6rem, 5vw, 4.4rem);
}

.faq-list {
    border-top: 1px solid var(--color-line);
}

.faq-item {
    border-bottom: 1px solid var(--color-line);
}

.faq-item summary {
    position: relative;
    display: block;
    padding: 1.35rem 3rem 1.35rem 0;
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    line-height: 1.3;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before,
.faq-item summary::after {
    content: "";
    position: absolute;
    right: 0.4rem;
    top: 50%;
    width: 14px;
    height: 1.5px;
    background: var(--color-primary);
    transition: transform 0.35s var(--ease);
}

.faq-item summary::after {
    transform: rotate(90deg);
}

.faq-item[open] summary::after {
    transform: rotate(0deg);
}

.faq-item summary:hover {
    color: var(--color-primary);
}

.faq-item p {
    max-width: 60ch;
    padding: 0 0 1.5rem;
    color: var(--color-muted);
}

.form-privacy {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--color-muted);
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* PAGINE LEGALI (cookie-policy.html, privacy-policy.html) */
.legal-header {
    padding-block: 1.25rem;
    border-bottom: 1px solid var(--color-line);
}

.legal-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.legal {
    max-width: 760px;
    padding-block: clamp(3rem, 8vw, 5.5rem);
}

.legal h1 {
    font-size: clamp(2.6rem, 6vw, 4rem);
    font-weight: 400;
    line-height: 1.05;
}

.legal h2 {
    font-size: 1.55rem;
    margin: 2.25rem 0 0.6rem;
}

.legal p,
.legal li {
    color: var(--color-muted);
    margin-bottom: 0.7rem;
}

.legal ul {
    padding-left: 1.25rem;
    list-style: disc;
}

.legal-date {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-style: italic;
}

.legal-footer {
    padding-block: 2rem;
    border-top: 1px solid var(--color-line);
    font-size: 0.8rem;
    color: var(--color-muted);
    text-align: center;
}

.legal-footer p + p {
    margin-top: 0.3rem;
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4.5rem 5.5rem;
    background: rgba(26, 24, 21, 0.97);
    color: var(--color-ivory);
    animation: fade-in 0.35s var(--ease) both;
    touch-action: pan-y;
}

.lightbox[hidden] {
    display: none;
}

.lb-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
}

.lb-img {
    max-width: 100%;
    max-height: calc(100vh - 11rem);
    max-height: calc(100dvh - 11rem);
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s var(--ease);
    user-select: none;
    -webkit-user-drag: none;
}

.lb-img.is-loading {
    opacity: 0;
}

.lb-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.25rem;
    margin-top: 1.1rem;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-style: italic;
    text-align: center;
}

.lb-counter {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    opacity: 0.7;
    align-self: center;
}

.lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--color-ivory);
    background: rgba(238, 227, 210, 0.08);
    font-size: 1.3rem;
    transition: background-color 0.3s var(--ease);
}

.lb-btn:hover {
    background: rgba(238, 227, 210, 0.2);
}

.lb-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
}

.lb-prev,
.lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lb-prev {
    left: 1.25rem;
}

.lb-next {
    right: 1.25rem;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .header-cta {
        display: none;
    }

    .hero-inner {
        grid-template-columns: 1fr 1fr;
    }

    .services-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-auto-rows: clamp(120px, 19vw, 200px);
    }

    .location-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .location-media {
        width: 100%;
        max-width: 460px;
        max-height: none;
    }
}

@media (max-width: 900px) {
    /* Camere: schede basse, foto ad arco a sinistra e testo a destra */
    .room-list {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 640px;
    }

    .room {
        display: grid;
        grid-template-columns: 38% 1fr;
        align-items: start;
        gap: clamp(1rem, 4vw, 1.75rem);
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--color-line);
    }

    .room:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .room-media {
        width: 100%;
        aspect-ratio: 3 / 4;
    }

    .room-content {
        padding-top: 0.75rem;
    }

    .room-title {
        font-size: clamp(1.3rem, 5.2vw, 1.75rem);
        margin-bottom: 0.4rem;
    }

    .room-text {
        font-size: 0.88rem;
        line-height: 1.5;
    }

    .room-price {
        font-size: 1.1rem;
        padding-top: 0.75rem;
    }

    .room-text + .room-price {
        margin-top: 0.9rem;
    }

    /* Chi Siamo: foto sopra, riquadro che risale sulla foto */
    .about {
        padding-bottom: var(--section-space);
    }

    .about-photo {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .about-overlay {
        position: relative;
        inset: auto;
        justify-content: center;
        margin-top: clamp(-7rem, -18vw, -4rem);
    }

    .about-card {
        width: 100%;
        max-width: 520px;
        padding: 4rem 1.5rem 2.25rem;
    }

    :root {
        --header-h: 68px;
    }

    .nav-toggle,
    .header-icon {
        display: inline-flex;
    }

    /* backdrop-filter creerebbe un containing block che confina il menu fixed */
    .site-header.is-open {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: var(--color-background);
    }

    .main-nav {
        position: fixed;
        inset: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        padding: calc(var(--header-h) + 1.5rem) var(--gutter) 2rem;
        background: var(--color-background);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
    }

    .site-header.is-open .main-nav {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.4s var(--ease), visibility 0s;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
    }

    .nav-link {
        font-family: var(--font-serif);
        font-size: 2rem;
        font-weight: 400;
        letter-spacing: 0.01em;
        text-transform: none;
        padding: 0.3rem 0;
    }

    .nav-link.is-active {
        font-style: italic;
    }

    .nav-mobile-extra {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
        text-align: center;
    }

    .nav-mobile-contacts {
        display: grid;
        gap: 0.25rem;
        font-size: 0.9rem;
        overflow-wrap: anywhere;
    }

    .nav-mobile-contacts a {
        color: var(--color-muted);
        text-decoration: none;
    }

    .hero-sticky {
        display: block;
        min-height: 0;
        padding-bottom: 2.5rem;
        --glow-x: 50%;
        --glow-y: 30%;
    }

    /* In modalità volo la hero riempie esattamente lo schermo: l'arco prende lo spazio che resta ai testi */
    .hero.is-fly .hero-sticky {
        display: flex;
        flex-direction: column;
        padding-bottom: 1.5rem;
    }

    .hero.is-fly .hero-inner {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .hero.is-fly .hero-visual {
        flex: 1 1 0;
        height: auto;
        min-height: 170px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hero-visual {
        order: -1;
        height: clamp(260px, 42svh, 420px);
        min-height: 0;
        margin-bottom: 0.5rem;
    }

    .hero-text {
        text-align: center;
    }

    .hero-text .eyebrow {
        letter-spacing: 0.14em;
    }

    .hero-tagline {
        margin: 1.1rem auto 0;
    }

    .hero-actions {
        justify-content: center;
        margin-top: 1.75rem;
    }

    .scroll-cue {
        display: none;
    }
}

@media (max-width: 768px) {
    .services-list {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-inline: auto;
    }

    .contact-item {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-bottom,
    .footer-legal {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .footer-legal {
        gap: 0.3rem;
    }

    .contact-label {
        padding-top: 0;
    }

    /* Mosaico su due colonne: alta, due piccole, larga, piccola, alta, piccola */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: clamp(120px, 40vw, 240px);
    }

    .g-item:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }

    .g-item:nth-child(7n + 1),
    .g-item:nth-child(7n + 6) {
        grid-row: span 2;
    }

    .g-item:nth-child(7n + 4) {
        grid-column: span 2;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    /* Pulsanti rotondi agli angoli: Chiama a sinistra, WhatsApp a destra */
    .wa-float,
    .call-float {
        display: inline-flex;
        bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .wa-float {
        right: 1rem;
    }

    .call-float {
        left: 1rem;
    }

    .cookie-banner {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(4.75rem + env(safe-area-inset-bottom));
        max-width: none;
        padding: 1rem 1.1rem;
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .cookie-actions {
        flex-wrap: nowrap;
        margin-top: 0.75rem;
    }

    .cookie-actions .btn {
        flex: 1;
        padding-inline: 0.75rem;
        letter-spacing: 0.1em;
    }

    .lightbox {
        padding: 4.5rem 0.75rem 6rem;
    }

    .lb-prev,
    .lb-next {
        top: auto;
        bottom: 1.25rem;
        transform: none;
    }

    .lb-prev {
        left: calc(50% - 60px);
    }

    .lb-next {
        right: calc(50% - 60px);
    }
}

/* MOBILE: ritmo più compatto, servizi su due colonne */
@media (max-width: 640px) {
    :root {
        --section-space: 4.5rem;
    }

    .section-title {
        font-size: clamp(2.5rem, 11vw, 3rem);
        line-height: 1.02;
    }

    .section-head,
    .services-head {
        margin-bottom: 2.25rem;
    }

    .hero-text .eyebrow::before {
        display: none;
    }

    .lead {
        font-size: 1.3rem;
    }

    /* Servizi: nicchie piccole su due colonne */
    .services-list {
        grid-template-columns: repeat(2, 1fr);
        max-width: none;
        gap: 0.75rem;
    }

    .service {
        gap: 0.55rem;
        padding: 2.6rem 0.85rem 1.4rem;
    }

    .service-icon {
        font-size: 1.6rem;
    }

    .service-title {
        font-size: 1.2rem;
        line-height: 1.15;
        margin-bottom: 0.25rem;
    }

    .service p {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .service .service-note {
        margin-top: 0.4rem;
        font-size: 0.6rem;
        letter-spacing: 0.12em;
    }

    .gallery-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        margin-bottom: 2rem;
    }

    .gallery-grid {
        gap: 0.4rem;
    }

    .location-media {
        aspect-ratio: 4 / 5;
        max-width: none;
    }

    /* Spazio per i pulsanti rotondi fissi, così non coprono i testi legali */
    .site-footer {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 400px) {

    .brand-name {
        font-size: 1.22rem;
    }

    .brand-sub {
        font-size: 0.95rem;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .btn {
        padding-inline: 1.35rem;
    }
}


/* ACCESSIBILITY */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 300;
    padding: 0.75rem 1.25rem;
    background: var(--color-text);
    color: var(--color-ivory);
    text-decoration: none;
    font-weight: 700;
    transform: translateY(-200%);
    transition: transform 0.3s var(--ease);
}

.skip-link:focus {
    transform: none;
}

:focus-visible {
    outline: 1.5px solid var(--color-primary);
    outline-offset: 3px;
}

.lightbox :focus-visible {
    outline-color: var(--color-ivory);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}
