/* Samuele Silvestri Architetto – stile condiviso da tutte le pagine */

:root {
  /* Grigio del testo: prima era nero al 50%, ora al 62% per una lettura migliore */
  --muted: rgba(0, 0, 0, 0.62);
  --muted-mobile: rgba(0, 0, 0, 0.66);
  --fade: 1.8s;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  height: var(--app-height, 100vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ================= INTRO (solo home, una volta per sessione) ================= */
#intro { display: none; }

.js #intro {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 1.5s ease;
}

.js.intro-seen #intro { display: none; }

#intro-text {
  font-size: 1em;
  color: #000;
  text-align: center;
  opacity: 0;
  transition: opacity 1.5s ease;
}

/* ================= LAYOUT DESKTOP ================= */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.side-column {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 40px;
  font-size: 12px;
  color: #666;
}

.counter {
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.caption {
  display: block;
  font-size: 10pt;
  color: var(--muted);
  line-height: 1.4;
}

.info-box {
  margin-top: auto;
  padding-top: 24px;
  width: 350px;
  font-size: 10pt;
  color: var(--muted);
  line-height: 1.4;
}

.info-box p { margin: 0 0 1.4em; }
address { font-style: normal; }

.project-nav {
  margin: 0 0 1.4em;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.cookie-link {
  display: inline-block;
  margin-top: 1.4em;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.cookie-link:hover, .cookie-link:focus-visible { text-decoration: underline; }

/* Schermi desktop bassi: si nascondono i paragrafi secondari (restano nel codice per Google) */
@media (min-width: 769px) and (max-height: 720px) {
  .info-box .secondary { display: none; }
}

/* ================= SLIDESHOW ================= */
.slideshow-wrapper {
  position: relative;
  padding: 40px 40px 40px 10px;
  min-height: 0;
  overflow: hidden;
}

.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: none;
}

.slideshow.navigable { cursor: pointer; }

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--fade) ease;
  object-fit: contain;
  object-position: right center;
  user-select: none;
  -webkit-user-drag: none;
}

.slide.horizontal { object-position: right top; }
.slide.active { opacity: 1; }

.mobile-info-wrapper { display: none; }

/* ================= PAGINE DI TESTO (privacy, 404) ================= */
body.text-page {
  height: auto;
  min-height: 100%;
  overflow: auto;
  display: block;
}

.text-page main {
  max-width: 640px;
  padding: 40px;
  font-size: 10pt;
  line-height: 1.5;
  color: var(--muted);
}

.text-page h1 {
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 1px;
  color: #000;
  margin: 0 0 24px;
}

.text-page h2 {
  font-size: 10pt;
  font-weight: bold;
  color: #000;
  margin: 2em 0 0.5em;
}

.text-page .back { display: inline-block; margin-bottom: 32px; color: #000; }

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .layout {
    display: flex;
    flex-direction: column;
  }

  .side-column { display: none; }

  .slideshow-wrapper {
    flex: 1;
    padding: 24px;
  }

  .slide,
  .slide.horizontal { object-position: center center; }

  .mobile-info-wrapper {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .mobile-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-data {
    font-size: 12px;
    line-height: 1.3;
    flex: 1;
  }

  .mobile-data .extra-info {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted-mobile);
  }

  .mobile-caption {
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
    opacity: 0.8;
  }

  .counter-mobile {
    font-size: 15px;
    margin-bottom: 6px;
  }

  .mobile-about summary {
    font-size: 11px;
    color: var(--muted-mobile);
    cursor: pointer;
    list-style: none;
  }
  .mobile-about summary::-webkit-details-marker { display: none; }
  .mobile-about summary::after { content: " +"; }
  .mobile-about[open] summary::after { content: " –"; }

  .mobile-about-text {
    max-height: 40vh;
    overflow-y: auto;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted-mobile);
  }
  .mobile-about-text p { margin: 0 0 1em; }
  .mobile-about-text .project-nav { margin-bottom: 1em; }

  .text-page main { padding: 24px 18px; }
}

/* ================= BANNER COOKIE ================= */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 40px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-mobile);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; max-width: 640px; }
.cookie-banner p a { text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-actions button {
  font: inherit;
  padding: 6px 14px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  background: #fff;
  color: #000;
  cursor: pointer;
}
.cookie-actions button:hover, .cookie-actions button:focus-visible { border-color: #000; }

@media (max-width: 768px) {
  .cookie-banner { padding-left: 18px; padding-right: 18px; }
}

/* ================= MOVIMENTO RIDOTTO ================= */
@media (prefers-reduced-motion: reduce) {
  .slide, #intro, #intro-text { transition: none; }
}
