/* ═══════════════════════════════════════════════════════
   Castello della Fava – Posada
   Stile condiviso tra index.php, approfondimento.php, privacy.php
   Questo file vive in includes/ — i path relativi (fonts, ecc.)
   sono calcolati da qui, non dalla pagina che lo include.
   ═══════════════════════════════════════════════════════ */

/* ── FONT FACE (locali) ── */
@font-face {
  font-family: 'Cinzel';
  src: url('../fonts/cinzel-v26-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('../fonts/cinzel-v26-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('../fonts/cinzel-v26-latin-900.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../fonts/eb-garamond-v32-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../fonts/eb-garamond-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
/* Nota: nella cartella fonts/ non è presente il peso 500 di EB Garamond,
   ma nessuna regola del sito lo usa comunque (safe da omettere). */

/* ── VARIABILI ── */
:root {
  --gold:       #c9a84c;
  --gold-light: #e8c97a;
  --stone:      #8b7355;
  --dark:       #1a1410;
  --warm-dark:  #2c2218;
  --parchment:  #f5ead8;
  --parchment2: #ede0c4;
  --text:       #3a2e22;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--dark);
  color: var(--parchment);
  overflow-x: hidden;
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(160deg, #0d0b08 0%, #2c1f0e 50%, #1a1208 100%);
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 70%, rgba(201,168,76,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-silhouette {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(600px, 90vw);
  opacity: 0.12;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  animation: fadeUp 1.2s ease both;
}

.hero-eyebrow {
  font-family: 'Cinzel', 'Palatino Linotype', Georgia, serif;
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  letter-spacing: 0.35em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-family: 'Cinzel', 'Palatino Linotype', Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: 1;
  color: var(--parchment);
  text-shadow: 0 4px 40px rgba(0,0,0,0.8);
  letter-spacing: 0.04em;
}

.hero h1 span { display: block; color: var(--gold-light); }

.hero-quote {
  margin-top: 2rem;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--stone);
  max-width: 480px;
  line-height: 1.6;
}

.hero-divider {
  margin: 2rem auto;
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-meta {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--stone);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  opacity: 0.5;
  animation: bounce 2s infinite;
}
.scroll-hint span {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.6rem; letter-spacing: 0.3em; color: var(--gold);
}

/* ── SEZIONI ── */
section { padding: 5rem 1.5rem; }
.container { max-width: 860px; margin: 0 auto; }

.section-label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem; letter-spacing: 0.4em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 0.75rem;
}
.section-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 600;
  color: var(--parchment); margin-bottom: 2rem; line-height: 1.2;
}
.gold-rule { width: 50px; height: 2px; background: var(--gold); margin-bottom: 2rem; }

/* ── STORIA ── */
.storia {
  background: var(--warm-dark);
  border-top: 1px solid rgba(201,168,76,0.15);
  border-bottom: 1px solid rgba(201,168,76,0.15);
}
.storia p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.85; color: var(--parchment2); margin-bottom: 1.2rem;
}
.storia p:last-child { margin-bottom: 0; }
.storia-highlight {
  border-left: 3px solid var(--gold);
  padding-left: 1.5rem;
  font-style: italic;
  color: var(--gold-light) !important;
  margin: 2rem 0 !important;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem) !important;
}

/* ── PHOTO STRIP ── */
.photo-strip {
  background: var(--dark);
  padding: 0;
  display: flex;
  height: clamp(220px, 35vw, 380px);
  overflow: hidden;
}
.photo-strip-item {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 1.5rem;
  transition: flex 0.5s ease; cursor: default;
}
.photo-strip-item:hover { flex: 2.5; }
.photo-strip-item img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: sepia(30%) brightness(0.7);
  transition: filter 0.5s;
}
.photo-strip-item:hover img { filter: sepia(10%) brightness(0.85); }
.photo-strip-item::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}
.photo-caption {
  position: relative; z-index: 1;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem; letter-spacing: 0.2em; color: var(--gold-light);
  opacity: 0; transition: opacity 0.4s;
}
.photo-strip-item:hover .photo-caption { opacity: 1; }


/* ── TARIFFE ── */
.tariffe { background: var(--parchment); color: var(--text); }
.tariffe .section-label { color: var(--stone); }
.tariffe .section-title { color: var(--dark); }

.tariffe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; margin-top: 1rem;
}
.tariffa-card {
  background: white;
  border: 1px solid var(--parchment2); border-radius: 2px;
  padding: 2rem 1.5rem; text-align: center;
  position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.tariffa-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
.tariffa-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--gold);
}
.tariffa-tipo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.8rem; letter-spacing: 0.2em; color: var(--stone);
  text-transform: uppercase; margin-bottom: 0.75rem;
}
.tariffa-prezzo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 2.5rem; font-weight: 900; color: var(--dark); line-height: 1;
}
.tariffa-prezzo sup { font-size: 1rem; vertical-align: super; color: var(--stone); }
.tariffa-note { margin-top: 1rem; font-size: 0.9rem; color: var(--stone); line-height: 1.6; }
.tariffa-card.gratuito::before { background: #6b9e6b; }
.tariffa-card.gratuito .tariffa-prezzo { color: #3d6b3d; font-size: 1.8rem; }

/* ── ORARI ── */
.orari { background: var(--warm-dark); }
.orari-box {
  border: 1px solid rgba(201,168,76,0.25); padding: 2.5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
}
@media (max-width: 560px) { .orari-box { grid-template-columns: 1fr; } }
.orari-group h3 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.75rem; letter-spacing: 0.25em; color: var(--gold); margin-bottom: 1rem;
}
.orari-row {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.95rem; color: var(--parchment2);
}
.orari-row:last-child { border-bottom: none; }
.orari-row .giorno { color: var(--stone); }
.orari-note { margin-top: 2rem; font-style: italic; font-size: 0.9rem; color: var(--stone); text-align: center; }

/* ── CONTATTI ── */
.contatti {
  background: var(--dark);
  border-top: 1px solid rgba(201,168,76,0.15);
}
.contatti-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem; margin-top: 2rem;
}
.contatto-item { display: flex; align-items: flex-start; gap: 1rem; }
.contatto-icon {
  width: 40px; height: 40px;
  border: 1px solid rgba(201,168,76,0.3); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--gold);
}
.contatto-label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.65rem; letter-spacing: 0.25em; color: var(--stone); margin-bottom: 0.3rem;
}
.contatto-value { font-size: 0.95rem; color: var(--parchment); line-height: 1.5; }
.contatto-value a { color: var(--parchment); text-decoration: none; transition: color 0.2s; }
.contatto-value a:hover { color: var(--gold-light); }

/* ── MAPPA OSM ── */
.mappa-section {
  background: var(--warm-dark);
  padding: 0;
}
#osm-map {
  width: 100%;
  height: 320px;
}

/* ── BANNER PRIVACY ── */
#privacy-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: rgba(26, 20, 16, 0.97);
  border-top: 1px solid rgba(201,168,76,0.3);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
#privacy-banner p {
  font-size: 0.88rem;
  color: var(--parchment2);
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}
#privacy-banner a {
  color: var(--gold);
  text-decoration: underline;
}
.banner-btn {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.banner-btn:hover { background: var(--gold); color: var(--dark); }

/* ── FOOTER ── */
footer {
  background: #0d0b08;
  padding: 3rem 1.5rem;
  text-align: center;
  border-top: 1px solid rgba(201,168,76,0.1);
}
.footer-logo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem; letter-spacing: 0.3em; color: var(--stone); margin-bottom: 0.5rem;
}
footer a {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.8rem; letter-spacing: 0.15em;
  color: var(--gold); text-decoration: none;
  border-bottom: 1px solid rgba(201,168,76,0.3); padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
footer a:hover { color: var(--gold-light); border-color: var(--gold); }
.footer-links { margin-top: 1.5rem; display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { font-size: 0.7rem; letter-spacing: 0.2em; border: none; color: var(--stone); }
.footer-credits { margin-top: 2rem; font-size: 0.8rem; color: rgba(139,115,85,0.4); }

/* ── ANIMAZIONI ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }


/* ═══════════════════════════════════════════════════════
   NUOVE CLASSI — pagina di approfondimento
   (coerenti con la palette/tipografia esistente)
   ═══════════════════════════════════════════════════════ */

/* Bottone "Approfondisci" in chiusura sezione storia */
.cta-approfondisci {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.cta-approfondisci:hover { background: var(--gold); color: var(--dark); }

/* Intestazione semplice per pagine "interne" (approfondimento, privacy) */
.page-header {
  background: var(--warm-dark);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}
.page-header .section-label { justify-content: center; }
.page-header .section-title { margin-bottom: 0.5rem; }
.page-header .page-subtitle {
  font-style: italic;
  color: var(--stone);
  font-size: 1rem;
}

/* Link di ritorno */
.torna-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--stone);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.torna-home:hover { color: var(--gold-light); }

/* Indice dei capitoli */
.indice-capitoli {
  list-style: none;
  border: 1px solid rgba(201,168,76,0.25);
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
}
.indice-capitoli li { padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.indice-capitoli li:last-child { border-bottom: none; }
.indice-capitoli a {
  color: var(--parchment2);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.indice-capitoli a:hover { color: var(--gold-light); }

/* Singolo capitolo */
.capitolo { padding: 3rem 0; border-bottom: 1px solid rgba(201,168,76,0.1); scroll-margin-top: 2rem; }
.capitolo:last-child { border-bottom: none; }
.capitolo-titolo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--gold-light);
  margin-bottom: 1.5rem;
}
.capitolo p {
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.85;
  color: var(--parchment2);
  margin-bottom: 1.2rem;
}
.capitolo p:last-child { margin-bottom: 0; }

/* Fonti bibliografiche in chiusura capitolo */
.capitolo-fonti {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--stone);
}
.capitolo-fonti summary {
  cursor: pointer;
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--stone);
}
.capitolo-fonti ul { margin-top: 0.75rem; padding-left: 1.2rem; line-height: 1.6; }

/* Termine con glossa (tooltip) */
.termine-glossario {
  border-bottom: 1px dotted var(--gold);
  cursor: help;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════
   Testo "prosa" — pagine informative/legali (privacy, ecc.)
   ═══════════════════════════════════════════════════════ */
.pagina-testo h2 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--parchment);
  margin-bottom: 0.5rem;
}
.pagina-testo h3 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin: 2.5rem 0 0.75rem;
}
.pagina-testo p { font-size: 1.05rem; line-height: 1.8; margin-bottom: 1rem; color: var(--parchment2); }
.pagina-testo ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.pagina-testo ul li { font-size: 1.05rem; line-height: 1.8; margin-bottom: 0.4rem; color: var(--parchment2); }
.pagina-testo a { color: var(--gold); }
.pagina-testo em { color: var(--stone); }

.callout-box {
  border: 1px solid rgba(201,168,76,0.25);
  padding: 1.5rem;
  margin: 2rem 0;
  background: rgba(201,168,76,0.05);
}
.callout-box p { margin-bottom: 0; color: var(--parchment); }

/* Selettore lingua — fisso in alto a destra, presente su tutte le pagine */
.selettore-lingua {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  gap: 0.5rem;
  background: rgba(13, 11, 8, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 20px;
  padding: 0.35rem 0.6rem;
}
.selettore-lingua a {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--stone);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
}
.selettore-lingua a:hover { color: var(--gold-light); }
.selettore-lingua a.attiva {
  color: var(--dark);
  background: var(--gold);
}

/* Bottone "torna su" — fisso in basso a destra, compare dopo un po' di scroll */
.torna-su {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(13, 11, 8, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(201,168,76,0.35);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s, color 0.2s, visibility 0.3s;
}
.torna-su.visibile { opacity: 1; visibility: visible; transform: none; }
.torna-su:hover { background: var(--gold); color: var(--dark); }

/* Bottone ascolto capitolo (TTS) */
.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--gold);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.audio-btn:hover { background: var(--gold); color: var(--dark); }
.audio-btn.playing { background: var(--gold); color: var(--dark); }
