/* clubmc.world — the atlas plate.
   The map is a plate set into the page: a cartography you can read, a
   drawer of records on the left, a dossier on the right, and a stone
   relief of the world for the three-dimensional reading.

   The palette is gold on black — the archive's own — and it is scoped to
   the plate. The gold is never a flat colour: the sigills on the map, the
   cards of the drawer, the dossier and the buttons all carry a gradient,
   from the lit gold of the highlight to the bronze of the shadow. */

.mappa-plate {
  --black:      #0A0A0A;
  --black-2:    #141414;
  --black-3:    #1F1F1F;
  --gold:       #D4AF37;
  --gold-hi:    #F7E7B4;
  --gold-lo:    #8B6914;
  --gold-line:  rgba(212, 175, 55, .30);
  --cream:      #F5F0E6;
  --muted:      #C9C4B8;
  --dim:        #8a8578;

  /* the gradients of the plate */
  --grad-gold:      linear-gradient(135deg, #F7E7B4 0%, #D4AF37 38%, #A8842A 72%, #E4C86A 100%);
  --grad-gold-soft: linear-gradient(135deg, rgba(247, 231, 180, .16) 0%, rgba(212, 175, 55, .06) 60%, rgba(0, 0, 0, 0) 100%);
  --grad-panel:     linear-gradient(180deg, rgba(22, 22, 22, .97) 0%, rgba(8, 8, 8, .97) 100%);
  --grad-card:      linear-gradient(145deg, #1A1A1A 0%, #0D0D0D 100%);
  --grad-card-hot:  linear-gradient(145deg, #26200F 0%, #12100A 100%);
  --grad-bar:       linear-gradient(180deg, rgba(20, 20, 20, .96) 0%, rgba(6, 6, 6, .96) 100%);

  position: relative;
  width: 100%;
  background: var(--black);
  background-image: var(--grad-gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--cream);
  font-family: var(--font-ui);
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(212, 175, 55, .18);
  transition: all .3s ease;
}

.mappa-plate.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0;
}

/* ------------------------------------------------------------ the control bar */
.mappa-subbar {
  position: relative;
  z-index: 900;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--grad-bar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-line);
  padding: 5px 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.mappa-subbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mappa-subbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mappa-kicker {
  letter-spacing: .14em;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.mappa-metrics {
  display: flex;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  align-items: baseline;
  flex-wrap: wrap;
}
.mappa-metrics b {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.mappa-metrics .mappa-metric-note { color: var(--gold-lo); font-size: 10px; letter-spacing: .03em; }

.mappa-select {
  background: var(--black-2);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  padding: 3px 7px;
  font-size: 11px;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}
.mappa-select:hover { border-color: var(--gold); }

.mappa-btn {
  background: var(--grad-card);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .2s;
  font-family: inherit;
  line-height: 1.35;
}
.mappa-btn:hover {
  background: var(--grad-gold);
  border-color: var(--gold);
  color: var(--black);
  box-shadow: 0 4px 14px rgba(212, 175, 55, .22);
}
.mappa-btn.is-active {
  background: var(--grad-gold);
  border-color: var(--gold);
  color: var(--black);
  box-shadow: 0 4px 16px rgba(212, 175, 55, .28);
}
.mappa-btn--ghost { background: transparent; border-color: var(--gold); color: var(--gold); }
.mappa-btn--ghost:hover { background: var(--grad-gold); color: var(--black); }

/* ---------------------------------------------------------------- the viewport */
.mappa-viewport {
  position: relative;
  width: 100%;
  height: 620px;
  overflow: hidden;
  perspective: 1200px;
  background: var(--black);
}
.mappa-2d {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--black);
  transition: transform .6s cubic-bezier(.16, 1, .3, 1);
  transform-origin: 50% 60%;
}
.mappa-2d.is-tilted { transform: rotateX(36deg) scale(1.08); }

/* il velo del respiro: sta sopra la cartografia, sotto le finestre */
.mappa-pulse {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 1;
}
.mappa-plate .maplibregl-popup { z-index: 3; }
.mappa-plate .maplibregl-ctrl-bottom-right,
.mappa-plate .maplibregl-ctrl-bottom-left { z-index: 3; }

/* -------------------------------------------------------------- the drawer */
.mappa-side {
  position: absolute;
  top: 52px;
  left: 12px;
  bottom: 12px;
  width: 310px;
  max-width: calc(100% - 24px);
  z-index: 850;
  background: var(--grad-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--gold-line);
  border-radius: 2px;
  padding: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(212, 175, 55, .14);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}
.mappa-side.is-collapsed { transform: translateX(-335px); }
.mappa-side-tab {
  position: absolute;
  top: 8px;
  right: -28px;
  width: 27px;
  height: 34px;
  background: var(--grad-panel);
  border: 1px solid var(--gold-line);
  border-left: none;
  border-radius: 0 3px 3px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gold);
  font-size: 12px;
  box-shadow: 4px 2px 10px rgba(0, 0, 0, .5);
  user-select: none;
}
.mappa-side-tab:hover { background: var(--grad-gold); color: var(--black); }

.mappa-search {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--gold-line);
  background: var(--black-2);
  font-family: inherit;
  font-size: 12px;
  color: var(--cream);
  border-radius: 2px;
  outline: none;
}
.mappa-search:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, .16); }
.mappa-search::placeholder { color: var(--dim); }

.mappa-filters { display: flex; gap: 5px; }
.mappa-filter {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--gold-line);
  background: var(--black-2);
  font-family: inherit;
  font-size: 11px;
  color: var(--gold);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.mappa-filter:hover { border-color: var(--gold); }

.mappa-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mappa-note-plate {
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  padding: 4px 7px;
  border-left: 2px solid var(--gold);
  background: rgba(212, 175, 55, .05);
}
.mappa-more {
  width: 100%;
  background: var(--grad-card);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: 5px;
  cursor: pointer;
  border-radius: 2px;
  margin-top: 2px;
  transition: all .2s;
}
.mappa-more:hover { background: var(--grad-gold); color: var(--black); border-color: var(--gold); }
.mappa-chip {
  flex: 1 1 auto;
  padding: 5px 6px;
  background: var(--grad-card);
  border: 1px solid var(--gold-line);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: all .2s;
  white-space: nowrap;
}
.mappa-chip:hover { border-color: var(--gold); color: var(--gold); }
.mappa-chip.is-active {
  background: var(--grad-gold);
  border-color: var(--gold);
  color: var(--black);
}

.mappa-extra {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 5px;
  border-top: 1px solid var(--gold-line);
}
.mappa-extra label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold-lo);
}
.mappa-extra input[type=range] { width: 90px; accent-color: var(--gold); }
.mappa-extra .mappa-value {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  min-width: 28px;
}
.mappa-extra .mappa-mini {
  background: var(--grad-card);
  border: 1px solid var(--gold-line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 5px;
  cursor: pointer;
  border-radius: 2px;
  transition: all .2s;
}
.mappa-extra .mappa-mini:hover { border-color: var(--gold); color: var(--gold); }
.mappa-extra .mappa-mini[aria-pressed="true"] {
  background: var(--grad-gold);
  border-color: var(--gold);
  color: var(--black);
}

.mappa-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
  min-height: 0;
}
.mappa-list::-webkit-scrollbar { width: 4px; }
.mappa-list::-webkit-scrollbar-thumb { background: var(--gold-lo); border-radius: 2px; }
.mappa-empty {
  font-size: 12.5px;
  color: var(--muted);
  padding: 12px 4px;
  line-height: 1.5;
}

/* the cards: black plates with a gold edge */
.mappa-card {
  background: var(--grad-card);
  border: 1px solid rgba(212, 175, 55, .22);
  border-left: 2px solid var(--gold-lo);
  padding: 7px 9px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  width: 100%;
  font: inherit;
  display: block;
  color: var(--cream);
}
.mappa-card:hover {
  border-color: var(--gold);
  border-left-color: var(--gold);
  background: var(--grad-card-hot);
  transform: translateX(2px);
  box-shadow: -2px 0 12px rgba(212, 175, 55, .18);
}
.mappa-card.is-target {
  border: 1px solid var(--gold);
  border-left: 3px solid var(--gold);
  background: var(--grad-card-hot);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .28), -3px 0 16px rgba(212, 175, 55, .25);
}
.mappa-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 7px; margin-bottom: 2px; }
.mappa-card-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
/* il sigillo e' lo stesso per tutti: l'oro non distingue, la scheda
   distingue */
.mappa-badge {
  font-size: 8.5px;
  padding: 1px 4px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 2px;
  white-space: nowrap;
  flex: 0 0 auto;
  background: var(--grad-gold);
  color: var(--black);
  border: 1px solid var(--gold);
}
.mappa-card-meta { font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.mappa-card-meta b { color: var(--gold); }
.mappa-card-tags { display: flex; flex-wrap: wrap; gap: 3px; font-size: 9.5px; }
.mappa-tag {
  background: rgba(212, 175, 55, .10);
  border: 1px solid rgba(212, 175, 55, .18);
  padding: 0 4px;
  border-radius: 2px;
  color: var(--muted);
}
.mappa-tag:first-child { color: var(--gold); border-color: rgba(212, 175, 55, .34); }

/* ---------------------------------------------------------------- the dossier */
.mappa-dossier {
  position: absolute;
  top: 52px;
  right: 12px;
  bottom: 12px;
  width: 360px;
  max-width: calc(100% - 24px);
  z-index: 850;
  background: var(--grad-panel);
  border: 1px solid var(--gold-line);
  border-radius: 2px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(212, 175, 55, .14);
  display: none;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  animation: mappaFade .25s ease;
}
.mappa-dossier.is-on { display: flex; }
@keyframes mappaFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mappa-dossier-close {
  position: absolute;
  top: 9px;
  right: 9px;
  background: none;
  border: 1px solid var(--gold-line);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 1px 6px;
  border-radius: 2px;
}
.mappa-dossier-close:hover { color: var(--black); background: var(--grad-gold); border-color: var(--gold); }
.mappa-dossier-kicker {
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-lo);
  font-weight: 700;
  margin-bottom: 2px;
}
.mappa-dossier-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 2px;
  padding-right: 1.4rem;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.mappa-dossier-sub { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.mappa-dossier-desc {
  background: linear-gradient(135deg, rgba(212, 175, 55, .10) 0%, rgba(212, 175, 55, .02) 100%);
  border-left: 3px solid var(--gold);
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--cream);
}
.mappa-dossier-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.mappa-dossier-table th,
.mappa-dossier-table td {
  border-bottom: 1px solid rgba(212, 175, 55, .16);
  padding: 4px 3px;
  vertical-align: top;
  text-align: left;
}
.mappa-dossier-table th { width: 44%; color: var(--muted); font-weight: 500; }
.mappa-dossier-table td { font-weight: 600; color: var(--cream); word-break: break-word; }
.mappa-dossier-table td a { color: var(--gold); text-decoration: underline; }
.mappa-pills { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.mappa-pill {
  background: rgba(212, 175, 55, .10);
  border: 1px solid rgba(212, 175, 55, .24);
  padding: 1px 4px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
}
.mappa-dossier-cta {
  background: var(--grad-gold);
  color: var(--black);
  border: 1px solid var(--gold);
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border-radius: 2px;
  transition: filter .2s, box-shadow .2s;
  text-decoration: none;
  display: block;
}
.mappa-dossier-cta:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 18px rgba(212, 175, 55, .28);
  text-decoration: none;
}
.mappa-dossier-note { font-size: 10px; color: var(--dim); line-height: 1.45; margin: 0; }


/* ------------------------------------------------------------- the markers */
.mappa-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .2s;
}
.mappa-seal:hover { transform: scale(1.22); }

.mappa-hover {
  background: rgba(12, 12, 12, .97) !important;
  border: 1px solid var(--gold) !important;
  border-radius: 2px !important;
  padding: .45rem .6rem !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .7) !important;
  font-family: var(--font-ui) !important;
  color: var(--cream) !important;
}
.mappa-hover b { color: var(--gold); display: block; font-size: .82rem; }
.mappa-hover span { display: block; color: var(--muted); font-size: .72rem; }

.mappa-attrib {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 800;
  background: rgba(10, 10, 10, .82);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--dim);
  padding: 2px 6px;
  pointer-events: none;
}
.mappa-attrib a { color: var(--muted); }

.mappa-loading {
  position: absolute;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, .88);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background-image: var(--grad-gold-soft);
  color: var(--gold);
}
.mappa-loading[hidden] { display: none; }

/* the device-local panel, inside the dark plate */
.mappa-plate .nearby-panel {
  background: var(--grad-panel);
  border: 1px solid var(--gold-line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .7);
}
.mappa-plate .nearby-panel h3 { color: var(--gold); }
.mappa-plate .nearby-panel .close { border-color: var(--gold-line); color: var(--muted); }
.mappa-plate .nearby-panel .close:hover { border-color: var(--gold); color: var(--gold); }
.mappa-plate .nearby-list b { color: var(--gold); }
.mappa-plate .nearby-list span,
.mappa-plate .nearby-note,
.mappa-plate .nearby-lead { color: var(--muted); }
.mappa-plate .nearby-list i { color: var(--cream); }
.mappa-plate .nearby-countries { color: var(--dim); }
.mappa-plate .nearby-countries i { color: var(--gold-lo); }
.mappa-plate .nearby-privacy { color: var(--dim); border-top-color: var(--gold-line); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .mappa-viewport { height: 560px; }
  .mappa-subbar { flex-direction: column; gap: 6px; align-items: flex-start; }
  .mappa-side { width: 280px; top: 96px; }
  .mappa-dossier { width: calc(100% - 24px); left: 12px; right: 12px; top: 96px; }
}
@media (max-width: 640px) {
  .mappa-viewport { height: 520px; }
  .mappa-side { width: calc(100% - 24px); }
  .mappa-dossier { top: 96px; }
}
