/* ==========================================================
   REFRESH – novembre 2026
   Caricato per ultimo: aggiunge e corregge, non sostituisce.
   ========================================================== */

:root {
    --tg-blue: #2C5F7F;
    --tg-blue-dark: #1a3f5c;
    --tg-blue-tint: #e8f0f5;
    --tg-red: #c41e3a;
    --tg-ink: #2b3540;
    --tg-muted: #5f6b75;
    --tg-line: #e6e9ec;
}

html { scroll-padding-top: 70px; }
html, body { overflow-x: hidden; }

/* ---------- Correzione: su mobile il tasto "Accedi" della Guida Casa usciva dallo schermo ---------- */
.pin-form { flex-wrap: nowrap; }
.pin-form input { min-width: 0; width: 100%; }
.pin-form .btn { flex-shrink: 0; }

/* ---------- Caratteristiche: icone vere, griglia compatta ---------- */
.features-grid-compact {
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}
.feature-card-compact {
    padding: 1.4rem 0.8rem;
    background: #fff;
    border: 1px solid var(--tg-line);
    border-radius: 14px;
}
.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.8rem;
    border-radius: 50%;
    background: var(--tg-blue-tint);
    color: var(--tg-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0; /* nessuna emoji residua */
}
.feature-title { font-size: 0.85rem; line-height: 1.3; }

@media (max-width: 900px) {
    .features-grid-compact { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .features-grid-compact { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
    .feature-card-compact { padding: 1rem 0.3rem; border-radius: 12px; }
    .feature-icon { width: 46px; height: 46px; margin-bottom: 0.55rem; }
    .feature-icon svg { width: 24px; height: 24px; }
    .feature-title { font-size: 0.74rem; }
    .feature-card-compact:hover { transform: none; }
}

/* ---------- Galleria ---------- */
.gallery-swipe-hint { display: none; }

@media (max-width: 768px) {
    /* su mobile: foto subito visibili, si scorrono di lato (niente "Mostra") */
    .gallery-toggle { display: none !important; }
    .gallery-header { justify-content: center; margin-bottom: 1.2rem; }
    .gallery-grid,
    .gallery-grid.expanded {
        display: flex;
        grid-template-columns: none;
        gap: 12px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 0 6px;
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        scroll-padding-left: 1rem;
    }
    .gallery-grid::-webkit-scrollbar { display: none; }
    .gallery-item {
        flex: 0 0 86%;
        padding-bottom: 0;
        height: 66vw;
        max-height: 420px;
        scroll-snap-align: start;
        border-radius: 12px;
    }
    .gallery-item:hover img { transform: none; }
    .gallery-swipe-hint {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.8rem;
        font-size: 0.85rem;
        color: var(--tg-muted);
    }
    .gallery-counter { font-weight: 600; color: var(--tg-blue); }
}
@media (min-width: 481px) and (max-width: 768px) {
    .gallery-grid, .gallery-grid.expanded { margin: 0 -2rem; padding-left: 2rem; padding-right: 2rem; scroll-padding-left: 2rem; }
    .gallery-item { flex-basis: 70%; height: 46vw; }
}

/* ---------- Recensioni ---------- */
.review-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tg-line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 14px;
}
.review-card-hidden { display: none; }
.review-header { align-items: flex-start; gap: 0.8rem; }
.review-author { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.review-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--tg-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.05rem;
}
.review-name { font-size: 1rem; margin: 0; line-height: 1.3; color: var(--tg-ink); }
.review-name a { color: inherit; text-decoration: none; }
.review-name a:hover { text-decoration: underline; }
.review-date { font-size: 0.8rem; color: var(--tg-muted); margin: 0; font-weight: 400; }
.review-rating { color: #f5b301; letter-spacing: 1px; white-space: nowrap; flex-shrink: 0; }
.review-content { flex: 1; }
.review-text-preview, .review-text-full { font-size: 0.95rem; }
.review-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--tg-line);
    font-size: 0.75rem;
}
.review-source {
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}
.review-source:empty { display: none; }
.review-source-airbnb { background: #fdecef; color: #d4334f; }
.review-source-google { background: #e8f0fe; color: #1a5fd0; }
.review-translated { color: var(--tg-muted); font-style: italic; }
.rating-stars { letter-spacing: 2px; }

.reviews-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-top: 2rem;
}
.reviews-more {
    background: #fff;
    color: var(--tg-blue);
    border: 2px solid var(--tg-blue);
    border-radius: 999px;
    padding: 0.75rem 1.6rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.reviews-more:hover { background: var(--tg-blue); color: #fff; }
.reviews-google-link { color: var(--tg-blue); font-weight: 600; font-size: 0.9rem; }
.reviews-more[hidden], .reviews-google-link[hidden] { display: none; }

@media (max-width: 480px) {
    .review-card { padding: 1.3rem; }
    .reviews-grid { gap: 1rem; }
}

/* ---------- Mappa su richiesta ---------- */
.map-consent {
    min-height: 260px;
    background: var(--tg-blue-tint);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.8rem;
    padding: 1.5rem;
}
.map-consent-icon { color: var(--tg-blue); }
.map-consent-note { font-size: 0.82rem; color: var(--tg-muted); max-width: 320px; margin: 0; line-height: 1.5; }
.map-load-btn {
    background: var(--tg-blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.map-load-btn:hover { background: var(--tg-blue-dark); }
.map-open-link { font-size: 0.85rem; color: var(--tg-blue); font-weight: 600; }

/* ---------- Modulo contatti ---------- */
.form-status { margin-top: 1rem; font-size: 0.92rem; font-weight: 500; }
.form-status:empty { display: none; }
.form-status-ok { color: #1f7a45; }
.form-status-err { color: var(--tg-red); }
.form-status-wait { color: var(--tg-muted); }
.form-privacy { margin-top: 1rem; font-size: 0.78rem; color: var(--tg-muted); line-height: 1.5; }
.form-privacy a { color: var(--tg-blue); }
.contact-form .btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* ---------- Footer ---------- */
.footer p { margin: 0.2rem 0; font-size: 0.9rem; }
.footer .footer-legal { font-size: 0.8rem; opacity: 0.8; }
.footer a { color: #fff; }

/* ---------- Mobile: titoli un po' più compatti ---------- */
@media (max-width: 480px) {
    .section { padding: 2.6rem 0; }
    .section-title { font-size: 1.8rem; margin-bottom: 1.8rem; }
}

/* ---------- Guida alla città: voce attiva nel menu ---------- */
.nav-link-current { color: var(--tg-blue); font-weight: 600; }

/* ---------- Guida alla città: bacheca News ed eventi ---------- */
.news-filters { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin: 0 0 1.5rem; }
.news-filter {
    font: inherit; font-weight: 600; font-size: 0.9rem;
    background: #fff; color: var(--tg-blue);
    border: 2px solid var(--tg-blue); border-radius: 999px;
    padding: 0.5rem 1.1rem; cursor: pointer;
}
.news-filter span {
    display: inline-block; min-width: 1.4em; margin-left: 0.3rem; padding: 0 0.35rem;
    border-radius: 999px; background: var(--tg-blue-tint); font-size: 0.78rem;
}
.news-filter.active { background: var(--tg-blue); color: #fff; }
.news-filter.active span { background: rgba(255, 255, 255, 0.25); }
.news-date { font-weight: 600; color: var(--tg-red) !important; margin: 0 0 0.2rem !important; }
.news-item .article-full a { color: var(--tg-blue); font-weight: 600; word-break: break-word; }
.news-translated { font-size: 0.8rem; color: var(--tg-muted); font-style: italic; }

/* ---------- Pagina Eventi ---------- */
.events-page { padding-top: 120px; min-height: 70vh; }
.events-title { text-align: center; color: #2c5f7c; margin-bottom: 10px; font-size: 2.5rem; }
.events-subtitle { text-align: center; color: #666; margin-bottom: 32px; font-size: 1.1rem; }
@media (max-width: 480px) {
    .events-page { padding-top: 100px; }
    .events-title { font-size: 2rem; }
}

/* Pulsante menu: niente riquadro dopo il tocco (resta per chi usa la tastiera) */
.nav-toggle-mobile:focus:not(:focus-visible) { outline: none; }

/* ---------- Schede espandibili (Cenni storici ed Eventi) ---------- */
.articles-container::after { height: 0; }               /* tolto lo spazio vuoto di 50vh in fondo */
.article-full > * { border-top: none; }                  /* niente righe tra un paragrafo e l'altro */
.article-full > :first-child { border-top: 1px solid #e0e0e0; padding-top: 20px; }
.article-header { -webkit-tap-highlight-color: transparent; }
.article-header:focus-visible { outline: 2px solid var(--tg-blue); outline-offset: -2px; }
.article-toggle {
    width: 34px; height: 34px; min-width: 34px;
    border-radius: 50%;
    background: var(--tg-blue-tint);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}
.article-item.expanded .article-toggle { background: var(--tg-blue); color: #fff; }
.article-more-wrap { padding-top: 0.9rem; }
.article-full > .article-more-wrap { border-top: none; padding: 0 25px 22px; }
.article-more {
    font: inherit; font-weight: 600; font-size: 0.9rem;
    color: var(--tg-blue); background: #fff;
    border: 1.5px solid var(--tg-blue); border-radius: 999px;
    padding: 0.45rem 1.1rem; cursor: pointer;
}
.article-more:hover { background: var(--tg-blue); color: #fff; }
@media (max-width: 768px) {
    .article-full > .article-more-wrap { padding-left: 20px; padding-right: 20px; }
}

/* ---------- La casa in breve: Servizi · Regole · Come arrivare ---------- */
.details-box {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    background: #fff;
    border: 1px solid var(--tg-line);
    border-radius: 14px;
    overflow: hidden;
}
.details-tabs { display: flex; border-bottom: 1px solid var(--tg-line); }
.details-tab {
    flex: 1;
    font: inherit; font-weight: 600; font-size: 0.95rem;
    background: #f7f9fa; color: var(--tg-muted);
    border: none; border-bottom: 3px solid transparent;
    padding: 0.95rem 0.5rem; cursor: pointer;
}
.details-tab.active { background: #fff; color: var(--tg-blue); border-bottom-color: var(--tg-blue); }
.details-panel { display: none; padding: 1.4rem 1.6rem 1.6rem; }
.details-panel.active { display: block; }
.details-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.5rem; }
.details-list li { position: relative; padding-left: 1.5rem; line-height: 1.5; color: var(--tg-ink); }
.details-list li::before {
    content: '✓'; position: absolute; left: 0; top: 0;
    color: var(--tg-blue); font-weight: 700;
}
.details-intro { line-height: 1.6; margin: 0 0 1.2rem; color: var(--tg-ink); }
.details-subtitle { font-size: 1rem; color: var(--tg-blue); margin: 0 0 0.6rem; }
.details-distances { list-style: none; margin: 0; padding: 0; }
.details-distances li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 0.65rem 0; border-bottom: 1px solid var(--tg-line);
}
.details-distances li:last-child { border-bottom: none; }
.dist-name { color: var(--tg-ink); line-height: 1.4; }
.dist-values { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; white-space: nowrap; font-size: 0.88rem; color: var(--tg-muted); }
.details-note { font-size: 0.78rem; color: var(--tg-muted); margin: 1rem 0 0; }
@media (max-width: 600px) {
    .details-list { grid-template-columns: 1fr; }
    .details-panel { padding: 1.2rem 1.1rem 1.3rem; }
    .details-tab { font-size: 0.85rem; padding: 0.85rem 0.3rem; }
    .details-distances li { flex-direction: column; gap: 0.25rem; }
    .dist-values { flex-direction: row; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: flex-start; white-space: normal; }
}

/* ---------- La casa in breve: sezioni compatte ed espandibili ---------- */
.details-box { margin-bottom: 2rem; }
.details-item { border-bottom: 1px solid var(--tg-line); }
.details-item:last-child { border-bottom: none; }
.details-item > summary {
    list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.4rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.details-item > summary::-webkit-details-marker { display: none; }
.details-item > summary:hover { background: #f7f9fa; }
.details-item > summary:focus-visible { outline: 2px solid var(--tg-blue); outline-offset: -2px; }
.details-head { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.details-name { font-weight: 600; color: var(--tg-blue); font-size: 1.02rem; }
.details-sum { font-size: 0.85rem; color: var(--tg-muted); line-height: 1.4; }
.details-chevron {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    background: var(--tg-blue-tint); position: relative; transition: transform .25s, background .25s;
}
.details-chevron::before {
    content: ''; position: absolute; left: 50%; top: 45%;
    width: 8px; height: 8px; border-right: 2px solid var(--tg-blue); border-bottom: 2px solid var(--tg-blue);
    transform: translate(-50%, -50%) rotate(45deg);
}
.details-item[open] .details-chevron { transform: rotate(180deg); background: var(--tg-blue); }
.details-item[open] .details-chevron::before { border-color: #fff; }
.details-item[open] > summary { background: #f7f9fa; }
.details-body { padding: 0.4rem 1.4rem 1.4rem; }
@media (max-width: 600px) {
    .details-item > summary { padding: 0.9rem 1.1rem; }
    .details-body { padding: 0.3rem 1.1rem 1.2rem; }
}

/* ---------- Recensioni: carosello orizzontale ---------- */
.reviews-grid {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: flex-start;
    padding: 4px 2px 10px;
}
.reviews-grid::-webkit-scrollbar { display: none; }
.reviews-grid .review-card {
    flex: 0 0 calc((100% - 2rem) / 3);
    scroll-snap-align: start;
    margin: 0;
}
.reviews-grid .review-card-hidden { display: flex; }
@media (max-width: 900px) {
    .reviews-grid .review-card { flex-basis: calc((100% - 1rem) / 2); }
}
@media (max-width: 600px) {
    .reviews-grid { margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; scroll-padding-left: 1rem; }
    .reviews-grid .review-card { flex-basis: 86%; }
}
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.carousel-nav[hidden] { display: none; }
.carousel-btn {
    width: 42px; height: 42px; border-radius: 50%;
    border: 2px solid var(--tg-blue); background: #fff; color: var(--tg-blue);
    font-size: 1.5rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0 0 3px;
}
.carousel-btn:hover:not(:disabled) { background: var(--tg-blue); color: #fff; }
.carousel-btn:disabled { opacity: 0.3; cursor: default; }
.carousel-counter { min-width: 4.5rem; text-align: center; font-weight: 600; color: var(--tg-blue); font-size: 0.9rem; }
.reviews-actions { margin-top: 0.8rem; }

/* ---------- News: formattazione (titoletti, elenchi) ---------- */
.news-item .article-full h4 { color: var(--tg-blue); font-size: 1.05rem; margin: 1.2rem 25px 0.5rem; padding: 0; }
.news-item .article-full ul, .news-item .article-full ol { margin: 0 25px 1rem; padding: 0 0 0 1.3rem; border-top: none; }
.news-item .article-full li { margin-bottom: 0.35rem; line-height: 1.6; color: #333; }
@media (max-width: 768px) {
    .news-item .article-full h4, .news-item .article-full ul, .news-item .article-full ol { margin-left: 20px; margin-right: 20px; }
}
.news-item .article-full > h4:first-child, .news-item .article-full > ul:first-child, .news-item .article-full > ol:first-child { padding-top: 20px; margin-top: 0; }
.news-item .article-full > p { padding-bottom: 6px; }
.news-item .article-full > h4 { margin-top: 0.6rem; }

/* News: l'anteprima mostra già grassetti, corsivi, emoji e link (prime righe, sfumate in fondo) */
.news-preview-rich { max-height: 7.2em; overflow: hidden; position: relative; }
.news-preview-rich::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.2em;
    background: linear-gradient(rgba(255,255,255,0), #fff);
}
.news-preview-rich p { margin: 0 0 0.5em; padding: 0; border: none; }
.news-preview-rich h4 { color: var(--tg-blue); font-size: 1rem; margin: 0 0 0.3em; }
.news-preview-rich ul, .news-preview-rich ol { margin: 0 0 0.5em 1.2em; padding: 0; }
.news-preview-rich a { color: var(--tg-blue); font-weight: 600; word-break: break-word; }
.news-item .article-full strong, .news-preview-rich strong { font-weight: 700; color: #222; }
.news-item .article-full em, .news-preview-rich em { font-style: italic; }
