/* ====== Tema ====== */
:root {
    --bg: #fff;
    --ink: #111;
    --muted: #6b6b6b;
    --cream: #f4efe9;
    --line: #e9e6e1;
    --radius: 16px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.55;
}

/* Tipografia */
h1,
h2,
h3 {
    font-family: "Playfair Display", Georgia, serif;
    letter-spacing: -.2px;
}

h1 {
    font-size: clamp(2.2rem, 3.4vw + 1rem, 4rem);
    line-height: 1.05;
}

h2 {
    font-size: clamp(1.6rem, 1.2vw + 1rem, 2.4rem);
    margin: 0 0 .5rem;
}

h3 {
    font-size: 1.15rem;
    margin: 0 0 .25rem;
}

.lead {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 42ch;
}

.muted {
    color: var(--muted);
}

/* Rail laterale */
.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    padding: 28px 22px;
    border-right: 1px solid var(--line);
    background: #fffefc;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--ink);
    text-decoration: none;
}

.rail-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rail-nav a {
    color: var(--ink);
    text-decoration: none;
    opacity: .75;
    transition: opacity .2s ease;
}

.rail-nav a:hover {
    opacity: 1;
}

.rail-meta {
    font-size: .9rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rail-meta a {
    color: inherit;
    text-decoration: none;
}

/* Area pagina */
.page {
    margin-left: 260px;
}

/* Sezioni base */
.section {
    padding: 80px clamp(22px, 4vw, 70px);
}

.section.tone {
    background: var(--cream);
}

.section-head {
    margin-bottom: 28px;
}

/* HERO split */
.hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 42px;
    align-items: center;
    padding: 80px clamp(22px, 4vw, 70px);
    border-bottom: 1px solid var(--line);
}

.hero-text .eyebrow {
    letter-spacing: .18em;
    font-size: .8rem;
    color: var(--muted);
    margin: 0 0 10px;
}

.cta {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #1110;
}

.btn-dark {
    background: #111;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: #111;
    color: #111;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Media hero */
.hero-media {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 1.2s ease;
}

.hero-media:hover img {
    transform: scale(1.06);
}

/* Strip USP */
.strip {
    border-block: 1px solid var(--line);
    background: #fff;
}

.strip-list {
    list-style: none;
    margin: 0;
    padding: 16px clamp(22px, 4vw, 70px);
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.strip-list li {
    font-weight: 600;
    font-size: .95rem;
}

/* Griglia servizi asimmetrica */
.grid-service {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(6, 1fr);
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

.card.tall img {
    height: 420px;
}

.card.wide {
    grid-column: span 3;
}

.card.tall {
    grid-column: span 3;
}

.card:not(.wide):not(.tall) {
    grid-column: span 3;
}

.card-body {
    padding: 16px;
}

/* Listino editoriale */
.price-table {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.price-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 8px;
    padding: 10px 6px;
}

.price-row:not(:last-child) {
    border-bottom: 1px dashed var(--line);
}

.price {
    font-weight: 700;
}

.leaders {
    --d: 4px;
    height: 1em;
    background:
        linear-gradient(to right, #c9c4bc 0 50%, rgba(0, 0, 0, 0) 0) repeat-x left 0/var(--d) 1px;
    align-self: center;
    width: 100%;
}

/* Masonry semplice (senza JS) */
.masonry {
    columns: 3 260px;
    column-gap: 14px;
}

.masonry figure {
    break-inside: avoid;
    margin: 0 0 14px;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.masonry img {
    width: 100%;
    display: block;
    transition: transform .5s ease;
}

.masonry figure:hover img {
    transform: scale(1.03);
}

/* Team */
.team {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 20px;
}

.person {
    text-align: center;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.person img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px;
}

.role {
    color: var(--muted);
    font-size: .95rem;
    margin: .1rem 0 0;
}

/* Contatti */
.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr 1.2fr;
    gap: 18px;
}

.contact-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.stack {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    color: var(--muted);
}

.list li {
    margin: 4px 0;
}

.schedule {
    list-style: none;
    padding: 0;
    margin: 0;
}

.schedule li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
}

.map {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
}

.map iframe {
    width: 100%;
    height: 100%;
    min-height: 260px;
    border: 0;
}

/* Footer */
.footer {
    padding: 32px clamp(22px, 4vw, 70px);
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer a:hover {
    color: var(--ink);
}

.footer .dev {
    font-size: 0.85rem;
    opacity: 0.7;
    font-style: italic;
}


/* Responsività */
@media (max-width: 1024px) {
    .rail {
        position: static;
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .rail-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .rail-meta {
        display: none;
    }

    .page {
        margin-left: 0;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {

    .section,
    .hero {
        padding: 56px 18px;
    }

    .strip-list {
        padding: 12px 18px;
    }

    .card img {
        height: 220px;
    }
}

/* === Mobile Fix Pack (aggiungi in fondo al file) === */
@media (max-width: 768px) {

    /* Layout generale */
    .section,
    .hero {
        padding: 56px 18px;
    }

    .lead {
        font-size: 1rem;
    }

    /* Rail: da colonna a topbar scorrevole */
    .rail {
        position: sticky;
        top: 0;
        z-index: 50;
        width: 100%;
        padding: 14px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .brand {
        font-size: 1.15rem;
    }

    .rail-nav {
        flex-direction: row;
        gap: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rail-nav a {
        padding: 8px 10px;
        border-radius: 999px;
        background: #fff;
        border: 1px solid var(--line);
        white-space: nowrap;
    }

    .rail-meta {
        display: none;
    }

    .page {
        margin-left: 0;
    }

    /* Hero: impila e limita l’altezza immagine */
    .hero {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero-media {
        max-height: 52vh;
    }

    .hero-media img {
        height: 100%;
    }

    /* Strip USP: orizzontale scorrevole con “pill” */
    .strip-list {
        padding: 12px 18px;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .strip-list li {
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fffefc;
        flex: 0 0 auto;
    }

    /* Servizi: una colonna, immagini proporzionate */
    .grid-service {
        grid-template-columns: 1fr;
    }

    .card img {
        height: auto;
        aspect-ratio: 4/3;
    }

    .card.tall img {
        aspect-ratio: 3/4;
    }

    /* Listino: testo più compatto */
    .price-row {
        grid-template-columns: 1fr auto;
    }

    .leaders {
        display: none;
    }

    .price {
        font-size: 1rem;
    }

    /* Galleria: una colonna (masonry semplificato) */
    .masonry {
        columns: 1 240px;
        column-gap: 10px;
    }

    .masonry figure {
        margin-bottom: 10px;
    }

    /* Team: card a tutta larghezza */
    .team {
        grid-template-columns: 1fr;
    }

    .person {
        padding: 14px;
    }

    .person img {
        width: 120px;
        height: 120px;
    }

    /* Contatti: colonne -> pila */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .map iframe {
        min-height: 220px;
    }

    /* Bottoni: tap target più grandi */
    .btn {
        padding: 12px 16px;
    }
}

@media (max-width: 420px) {
    h1 {
        font-size: clamp(1.8rem, 6vw + 1rem, 2.4rem);
    }

    h2 {
        font-size: 1.3rem;
    }

    .brand {
        font-size: 1.05rem;
    }

    .rail-nav a {
        padding: 7px 9px;
        font-size: .9rem;
    }
}


/* === Back to top (mobile) === */
.to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    width: 52px;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #111;
    color: #fff;
    display: none;
    /* di base nascosto su desktop */
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    opacity: 0;
    transform: translateY(10px) scale(.95);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    /* non cliccabile finché invisibile */
}

.to-top svg {
    fill: currentColor;
}

.to-top:focus {
    outline: none;
}

.to-top:focus-visible {
    box-shadow: 0 0 0 3px #0000, 0 0 0 3px rgba(17, 17, 17, .3) inset;
}

.to-top.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.to-top:hover {
    transform: translateY(-2px) scale(1.03);
}

/* Mostra il bottone solo su mobile/tablet */
@media (max-width: 768px) {
    .to-top {
        display: inline-flex;
    }
}