/* Archivio La Margherita — stile interfaccia di consultazione */
:root {
  --bar-h: 48px;
  --accent: #2f6b4f;
  --bg: #f6f4ef;
  --ink: #222;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
}

/* Barra superiore dell'archivio (non fa parte della schermata storica) */
.archivio-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--bar-h);
  padding: 6px 12px;
  background: #233428;
  color: #fff;
  flex-wrap: wrap;
}
.home-btn {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}
.home-btn:hover, .home-btn:focus { text-decoration: underline; }
/* Link di ritorno al sito WordPress (stessa barra di navigazione) */
.est-link {
  font-weight: normal;
  opacity: 0.92;
}
.crumb {
  font-size: 0.9rem;
  opacity: 0.85;
  flex: 1;
  min-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-index details { position: relative; }
.section-index summary {
  cursor: pointer;
  list-style: none;
  border: 1px solid #ffffff55;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.9rem;
}
.section-index summary::-webkit-details-marker { display: none; }
.section-index .menu-lista {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  color: var(--ink);
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 6px 18px #0003;
  min-width: 260px;
  max-height: 70vh;
  overflow: auto;
  padding: 8px;
  z-index: 60;
}
.section-index .menu-lista h3 {
  margin: 8px 0 4px;
  font-size: 0.85rem;
  color: var(--accent);
}
.section-index .menu-lista a {
  display: block;
  padding: 4px 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
}
.section-index .menu-lista a:hover, .section-index .menu-lista a:focus {
  background: #eef3ee;
  outline: 2px solid var(--accent);
}

/* Stato / caricamento */
.stato { padding: 20px; font-style: italic; }

/* Schermata storica */
.schermata-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 0 24px;
}
.schermata {
  position: relative;
  margin: 0;
  line-height: 0;
}
.schermata img {
  display: block;
  width: 100%;
  height: auto;
}
/* SVG degli hotspot: stesso box dell'immagine, scala in sincrono */
.hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hotspots a {
  cursor: pointer;
  fill: transparent;
  stroke: transparent;
  outline: none;
}
/* hover e focus visibili */
.hotspots a:hover, .hotspots a:focus-visible {
  fill: rgba(47, 107, 79, 0.18);
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
/* aree "nota" (moduli non attivi) */
.hotspots .nota-area {
  fill: rgba(160, 0, 0, 0.0);
  cursor: not-allowed;
}
.hotspots .nota-area:hover {
  fill: rgba(160, 0, 0, 0.10);
}

/* Popup per menu a tendina storici */
.menu-popup {
  position: absolute;
  z-index: 40;
  background: #fff;
  color: var(--ink);
  border: 1px solid #bbb;
  border-radius: 8px;
  box-shadow: 0 8px 20px #0004;
  min-width: 220px;
  max-width: 320px;
  padding: 6px;
}
.menu-popup a {
  display: block;
  padding: 6px 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 5px;
}
.menu-popup a:hover, .menu-popup a:focus {
  background: #eef3ee;
  outline: 2px solid var(--accent);
}

/* Nota archivistica */
.nota-archivio {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 16px 28px;
  font-size: 0.95rem;
  color: #444;
  border-top: 2px solid #d8d2c4;
}

/* Pagina non trovata */
#nontrovata { max-width: 700px; margin: 40px auto; padding: 0 16px; }

/* Footer */
.archivio-footer {
  border-top: 1px solid #d8d2c4;
  padding: 16px;
  font-size: 0.85rem;
  color: #555;
  text-align: center;
}

/* Mobile: barra più compatta */
@media (max-width: 640px) {
  .archivio-bar { gap: 6px; padding: 4px 8px; }
  .crumb { order: 3; flex-basis: 100%; }
  .schermata-wrap { padding: 4px 0 16px; }
}
