/* Nautical 360° Viewer — v1.1.0
   Palette allineata al sito: bronzo/oro su bianco, Playfair Display + DM Sans.
   La v1.0 usava un verde estraneo all'identità del sito. */

.n360-explorer {
    --n360-bronze:      #C4924A;
    --n360-bronze-deep: #8B5E2A;
    --n360-bronze-soft: #F3E7D3;
    --n360-ink:         #0d0d0d;
    --n360-line:        rgba(0,0,0,0.09);
    --n360-serif:       'Playfair Display', Georgia, 'Times New Roman', serif;
    --n360-sans:        'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    font-family: var(--n360-sans);
    color: var(--n360-ink);
    max-width: 1100px;
    margin: 0 auto;
}

.n360-explorer *,
.n360-explorer *::before,
.n360-explorer *::after { box-sizing: border-box; }

/* ---------- barra titolo ---------- */

.n360-hero-bar {
    background: #fff;
    border: 1px solid var(--n360-line);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 14px;
}
.n360-hero-title {
    font-family: var(--n360-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--n360-ink);
    line-height: 1.25;
}
.n360-hero-sub {
    font-size: 13px;
    color: #7a7a7a;
    margin-top: 4px;
}

/* ---------- layout ---------- */

.n360-main-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
    align-items: start;
}

.n360-sidebar-wrap { position: relative; }

.n360-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.n360-scroll-hint { display: none; }

/* ---------- card cala ---------- */

.n360-cala-card {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid var(--n360-line);
    border-radius: 10px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, background .15s, transform .1s;
}
.n360-cala-card:hover  { border-color: var(--n360-bronze); }
.n360-cala-card:active { transform: scale(.98); }
.n360-cala-card:focus-visible {
    outline: 2px solid var(--n360-bronze);
    outline-offset: 2px;
}
.n360-cala-card.n360-active {
    border: 2px solid var(--n360-bronze);
    background: #FDFAF4;
}
.n360-cala-card.n360-active .n360-cala-name { color: var(--n360-bronze-deep); }

.n360-card-body { padding: 11px 13px; display: block; }

.n360-cala-name {
    display: block;
    font-family: var(--n360-serif);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--n360-ink);
}
.n360-card-location {
    display: block;
    font-size: 11.5px;
    color: var(--n360-bronze-deep);
    font-weight: 500;
    margin-top: 3px;
}
.n360-cala-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 7px;
}

/* ---------- pillole ---------- */

.n360-pill {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 20px;
    background: #F1EFE8;
    color: #5F5E5A;
    white-space: nowrap;
}
.n360-pill-360  { background: var(--n360-bronze-soft); color: var(--n360-bronze-deep); }
.n360-pill-foto { background: #F1EFE8; color: #5F5E5A; }
.n360-pill-vid  { background: #FAEEDA; color: #854F0B; }

/* ---------- pannello viewer ---------- */

.n360-viewer-panel {
    background: #fff;
    border: 1px solid var(--n360-line);
    border-radius: 12px;
    overflow: hidden;
}

.n360-viewer-tabs {
    display: flex;
    border-bottom: 1px solid var(--n360-line);
    background: #FAF9F7;
}
.n360-vtab {
    flex: 1;
    padding: 13px 10px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    color: #6a6a6a;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
}
.n360-vtab.n360-active {
    color: var(--n360-bronze-deep);
    border-bottom-color: var(--n360-bronze);
    background: #fff;
}
.n360-vtab:hover:not(.n360-active) { background: #F1EFE8; }
.n360-vtab:focus-visible {
    outline: 2px solid var(--n360-bronze);
    outline-offset: -2px;
}
/* Tab senza contenuto: resta cliccabile ma segnalata visivamente */
.n360-vtab.n360-empty { color: #b4b2a9; }
.n360-vtab.n360-empty::after {
    content: '·';
    margin-left: 5px;
    color: #d3d1c7;
}

/* ---------- corpo viewer ---------- */

.n360-viewer-body {
    position: relative;
    background: #F7F6F3;
    min-height: 400px;
}

.n360-pano-wrap,
.n360-flat-wrap { position: relative; width: 100%; }

.n360-pano-container { width: 100%; height: 400px; background: #1a1a1a; }

.n360-flat-wrap { height: 400px; overflow: hidden; background: #1a1a1a; }
.n360-flat-img  { width: 100%; height: 100%; object-fit: cover; display: block; }

.n360-pano-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
    font-size: 13.5px;
    line-height: 1.6;
    color: #E8B876;
}

/* ---------- affordance 360° ---------- */

.n360-badge-360 {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(13,13,13,.72);
    color: #E8B876;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .04em;
    padding: 5px 11px;
    border-radius: 20px;
    pointer-events: none;
}
.n360-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--n360-bronze);
    animation: n360-pulse 2.4s ease-in-out infinite;
}
@keyframes n360-pulse {
    0%,100% { opacity: .35; }
    50%     { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .n360-badge-dot { animation: none; opacity: 1; }
}

/* Overlay di prima visita */
.n360-first-hint {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(13,13,13,.5);
    pointer-events: none;
    transition: opacity .7s ease;
}
.n360-first-hint.n360-fade { opacity: 0; }
.n360-first-icon {
    font-size: 30px;
    color: #E8B876;
    line-height: 1;
}
.n360-first-text {
    font-size: 14.5px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    max-width: 260px;
    line-height: 1.5;
    padding: 0 16px;
}

/* Bottone schermo intero desktop */
.n360-fs-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(13,13,13,.72);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.n360-fs-btn:hover { background: var(--n360-bronze-deep); }
.n360-fs-btn:focus-visible { outline: 2px solid #E8B876; outline-offset: 2px; }

/* Gate touch: intercetta il tocco così la pagina continua a scorrere,
   e porta il 360° a schermo intero dove il gesto non è ambiguo. */
.n360-touch-gate {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    cursor: pointer;
    background: transparent;
}
.n360-gate-chip {
    background: rgba(13,13,13,.8);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 24px;
    text-align: center;
    line-height: 1.4;
    max-width: 88%;
}

/* ---------- placeholder ---------- */

.n360-placeholder {
    display: flex;
    width: 100%;
    height: 400px;
    background: #F7F6F3;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}
.n360-ph-icon { font-size: 34px; color: var(--n360-bronze); }
.n360-placeholder p {
    font-size: 14px;
    color: #8a8a8a;
    text-align: center;
    max-width: 280px;
    line-height: 1.6;
    margin: 0;
}

/* ---------- video ---------- */

.n360-video-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
}
.n360-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.n360-video-poster {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: #000;
    cursor: pointer;
    font-family: inherit;
    overflow: hidden;
}
.n360-video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .8;
    transition: opacity .2s, transform .3s;
}
.n360-video-poster:hover .n360-video-thumb { opacity: 1; transform: scale(1.02); }
.n360-video-poster:focus-visible { outline: 2px solid var(--n360-bronze); outline-offset: -2px; }

.n360-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(196,146,74,.94);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
}
.n360-video-poster:hover .n360-play-btn {
    background: var(--n360-bronze-deep);
    transform: translate(-50%,-50%) scale(1.06);
}
.n360-video-cap {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* ---------- microtesto istruzioni ---------- */

.n360-hint {
    display: none;
    margin: 0;
    padding: 11px 20px;
    background: #FDFAF4;
    border-bottom: 1px solid var(--n360-line);
    font-size: 13px;
    line-height: 1.55;
    color: #6b5836;
}

/* ---------- pannello info ---------- */

.n360-info-strip {
    padding: 20px;
    background: #fff;
}
.n360-info-location {
    display: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--n360-bronze-deep);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 5px;
}
.n360-info-name {
    font-family: var(--n360-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--n360-ink);
    margin-bottom: 12px;
    line-height: 1.2;
}
.n360-info-tags {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.n360-info-desc {
    display: none;
    font-size: 14.5px;
    color: #3a3a3a;
    line-height: 1.7;
    margin-bottom: 16px;
}

.n360-info-tips {
    display: none;
    background: #FDFAF4;
    border: 1px solid var(--n360-bronze-soft);
    border-radius: 8px;
    padding: 13px 16px;
}
.n360-tips-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--n360-bronze-deep);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}
.n360-tips-text {
    font-size: 13.5px;
    color: #4a3c26;
    line-height: 1.7;
    white-space: pre-line;
}

/* ---------- CTA WhatsApp ---------- */

.n360-btn-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 12px 22px;
    background: #25D366;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    transition: background .2s, transform .12s;
}
.n360-btn-wa:hover  { background: #1ebe5a; transform: translateY(-1px); }
.n360-btn-wa:active { transform: scale(.98); }

/* ================================================================
   Tablet
   ================================================================ */

@media (max-width: 900px) {
    .n360-main-layout { grid-template-columns: 176px 1fr; gap: 10px; }
    .n360-cala-name   { font-size: 14px; }
    .n360-pano-container,
    .n360-flat-wrap,
    .n360-video-container,
    .n360-placeholder,
    .n360-viewer-body { height: auto; min-height: 340px; }
    .n360-pano-container { height: 340px; }
    .n360-flat-wrap      { height: 340px; }
    .n360-video-container{ height: 340px; }
    .n360-placeholder    { height: 340px; }
}

/* ================================================================
   Mobile — pacchetti di usabilità: leggibilità, tap target,
   struttura, chiarezza. Riferimento target 50-75 anni.
   ================================================================ */

@media (max-width: 680px) {

    .n360-main-layout { grid-template-columns: 1fr; gap: 12px; }

    /* Lista orizzontale con mezza card tagliata: si capisce che continua */
    .n360-sidebar {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }
    .n360-cala-card {
        min-width: 168px;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
    .n360-card-body { padding: 12px 14px; }

    /* Sfumatura sul bordo destro, attivata da JS quando c'è altro da scorrere */
    .n360-scroll-hint {
        display: block;
        position: absolute;
        top: 0;
        right: -1px;
        bottom: 8px;
        width: 42px;
        pointer-events: none;
        background: linear-gradient(to right, rgba(255,255,255,0), rgba(244,243,240,.96));
        opacity: 0;
        transition: opacity .2s;
    }
    .n360-scroll-hint.n360-visible { opacity: 1; }

    /* Il 360° occupa più schermo: sotto i 300px l'effetto immersivo si perde */
    .n360-pano-container,
    .n360-flat-wrap,
    .n360-video-container,
    .n360-placeholder {
        height: 55vh;
        min-height: 300px;
        max-height: 460px;
    }
    .n360-viewer-body { min-height: 300px; }

    /* Il gate compare solo su touch */
    .n360-touch-gate { display: flex; }
    .n360-fs-btn     { display: none; }

    /* Leggibilità */
    .n360-hero-title  { font-size: 19px; }
    .n360-hero-sub    { font-size: 13px; }
    .n360-info-name   { font-size: 22px; }
    .n360-info-desc   { font-size: 16px; line-height: 1.65; }
    .n360-tips-text   { font-size: 15px; line-height: 1.65; }
    .n360-hint        { font-size: 14px; padding: 12px 16px; }
    .n360-placeholder p { font-size: 15px; }
    .n360-info-strip  { padding: 18px 16px; }

    /* Tap target: minimo 48px, sopra la soglia WCAG di 44px */
    .n360-vtab   { padding: 16px 10px; font-size: 14.5px; min-height: 52px; }
    .n360-btn-wa { width: 100%; min-height: 54px; font-size: 15px; }
    .n360-gate-chip { font-size: 14px; padding: 13px 20px; }
    .n360-play-btn  { width: 70px; height: 70px; }
    .n360-video-cap { font-size: 14px; }
    .n360-first-text{ font-size: 15px; }
}

/* Schermi molto piccoli */
@media (max-width: 380px) {
    .n360-cala-card { min-width: 148px; }
    .n360-info-name { font-size: 20px; }
}
