/* ============================================================
   COMPONENTS.CSS — navbar, cards, form, footer
   ============================================================ */

/* ── NAVBAR ─────────────────────────────────────────────────── */
/* Fondo bianco pieno: il logo è nero e cremisi su bianco e ci si appoggia
   senza ritagli. Se un giorno arriva un PNG trasparente si può alleggerire. */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    height: var(--nav-height);
    background: #ffffff;
    border-bottom: 1px solid var(--paper-dark);
    transition: box-shadow var(--transition);
}

#navbar.scrolled {
    box-shadow: 0 2px 16px rgba(53,53,51,0.13);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-brand img {
    height: 46px;
    width: auto;
    display: block;
}

/* Ripiego testuale se l'immagine non c'è */
.nav-brand__testo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: -0.01em;
}
.nav-brand__testo span { color: var(--crimson); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-menu a {
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
}

.nav-menu a:hover {
    color: var(--crimson);
}

.nav-menu a.active {
    color: var(--crimson);
    border-bottom-color: var(--crimson);
}

/* Toggle lingua nella nav */
.nav-lang {
    background: transparent;
    color: var(--crimson);
    border: 2px solid var(--crimson);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    transition: all var(--transition);
    flex-shrink: 0;
}
.nav-lang:hover {
    background: var(--crimson);
    color: var(--white);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 6px;
    flex-shrink: 0;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all var(--transition);
    display: block;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

@media (max-width: 960px) {
    .nav-toggle { display: flex; }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: 0 12px 24px rgba(53,53,51,0.14);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 16px 0 24px;
        transform: translateY(-110%);
        transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .nav-menu a {
        padding: 13px 28px;
        font-size: 0.85rem;
        border-radius: 0;
        border-bottom: 1px solid var(--paper-dark);
    }
    .nav-menu a.active { border-bottom-color: var(--crimson); }

    .nav-lang {
        margin: 12px 28px 0;
        align-self: flex-start;
    }
}

/* ── CARDS ──────────────────────────────────────────────────── */

/* Card tipo 1 — bordo sinistro colorato */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 28px 28px 28px 32px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--orange);
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.card h3 { color: var(--orange); margin-bottom: 12px; font-size: 1.1rem; }
.card p { font-size: 0.98rem; }

/* Card tipo 2 — icona centrata (highlight card) */
.card--feature {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.06);
    transition: transform var(--transition), box-shadow var(--transition);
}
.card--feature:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--orange);
}
.card--feature .card__icon {
    font-size: 2.8rem;
    margin-bottom: 20px;
    display: block;
}
.card--feature h3 { margin-bottom: 12px; font-size: 1.2rem; }

/* Card tipo 3 — testo su sfondo scuro/colorato */
.card--dark {
    background: var(--dark);
    color: var(--white);
    border-radius: var(--radius-md);
    padding: 32px;
    border-left: 5px solid var(--orange);
}
.card--dark h3 { color: var(--orange); margin-bottom: 12px; }
.card--dark p { color: rgba(255,255,255,0.78); }

/* Card tipo 4 — con immagine in alto */
.card--media {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.card--media:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.card--media .card__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card--media .card__body {
    padding: 24px;
}
.card--media h3 { margin-bottom: 10px; font-size: 1.1rem; }

/* Highlight box (callout) */
.callout {
    background: var(--stone);
    border-left: 5px solid var(--orange);
    border-radius: var(--radius-md);
    padding: 28px 32px;
}
.callout h3 { color: var(--orange); margin-bottom: 12px; }
.callout p { margin: 0; }

.callout--warning {
    background: #fff8e1;
    border-left-color: #f59e0b;
}
.callout--warning h3 { color: #b45309; }

/* ── CONTENUTI DINAMICI (render.js) ─────────────────────────── */
.meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--cream);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    font-size: 0.82rem;
    font-weight: 600;
}
.meta-chip a { color: inherit; text-decoration: none; }

/* L'etichetta dice che cos'è il dato, il valore lo porta: due pesi diversi */
.meta-chip__k {
    font-weight: 500;
    opacity: 0.75;
    white-space: nowrap;
}
.meta-chip__v { font-weight: 700; }

/* Blocco descrittivo in coda alla scheda (es. avvicinamento alla grotta) */
.card__blocco {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--paper-dark, #e2d9c8);
}
.card__blocco h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.card__blocco p { font-size: 0.95rem; }

.card__cta {
    display: inline-block;
    margin: 14px 8px 0 0;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: var(--orange);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--orange);
    transition: all var(--transition);
}
.card__cta:hover { background: var(--orange-dark); border-color: var(--orange-dark); }

.card__cta--soft { background: transparent; color: var(--orange); }
.card__cta--soft:hover { background: var(--orange); color: var(--white); }

.apolje-stato {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 32px 0;
}

/* ── LISTE CONTENUTO ────────────────────────────────────────── */
.content-list {
    padding-left: 0;
}
.content-list li {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.9;
    padding-left: 20px;
    position: relative;
}
.content-list li::before {
    content: '▸';
    color: var(--orange);
    position: absolute;
    left: 0;
    font-size: 0.8em;
    top: 0.15em;
}

/* ── FORM CONTATTO ──────────────────────────────────────────── */
.form-wrap {
    max-width: 640px;
    margin: 0 auto;
    background: var(--white);
    padding: 44px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(161,5,44,0.12);
}
.form-group textarea {
    resize: vertical;
    min-height: 130px;
}
.form-group .checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.form-group .checkbox-row input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
}
.form-group .checkbox-row span {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: normal;
}

@media (max-width: 600px) {
    .form-wrap { padding: 28px 20px; }
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    border-left: 4px solid transparent;
    transition: border-color var(--transition);
}
.faq-item:hover { border-left-color: var(--orange); }
.faq-item h4 { color: var(--orange); margin-bottom: 10px; font-size: 1.05rem; }
.faq-item p { margin: 0; font-size: 0.98rem; }

/* ── FOTO GALLERY ───────────────────────────────────────────── */
.photo-credit {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin-top: 8px;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
#footer {
    background: var(--dark);
    color: rgba(255,255,255,0.78);
    padding: 56px 24px 24px;
}

.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    border-left: 4px solid var(--crimson);
    padding-left: 12px;
}

.footer-tagline {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.6);
}

.footer-contact p {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.7);
}

#footer h4 {
    color: var(--white);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 20px;
    font-family: var(--font-body);
    font-weight: 700;
}

.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--orange); }

.footer-bottom {
    max-width: var(--max-width);
    margin: 24px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ── BADGE / PILL ───────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge--orange { background: var(--crimson-soft); color: var(--crimson); }
.badge--sage   { background: rgba(111,122,90,0.14); color: var(--sage); }
.badge--dark   { background: var(--ink); color: var(--white); }

/* ── IMG FIGURE ─────────────────────────────────────────────── */
figure.img-block {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin: 0;
}
figure.img-block img {
    width: 100%;
    height: 420px;
    object-fit: cover;
}
figure.img-block figcaption {
    background: var(--dark-mid);
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    font-style: italic;
    padding: 10px 16px;
}

/* ── Nav dropdown ───────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown__toggle {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition);
    font-family: var(--font-display);
}
.nav-dropdown__toggle:hover { color: var(--crimson); }

.nav-dropdown.active .nav-dropdown__toggle {
    color: var(--crimson);
    border-bottom-color: var(--crimson);
}

.nav-dropdown__arrow {
    font-size: 0.65rem;
    transition: transform var(--transition);
}
.nav-dropdown.open .nav-dropdown__arrow {
    transform: rotate(180deg);
}

.nav-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #ffffff;
    border: 1px solid var(--paper-dark);
    border-top: 3px solid var(--crimson);
    border-radius: var(--radius-sm);
    padding: 8px;
    min-width: 190px;
    box-shadow: 0 12px 28px rgba(53,53,51,0.16);
    z-index: 100;
}
.nav-dropdown.open .nav-dropdown__menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-dropdown__menu a {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Mobile: dropdown inline */
@media (max-width: 960px) {
    .nav-dropdown__menu {
        position: static;
        background: var(--paper);
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--crimson);
        border-radius: 0;
        padding: 0 0 0 12px;
        margin: 0 28px;
    }
    .nav-dropdown__toggle {
        width: 100%;
        padding: 13px 28px;
        border-radius: 0;
        border-bottom: 1px solid var(--paper-dark);
        font-size: 0.85rem;
        justify-content: space-between;
    }
    .nav-dropdown__menu a {
        border-bottom: none;
    }
}

@media (max-width: 960px) {
    .nav-menu {
        ...
        transform: translateY(-110%);
        visibility: hidden;        /* ← aggiungi */
    }

    .nav-menu.open {
        transform: translateY(0);
        visibility: visible;       /* ← aggiungi */
    }
}