/* ==========================================================================
   tour-section-nav.css
   Navigazione sezioni della pagina single-tour:
     – desktop (≥ 900px): dots verticali fissi a destra con label all'hover
     – mobile  (< 900px): pill fisso in basso a destra, apre drawer dal basso

   Chiamata in functions.php (dentro ohayo_scripts):
     wp_enqueue_style(
       'ohayo-tour-section-nav',
       get_template_directory_uri() . '/css/tour-section-nav.css',
       array('ohayo-style'),
       _S_VERSION
     );
   ========================================================================== */


/* --------------------------------------------------------------------------
   Base — elemento radice
   Il <nav> è il contenitore di entrambe le versioni.
   Il CSS nasconde l'uno o l'altro in base alla viewport.
   -------------------------------------------------------------------------- */

.st-section-nav {
  /* niente stile sul nav stesso — i figli si posizionano da soli */
}


/* ══════════════════════════════════════════════════════════════════════════
   DESKTOP — dots verticali
   Visibili da 900px in su. Fissi al lato destro, centrati verticalmente.
   ══════════════════════════════════════════════════════════════════════════ */

.st-nav-dots {
  display: none;
}

@media (min-width: 900px) {
  .st-nav-dots {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    padding: 20px 0;
    pointer-events: none;
  }
}

/* singola voce */
.st-nav-dot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  text-decoration: none;
  cursor: pointer;
  pointer-events: all;
  position: relative;
}

/* label — appare all'hover e quando attiva */
.st-nav-dot-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  white-space: nowrap;
  transition: color 0.2s ease;
  line-height: 1;
  user-select: none;
}

.st-nav-dot-item:hover .st-nav-dot-label,
.st-nav-dot-item.st-nav--active .st-nav-dot-label {
  color: var(--secondary);
}

/* pallino */
.st-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.st-nav-dot-item:hover .st-nav-dot {
  background: rgba(255, 255, 255, 0.55);
}

.st-nav-dot-item.st-nav--active .st-nav-dot {
  background: var(--secondary, #C47B2A);
  transform: scale(1.35);
}

/* indicatore barra sinistra — cresce sull'attivo */
.st-nav-dot-item::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--secondary, #C47B2A);
  transition: height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.st-nav-dot-item:hover::before {
  height: 50%;
}

.st-nav-dot-item.st-nav--active::before {
  height: 100%;
}


/* ══════════════════════════════════════════════════════════════════════════
   MOBILE — pill fisso + drawer dal basso
   Visibili sotto 900px.
   ══════════════════════════════════════════════════════════════════════════ */

/* -- pill trigger -- */

.st-nav-pill {
  display: none;
}

@media (max-width: 899px) {
  .st-nav-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    position: fixed;
    bottom: 75px;
    right: 16px;
    z-index: 300;
    background: rgba(10, 7, 4, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 9px 16px;
    font-family: var(--sans, sans-serif);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.2s ease, color 0.2s ease;
  }

  .st-nav-pill:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
  }

  .st-nav-pill[aria-expanded="true"] {
    border-color: var(--secondary, #C47B2A);
    color: var(--secondary, #C47B2A);
  }

  .st-nav-pill svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
  }

  .st-nav-pill:hover svg,
  .st-nav-pill[aria-expanded="true"] svg {
    opacity: 1;
  }
}

/* -- drawer -- */

.st-nav-drawer {
  display: none;
}

@media (max-width: 899px) {
  .st-nav-drawer {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 400;
    background: rgba(8, 5, 3, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 0 max(20px, env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .st-nav-drawer.st-nav-drawer--open {
    transform: translateY(0);
  }
}

/* maniglia drag */
.st-nav-drawer-handle {
  width: 32px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 4px auto 12px;
}

/* singola voce del drawer */
.st-nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.15s ease;
}

.st-nav-drawer-item:hover {
  color: rgba(255, 255, 255, 0.8);
}

.st-nav-drawer-item.st-nav--active {
  color: var(--secondary, #C47B2A);
}

/* pallino a sinistra di ogni voce */
.st-nav-drawer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.15s ease;
}

.st-nav-drawer-item:hover .st-nav-drawer-dot {
  background: rgba(255, 255, 255, 0.55);
}

.st-nav-drawer-item.st-nav--active .st-nav-drawer-dot {
  background: var(--secondary, #C47B2A);
}

/* -- backdrop -- */

.st-nav-backdrop {
  display: none;
}

@media (max-width: 899px) {
  .st-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 350;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.28s ease;
  }

  .st-nav-backdrop.st-nav-backdrop--show {
    background: rgba(0, 0, 0, 0.55);
    pointer-events: all;
  }
}


/* --------------------------------------------------------------------------
   LIGHTBOX OVERRIDE
   Quando la lightbox galleria è aperta (.st-lightbox-open sul body),
   il nav viene nascosto completamente per evitare conflitti di stacking context.
   -------------------------------------------------------------------------- */

.st-lightbox-open .st-nav-dots,
.st-lightbox-open .st-nav-pill,
.st-lightbox-open .st-nav-drawer,
.st-lightbox-open .st-nav-backdrop {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, visibility 0s 0.15s;
}
