/* ==========================================================================
   Francobollino — sito vetrina
   Palette brand (da cloud/frontend/public/css/main.css):
   bordeaux #8b2332, gradiente #a02c3d → #6d1b27, oro antico #f0d391 / #c9a76b
   ========================================================================== */

:root {
    --accent: #8b2332;
    --accent-2: #b03a4a;
    --accent-dark: #6d1b27;
    --accent-gradient: linear-gradient(135deg, #a02c3d 0%, #6d1b27 100%);
    --bg-deep-start: #7d1f2e;
    --bg-deep-end: #3d1018;
    --gold: #f0d391;
    --gold-dark: #c9a76b;
    --paper: #fdf9f0;
    --ink: #2b2b2b;
    --muted: #6b6b6b;
    --border: #ddd6c9;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-card: 0 8px 24px rgba(20, 8, 10, 0.25);
    --shadow-pop: 0 4px 15px rgba(139, 35, 50, 0.4);
    --font-serif: "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3, .brand { font-family: var(--font-serif); }

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

/* ------------------------------ Nav ------------------------------ */
.topnav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px clamp(16px, 4vw, 40px);
    color: #fff;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}
.topnav.solid {
    background: linear-gradient(135deg, rgba(109, 27, 39, 0.97), rgba(61, 16, 24, 0.97));
    box-shadow: 0 2px 12px rgba(20, 8, 10, 0.4);
    padding-top: 8px;
    padding-bottom: 8px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.brand-stamp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--accent-gradient);
    color: var(--gold);
    font-size: 1.15rem;
    border: 1.5px dashed var(--gold-dark);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.topnav nav {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 28px);
}
.topnav nav a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.topnav nav a:hover { color: var(--gold); }
.nav-cta {
    padding: 7px 18px;
    background: var(--gold);
    color: var(--accent-dark) !important;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.nav-cta:hover { background: #fff; }

/* ------------------------------ Hero ------------------------------ */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    padding: 110px 16px 0;
    background:
        linear-gradient(180deg, rgba(45, 12, 18, 0.72) 0%, rgba(45, 12, 18, 0.45) 45%, rgba(45, 12, 18, 0.82) 100%),
        url("../imgs/d010.jpg") center 30% / cover no-repeat;
    background-color: var(--bg-deep-end);
}
.hero-inner { max-width: 780px; width: 100%; }

/* Emblema a forma di francobollo: bordo perforato via mask */
.hero-stamp {
    display: inline-block;
    max-width: 100%;
    padding: clamp(14px, 3vw, 26px) clamp(20px, 5vw, 48px);
    border: 13px solid transparent;
    background: rgba(253, 249, 240, 0.97);
    color: var(--accent-dark);
    /* perforazione da francobollo: tacche semicircolari sul bordo */
    -webkit-mask:
        radial-gradient(6px, transparent 96%, #000 100%) -9px -9px / 18px 18px round,
        linear-gradient(#000 0 0) padding-box;
    -webkit-mask-composite: source-over;
    mask:
        radial-gradient(6px, transparent 96%, #000 100%) -9px -9px / 18px 18px round,
        linear-gradient(#000 0 0) padding-box;
    mask-composite: add;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.55));
}
.hero-stamp h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4.2rem);
    letter-spacing: 0.03em;
    color: var(--accent);
}
.hero-claim {
    margin: 8px 0 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1rem, 2.4vw, 1.3rem);
    color: #5a4632;
}
.hero-sub {
    margin: 28px auto 0;
    max-width: 620px;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    color: rgba(255, 255, 255, 0.94);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.hero-cta {
    margin-top: 30px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 13px 34px;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--accent-dark);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5); }
.btn-ghost {
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.75);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
.btn-lg { padding: 16px 44px; font-size: 1.15rem; }

.hero-stats {
    width: 100%;
    margin-top: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: rgba(240, 211, 145, 0.25);
    border-top: 1px solid rgba(240, 211, 145, 0.35);
    backdrop-filter: blur(3px);
}
.hero-stats .stat {
    padding: 18px 10px;
    background: rgba(45, 12, 18, 0.72);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.hero-stats strong {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--gold);
}
.hero-stats span { font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); }

/* ------------------------------ Sezioni ------------------------------ */
section { padding: clamp(56px, 9vw, 96px) 0; }
.hero { padding-bottom: 0; }

.section-title {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    color: var(--accent);
    text-align: center;
}
.section-sub {
    margin: 0 auto 46px;
    max-width: 640px;
    text-align: center;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ------------------------------ Funzionalità ------------------------------ */
.features { background: var(--paper); }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 24px;
}
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 28px 26px;
    box-shadow: 0 4px 14px rgba(20, 8, 10, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(139, 35, 50, 0.18);
}
.card-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: var(--accent-gradient);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-pop);
}
.card-icon svg { width: 32px; height: 32px; }
.card h3 {
    margin: 18px 0 8px;
    font-size: 1.3rem;
    color: var(--accent-dark);
}
.card p { margin: 0; color: #4a4a4a; font-size: 0.98rem; }

.mini-features {
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 16px;
}
.mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(139, 35, 50, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-dark);
}
.mini svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--accent); }

/* ------------------------------ Galleria ------------------------------ */
.gallery {
    background:
        linear-gradient(180deg, rgba(61, 16, 24, 0.94), rgba(61, 16, 24, 0.94)),
        url("../imgs/menu-legno.jpg") center / 420px repeat;
}
.gallery .section-title { color: var(--gold); }
.gallery .section-sub { color: rgba(255, 255, 255, 0.8); }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 20px;
}
.gallery-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 2px solid rgba(240, 211, 145, 0.35);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.gallery-item:hover,
.gallery-item:focus-visible {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-label {
    position: absolute;
    inset: auto 0 0 0;
    padding: 24px 12px 10px;
    background: linear-gradient(180deg, transparent, rgba(20, 8, 10, 0.85));
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: 1rem;
    text-align: left;
    padding-left: 14px;
}

/* Placeholder "screenshot in arrivo": francobolli perforati su panno verde */
.gallery-item.placeholder {
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(rgba(0, 40, 20, 0.25), rgba(0, 40, 20, 0.25)),
        url("../imgs/panno-verde.jpg") center / 300px repeat;
    border-style: dashed;
}
.gallery-item.placeholder:hover { transform: none; box-shadow: none; border-color: rgba(240, 211, 145, 0.55); }
.ph-stamp {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 72%;
    aspect-ratio: 5 / 4;
    padding: 10px;
    border: 11px solid transparent;
    background: var(--paper);
    color: var(--accent-dark);
    text-align: center;
    -webkit-mask:
        radial-gradient(5px, transparent 96%, #000 100%) -7.5px -7.5px / 15px 15px round,
        linear-gradient(#000 0 0) padding-box;
    -webkit-mask-composite: source-over;
    mask:
        radial-gradient(5px, transparent 96%, #000 100%) -7.5px -7.5px / 15px 15px round,
        linear-gradient(#000 0 0) padding-box;
    mask-composite: add;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}
.ph-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
}
.ph-sub {
    font-size: 0.78rem;
    font-style: italic;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-transform: uppercase;
}

/* ------------------------------ Storia ------------------------------ */
.story {
    background:
        linear-gradient(rgba(253, 249, 240, 0.88), rgba(253, 249, 240, 0.88)),
        url("../imgs/legno-chiaro.jpg") center / 480px repeat;
}
.story-flex {
    display: flex;
    align-items: center;
    gap: clamp(28px, 5vw, 64px);
    flex-wrap: wrap;
    justify-content: center;
}
.story-targa {
    position: relative;
    flex: 0 1 300px;
    max-width: 300px;
}
.targa-text {
    position: absolute;
    /* zona utile della tavola della targa (sotto le catene) */
    top: 46%;
    left: 14%;
    right: 14%;
    height: 34%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}
.targa-year {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: 0.05em;
}
.targa-line {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: #e8d5a8;
}
.story-text { flex: 1 1 420px; max-width: 620px; }
.story-text .section-title { text-align: left; }
.story-text p { color: #443c34; font-size: 1.02rem; }
.story-highlight {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.12rem !important;
    color: var(--accent) !important;
    border-left: 3px solid var(--gold-dark);
    padding-left: 14px;
}

/* ------------------------------ CTA finale ------------------------------ */
.final-cta {
    text-align: center;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(45, 12, 18, 0.82), rgba(45, 12, 18, 0.9)),
        url("../imgs/d005.jpg") center 60% / cover no-repeat;
}
.final-cta h2 {
    margin: 0 0 26px;
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    color: var(--gold);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ------------------------------ Footer ------------------------------ */
.footer {
    background: linear-gradient(135deg, var(--bg-deep-end) 0%, #24090e 100%);
    color: rgba(255, 255, 255, 0.85);
    padding: 40px 0 22px;
    font-size: 0.92rem;
}
.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(240, 211, 145, 0.2);
}
.footer strong {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--gold);
}
.footer p { margin: 6px 0 0; color: rgba(255, 255, 255, 0.6); }
.footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer nav a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.footer nav a:hover { color: var(--gold); }
.footer-copy {
    text-align: center;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
}

/* ------------------------------ Lightbox ------------------------------ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: rgba(20, 8, 10, 0.93);
}
.lightbox[hidden] { display: none; }
.lightbox figure {
    margin: 0;
    max-width: min(1000px, 88vw);
    text-align: center;
}
.lightbox img {
    max-width: 100%;
    max-height: 78vh;
    margin: 0 auto;
    border: 3px solid rgba(240, 211, 145, 0.5);
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.lightbox figcaption {
    margin-top: 12px;
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: 1.05rem;
}
.lb-close, .lb-prev, .lb-next {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 2rem;
    cursor: pointer;
    padding: 8px 12px;
    line-height: 1;
    transition: color 0.15s ease, transform 0.15s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--gold); transform: scale(1.15); }
.lb-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 2.6rem;
}

/* ------------------------------ Animazioni reveal ------------------------------ */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .card, .gallery-item, .btn { transition: none; }
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 640px) {
    .topnav { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
    .topnav nav { gap: 14px; }
    .topnav nav a:not(.nav-cta) { font-size: 0.85rem; }
    .nav-cta { padding: 5px 14px; }
    .hero { padding-top: 110px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .footer-flex { flex-direction: column; }
    .lb-prev, .lb-next { font-size: 1.5rem; padding: 6px; }
}
