/* =========================================================
   VISIT FILIGNANO – DESKTOP CSS
   Struttura:
   0) BASE/RESET
   1) LAYOUT GENERALE (body, sidebar fissa, main, header/logo)
   2) NAVIGAZIONE (menu laterale, stato active, puntino)
   3) COMPONENTI (hero/footer, bandiere, circle, box bianchi, gallery, video, map, hero img)
   4) UTILITIES (spaziature, helper, testo)
   5) PWA (install button)
   6) PAGINE SPECIFICHE (audioguide, eventi, contatti)
   7) MEDIA QUERIES
   ========================================================= */

/* =============== 0) BASE / RESET =============== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: "Poppins", sans-serif;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
li {
  margin-bottom: 20px;
}
.container a {
  text-decoration: none;
}

/* =============== 1) LAYOUT GENERALE =============== */

/* Sfondo globale desktop */
.body {
  background-image: url(/assets/img/home-page/sfondo-filignano-desktop.png);
  background-size: cover;
  background-position: 41%;
}

/* Sidebar fissa (sostituisce gli inline) */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  background-color: #fff;
  color: #000;
  width: 280px;
  height: 892px; /* fallback; adattata sotto con media queries */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

/* Logo nella sidebar */
.imgLogo {
  width: 190px;
  object-fit: cover;
}

/* Area contenuti a destra della sidebar */
#main-content {
  flex-grow: 1;
  box-sizing: border-box;
  padding: 20px;
  margin-left: 300px; /* sostituisce gli inline negli HTML */
}

/* Immagine “fondo europeo” in home desktop */
.imgFondo {
  box-shadow: 5px 5px 2px -2px rgba(0, 0, 0, 0.99);
  width: 33%;
}

/* =============== 2) NAVIGAZIONE (MENU LATERALE) =============== */

/* Testi sotto al logo */
.visit {
  color: #24a117;
  display: block;
  text-align: center;
}
.alserio {
  color: #246dcc;
  display: block;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  line-height: 10px;
}

/* Lista link verticale */
#nav-links {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  font-weight: bold;
}
#nav-links a {
  color: #000;
  text-decoration: none;
  margin-bottom: 20px;
  font-size: 20px;
  position: relative;
}

/* Puntino verde prima del link */
#nav-links a::before {
  content: "\2022";
  color: #3fbf2d;
  font-size: 40px;
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%);
}

/* Stato attivo / hover */
#nav-links a.active,
#nav-links a:hover {
  color: #d52530 !important;
}
#nav-links a.active::before,
#nav-links a:hover::before {
  color: #d52530 !important;
}

/* =============== 3) COMPONENTI =============== */

/* 3.1 – Footer hero “Visit / FILIGNANO” (index desktop) */
.visitFondo {
  color: #fff;
  display: block;
  text-align: center;
  font-size: 40px;
  line-height: 10px;
  text-shadow: 2px 2px #000;
}
.alserioFondo {
  color: #fff;
  display: block;
  text-align: center;
  font-size: 60px;
  text-shadow: 2px 2px #000;
  font-weight: bold;
}
/* Posizionamento fisso in basso, centrato rispetto al main (senza modificare l’HTML) */
#main-content > center {
  position: fixed;
  left: 300px; /* uguale al margin-left di #main-content (sidebar) */
  right: 0;
  bottom: 30px;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}
#main-content > center .visitFondo,
#main-content > center .alserioFondo {
  display: block; /* forza le due righe */
  text-align: center;
  margin: 0;
  line-height: 1.05;
}
#main-content > center .alserioFondo {
  margin-top: 6px;
}

/* 3.2 – Bandiere lingua */
.divBandiere {
  position: absolute;
  top: 20px;
  right: 70px;
}
.btn-flag {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.btn-flag.is-active img {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}
.imgBandieraItaliana,
.imgBandieraInglese {
  height: 50px;
  width: 80px;
  margin-right: 20px;
}
.imgBandieraInglese {
  margin-right: 0;
}

/* 3.3 – Blocchi “circle” (home) */
.circle-container {
  display: flex;
  margin-top: 30px;
}
.circle-container a {
  text-decoration: none !important;
}

.circle {
  width: 328px;
  height: 100px;
  background-color: #fff;
  border: 3px solid #fff;
  border-radius: 5px;
  box-shadow: 5px 5px 2px -2px rgba(0, 0, 0, 0.89);
  -webkit-box-shadow: 5px 5px 2px -2px rgba(0, 0, 0, 0.89);
  -moz-box-shadow: 5px 5px 2px -2px rgba(0, 0, 0, 0.89);
  position: relative;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.circle span {
  font-size: 20px;
  color: #1e6def;
  font-weight: bold;
  text-align: center;
}
.circle a {
  color: #fff;
  font-weight: bold;
  text-align: center;
}

/* Icone e testi posizionati all’interno (layout legacy) */
.testoaSinistra {
  padding-left: 10px;
  position: absolute;
  top: 36px;
  left: 20px;
}
.testoaDestra {
  padding-left: 10px;
  position: absolute;
  top: 36px;
  right: 20px;
}
.imgSinistra {
  position: absolute;
  left: 20px;
  top: 14px;
}
.imgDestra {
  position: absolute;
  right: 20px;
  top: 14px;
}
.margineCircle {
  margin-left: 50px;
}

/* Dimensione icone nei “circle” (niente deformazioni) */
.circle img,
.imgSinistra,
.imgDestra {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.circle img {
  max-width: 64px;
  max-height: 64px;
}

/* 3.4 – Box bianco di pagina (contenitore contenuti) */
.circlePagine {
  width: 1510px;
  margin-left: 20px;
  background: #fff;
  padding: 20px;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 3.5 – Titoli pagina */
.titoloH1 {
  font-size: 50px;
  color: #d52530;
}

/* 3.6 – Immagine hero “cover” */
.hero-cover-img {
  width: 100%;
  height: 800px;
  object-fit: cover;
}

/* 3.7 – Gallery a gruppi (titolo + griglia uniforme) */

.gallery-group {
  margin-top: 28px;
}

.gallery-title {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 14px 0;
}

.gallery-grid {
  --gallery-ar: 4 / 3; /* cambia qui il rapporto (16/9, 1/1, ecc.) */
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  aspect-ratio: var(--gallery-ar); /* tutte le card hanno lo stesso rapporto */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  background: #eee;
}

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* riempi e ritaglia in modo elegante */
  display: block;
}

/* Responsive */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}
@media (max-width: 700px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* 3.7bis – QR Code grid (4 colonne, titolino sopra QR) */

.qrcode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.qrcode-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qrcode-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  color: #000;
}

.qrcode-item img {
  width: 100%;
  max-width: 220px; /* mantiene QR “bello grande” ma non enorme */
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

/* 3.8 – Video (player full width dentro il box bianco) */
.video-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 40px auto 0; /* stacco dal titolo */
  border-radius: 10px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.video-container video,
.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover; /* riempi; usa contain per no-crop */
}

/* 3.9 – Mappa Leaflet */
.map-wrapper {
  height: 600px;
  width: 100%;
}

/* 3.10 – Box bianchi generici (compat mobile) */
.white-box {
  background: #fff;
  padding: 40px;
}
.white-box p {
  text-align: justify;
}

/* Firma footer */
.firma {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
}

.firma-link {
  color: #000;
  text-decoration: none;
  font-weight: 400;
}

.zag-arancio {
  color: #ea580c;
  font-weight: 700;
}

/* 3.11 - Sottotitoli e paragrafi pagina comune */
.sottotitolo-comune {
  font-size: 32px;
}

.paragrafo-comune {
  font-size: 18px;
  text-align: justify;
  line-height: 35px;
}

/* =============== 4) UTILITIES =============== */

.text-center {
  text-align: center;
}
.no-padding {
  padding: 0 !important;
}
.contenuto {
  margin-left: 100px !important;
} /* legacy */
.main-offset-81 {
  margin-top: 81px;
} /* sostituisce inline negli HTML */
.h2Evento {
  color: #37549a;
  padding-top: 20px;
  padding-left: 20px;
}
.pEvento {
  margin-left: 20px;
}

/* =============== 5) PWA (Install button) =============== */

/* #install-button {
  margin-top: 68px;
  background-color: transparent;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  display: block;
  font-family: Poppins, sans-serif;
} */

/* =============== 6) PAGINE SPECIFICHE =============== */

/* Audioguide – accordion stile mobile in box bianco desktop */

.audioguide-container {
  margin-top: 10px;
}

.audioguide-container .titoloH1 {
  margin-bottom: 10px;
}

.audioguide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px auto 20px auto;
  max-width: 900px;
  width: 100%;
}

/* Singolo elemento */
.audioguide-item {
  background-color: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Riga header */
.audioguide-header {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: stretch;
  width: 100%;
  min-height: 60px;
  padding: 0;
  border: none;
  cursor: pointer;
  background-color: #f2f2f2;
  font-family: "Poppins", sans-serif;
}

/* Numero */
.audioguide-number {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #219f10;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

/* Titolo */
.audioguide-title {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 1.3rem;
  color: #000;
  text-align: center;
  justify-content: center;
}

/* + / – */
.audioguide-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #219f10;
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
}

/* Corpo espanso */
.audioguide-body {
  padding: 16px 20px 20px 20px;
  background-color: #ffffff;
  border-top: 1px solid #e0e0e0;
}

.audioguide-body audio {
  width: 100%;
  margin-bottom: 10px;
}

.audioguide-text {
  font-size: 1rem;
  line-height: 1.9;
  text-align: justify;
}

/* Eventi */
.event-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin: -10px;
}
.event {
  width: 20%;
  margin-bottom: 20px;
  border: 2px solid #31951d;
  border-radius: 8px;
}
.event a {
  color: #31951d;
  text-decoration: none;
  float: right;
  margin: 20px;
}
.event img {
  max-width: 100%;
  height: auto;
}

/* Contatti */
.contatti {
  display: flex;
  align-items: center;
}
.contact-info {
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}
.contact-info-item {
  display: flex;
  align-items: center;
  text-align: left;
  margin: 10px;
}
.contact-info-item i {
  font-size: 30px;
  color: #31951d;
  margin-right: 20px;
}
.contact-info-item p {
  margin: 0;
  font-size: 20px;
}

/* =============== 7) MEDIA QUERIES =============== */

/* Altezze/risoluzioni specifiche per la sidebar (mantiene il layout attuale) */
@media (width: 1680px) {
  #sidebar {
    height: 1050px !important;
  }
}
@media (width: 1920px) {
  #sidebar {
    height: 100vh !important;
  }
}

/* Desktop / tablet larghi – compat mobile */
@media (min-width: 800px) {
  .white-box {
    margin-top: 200px;
    margin-left: 20px;
  }
}
