/* =========================================================================
   Template Sito Cantiere — CSS base
   Colori & font sono variabili CSS iniettate da partials/head.php.
   ========================================================================= */

*,*::before,*::after { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}
html { scroll-behavior: smooth; }
body {
    font-family: var(--f-body);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.65;
    font-size: 17px;
}

h1, h2, h3, h4 {
    font-family: var(--f-heading);
    color: var(--c-text);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 .6em;
    font-weight: 600;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p  { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
a  { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }
.text-center { text-align: center; }
.muted { color: var(--c-muted); }
.lead  { font-size: 1.15rem; color: #333; }

/* Buttons ----------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 14px 26px;
    border-radius: 999px;
    font-family: var(--f-heading);
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .02em;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn--primary:hover { background: var(--c-primary-dk); border-color: var(--c-primary-dk); color: #fff; }
.btn--ghost { color: #fff; border-color: #fff; background: transparent; }
.btn--ghost:hover { background: #fff; color: var(--c-text); }

/* Header — trasparente sopra l'hero, solido allo scroll (stile Dils/Abitareco)
   Sopra l'hero della home: barra trasparente, logo chiaro, nav bianco.
   Dopo lo scroll e su tutte le pagine senza hero scuro: barra solida (--c-bg),
   logo scuro, nav nel colore testo. La classe .is-scrolled la mette site.js;
   lo stato "solido di default" è pilotato da body:not(.page-home). ------------ */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 60;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}
/* velatura sfumata dietro la barra trasparente: logo+nav sempre leggibili sopra l'hero */
body.page-home .site-header:not(.is-scrolled)::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 150px; pointer-events: none; z-index: -1;
    background: linear-gradient(180deg, rgba(0,0,0,.34) 0%, rgba(0,0,0,0) 100%);
}
.site-header__bar { display: flex; align-items: center; justify-content: space-between; padding: 22px 40px; transition: padding .35s ease; }
.site-header__logo { display: inline-flex; align-items: center; }
.site-header__logo img { width: auto; transition: max-height .35s ease; }
/* ombra: garantisce logo+nav SEMPRE leggibili sopra qualsiasi punto dell'hero */
.logo--light { max-height: 54px; filter: drop-shadow(0 2px 12px rgba(0,0,0,.55)); }
.logo--dark  { max-height: 54px; display: none; }
.site-header__wordmark { font-family: var(--f-heading); font-weight: 600; font-size: 1.5rem; letter-spacing: .02em; color: #fff; text-shadow: 0 1px 14px rgba(0,0,0,.5); transition: color .35s ease, text-shadow .35s ease; }

.site-nav ul { list-style: none; display: flex; gap: 34px; margin: 0; padding: 0; }
.site-nav a  {
    font-family: var(--f-body); font-weight: 500; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .15em; color: #fff;
    text-shadow: 0 1px 12px rgba(0,0,0,.45);
    position: relative; padding-bottom: 5px; transition: color .25s ease;
}
.site-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: currentColor; transition: right .3s ease; }
.site-nav a:hover { text-decoration: none; }
.site-nav a:hover::after, .site-nav a.is-current::after { right: 0; }

.nav-toggle { display: none; background: none; border: 0; gap: 5px; flex-direction: column; cursor: pointer; padding: 10px; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); transition: background .35s ease, box-shadow .35s ease; }

/* Stato SOLIDO: pagine senza hero scuro + dopo lo scroll */
body:not(.page-home) .site-header,
.site-header.is-scrolled {
    background: var(--c-bg);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom-color: rgba(0,0,0,.08);
    box-shadow: 0 6px 26px rgba(0,0,0,.06);
}
body:not(.page-home) .site-header__bar,
.site-header.is-scrolled .site-header__bar { padding-top: 13px; padding-bottom: 13px; }
body:not(.page-home) .site-nav a,
.site-header.is-scrolled .site-nav a { color: var(--c-text); text-shadow: none; }
body:not(.page-home) .site-nav a.is-current,
.site-header.is-scrolled .site-nav a.is-current { color: var(--c-primary); }
body:not(.page-home) .site-header__wordmark,
.site-header.is-scrolled .site-header__wordmark { color: var(--c-primary); text-shadow: none; }
body:not(.page-home) .nav-toggle span,
.site-header.is-scrolled .nav-toggle span { background: var(--c-text); box-shadow: none; }
body:not(.page-home) .logo--light,
.site-header.is-scrolled .logo--light { display: none; }
body:not(.page-home) .logo--dark,
.site-header.is-scrolled .logo--dark { display: inline-block; max-height: 46px; }

@media (max-width: 820px) {
    .site-header__bar { padding: 16px 22px; }
    .logo--light, .logo--dark { max-height: 44px; }
    .nav-toggle { display: inline-flex; z-index: 2; }
    .site-nav {
        position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
        background: var(--c-bg); box-shadow: -10px 0 40px rgba(0,0,0,.18);
        padding: 96px 32px 32px; display: none;
    }
    .site-nav[data-open] { display: block; }
    .site-nav ul { flex-direction: column; gap: 22px; }
    .site-nav a, body:not(.page-home) .site-nav a, .site-header.is-scrolled .site-nav a { color: var(--c-text); font-size: .9rem; text-shadow: none; }
    .site-nav a::after { display: none; }
}

/* Hero -------------------------------------------------------------------- */
.hero { position: relative; height: 82vh; min-height: 520px; overflow: hidden; background: #111; isolation: isolate; }
.hero__slider { position: absolute; inset: 0; z-index: 1; }
.hero__slider .swiper, .hero__slider .swiper-wrapper, .hero__slider .swiper-slide { height: 100%; }
.hero__slider img { width: 100%; height: 100%; object-fit: cover; }
.hero__overlay {
    position: absolute; inset: 0;
    z-index: 3;
    background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.7) 100%);
    display: flex; align-items: center;
    color: #fff;
    pointer-events: none;
}
.hero__overlay .container { pointer-events: auto; }
.hero__overlay h1 {
    color: #fff;
    max-width: 820px;
    text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero__address { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; margin-bottom: 1.5em; text-shadow: 0 1px 12px rgba(0,0,0,.4); }

.hero .swiper-pagination { z-index: 4; }
.hero .swiper-pagination-bullet { background: #fff; opacity: .6; }
.hero .swiper-pagination-bullet-active { opacity: 1; }

/* Generic sections -------------------------------------------------------- */
.section { padding: clamp(56px, 9vw, 120px) 0; }
.section--alt { background: #fff; }
.section--inverted { background: var(--c-primary); color: #fff; }
.section--inverted h2 { color: #fff; }
.section--inverted .btn--primary { background: #fff; color: var(--c-primary-dk); border-color: #fff; }
.section--inverted .btn--primary:hover { background: rgba(255,255,255,.85); color: var(--c-primary-dk); }
.section--cta { background: #fff; }

.page-hero { padding: 140px 0 50px; background: var(--c-bg); text-align: center; }
.page-hero h1 { margin: 0; }

/* Split (intro + media) --------------------------------------------------- */
.split__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split__grid--reverse .split__media { order: -1; }
.split__media img { border-radius: 10px; box-shadow: 0 20px 40px rgba(0,0,0,.08); }
@media (max-width: 820px) {
    .split__grid { grid-template-columns: 1fr; gap: 32px; }
    .split__grid--reverse .split__media { order: 0; }
}

/* Feature grid ------------------------------------------------------------ */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.feature img   { border-radius: 8px; margin-bottom: 18px; aspect-ratio: 4/3; object-fit: cover; }
@media (max-width: 820px) { .feature-grid { grid-template-columns: 1fr; } }

/* Units (appartamenti) ---------------------------------------------------- */
.piano-title { font-size: 1.4rem; margin: 0 0 28px; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,.1); }
.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.unit { background: var(--c-bg); border: 1px solid rgba(0,0,0,.07); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.unit__head { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; background: #fff; border-bottom: 1px solid rgba(0,0,0,.07); }
.unit__code { font-family: var(--f-heading); font-weight: 700; font-size: 1.1rem; }
.unit__status { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.05); color: var(--c-muted); }
.unit--opzionato .unit__status { background: #fef3c7; color: #854d0e; }
.unit--venduto   .unit__status { background: rgba(0,0,0,.12); color: rgba(0,0,0,.5); }
.unit--disponibile .unit__status { background: #dcfce7; color: #166534; }
.unit__plan img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #fff; }
.unit__meta { padding: 16px 18px 20px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: .95rem; }
.unit__meta dt { color: var(--c-muted); font-size: .8rem; }
.unit__meta dd { margin: 0 0 4px; font-weight: 600; }

/* Contesto ---------------------------------------------------------------- */
/* La mappa riempie SEMPRE l'altezza della colonna POI (align-items:stretch):
   se l'elenco punti di interesse è più lungo della mappa NON resta un buco
   bianco nella colonna mappa. height fissa = vietata, usa min-height come pavimento. */
.context-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: stretch; }
.map { min-height: 480px; border-radius: 12px; overflow: hidden; background: #e8e5d7; }
.map iframe { width: 100%; height: 100%; min-height: 480px; border: 0; display: block; }
.poi-list section { margin-bottom: 22px; }
.poi-list h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--c-primary); margin-bottom: 8px; }
.poi-list ul  { list-style: none; padding: 0; margin: 0; }
.poi-list li  { padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
@media (max-width: 820px) { .context-grid { grid-template-columns: 1fr; } .map, .map iframe { min-height: 320px; } }

/* Contatti ---------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; }
.contact-list li { padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.contact-list__label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--c-muted); }
.contact-box { background: #fff; padding: 36px; border-radius: 12px; border: 1px solid rgba(0,0,0,.08); }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } .contact-box { padding: 24px; } }

/* Form -------------------------------------------------------------------- */
.contact-form { display: flex; flex-direction: column; gap: 16px; position: relative; }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .contact-form__row { grid-template-columns: 1fr; } }
.contact-form label > span { display: block; font-size: .85rem; color: var(--c-muted); margin-bottom: 6px; letter-spacing: .02em; }
.contact-form input:not([type="checkbox"]):not([type="radio"]),
.contact-form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid rgba(0,0,0,.15);
    border-radius: 8px; background: #fff; font: inherit; color: var(--c-text);
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37,94,90,.15); }
.contact-form__check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .9rem;
    color: var(--c-muted);
    line-height: 1.45;
    cursor: pointer;
}
.contact-form__check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--c-primary);
    cursor: pointer;
}
.contact-form__check span { flex: 1 1 auto; }
.contact-form__actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.contact-form__feedback { font-size: .9rem; color: var(--c-muted); }
.contact-form__feedback.is-success { color: #166534; }
.contact-form__feedback.is-error   { color: #b91c1c; }

/* Downloads (brochure / capitolato) --------------------------------------- */
.downloads__head { text-align: center; margin-bottom: 48px; max-width: 640px; margin-left: auto; margin-right: auto; }
.downloads__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 940px;
    margin: 0 auto;
}
.download-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.download-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.06); border-color: var(--c-primary); }
.section--alt .download-card { background: var(--c-bg); }
.download-card__icon {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.download-card__body h3 { margin: 0 0 6px; font-size: 1.1rem; }
.download-card__body p  { margin: 0; font-size: .92rem; line-height: 1.5; }
.download-card__cta {
    margin-top: auto;
    align-self: flex-start;
    color: var(--c-primary);
    font-family: var(--f-heading);
    font-weight: 600;
    font-size: .95rem;
}
.download-card__cta:hover { color: var(--c-primary-dk); text-decoration: none; }

/* Legal pages (privacy / cookie) ------------------------------------------ */
.legal-page h2 { margin-top: 2.4em; font-size: 1.25rem; }
.legal-page h2:first-of-type { margin-top: 0.6em; }
.legal-page p, .legal-page ul, .legal-page ol { line-height: 1.75; }
.legal-page ul, .legal-page ol { padding-left: 1.4em; }
.legal-page ul li, .legal-page ol li { margin-bottom: .4em; }
.legal-page code {
    background: rgba(0,0,0,.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.legal-page .cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 28px;
    font-size: .92rem;
}
.legal-page .cookie-table th,
.legal-page .cookie-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,.08);
    vertical-align: top;
}
.legal-page .cookie-table th {
    background: rgba(0,0,0,.03);
    font-family: var(--f-heading);
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-muted);
}
.legal-page .legal-notice {
    background: #fef3c7;
    border-left: 4px solid #d97706;
    color: #854d0e;
    padding: 14px 18px;
    margin: 0 0 32px;
    border-radius: 6px;
    font-size: .95rem;
}
.legal-page .legal-back { margin-top: 48px; font-size: .95rem; }

/* Cookie banner ----------------------------------------------------------- */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px;
    z-index: 1000;
    max-width: 520px;
    margin-left: auto;
    background: #fff;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0,0,0,.18);
    padding: 22px 24px;
    display: none;
    font-size: .92rem;
    line-height: 1.55;
}
.cookie-banner[data-visible] { display: block; }
.cookie-banner h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--c-text);
}
.cookie-banner p { margin: 0 0 14px; color: var(--c-muted); }
.cookie-banner a { color: var(--c-primary); }
.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
.cookie-banner__btn {
    padding: 10px 18px;
    border-radius: 999px;
    font-family: var(--f-heading);
    font-weight: 600;
    font-size: .88rem;
    letter-spacing: .02em;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.cookie-banner__btn--accept { background: var(--c-primary); color: #fff; }
.cookie-banner__btn--accept:hover { background: var(--c-primary-dk); }
.cookie-banner__btn--reject {
    background: transparent;
    color: var(--c-text);
    border-color: rgba(0,0,0,.2);
}
.cookie-banner__btn--reject:hover { border-color: var(--c-text); }
@media (max-width: 620px) {
    .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 18px 20px; }
    .cookie-banner__actions { justify-content: stretch; }
    .cookie-banner__btn { flex: 1 1 0; text-align: center; }
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
    background: var(--c-primary-dk); color: rgba(255,255,255,.85);
    padding: 72px 0 32px; margin-top: 40px;
    max-width: 100%;
    overflow: hidden;
}
.site-footer .container { min-width: 0; }
.site-footer a { color: #fff; overflow-wrap: anywhere; word-break: break-word; }
.site-footer__email { display: inline-block; white-space: nowrap; word-break: normal; overflow-wrap: normal; font-size: .92em; max-width: 100%; }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.site-footer__grid > * { min-width: 0; }
.site-footer__brand { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.site-footer__agency-logo { display: block; max-width: 160px; width: 100%; height: auto; margin-top: 4px; opacity: .9; }
.site-footer__agency a { display: inline-block; }
.site-footer__logo { display: block; max-height: 56px; max-width: 100%; width: auto; height: auto; }
.site-footer__title { font-family: var(--f-heading); font-weight: 700; color: #fff; font-size: 1.2rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.site-footer__muted { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.55); margin-bottom: 10px; }
.site-footer__legal { grid-column: 1 / -1; margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: rgba(255,255,255,.6); overflow-wrap: anywhere; }
.site-footer__wordmark {
    text-align: center;
    padding: 56px 24px 16px;
    font-family: var(--f-heading);
    color: rgba(255,255,255,.22);
    font-size: clamp(3rem, 12vw, 9rem);
    font-weight: 300;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
    overflow: hidden;
}
.site-footer__wordmark img {
    display: block;
    max-height: 96px;
    max-width: min(540px, 70%);
    width: auto;
    height: auto;
    margin: 0 auto;
    opacity: .92;
}
@media (max-width: 820px) { .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 520px) { .site-footer__grid { grid-template-columns: 1fr; gap: 24px; } }

/* =========================================================================
   PATTERN MODIFIERS — applicati al <body> in base a config.theme.patterns
   ========================================================================= */

/* HERO ----------------------------------------------------------------- */
body.hero--centered .hero__overlay { text-align: center; align-items: center; }
body.hero--centered .hero__overlay h1,
body.hero--centered .hero__address { margin-left: auto; margin-right: auto; }

body.hero--fullbleed .hero { height: 100vh; min-height: 640px; }
body.hero--fullbleed .hero__overlay h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); }

body.hero--overlay .hero__overlay {
    align-items: flex-end;
    padding-bottom: 56px;
    background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.2) 50%, transparent 80%);
}
body.hero--overlay .hero__overlay h1 { font-size: clamp(2rem, 4vw, 3rem); }

/* TYPE STACK ----------------------------------------------------------- */
/* Melette 5: heading Montserrat (come il logo della brochure) + corpo Manrope. */
body.type--sans { --f-heading: "Montserrat", "Inter", system-ui, sans-serif; --f-body: "Manrope", "Inter", system-ui, sans-serif; }
body.type--sans h1, body.type--sans h2, body.type--sans h3 { font-weight: 700; letter-spacing: -0.015em; }
body.type--sans .site-header__wordmark, body.type--sans .site-footer__title { letter-spacing: .04em; }

body.type--display { --f-heading: "Space Grotesk", "Manrope", sans-serif; --f-body: "Inter", system-ui, sans-serif; }
body.type--display h1 { font-weight: 700; letter-spacing: -0.03em; }

body.type--mixed { --f-heading: "Cormorant Garamond", Georgia, serif; --f-body: "Manrope", system-ui, sans-serif; }
body.type--mixed h1 { font-weight: 400; font-style: italic; }

/* PALETTE MODE --------------------------------------------------------- */
body.palette--dark {
    --c-bg: #0e0f10;
    --c-text: #f3f3f3;
    --c-muted: #9aa0a6;
}
body.palette--dark .lead { color: rgba(255,255,255,.78); }
body.palette--dark .site-header { background: rgba(14,15,16,.85); border-bottom: 1px solid rgba(255,255,255,.08); }
body.palette--dark .btn--ghost { color: var(--c-text); border-color: rgba(255,255,255,.3); }

body.palette--vivid { --c-accent: #e85a4f; }
body.palette--vivid .btn--primary { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }

body.palette--mono {
    --c-primary: var(--c-text);
    --c-primary-dk: #000;
    --c-accent: var(--c-text);
}

/* DENSITY -------------------------------------------------------------- */
/* SOLO i section di primo livello (figli diretti di body): altrimenti il
   padding colpisce anche i <section> annidati (es. i gruppi della .poi-list). */
body.density--airy > section { padding: 96px 0; }
body.density--compact > section { padding: 56px 0; }
body.density--compact .container { padding: 0 18px; }
body.density--compact body { font-size: 16px; }

/* DECORATIONS ---------------------------------------------------------- */
body.deco--lines > section + section { border-top: 1px solid rgba(0,0,0,.07); }
body.deco--lines.palette--dark > section + section { border-top-color: rgba(255,255,255,.08); }

body.deco--geometric .hero::after {
    content: ''; position: absolute; right: 0; bottom: 0; width: 35%; height: 4px;
    background: var(--c-accent); z-index: 5;
}

body.deco--texture body { background-image: radial-gradient(circle at 20% 50%, rgba(0,0,0,.02) 1px, transparent 2px); background-size: 20px 20px; }

/* (deco--none: nessuna regola, è il default più asciutto) */

/* PHOTO RATIO ---------------------------------------------------------- */
body.photo--16-9 .split__media { aspect-ratio: 16 / 9; }
body.photo--4-3 .split__media { aspect-ratio: 4 / 3; }
body.photo--vertical .split__media { aspect-ratio: 3 / 4; }
body.photo--square .split__media { aspect-ratio: 1 / 1; }
body.photo--mixed .split:nth-of-type(odd) .split__media { aspect-ratio: 16 / 9; }
body.photo--mixed .split:nth-of-type(even) .split__media { aspect-ratio: 4 / 5; }

/* BUTTONS -------------------------------------------------------------- */
body.btn--square .btn { border-radius: 4px; }
body.btn--underline .btn--ghost { border: 0; border-bottom: 2px solid currentColor; border-radius: 0; padding: 8px 4px; }
body.btn--arrow .btn--ghost::after { content: ' →'; transition: transform .2s; }
body.btn--arrow .btn--ghost:hover::after { transform: translateX(4px); }
body.btn--pill .btn { border-radius: 999px; } /* default già pill, esplicito */

/* Video section (Dicono di noi / YouTube embed) ---------------------------- */
.section--video { background: var(--c-bg); }
.video-split {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 24px;
    align-items: center;
}
.video-split__text h2 { margin: 0 0 12px; }
.video-split__text .muted { margin-bottom: 20px; }
.video-quote {
    margin: 0 0 16px;
    padding: 18px 22px;
    border-left: 3px solid var(--c-accent);
    background: rgba(0,0,0,.03);
    border-radius: 0 8px 8px 0;
}
.video-quote p { margin: 0 0 8px; font-style: italic; font-size: 1.05rem; line-height: 1.55; }
.video-quote cite { font-style: normal; color: var(--c-muted); font-size: .9rem; }
.video-embed {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,.22);
    background: #000;
    margin: 0;
}
.video-embed iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border: 0; display: block;
}
.video-embed--horizontal { aspect-ratio: 16 / 9; }
.video-embed--vertical   { aspect-ratio: 9 / 16; }
@media (max-width: 480px) {
    .video-split { grid-template-columns: 1fr; gap: 24px; }
    .video-split__media { max-width: 240px; margin: 0 auto; width: 100%; }
}

/* =========================================================================
   CONTACT RAIL — bottoni Chiama/Scrivi sempre visibili a destra
   (partials/contact_rail.php, incluso su ogni pagina da index.php)
   ========================================================================= */
.contact-rail {
    position: fixed; z-index: 90;
    right: 20px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 14px;
}
.contact-rail__btn {
    display: flex; align-items: center;
    height: 56px; border-radius: 999px;
    background: var(--c-primary); color: #fff;
    box-shadow: 0 10px 26px rgba(0,0,0,.20);
    overflow: hidden; text-decoration: none;
    transition: background .2s ease, box-shadow .2s ease, transform .15s ease;
}
.contact-rail__icon {
    flex: 0 0 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
}
.contact-rail__icon svg { width: 23px; height: 23px; }
.contact-rail__label {
    font-family: var(--f-heading); font-weight: 600; font-size: .92rem;
    letter-spacing: .02em; white-space: nowrap;
    max-width: 0; opacity: 0; overflow: hidden; padding-right: 0;
    transition: max-width .28s ease, opacity .2s ease, padding .28s ease;
}
.contact-rail__btn:hover,
.contact-rail__btn:focus-visible {
    background: var(--c-primary-dk); transform: translateY(-1px); text-decoration: none;
}
.contact-rail__btn:hover .contact-rail__label,
.contact-rail__btn:focus-visible .contact-rail__label {
    max-width: 160px; opacity: 1; padding-right: 22px;
}
.contact-rail__btn:focus-visible { outline: 3px solid var(--c-bg); outline-offset: 2px; }
/* coerenza col theme: se il sito usa bottoni squadrati, anche il rail lo è */
body.btn--square .contact-rail__btn { border-radius: 14px; }

@media (max-width: 820px) {
    .contact-rail { top: auto; bottom: 20px; right: 14px; transform: none; gap: 12px; }
    .contact-rail__btn { height: 52px; box-shadow: 0 8px 20px rgba(0,0,0,.22); }
    .contact-rail__icon { flex-basis: 52px; height: 52px; }
    .contact-rail__label { display: none; } /* su touch: solo icona, niente espansione */
}
/* =========================================================================
   ANIMAZIONI — sobrie, stile Dils/Abitareco (reveal on scroll, hero, hover)
   La classe .reveal viene aggiunta da site.js: senza JS i contenuti restano
   pienamente visibili (nessun FOUC).
   ========================================================================= */

/* Reveal on scroll: entrata opacity + translateY, una sola volta */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.is-visible {
    opacity: 1; transform: none;
    transition: opacity .85s cubic-bezier(.2,.6,.2,1), transform .85s cubic-bezier(.2,.6,.2,1);
    transition-delay: var(--reveal-delay, 0ms);
}

/* Hero: fadeUp del claim al load */
.hero__overlay .container > * { opacity: 0; animation: heroFadeUp 1.05s cubic-bezier(.2,.6,.2,1) both; }
.hero__overlay h1            { animation-delay: .25s; }
.hero__overlay .hero__address{ animation-delay: .45s; }
.hero__overlay .btn          { animation-delay: .60s; }
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* Hero: ken-burns lentissimo sull'immagine */
.hero__slider img { animation: heroKen 16s ease-out both; transform-origin: 50% 55%; }
@keyframes heroKen { from { transform: scale(1); } to { transform: scale(1.07); } }

/* Immagini editoriali: zoom morbido all'hover (clip sul contenitore) */
.split__media { overflow: hidden; border-radius: 10px; box-shadow: 0 20px 40px rgba(0,0,0,.08); }
.split__media img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; transition: transform 1.1s cubic-bezier(.2,.6,.2,1); }
.split__media:hover img { transform: scale(1.05); }
.feature { overflow: hidden; }
.feature img { transition: transform 1.1s cubic-bezier(.2,.6,.2,1); }
.feature:hover img { transform: scale(1.05); }

/* Card unità: lift + zoom planimetria all'hover */
.unit { transition: transform .25s ease, box-shadow .25s ease; }
.unit:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.09); }
.unit__plan img { transition: transform 1.1s cubic-bezier(.2,.6,.2,1); }
.unit:hover .unit__plan img { transform: scale(1.04); }

@media (prefers-reduced-motion: reduce) {
    .contact-rail__btn, .contact-rail__label { transition: none; }
    .reveal, .reveal.is-visible { opacity: 1 !important; transform: none !important; transition: none !important; }
    .hero__overlay .container > * { opacity: 1; animation: none; }
    .hero__slider img { animation: none; }
    .split__media img, .feature img, .unit, .unit__plan img { transition: none; }
    .split__media:hover img, .feature:hover img, .unit:hover, .unit:hover .unit__plan img { transform: none; box-shadow: none; }
}
@media print { .contact-rail { display: none; } }

/* =========================================================================
   Leggibilità CTA / rail — fix generali (portati da derganino17, 2026-06).
   ========================================================================= */

/* CTA secondaria dell'hero: la versione trasparente con solo bordo bianco è
   illeggibile sulle slide chiare → vetro scuro semitrasparente, leggibile su
   qualsiasi foto. Hover invariato (riempie di bianco). */
.hero__overlay .btn--ghost {
    background: rgba(16,12,11,.42);
    border-color: #fff;
    color: #fff;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.hero__overlay .btn--ghost:hover,
.hero__overlay .btn--ghost:focus-visible {
    background: #fff; color: var(--c-text); border-color: #fff;
}

/* Rail contatti: su mobile, finché il cookie banner è aperto, sali sopra di esso
   così i bottoni Chiama/Scrivi non restano coperti (motivo del "non visibili"). */
@media (max-width: 820px) {
    body:has(#cookieBanner[data-visible]) .contact-rail {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 230px);
    }
}

/* Safari/WebKit: senza misure esplicite i bottoni del rail collassano e appaiono
   "schiacciati" (overflow:hidden + cross-size content-based in flex annidato). */
.contact-rail__icon { width: 56px; flex: 0 0 56px; }
.contact-rail__btn { min-width: 56px; }
@media (max-width: 820px) {
    .contact-rail__icon { width: 46px; flex: 0 0 46px; }
    .contact-rail__btn { width: 46px; min-width: 46px; }
}

/* =========================================================================
   MELETTE 5 — personalizzazioni di sito (combo: hero overlay + sans + navy)
   ========================================================================= */

/* Hero overlay più monumentale (claim ancorato in basso, immagine protagonista) */
body.hero--overlay .hero { height: 90vh; min-height: 600px; }
body.hero--overlay .hero__overlay h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); max-width: 16ch; }
body.hero--overlay .hero__address { font-weight: 500; }

/* Eyebrow editoriale (label uppercase sopra i titoli di sezione) */
.eyebrow {
    display: inline-block;
    font-family: var(--f-body);
    font-size: .74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--c-accent);
    margin-bottom: 14px;
}
.section--inverted .eyebrow { color: rgba(255,255,255,.72); }

/* Lista outdoor (giardini / terrazzi / maxiterrazzo) nella pagina Progetto */
.outdoor-list { list-style: none; padding: 0; margin: 30px 0 0; }
.outdoor-list li { padding: 16px 0; border-top: 1px solid rgba(0,0,0,.1); }
.outdoor-list li:last-child { border-bottom: 1px solid rgba(0,0,0,.1); }
.outdoor-list strong { display: block; font-family: var(--f-heading); font-weight: 600; font-size: 1rem; letter-spacing: .01em; margin-bottom: 4px; color: var(--c-text); }
.outdoor-list span { color: var(--c-muted); font-size: .95rem; line-height: 1.55; }

/* Griglia capitolato (finiture) */
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 44px; text-align: left; }
.spec h3 {
    font-size: .82rem; text-transform: uppercase; letter-spacing: .12em;
    color: var(--c-primary); margin: 0 0 12px; padding-bottom: 10px;
    border-bottom: 2px solid var(--c-accent); display: inline-block;
}
.spec p { margin: 0; font-size: .95rem; color: var(--c-muted); line-height: 1.6; }
@media (max-width: 820px) { .spec-grid { grid-template-columns: 1fr 1fr; gap: 26px 30px; } }
@media (max-width: 560px) { .spec-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   MELETTE 5 — IDENTITÀ GRAFICA (motivo "5", striscia dati, editoriale)
   Spinge la differenziazione oltre il theme layer: composizione + signature.
   ========================================================================= */

/* --- Hero: claim editoriale in basso a sx + grande "5" outline --- */
.hero--melette .hero__overlay { align-items: flex-end; }
.hero--melette .hero__content { position: relative; z-index: 2; }
.hero__eyebrow {
    display: inline-block; font-family: var(--f-body); font-weight: 600;
    font-size: .78rem; text-transform: uppercase; letter-spacing: .22em;
    color: #fff; margin-bottom: 18px; padding-left: 52px; position: relative;
    text-shadow: 0 1px 10px rgba(0,0,0,.5);
}
.hero__eyebrow::before {
    content: ''; position: absolute; left: 0; top: 50%; width: 38px; height: 2px;
    background: var(--c-accent);
}
.hero__numeral {
    position: absolute; z-index: 1; top: 46%; right: 2%; transform: translateY(-50%);
    font-family: var(--f-heading); font-weight: 300; line-height: .78;
    font-size: clamp(15rem, 34vw, 40rem);
    color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.32);
    text-stroke: 2px rgba(255,255,255,.32);
    pointer-events: none; user-select: none;
}
@media (max-width: 820px) {
    .hero__numeral { font-size: 16rem; right: -1.5rem; top: 30%; -webkit-text-stroke-width: 1.5px; }
    .hero__eyebrow { padding-left: 40px; letter-spacing: .16em; }
    .hero__eyebrow::before { width: 26px; }
}

/* --- Striscia dati a tutta larghezza (rompe il ritmo split-split) --- */
body.density--airy > .facts, .facts { padding: 0; background: var(--c-bg); }
.facts__grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgba(0,0,0,.12); border-bottom: 1px solid rgba(0,0,0,.12);
}
.fact { padding: 46px 26px; text-align: center; border-left: 1px solid rgba(0,0,0,.12); }
.fact:first-child { border-left: 0; }
.fact__num {
    display: block; font-family: var(--f-heading); font-weight: 300;
    font-size: clamp(2.3rem, 3.6vw, 3.3rem); line-height: 1; letter-spacing: -.02em;
    color: var(--c-primary);
}
.fact__unit { font-style: normal; font-size: .4em; font-weight: 500; color: var(--c-accent); margin-left: .18em; vertical-align: super; }
.fact__label { display: block; margin-top: 14px; font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--c-muted); }
@media (max-width: 760px) {
    .facts__grid { grid-template-columns: 1fr 1fr; }
    .fact { border-left: 0; padding: 34px 18px; }
    .fact:nth-child(even) { border-left: 1px solid rgba(0,0,0,.12); }
    .fact:nth-child(n+3) { border-top: 1px solid rgba(0,0,0,.12); }
}

/* --- Numerazione editoriale delle sezioni (01 — Il progetto) --- */
.eyebrow__num { font-weight: 700; font-size: 1.05em; color: var(--c-accent); margin-right: 6px; }
.section--inverted .eyebrow__num { color: var(--c-accent); }

/* --- Split asimmetrico (immagine più larga del testo): diverso dall'1:1 --- */
.split--editorial .split__grid { grid-template-columns: .86fr 1.14fr; gap: 64px; }
.split--editorial .split__grid--reverse { grid-template-columns: 1.14fr .86fr; }
@media (max-width: 820px) {
    .split--editorial .split__grid,
    .split--editorial .split__grid--reverse { grid-template-columns: 1fr; gap: 32px; }
}

/* --- CTA finale con grande "5" in filigrana --- */
.cta--melette { position: relative; overflow: hidden; }
.cta--melette .container { position: relative; z-index: 1; }
.cta__numeral {
    position: absolute; z-index: 0; right: 6%; top: 50%; transform: translateY(-50%);
    font-family: var(--f-heading); font-weight: 300; line-height: .8;
    font-size: clamp(12rem, 26vw, 26rem); color: var(--c-primary); opacity: .05;
    pointer-events: none; user-select: none;
}
