/* ============================================================
   Pizzeria Ciribì — tema landing page (MOBILE-FIRST)
   Palette derivata dal logo: rosso #990000 + crema #e2d2b1
   Gli stili base sono per mobile; le media query `min-width`
   arricchiscono il layout su schermi più grandi.
   ============================================================ */

:root {
    --red:        #990000;
    --red-dark:   #6f0000;
    --red-deep:   #4a0000;
    --cream:      #e2d2b1;
    --cream-lite: #f4ecdc;
    --cream-soft: #faf5ea;
    --ink:        #241512;
    --ink-soft:   #5a4a42;
    --gold:       #c9a24b;   /* accento decorativo (fondi scuri) */
    --gold-deep:  #8a6a12;   /* oro leggibile su chiaro — WCAG AA ~5:1 su bianco */
    --white:      #ffffff;

    --radius:     18px;
    --radius-sm:  12px;
    --shadow:     0 18px 45px -20px rgba(74, 0, 0, .45);
    --shadow-sm:  0 8px 22px -14px rgba(74, 0, 0, .5);
    --maxw:       1160px;
    --nav-h:      60px;

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream-soft);
    overflow-x: hidden;                 /* evita scroll orizzontale su mobile */
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.12; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Loading screen (prima del boot di Blazor) ---------- */
.app-loading {
    min-height: 100vh; min-height: 100dvh;
    display: grid; place-content: center; justify-items: center; gap: 1.25rem;
    padding: 1.5rem;
    background: radial-gradient(1200px 600px at 50% -10%, var(--cream-lite), var(--cream-soft));
    color: var(--red);
}
.app-loading img { filter: drop-shadow(0 10px 20px rgba(74,0,0,.25)); animation: floaty 3s ease-in-out infinite; }
.app-loading p { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .3px; }
.app-loading__bar { width: 200px; max-width: 60vw; height: 6px; border-radius: 999px; background: var(--cream); overflow: hidden; }
.app-loading__bar span { display: block; height: 100%; width: 40%; border-radius: 999px; background: var(--red);
    animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@keyframes floaty { 50% { transform: translateY(-8px); } }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .9rem 1.6rem; min-height: 46px;      /* target touch comodo */
    border-radius: 999px;
    font-family: var(--font-body); font-weight: 600; font-size: 1rem;
    border: 2px solid transparent; cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
    white-space: nowrap;
}
.btn--sm { padding: .6rem 1.15rem; min-height: 40px; font-size: .9rem; }
.btn--primary { background: var(--red); color: var(--cream-lite); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn--outline:hover { background: var(--red); color: var(--cream-lite); transform: translateY(-2px); }
.btn--ghost { background: rgba(226,210,177,.18); color: var(--cream-lite); border-color: rgba(226,210,177,.55); }
.btn--ghost:hover { background: var(--cream-lite); color: var(--red-dark); }
/* Varianti per fondi scuri (es. hero rosso) — contrasto WCAG AA */
.btn--cream { background: var(--cream-lite); color: var(--red-dark); box-shadow: var(--shadow-sm); }
.btn--cream:hover { background: var(--white); color: var(--red-deep); transform: translateY(-2px); }
.btn--outline-cream { background: transparent; color: var(--cream-lite); border-color: var(--cream-lite); }
.btn--outline-cream:hover { background: var(--cream-lite); color: var(--red-dark); transform: translateY(-2px); }

/* ============================================================
   NAVBAR — base: mobile con menù a tendina + hamburger
   ============================================================ */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(74, 0, 0, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226,210,177,.18);
    padding-top: env(safe-area-inset-top);
}
.nav__inner {
    max-width: var(--maxw); margin: 0 auto; min-height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem clamp(1rem, 4vw, 1.25rem); gap: 1rem;
}
.nav__brand { display: flex; align-items: center; gap: .6rem; }
.nav__logo { width: 38px; height: auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.nav__name { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--cream-lite); letter-spacing: .5px; }

.nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(74,0,0,.98); backdrop-filter: blur(10px);
    padding: 0 clamp(1rem, 4vw, 1.25rem);
    max-height: 0; overflow: hidden; opacity: 0; pointer-events: none;
    box-shadow: var(--shadow);
    transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
}
.nav__links.is-open { max-height: 80vh; opacity: 1; pointer-events: auto; padding: .5rem clamp(1rem,4vw,1.25rem) 1.25rem; }
.nav__links > a { color: var(--cream); font-weight: 500; font-size: 1.02rem; padding: .95rem .25rem; border-bottom: 1px solid rgba(226,210,177,.12); }
.nav__cta { margin-top: .85rem; text-align: center; }

.nav__toggle { display: flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 10px; margin: -10px -10px -10px 0; }
.nav__toggle span { width: 26px; height: 2.5px; background: var(--cream-lite); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* NAVBAR — desktop: barra orizzontale */
@media (min-width: 721px) {
    .nav__toggle { display: none; }
    .nav__logo { width: 40px; }
    .nav__name { font-size: 1.5rem; }
    .nav__links {
        position: static; flex-direction: row; align-items: center; gap: 1.6rem;
        max-height: none; overflow: visible; opacity: 1; pointer-events: auto;
        background: none; backdrop-filter: none; box-shadow: none; padding: 0;
    }
    .nav__links > a { padding: .25rem 0; border-bottom: 0; position: relative; }
    .nav__links > a:not(.nav__cta)::after {
        content: ""; position: absolute; left: 0; bottom: -3px; height: 2px; width: 0;
        background: var(--cream-lite); transition: width .22s ease;
    }
    .nav__links > a:not(.nav__cta):hover::after { width: 100%; }
    .nav__cta { margin: 0 0 0 .4rem; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(900px 500px at 80% -20%, rgba(226,210,177,.22), transparent 60%),
        linear-gradient(160deg, var(--red-deep) 0%, var(--red) 55%, var(--red-dark) 100%);
    color: var(--cream-lite);
    text-align: center;
    padding: clamp(2.75rem, 8vw, 6rem) clamp(1rem, 4vw, 1.25rem) clamp(4rem, 9vw, 8rem);
}
.hero__glow {
    position: absolute; inset: auto 50% -40% 50%; width: 700px; max-width: 130vw; height: 700px; transform: translateX(-50%);
    background: radial-gradient(circle, rgba(201,162,75,.28), transparent 60%); pointer-events: none;
}
.hero__inner { position: relative; max-width: 780px; margin: 0 auto; display: grid; justify-items: center; gap: 1.1rem; }
.hero__logo { width: clamp(110px, 30vw, 180px); filter: drop-shadow(0 16px 30px rgba(0,0,0,.4)); animation: floaty 4s ease-in-out infinite; }
.hero__eyebrow {
    text-transform: uppercase; letter-spacing: 2.5px; font-size: .72rem; font-weight: 600;
    color: var(--cream); background: rgba(226,210,177,.12); padding: .4rem .9rem; border-radius: 999px;
    border: 1px solid rgba(226,210,177,.3);
}
.hero__title { font-size: clamp(2.4rem, 9vw, 5rem); font-weight: 900; letter-spacing: -1px; }
.hero__title span { color: var(--cream); font-style: italic; }
.hero__subtitle { font-size: clamp(1rem, 2.4vw, 1.2rem); color: rgba(244,236,220,.9); max-width: 620px; line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: .4rem; width: 100%; }
.hero__badges { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; justify-content: center; margin-top: 1.3rem; font-size: .88rem; color: var(--cream); opacity: .92; }
.hero__badges span { display: inline-flex; align-items: center; gap: .35rem; }
.hero__wave {
    position: absolute; left: 0; right: 0; bottom: -1px; height: 50px;
    background: var(--cream-soft);
    -webkit-mask: radial-gradient(60px 50px at 50% 0, transparent 98%, #000) repeat-x;
    mask: radial-gradient(60px 50px at 50% 0, transparent 98%, #000) repeat-x;
    -webkit-mask-size: 120px 50px; mask-size: 120px 50px;
}
@media (min-width: 560px) {
    .hero__actions { width: auto; }
    .hero__eyebrow { font-size: .8rem; letter-spacing: 3px; }
}

/* ============================================================
   SECTIONS (generico)
   ============================================================ */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 1.25rem); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto clamp(1.75rem, 4vw, 3rem); display: grid; gap: .7rem; }
.section__eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: .74rem; font-weight: 700; color: var(--red); }
.section__title { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 700; color: var(--ink); }
.section__lead { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.6; }

/* ============================================================
   MENU
   ============================================================ */
.menu__filters { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin-bottom: 2rem; }
.chip {
    border: 1.5px solid var(--cream); background: var(--white); color: var(--ink-soft);
    padding: .55rem 1.05rem; min-height: 40px; border-radius: 999px;
    font-family: var(--font-body); font-weight: 600; font-size: .9rem;
    cursor: pointer; transition: all .18s ease;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.is-active { background: var(--red); border-color: var(--red); color: var(--cream-lite); }

.menu__grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.pizza-card {
    background: var(--white); border-radius: var(--radius); padding: 1.3rem 1.4rem;
    border: 1px solid rgba(226,210,177,.7); box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: .55rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative; overflow: hidden;
}
.pizza-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); opacity: 0; transition: opacity .2s ease; }
.pizza-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--red); }
.pizza-card:hover::before { opacity: 1; }
.pizza-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.pizza-card__name { font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.pizza-card__price { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--red); white-space: nowrap; }
.pizza-card__desc { color: var(--ink-soft); font-size: .95rem; line-height: 1.5; flex: 1; }
.pizza-card__foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pizza-card__tag { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
    color: var(--red-dark); background: var(--cream-lite); padding: .28rem .7rem; border-radius: 999px; }
.pizza-card__signature { font-size: .78rem; font-weight: 700; color: var(--gold-deep); }
.menu__note { text-align: center; color: var(--ink-soft); font-size: .88rem; margin-top: 1.75rem; font-style: italic; }
.menu__loading { text-align: center; color: var(--ink-soft); font-family: var(--font-display); font-size: 1.1rem; padding: 2rem 0; }

/* ============================================================
   ABOUT
   ============================================================ */
.about { background: linear-gradient(180deg, transparent, rgba(226,210,177,.28)); }
.about__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
.about__media { display: flex; justify-content: center; }
.about__logo-badge {
    width: min(300px, 78%); aspect-ratio: 1; border-radius: 50%;
    /* fondo più chiaro del nastro crema del logo (#e2d2b1) così l'intero logo resta visibile */
    background: radial-gradient(circle at 30% 25%, var(--white), var(--cream-soft));
    /* flex (non grid+place-content): così width:% del logo è relativo al badge, non all'SVG */
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow); border: 6px solid var(--white);
}
.about__logo-badge img { width: 78%; height: auto; filter: drop-shadow(0 8px 16px rgba(74,0,0,.28)); }
.about__text { display: grid; gap: 1rem; }
.about__text p { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.7; }
.about__stats { display: flex; gap: 1.5rem 2rem; margin-top: 1rem; flex-wrap: wrap; }
.about__stats div { display: grid; }
.about__stats strong { font-family: var(--font-display); font-size: 1.9rem; color: var(--red); line-height: 1; }
.about__stats span { font-size: .82rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; }
@media (min-width: 861px) {
    .about__grid { grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); }
    .about__logo-badge { width: min(360px, 85%); }
    .about__text p { font-size: 1.05rem; }
    .about__stats strong { font-size: 2rem; }
}

/* ============================================================
   LOCATION + QR
   ============================================================ */
.location__grid { display: grid; grid-template-columns: 1fr; gap: 2.2rem; align-items: start; }
.location__info { display: grid; gap: 1.5rem; }
.info-row { display: flex; gap: 1rem; align-items: flex-start; }
.info-row__icon {
    flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-content: center;
    font-size: 1.3rem; background: var(--cream-lite); border: 1px solid var(--cream);
}
.info-row h3 { font-size: 1.12rem; color: var(--ink); margin-bottom: .35rem; }
.info-row p { color: var(--ink-soft); line-height: 1.5; margin-bottom: .5rem; }
.info-row a:not(.btn) { color: var(--red); font-weight: 600; }
.hours { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.hours li { display: flex; justify-content: space-between; gap: 1rem; color: var(--ink-soft); border-bottom: 1px dashed rgba(226,210,177,.9); padding-bottom: .35rem; }
.hours li span:first-child { font-weight: 600; color: var(--ink); }

.location__qr { display: flex; justify-content: center; }
.qr-card {
    background: var(--white); border-radius: var(--radius); padding: 1.5rem; text-align: center;
    box-shadow: var(--shadow); border: 1px solid rgba(226,210,177,.7); display: grid; gap: .8rem; justify-items: center;
    max-width: 320px; width: 100%;
}
.qr-card__img { width: 100%; max-width: 240px; border-radius: var(--radius-sm); }
.qr-card__label { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.qr-card__link { color: var(--red); font-weight: 600; font-size: .92rem; word-break: break-all; }
.qr-card__link:hover { text-decoration: underline; }
@media (min-width: 861px) {
    .location__grid { grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 3.5rem); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--red-deep); color: var(--cream);
    padding: 2.25rem clamp(1rem, 4vw, 1.25rem) calc(1.5rem + env(safe-area-inset-bottom));
    margin-top: 2rem;
}
.footer__inner {
    max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.25rem;
    align-items: center; justify-content: center; text-align: center; padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(226,210,177,.18);
}
.footer__brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--cream-lite); }
.footer__brand img { width: 38px; }
.footer__links, .footer__social { display: flex; flex-wrap: wrap; gap: .9rem 1.2rem; justify-content: center; }
.footer__links a, .footer__social a { color: var(--cream); font-size: .95rem; transition: color .18s ease; }
.footer__links a:hover, .footer__social a:hover { color: var(--white); }
.footer__copy { max-width: var(--maxw); margin: 1.25rem auto 0; text-align: center; color: rgba(226,210,177,.7); font-size: .84rem; }
@media (min-width: 641px) {
    .footer__inner { justify-content: space-between; text-align: left; }
}

/* ============================================================
   Blazor error UI
   ============================================================ */
#blazor-error-ui {
    color-scheme: light only;
    background: var(--cream-lite);
    bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box; display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed;
    width: 100%; z-index: 1000; color: var(--red-dark); font-family: var(--font-body);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary {
    background: var(--red); padding: 1rem; color: white; border-radius: 8px;
}
.blazor-error-boundary::after { content: "Si è verificato un errore."; }
