/* ==========================================================================
   I SIGNORI DEL CAFFÈ — Stylesheet (restyling 2026)
   Colori dal negozio e dal logo: giallo degli scaffali, espresso, tostato,
   crema della tazzina, muro di mattoncini bianchi.
   ========================================================================== */

:root {
    --giallo: #F6C40F;
    --giallo-ombra: #D9A800;
    --giallo-chiaro: #FFF3C4;
    --espresso: #24170F;
    --tostato: #4E2414;
    --crema: #E9A21A;
    --muro: #FFFFFF;
    --muro-ombra: #EFE9E1;
    --malta: #E3DCD2;
    --testo: #24170F;
    --testo-soft: #5C4A3F;
    --linea: rgba(36, 23, 15, 0.14);
    --whatsapp: #1FA855;

    --font-display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
    --font-body: 'Albert Sans', system-ui, -apple-system, sans-serif;

    /* muro di mattoncini, come quello del negozio */
    --mattoni: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='44' viewBox='0 0 88 44'%3E%3Cg fill='none' stroke='%23E3DCD2' stroke-width='2'%3E%3Cpath d='M0 1h88M0 23h88M44 1v22M0 23v21M88 23v21'/%3E%3C/g%3E%3C/svg%3E");
    --mattoni-ombra: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='44' viewBox='0 0 88 44'%3E%3Cg fill='none' stroke='%23DDD4C8' stroke-width='2'%3E%3Cpath d='M0 1h88M0 23h88M44 1v22M0 23v21M88 23v21'/%3E%3C/g%3E%3C/svg%3E");
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    color: var(--testo);
    background: var(--muro);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0; }

h1, h2, h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 0.98;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    text-wrap: balance;
}

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    fill: currentColor;
}

.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

.skip {
    position: absolute;
    left: -999px;
    top: 10px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: 6px;
    background: var(--muro);
}
.skip:focus { left: 10px; }

:focus-visible {
    outline: 3px solid var(--espresso);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ==========================================================================
   BOTTONI
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.85em 1.35em;
    border: 2px solid var(--espresso);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.btn:active { transform: translateY(1px); }

.btn-espresso { background: var(--espresso); color: var(--giallo); }
.btn-espresso:hover { background: var(--tostato); }

.btn-bianco { background: var(--muro); color: var(--espresso); }
.btn-bianco:hover { background: var(--giallo-chiaro); }
.btn-bianco .icon { color: var(--whatsapp); }

.btn-giallo { background: var(--giallo); color: var(--espresso); }
.btn-giallo:hover { background: var(--muro); }

.btn-sm { padding: 0.6em 1em; font-size: 0.92rem; }

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--muro);
    border-bottom: 3px solid var(--espresso);
}
.header-in {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 74px;
}
.brand img { height: 46px; width: auto; }

.nav { margin-left: auto; }
.nav ul {
    display: flex;
    gap: 1.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nav a {
    font-weight: 500;
    text-decoration: none;
    background: linear-gradient(var(--giallo), var(--giallo)) 0 100% / 0 0.45em no-repeat;
    transition: background-size 0.25s;
}
.nav a:hover { background-size: 100% 0.45em; }

.header-actions { display: flex; gap: 0.6rem; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
    position: relative;
    overflow: hidden;
    background: var(--giallo);
}
.hero-in {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    align-items: center;
    gap: 2rem;
    padding-top: clamp(2.25rem, 5vw, 3.5rem);
    padding-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.hero h1 {
    font-size: clamp(3.4rem, 7.4vw, 6rem);
    color: var(--espresso);
}

.lead {
    max-width: 44ch;
    margin-top: 1.4rem;
    font-size: 1.18rem;
    color: var(--espresso);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    margin-top: 1.4rem;
    padding: 0.4em 0.9em 0.4em 0.75em;
    border-radius: 999px;
    background: var(--espresso);
    color: var(--muro);
    font-weight: 500;
    font-size: 0.95rem;
}
.status::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9C8F86;
}
.status.is-open::before { background: #3DDC84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.25); }
.status.is-closed::before { background: #FF6B57; }

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

/* La mascotte: il cappello è separato per il saluto */
.signore {
    position: relative;
    justify-self: center;
    width: min(100%, 400px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.signore img { width: 100%; }
.signore-cappello {
    position: relative;
    z-index: 1;
    transform-origin: 50% 92%;
}
.signore.saluta .signore-cappello { animation: saluto 1.5s ease-in-out; }

@keyframes saluto {
    0%   { transform: none; }
    30%  { transform: translateY(-16%) rotate(-11deg); }
    62%  { transform: translateY(-16%) rotate(-11deg); }
    100% { transform: none; }
}

/* ==========================================================================
   SEZIONI
   ========================================================================== */

.section { padding: clamp(3.25rem, 6vw, 5rem) 0; }

.section-head { max-width: 640px; margin-bottom: 2.25rem; }
.section-head h2 {
    font-size: clamp(2.5rem, 5.4vw, 4.2rem);
    color: var(--espresso);
}
.section-head p { margin-top: 0.9rem; font-size: 1.1rem; color: var(--testo-soft); }

/* --- Lo scaffale --- */

.muro {
    background-color: var(--muro);
    background-image: var(--mattoni);
}

.scaffale {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
    border-radius: 4px;
    background: var(--giallo);
    box-shadow: 0 2px 0 var(--giallo-ombra), 0 30px 40px -28px rgba(36, 23, 15, 0.55);
    list-style: none;
    margin: 0;
}

.vano {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 290px;
    padding: 1.25rem 1rem 0;
    background-color: var(--muro-ombra);
    background-image: var(--mattoni-ombra);
    box-shadow: inset 0 14px 16px -12px rgba(36, 23, 15, 0.35), inset 8px 0 12px -10px rgba(36, 23, 15, 0.25);
}

.vano svg {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

.cartellino {
    position: relative;
    z-index: 2;
    margin: 0.6rem 0 -22px 0.25rem;
    padding: 0.7rem 0.9rem 0.75rem 1.6rem;
    width: calc(100% - 0.5rem);
    border-radius: 4px 10px 10px 4px;
    background: var(--muro);
    box-shadow: 0 6px 12px -6px rgba(36, 23, 15, 0.45);
    transform: rotate(-1.2deg);
}
.vano:nth-child(even) .cartellino { transform: rotate(1deg); }
.cartellino::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--giallo);
    box-shadow: inset 0 0 0 2px var(--espresso);
}
.cartellino h3 { font-size: 1.45rem; color: var(--tostato); }
.cartellino p { margin-top: 0.25rem; font-size: 0.9rem; line-height: 1.4; color: var(--testo-soft); }

.scaffale-nota {
    margin-top: 3.25rem;
    max-width: 60ch;
    color: var(--testo-soft);
}
.scaffale-nota a { font-weight: 700; color: var(--tostato); }

/* --- Compatibili --- */

.compat {
    background: var(--espresso);
    color: var(--muro);
}
.compat-in {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 4rem;
    align-items: center;
}
.compat h2 { font-size: clamp(2.5rem, 5.4vw, 4.2rem); color: var(--giallo); }
.compat-text p { margin-top: 1rem; max-width: 46ch; font-size: 1.1rem; color: #E8DDD5; }
.compat-text .btn { margin-top: 1.6rem; }

.sistemi {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sistemi li {
    padding: 0.65em 1.1em;
    border: 2px solid rgba(246, 196, 15, 0.55);
    border-radius: 10px;
    font-weight: 700;
    color: var(--muro);
}
.sistemi li.altro {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
    color: #E8DDD5;
}
.sistemi-titolo { margin-bottom: 0.75rem; font-weight: 500; color: #E8DDD5; }

.ufficiale {
    margin-top: 1.25rem;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    background: var(--giallo);
    color: var(--espresso);
}
.ufficiale-titolo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.1;
    text-transform: uppercase;
}
.ufficiale p + p { margin-top: 0.3rem; font-size: 0.95rem; }

.compat-nota { margin-top: 1rem; font-size: 0.8rem; color: #B5A79D; }
.compat-nota a { color: var(--giallo); }

sup { font-size: 0.55em; line-height: 0; vertical-align: 0.7em; margin-left: 0.05em; }
.sistemi sup { font-weight: 500; }

/* --- Negozio --- */

.foto-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 14px;
    margin: 0;
}
.foto-grid figure { margin: 0; overflow: hidden; border-radius: 6px; }
.foto-grid img { width: 100%; height: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.foto-grid figure:first-child img { aspect-ratio: auto; }

.marche { margin-top: 2.5rem; }
.marche p { font-size: 1.05rem; color: var(--testo-soft); }
.marche ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 1rem;
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4.2vw, 3.2rem);
    line-height: 1.15;
    text-transform: uppercase;
}
.marche li { display: inline-flex; align-items: center; gap: 1rem; color: var(--espresso); }
.marche li:nth-child(even) { color: var(--tostato); }
.marche li sup { font-family: var(--font-body); font-weight: 500; font-size: 0.3em; vertical-align: 2.2em; margin-left: 0.15em; }
.marche .marche-altri { margin-top: 0.4rem; }
.marche li:not(:last-child)::after {
    content: '';
    width: 0.32em;
    height: 0.46em;
    border-radius: 50%;
    background: var(--crema);
    transform: rotate(28deg);
}

/* --- Visita --- */

.visita { background: var(--giallo); }
.visita-in {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 3rem;
    align-items: start;
}
.visita h2 { font-size: clamp(2.5rem, 5.4vw, 4.2rem); color: var(--espresso); }
.indirizzo { margin-top: 1rem; font-size: 1.15rem; }
.indirizzo strong { font-weight: 700; }
.visita .status { margin-top: 1.1rem; }

.orari {
    width: 100%;
    max-width: 460px;
    margin-top: 1.6rem;
    border-collapse: collapse;
    font-size: 1rem;
}
.orari th, .orari td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid rgba(36, 23, 15, 0.18);
    text-align: left;
    font-weight: 400;
}
.orari th { width: 34%; font-weight: 500; }
.orari td { font-variant-numeric: tabular-nums; }
.orari .chiuso td { color: var(--testo-soft); }
.orari tr.oggi { background: var(--espresso); color: var(--giallo); }
.orari tr.oggi th, .orari tr.oggi td { color: var(--giallo); font-weight: 700; border-color: transparent; }
.orari tr.oggi th:first-child { border-radius: 8px 0 0 8px; }
.orari tr.oggi td:last-child { border-radius: 0 8px 8px 0; }

.visita-ctas { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; }

.mappa {
    position: relative;
    overflow: hidden;
    border: 3px solid var(--espresso);
    border-radius: 10px;
    background: var(--muro);
}
.mappa iframe {
    display: block;
    width: 100%;
    height: 460px;
    border: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    padding: 2.75rem 0 2rem;
    background: var(--espresso);
    color: #E8DDD5;
    font-size: 0.95rem;
}
.footer-in {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem 2.5rem;
    align-items: center;
}
.footer-mascotte {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    padding: 12px;
    border-radius: 50%;
    background: var(--giallo);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.footer-in strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; text-transform: uppercase; color: var(--giallo); line-height: 1.1; }
.footer-in a { text-decoration: none; }
.footer-in a:hover { color: var(--giallo); }
.footer-contatti { text-align: right; }
.social { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem; }
.social a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s, color 0.2s;
}
.social a:hover { background: var(--giallo); color: var(--espresso); }

.segui { margin-top: 1.1rem; }
.segui a { font-weight: 700; }

.note-marchi {
    margin-top: 1.75rem;
    max-width: 110ch;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #B5A79D;
}
.copy { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.82rem; color: #B5A79D; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1020px) {
    .nav { display: none; }
    .header-actions { margin-left: auto; }
    .hero-in { grid-template-columns: 1.4fr 1fr; }
    .compat-in, .visita-in { grid-template-columns: 1fr; }
    .scaffale { grid-template-columns: repeat(2, 1fr); }
    .foto-grid { grid-template-columns: 1fr 1fr; }
    .foto-grid figure:first-child { grid-column: 1 / -1; }
    .foto-grid figure:first-child img { aspect-ratio: 16 / 10; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .wrap { padding: 0 16px; }
    .header-in { height: 64px; gap: 0.75rem; }
    .brand img { height: 38px; }
    .header-actions .btn span { display: none; }
    .header-actions .btn { padding: 0.6em; }

    /* Su telefono il Signore sta accanto al titolo, in alto a destra */
    .hero-in {
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 0 14px;
        padding-top: 1.75rem;
        padding-bottom: 2.25rem;
    }
    .hero-text { display: contents; }
    .hero h1 { grid-column: 1; grid-row: 1; font-size: clamp(2.3rem, 10.8vw, 3rem); }
    .signore { grid-column: 2; grid-row: 1; width: clamp(96px, 28vw, 130px); margin: 0; }
    .lead, .hero .status, .hero-ctas { grid-column: 1 / -1; justify-self: start; }
    .lead { font-size: 1.05rem; }

    .scaffale { gap: 10px; padding: 10px; }
    .vano { min-height: 230px; padding: 0.9rem 0.5rem 0; }
    .cartellino { padding: 0.55rem 0.6rem 0.6rem 1.3rem; margin-bottom: -16px; }
    .cartellino::before { left: 0.45rem; width: 7px; height: 7px; }
    .cartellino h3 { font-size: 1.15rem; }
    .cartellino p { font-size: 0.78rem; }

    .foto-grid { gap: 8px; }
    .marche li { gap: 0.6rem; }

    .orari { font-size: 0.95rem; }
    .orari th, .orari td { padding: 0.5rem 0.45rem; }
    .mappa iframe { height: 320px; }

    .footer-in { grid-template-columns: auto 1fr; }
    .footer-contatti { grid-column: 1 / -1; text-align: left; }
    .social { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    /* il saluto resta disponibile quando è il visitatore a chiederlo (tocco o clic) */
    .signore.saluta .signore-cappello { animation: saluto 1.5s ease-in-out !important; }
}
