/* ==========================================================================
   AMUNÌ TOURISM — MOBILE HOME (allineata alla palette del sito desktop)
   Stessa logica di prima (audio, lingua, card dinamiche, service worker):
   qui cambia solo l'aspetto, non un solo ID o classe usata dal JS.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,600;1,600&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&display=swap');

:root {
    --sky: #5B8FAE;
    --sea: #1B4965;
    --sea-ink: #14283A;

    --stone: #EFE6D3;
    --stone-dim: #DCCFAF;

    --terracotta: #C1622D;
    --terracotta-dark: #9C4C22;

    --gold: #B8873B;
    --gold-light: #D4AF6A;

    --ink: #22303B;
    --ink-soft: #465563;

    --shadow-soft: rgba(0, 0, 0, 0.18);
    --shadow-strong: rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Jost', sans-serif;
    background: var(--stone);
    color: var(--ink);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

/* ==========================================================================
   SFONDO — foto del borgo solo qui in home (come sul desktop), non più
   il file generico di prima. Le altre pagine mobile (quando le
   aggiorneremo) resteranno invece a sfondo piatto pietra, come
   già fanno tutte le pagine interne del desktop.
   ========================================================================== */
.scene-background {
    position: fixed;
    inset: 0;
    background-image: url('img/sfondocaccamo.jpeg');
    background-size: cover;
    background-position: center;
    filter: brightness(0.88) contrast(1.12) saturate(1.2);
    z-index: 0;
}

.scene-background::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(20, 40, 58, 0.12) 0%,
        rgba(20, 40, 58, 0.3) 55%,
        var(--sea-ink) 100%);
    pointer-events: none;
}

/* ==========================================================================
   DASHBOARD — stessa identità del desktop: scura, bordo oro sottile,
   niente più effetto vetro dorato pesante
   ========================================================================== */
.dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 65px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(15, 25, 34, 0.92);
    backdrop-filter: blur(18px) saturate(200%);
    border-bottom: 2px solid var(--gold);
    z-index: 1000;
}

.logo-container {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
}

.logo-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--gold-light);
    white-space: nowrap;
}

.right-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1 1 100%;
}

.lang-switcher {
    display: flex;
    gap: 5px;
}

.lang-switcher button {
    width: 30px;
    height: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 2px;
    background: rgba(239, 230, 211, 0.08);
    border: 1px solid rgba(239, 230, 211, 0.4);
    color: var(--stone);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lang-switcher button.active {
    border-color: var(--gold);
    background: rgba(184, 135, 59, 0.25);
    color: var(--gold-light);
}

.lang-switcher button:hover {
    background: rgba(193, 98, 45, 0.25);
}

/* pulsante audio: struttura invariata, solo pulizia visiva */
.btn-audio {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 0 5px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stone);
}

/* ==========================================================================
   LAYOUT MOBILE
   ========================================================================== */
.mobile-layout {
    margin-top: 112px;
    padding: 16px;
    padding-bottom: 150px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   VIDEO CASTELLANA — cornice pietra invece di taglio netto, coerente
   con le cornici già usate per le immagini sul desktop
   ========================================================================== */
.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 38vh;
    overflow: visible;
    position: relative;
}

.castellana-avatar {
    max-height: 38vh;
    width: auto;
    margin: 0 auto;
    display: block;
    pointer-events: none;
    animation: fadeIn 1s ease-out, gentleBreathe 5s ease-in-out infinite;
    /* Sfumatura ai bordi: il video ha un bordo rettangolare netto
       (anche con canale alpha, il "riquadro" del video resta
       percepibile). Una maschera a gradiente radiale — opaca al
       centro, trasparente ai bordi — fa dissolvere dolcemente i
       lati invece di tagliarli di netto. */
    -webkit-mask-image: radial-gradient(
        ellipse 62% 85% at center,
        #000 55%,
        rgba(0,0,0,0.6) 75%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 62% 85% at center,
        #000 55%,
        rgba(0,0,0,0.6) 75%,
        transparent 100%
    );
}

/* ==========================================================================
   CARD DI NAVIGAZIONE — sostituiscono i vecchi bottoni "barocchi" neri
   con glow: bordo sottile, sfondo pietra, niente animazioni luminose
   ========================================================================== */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.buttons-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.btn-barocco {
    background: rgba(15, 25, 34, 0.55);
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    border: 1px solid var(--gold);
    border-radius: 2px;
    padding: 14px 6px;
    text-align: center;
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    display: block;
    box-shadow: 0 4px 12px var(--shadow-strong);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-barocco:active {
    background: rgba(15, 25, 34, 0.75);
    border-color: var(--terracotta);
}

/* ==========================================================================
   CTA PRINCIPALE — parla con la Castellana: unico bottone "pieno",
   per distinguerlo chiaramente dalle card di navigazione sopra
   ========================================================================== */
.btn-castellana {
    display: block;
    background: var(--sea);
    border: 1px solid var(--gold);
    border-radius: 2px;
    padding: 14px;
    text-align: center;
    color: var(--stone);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 6px 14px var(--shadow-soft);
    transition: background 0.2s ease;
}

.btn-castellana:active {
    background: var(--terracotta-dark);
}

/* ==========================================================================
   BOX INFORMATIVO AMUNÌ
   ========================================================================== */
.amuni-box {
    background: var(--stone-dim);
    border: 1px solid var(--gold);
    border-radius: 2px;
    padding: 18px;
}

.amuni-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sea);
    margin-bottom: 10px;
    text-align: center;
}

.amuni-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    text-align: center;
}

/* ==========================================================================
   CARD CIBO (generate dinamicamente da JS, in altre pagine mobile —
   restano qui pronte per quando estenderemo lo stesso stile a quelle)
   ========================================================================== */
.food-card {
    display: block;
    text-decoration: none;
    color: var(--ink);
    background: var(--stone-dim);
    border: 1px solid var(--gold);
    border-radius: 2px;
    margin-bottom: 12px;
    padding: 14px;
}

.food-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.food-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--sea);
}

.badge {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--terracotta-dark);
    font-weight: 700;
}

.food-card-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.food-card-btn {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--terracotta);
}

/* ==========================================================================
   ANIMAZIONI — solo quella discreta rimasta, niente più bagliori
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes gentleBreathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
/* ==========================================================================
   PULSANTE INSTALLAZIONE PWA — dentro .amuni-box, sotto il testo
   ========================================================================== */
#install-pwa-btn-mobile {
    display: block;
    width: 100%;
    margin-top: 16px;
    background: var(--sea);
    border: 1px solid var(--gold);
    border-radius: 2px;
    padding: 13px 10px;
    text-align: center;
    color: var(--stone);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-soft);
    transition: background 0.2s ease;
}

#install-pwa-btn-mobile:active {
    background: var(--terracotta-dark);
}
