/* ============================================================
   style.css — itsgiacomofierro.com
   Regole condivise tra tutte le pagine del sito
   ============================================================ */

/* ── FONTS ── */
@font-face {
  font-family: 'Antonio';
  src: url('./assets/Antonio-Variable.ttf') format('truetype');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/Inter-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/Inter-Italic-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

/* ── HEADER ──
   Il colore di sfondo segue --page-bg (impostato nel :root di ogni pagina).
   Default: #fff per le pagine che non dichiarano la variabile.
   Il bordo inferiore è controllato da --header-border:
     - none      → pagine senza bordo (index, personal, about, interior, live-music)
     - colore    → fanzine (impostano rgba sottile nel proprio :root)
   Quando il nav overlay è aperto, .nav-open azzera il bordo.
*/
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  background: var(--page-bg, #fff);
  border-bottom: 1px solid transparent;
  border-bottom-color: var(--header-border, transparent);
  padding: 22px 32px; display: flex; align-items: center;
  justify-content: space-between;
}
header.nav-open {
  background: #fff;
  border-bottom-color: transparent;
}

.site-name {
  font-family: 'Antonio', sans-serif; font-size: 22px;
  font-weight: 300; letter-spacing: 0.03em; transition: opacity 0.2s ease;
  color: var(--header-fg, #1e1e1e);
}
.site-name.hidden { opacity: 0; pointer-events: none; }

/* ── HAMBURGER ── */
.menu-toggle {
  background: none; border: none; cursor: pointer; padding: 4px;
  display: flex; flex-direction: column; gap: 5px;
  position: relative; z-index: 400;
}
.menu-toggle span {
  display: block; width: 22px; height: 1px;
  background: var(--header-fg, #1e1e1e);
  transition: all 0.3s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── NAV OVERLAY ──
   Copre tutto lo schermo (inset: 0). L'header rimane sopra grazie al z-index
   più alto (300 vs 250). L'overlay è sempre bianco con testo scuro.
*/
nav.overlay-nav {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 250;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 24px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
nav.overlay-nav.open { opacity: 1; pointer-events: all; }
nav.overlay-nav a {
  font-family: 'Antonio', sans-serif; font-size: 3.5rem;
  font-weight: 300; letter-spacing: 0.05em; text-transform: uppercase;
  color: #1e1e1e; transition: opacity 0.2s;
}
nav.overlay-nav a:hover { color: #c5d8d1; opacity: 1; }

/* Quando il nav è aperto, le righe dell'hamburger sono sempre scure
   (l'header è sopra l'overlay bianco, servono comunque scuri per contrasto) */
.menu-toggle.open span {
  background: #1e1e1e;
}

/* ── BACK LINK & PROJECT YEAR ──
   Font Antonio, colore via --header-fg per adattarsi al tema della pagina.
*/
.back-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Antonio', sans-serif;
  font-size: 13px; font-weight: 300;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--header-fg, #1e1e1e);
  text-decoration: none;
  opacity: 0.45; transition: opacity 0.2s ease;
  padding: 8px 0;
}
.back-link:hover { opacity: 0.9; }
.project-year {
  font-family: 'Antonio', sans-serif;
  font-size: 13px; font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--header-fg, #1e1e1e);
  opacity: 0.35;
}

/* ── DESCRIPTION (Inter body text) ── */
.description {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: #1e1e1e;
  max-width: 350px;
  margin-left: auto;
}

/* ── FOOTER ──
   Sfondo sage (#c5d8d1) di default.
   Le pagine che vogliono footer diverso impostano --footer-bg e --footer-fg nel :root
   (es. out-of-the-blue: sfondo bianco, testo #1e1e1e).
*/
footer {
  background: var(--footer-bg, #c5d8d1);
  padding: 14px 28px;
  text-align: right;
}
footer p {
  font-family: 'Inter', sans-serif; font-size: 12px;
  font-weight: 300; font-style: italic;
  color: var(--footer-fg, #1e1e1e);
  letter-spacing: 0.02em;
}

/* ── IMAGE PROTECTION ── */
img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}
/* ripristina pointer-events dove servono click (lightbox, hover) */
.photo-grid img,
.photo-stack img,
.project-card img,
.about-photo img,
.image-panel img,
.col-right img,
.lightbox-img-wrap img {
  pointer-events: auto;
}

/* ── MOBILE FOOTER (duplicato in fondo al notebook)
   Visibile solo su mobile: sostituisce il meta-footer della sidebar.
   Le pagine attivano lo scambio con:
     @media (max-width: 900px) { .meta-footer { display: none; } .nb-mobile-footer { display: flex; } }
── */
.nb-mobile-footer {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 32px;
  margin-top: 40px;
}

/* ── SCROLL BEHAVIOUR ──
   Identico in check, symptoms, o-que-e-autentico, hic-et-nunc.
*/
html { scroll-behavior: smooth; }

/* ── NOTEBOOK LAYOUT ──
   .meta-band: identico in check, symptoms, o-que-e-autentico, hic-et-nunc.
   .notebook:  identico in check, symptoms.
*/
.meta-band { padding-top: 80px; display: flex; align-items: flex-start; }
.notebook  { flex: 1; overflow: hidden; }

/* ── META-LEFT — sidebar sticky ──
   Struttura identica in check, symptoms, o-que-e-autentico, hic-et-nunc,
   velluto-rosso, out-of-the-blue.
   Padding canonico: 48px 40px 48px 32px (hic-et-nunc e out-of-the-blue usano
   52px 44px, velluto-rosso 56px top — sovrascrivono solo padding inline).
   Il colore del bordo destro è controllato da --sidebar-border:
     - pagine chiare: rgba(30,30,30,0.06–0.07)
     - symptoms: rgba(197,216,209,0.06)
     - out-of-the-blue: rgba(255,255,255,0.15)
     - velluto-rosso: var(--line) = rgba(28,28,28,0.08)
*/
.meta-left {
  width: 34%;
  flex-shrink: 0;
  padding: 48px 40px 48px 32px;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border, rgba(30,30,30,0.07));
}

/* ── META-FOOTER — back link + anno, fondo sidebar ──
   Identico in check, o-que-e-autentico, hic-et-nunc, velluto-rosso,
   out-of-the-blue, symptoms.
   Il colore del bordo usa --sidebar-border (stessa variabile del bordo destro).
*/
.meta-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--sidebar-border, rgba(30,30,30,0.07));
}

/* ── LANG TABS — struttura ──
   .lang-content e .lang-content.active sono identici in tutte le pagine con tab.
   Il colore e opacity di .lang-tab e .lang-tab.active variano per pagina
   (check: #1e1e1e / opacity 0.28; o-que: #1e1e1e / opacity 0.3 / active #c17b6f;
    hic-et-nunc: #1e1e1e / opacity 0.3 / active #c17b6f; symptoms: #cdc8c0 / opacity 0.28)
   → solo la struttura display/overflow va qui; colori restano inline.
*/
.lang-content        { display: none; }
.lang-content.active { display: block; flex: 1; overflow-y: auto; padding-bottom: 24px; }

/* ── COLOPHON — tema chiaro ──
   Identico in check, o-que-e-autentico, hic-et-nunc.
   symptoms usa rgba(197,216,209,…) — tema scuro, rimane inline.
   velluto-rosso usa rgba(28,28,28,…) e var(--line) — rimane inline.
   binario-unico usa .page-colophon (classe diversa) — rimane inline.
*/
.nb-colophon {
  padding: 0 52px;
  display: flex;
  flex-direction: column;
}
.nb-colophon-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(30,30,30,0.07);
}
.nb-colophon-row:first-child { border-top: 0.5px solid rgba(30,30,30,0.07); }
.nb-colophon-key {
  font-family: 'Antonio', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(30,30,30,0.35);
}
.nb-colophon-val {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: rgba(30,30,30,0.55);
  text-align: right;
}

/* ── NB-END-PAD ──
   Spazio finale del notebook prima del footer.
   Default 120px; le pagine con esigenze diverse sovrascrivono inline
   (check: 80px — notebook breve; hic-et-nunc: 180px — sequenza lunga).
*/
.nb-end-pad { height: 120px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .description { font-size: 15px; line-height: 1.7; }

  /* ── centramento mobile: titolo, selettore lingua, testo ── */
  .page-title        { text-align: center; }
  .lang-tabs         { justify-content: center; }
  .lang-content.active,
  .lang-content.active .description,
  .lang-content.active .description p { text-align: center; }

  /* ── meta-left: da sticky sidebar a blocco pieno in cima ──
     Il border-bottom usa --sidebar-border (stessa variabile del desktop).
     Le pagine che hanno padding o border diversi sovrascrivono inline.
  */
  .meta-left {
    position: static;
    width: 100%;
    height: auto;
    padding: 28px 24px 24px;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border, rgba(30,30,30,0.07));
  }

  /* ── meta-footer: nascosto su mobile, sostituito da .nb-mobile-footer ── */
  .meta-footer { display: none; }

  /* ── nb-gap mobile: gerarchia ridotta ma mantenuta ──
     Identico in symptoms, o-que-e-autentico, hic-et-nunc, velluto-rosso.
     check ha valori propri (64px/88px) — sovrascrive inline.
  */
  .nb-gap-xl { height: 80px; }
  .nb-gap-lg { height: 48px; }
}
@media (max-width: 768px) {
  header { padding: 18px 20px; }
  nav.overlay-nav a { font-size: 2.2rem; }
  .description { max-width: 100%; margin-left: auto; margin-right: auto; }
  .back-link { font-size: 12px; }
  .project-year { font-size: 12px; }
}
@media (max-width: 480px) {
  .description { font-size: 15px; }
}

/* ============================================================
   TRAVEL LAYOUT — horizontal strip
   Condiviso tra bulgaria, polonia, azzorre
   ============================================================ */

/* ── PAGE WRAP ── */
.page-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  padding-top: 68px;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 20%;
  flex-shrink: 0;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 0.5px solid #e2e2e2;
  height: 100%;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── PAGE TITLE (travel) ── */
.travel-page-title {
  font-family: 'Antonio', sans-serif;
  font-size: clamp(32px, 3.5vw, 56px);
  font-weight: 300;
  letter-spacing: 2px;
  color: #c5d8d1;
  line-height: 0.88;
  text-transform: uppercase;
  margin-bottom: 24px;
  white-space: nowrap;
}

/* ── SCROLL HINT ── */
.scroll-hint {
  font-family: 'Antonio', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 8px;
}
.scroll-hint::after {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: #ccc;
  animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(5px); }
}

/* ── BOTTONE PROVINO ── */
.contact-btn {
  font-family: 'Antonio', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1e1e1e;
  background: none;
  border: 0.5px solid rgba(30,30,30,0.3);
  padding: 10px 0;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-align: center;
  margin-top: 120px;
}
.contact-btn:hover {
  background: #1e1e1e;
  color: #fff;
  border-color: #1e1e1e;
}

/* ── STRIP WRAP ── */
.strip-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  position: relative;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.strip-wrap::-webkit-scrollbar { display: none; }
.strip-wrap.grabbing { cursor: grabbing; }

/* ── STRIP ── */
.strip {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 24px 48px 24px 32px;
  width: max-content;
}

.strip img {
  height: 100%;
  width: auto;
  display: block;
  flex-shrink: 0;
  max-height: calc(100vh - 68px - 48px);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.strip img.loaded { opacity: 1; }

/* ── PANNELLO FINALE ── */
.strip-end {
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding-bottom: 24px;
}

.next-trip-link {
  font-family: 'Antonio', sans-serif;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #1e1e1e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  opacity: 0.35;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.next-trip-link:hover { opacity: 1; }

/* ── CONTATORE FOTO ── */
.photo-counter {
  position: fixed;
  bottom: 20px;
  right: 28px;
  font-family: 'Antonio', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #ccc;
  z-index: 10;
  pointer-events: none;
}

/* ── POPUP PROVINO A CONTATTO ── */
.contact-popup {
  position: fixed;
  top: 68px;
  left: 20%;
  right: 0;
  bottom: 0;
  background: #f5f4f0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 16px;
}
.contact-popup.open { display: flex; }

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  width: 100%;
}

.popup-label {
  font-family: 'Antonio', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(30,30,30,0.35);
}

.popup-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 30px;
  height: 30px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup-close span {
  display: block;
  width: 22px;
  height: 1px;
  background: #1e1e1e;
  position: absolute;
  transition: opacity 0.2s;
}
.popup-close span:nth-child(1) { transform: rotate(45deg); }
.popup-close span:nth-child(2) { transform: rotate(-45deg); }
.popup-close:hover span { opacity: 0.45; }

/* ── GRIGLIA PROVINO ── */
.contact-grid {
  display: grid;
  gap: 3px;
  flex-shrink: 0;
}

.contact-cell {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #e8e4da;
}
.contact-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.04) brightness(1.0);
  transition: filter 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.contact-cell:hover img {
  filter: sepia(0) brightness(1.08);
  transform: scale(1.02);
}
.contact-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(30,30,30,0.08);
  pointer-events: none;
}
.contact-cell::before {
  content: attr(data-frame);
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-family: 'Antonio', sans-serif;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(30,30,30,0.25);
  z-index: 1;
  pointer-events: none;
}

/* ── TRAVEL MOBILE ── */
@media (max-width: 768px) {

  /* html/body: torna scrollabile, altezza naturale */
  html, body {
    overflow: visible !important;
    height: auto !important;
  }

  /* Layout: colonna verticale, piena altezza viewport */
  .page-wrap {
    position: fixed;
    inset: 0;
    padding-top: 58px; /* altezza header mobile */
    flex-direction: column;
    overflow: hidden;
  }

  /* Sidebar: fascia superiore */
  .sidebar {
    width: 100%;
    height: auto;
    flex-shrink: 0;
    padding: 24px 20px 20px;
    border-right: none;
    border-bottom: 0.5px solid #e2e2e2;
    justify-content: flex-start;
    gap: 0;
    overflow: visible;
  }

  .travel-page-title {
    font-size: clamp(40px, 11vw, 64px);
    line-height: 0.88;
    margin-bottom: 16px;
  }

  .description {
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
    max-width: 100%;
  }

  /* contact-btn: respiro sopra, come gap tra description e azione */
  .contact-btn {
    font-size: 10px;
    padding: 10px 0;
    margin-top: 20px !important;
  }

  /* freccia + anno: nascosti su mobile */
  .sidebar-footer { display: none; }

  /* Scroll hint: inutile su touch */
  .scroll-hint { display: none; }

  /* Strip wrap: prende tutto lo spazio residuo, scroll verticale */
  .strip-wrap {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-y: scroll; /* forza scroll su iOS */
    -webkit-overflow-scrolling: touch;
    cursor: default;
  }

  /* Strip: colonna verticale, centrata */
  .strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: auto;
    width: 100%;
    padding: 16px 0 80px;
  }

  /* Foto: 85% larghezza, centrate, altezza proporzionale */
  .strip img {
    width: 85%;
    height: auto;
    max-height: none;
    object-fit: contain;
    flex-shrink: 0;
  }

  /* Pannello finale */
  .strip-end {
    width: 85% !important;
    height: auto;
    align-self: center;
    align-items: center;
    justify-content: center;
    padding: 32px 0 16px;
    border-top: 0.5px solid #e2e2e2;
    margin-top: 8px;
  }

  .next-trip-link {
    font-size: 11px;
    letter-spacing: 0.18em;
    opacity: 0.5;
  }

  /* Popup: full screen sopra l'header */
  .contact-popup {
    position: fixed;
    left: 0;
    right: 0;
    top: 58px;
    bottom: 0;
    padding: 14px 16px;
  }

  /* Griglia provino: 3 colonne, scrollabile verticalmente se serve */
  .contact-grid {
    width: 100%;
    overflow-y: auto;
  }

  /* Contatore */
  .photo-counter {
    bottom: 12px;
    right: 16px;
    font-size: 11px;
  }
}
