/* static/style.css - VERSIONE DEFINITIVA E CORRETTA */

:root {
    --nav-height: 80px;
    --primary-color: #000000;
    --accent-color: #0071e3;
    --bg-gray: #f5f5f7;
    --border-color: #d2d2d7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-gray); /* Sfondo grigio chiaro per tutto il sito */
    color: #1d1d1f;
    padding-top: var(--nav-height);
    line-height: 1.5;
}

/* --- NAVBAR --- */
nav {
    position: fixed;
    top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px;
}

.nav-brand { display: flex; align-items: center; gap: 15px; text-decoration: none; color: black; }
.monviso-logo {
    width: 50px; height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #eee; /* Colore se l'img non carica */
}
.brand-text {
    font-size: 35px;           /* Più grande */
    font-weight: 800;          /* Massimo spessore */
    text-transform: uppercase; /* Forza stampatello */
    letter-spacing: 1px;       /* Lettere vicine per sembrare più massiccio */
    display: inline-block;
    /* Tripla ombra per un effetto "Grassetto Extra" */
    text-shadow: 1px 0px 0px currentColor, -1px 0px 0px currentColor, 0px 1px 0px currentColor;
    line-height: 1;
}

.nav-links { list-style: none; display: flex; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: #424245; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--accent-color); }
.nav-btn { background: black; color: white !important; padding: 8px 16px; border-radius: 20px; }

/* --- HERO HOME (SFONDO MONVISO) --- */
.hero-home {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.5)), url('https://vapkqdbguisjaryyxsnh.supabase.co/storage/v1/object/public/trekking-images/Monviso1.jpeg');
    background-size: cover;
    background-position: center 25%;
    height: 500px; /* Altezza fissa imponente */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.hero-home h1 { font-size: 60px; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-home p { font-size: 24px; color: #f5f5f7; text-shadow: 0 2px 5px rgba(0,0,0,0.5); font-weight: 500; }

/* --- TITOLI GENERICI --- */
.page-header { text-align: center; margin: 40px 0; }
.page-header h2 { font-size: 40px; font-weight: 700; }

/* --- CARDS & GRID --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    background: white; border-radius: 20px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease; text-decoration: none; color: inherit; display: block;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }
.card img {
    width: 100%;
    /* height: 250px;  <-- CANCELLA O COMMENTA QUESTA RIGA */

    /* AGGIUNGI QUESTE DUE: */
    aspect-ratio: 4 / 3; /* Crea un rettangolo proporzionato, ottimo per foto miste */
    object-fit: cover;
    object-position: center 20%; /* Anche qui, alziamo leggermente il focus */
}
.card-content { padding: 25px; }
.card h3 { font-size: 22px; margin: 8px 0; }
.card-eyebrow { font-size: 12px; text-transform: uppercase; font-weight: 600; color: #86868b; }

/* --- FORMS (LOGIN & ADMIN) --- */
.form-box {
    background: white;
    max-width: 500px;
    margin: 60px auto;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
input, select, textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(0,113,227,0.1); }

button.btn-primary {
    background: var(--accent-color);
    color: white;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}
button.btn-primary:hover { background: #0077ed; }

button[style*="background: #d93025"]:hover {
    background: #b22222 !important;
    transform: scale(1.02);
}

/* Helper per griglia nei form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- OTTIMIZZAZIONE PER MOBILE (Smartphone) --- */

@media (max-width: 768px) {
    /* 1. Navbar: Rendiamo il menu scorrevole orizzontalmente o più compatto */
    nav {
        padding: 0px 15px;
        height: auto;
        flex-direction: column; /* Sovrapponiamo Logo e Menu */
        padding-top: 10px;
    }

    .nav-links {
        gap: 15px;
        padding-bottom: 10px;
        width: 100%;
        justify-content: center;
        overflow-x: auto; /* Se i link sono troppi, si può scorrere col dito */
        white-space: nowrap;
    }

    .brand-text {
        font-size: 22px;           /* Molto più grande di prima (era 20px) */
        font-weight: 800;          /* Forza lo spessore */
        letter-spacing: 1px;       /* Dà aria allo stampatello */
        text-shadow: 1px 0px 0px currentColor, -1px 0px 0px currentColor, 0px 1px 0px currentColor;* Ombra più leggera per non "impastare" il testo piccolo */
        line-height: 1.1;
        margin-top: 5px;
    }

    .nav-btn {
        padding: 6px 12px; /* Un po' più piccolo su mobile */
        font-size: 11px !important;
    }

    /* 2. Hero Home: Riduciamo le scritte giganti che coprono tutto */
    .hero-home {
        height: 450px; /* Più bassa su mobile */
        padding: 0 20px;
    }

    .hero-home h1 {
        font-size: 32px; /* Da 60px a 32px */
    }

    .hero-home p {
        font-size: 18px;
    }

    /* 3. Griglia: Una sola colonna di gite per farle vedere bene */
    .grid {
        grid-template-columns: 1fr; /* Una gita per riga */
        gap: 20px;
    }

    .container {
        padding: 20px 15px;
    }

    /* 4. Form (Login/Iscrizione/Admin): Devono occupare quasi tutto lo schermo */
    .form-box {
        margin: 20px 10px;
        padding: 25px 20px;
        border-radius: 18px;
    }

    .form-row {
        grid-template-columns: 1fr; /* Campi uno sotto l'altro */
        gap: 0;
    }

    /* 5. Dettaglio Gita: Titolo più piccolo */
    h1[style*="font-size: 3.5rem"] {
        font-size: 2rem !important;
    }
}

/* --- NUOVO STILE FOTOGRAFICO PULITO --- */

.container-dettaglio {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px;
}

.img-copertina-frame {
    width: 100%;
    /* Rimuoviamo height: 500px */
    aspect-ratio: 21 / 9; /* Proporzione panoramica perfetta per PC */
    height: auto;
    max-height: 450px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    background-color: #eee;
}

.img-copertina-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Poiché carichi foto orizzontali, center center o un leggero 30%
       è l'ideale per non tagliare le cime */
    object-position: center 15%;
}

.titolo-gita-area {
    margin-bottom: 40px;
    padding-left: 10px;
}

.titolo-gita-area h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #1d1d1f;
    margin-bottom: 10px;
}

/* OTTIMIZZAZIONE MOBILE */
@media (max-width: 768px) {
    .img-copertina-frame {
        /* Rimuoviamo height: 400px */
        aspect-ratio: 3 / 2; /* Su mobile la foto diventa un po' più alta e visibile */
        height: auto;
        border-radius: 18px;
    }
    .titolo-gita-area h1 {
        font-size: 28px;
    }
}


/* --- BOX INFORMAZIONI TECNICHE DETTAGLIO --- */
.info-tecnica-box {
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin: 40px 0;
    border: 1px solid rgba(0,0,0,0.05);
}

.info-tecnica-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
    font-weight: 600;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.info-divider {
    height: 1px;
    background-color: #f2f2f7;
    margin: 20px 0;
}

.pasti-tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.pasti-tag {
    background: #f5f5f7;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;

}
