/* ===== Monte Athos — stile (palette bizantina: pietra, oro, notte) ===== */
:root {
  --bg: #15110c;
  --bg-2: #1d1810;
  --panel: #241d14;
  --panel-2: #2c2418;
  --ink: #ece2d0;
  --ink-soft: #c9bca4;
  --ink-dim: #9b8e76;
  --gold: #c9a96a;
  --gold-bright: #e0c084;
  --line: #3a2f20;
  --line-soft: #2c2418;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius: 14px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -200px, #2a2114 0%, rgba(42,33,20,0) 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 600; letter-spacing: .3px; line-height: 1.2; }

/* ===== Header ===== */
.site-header {
  text-align: center;
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(201,169,106,.06), rgba(0,0,0,0));
}
.kicker { color: var(--gold); letter-spacing: 4px; text-transform: uppercase; font-size: 13px; }
.site-header h1 { font-size: clamp(40px, 8vw, 76px); margin: 8px 0 6px; color: var(--gold-bright); text-shadow: 0 2px 18px rgba(0,0,0,.5); }
.subtitle { color: var(--ink-soft); font-size: clamp(16px, 3vw, 21px); margin: 0 auto 18px; max-width: 720px; font-style: italic; }
.permit-badge {
  display: inline-block; border: 1px solid var(--gold); color: var(--gold-bright);
  border-radius: 999px; padding: 8px 18px; font-size: 15px; margin-bottom: 20px;
  background: rgba(201,169,106,.08);
}
.intro { color: var(--ink-soft); max-width: 800px; margin: 0 auto 14px; font-size: 16px; }
.avaton-note { color: var(--ink-dim); max-width: 760px; margin: 0 auto; font-size: 13.5px; font-style: italic; }

/* ===== Nav (sticky) ===== */
.site-nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(21,17,12,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 10px 20px; }
.site-nav a {
  color: var(--ink-soft); padding: 8px 16px; border-radius: 8px; font-size: 15px;
  text-decoration: none; transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--panel); color: var(--gold-bright); text-decoration: none; }

/* ===== Sections ===== */
.section { padding: 48px 0; border-bottom: 1px solid var(--line-soft); }
.section h2 { font-size: clamp(26px, 4vw, 36px); color: var(--gold-bright); margin: 0 0 8px; }
.section-lead { color: var(--ink-dim); max-width: 760px; margin: 0 0 24px; }

/* ===== Mappa ===== */
#map { height: 560px; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: #0e0b07; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; color: var(--ink-soft); font-size: 14px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
.leaflet-popup-content-wrapper { background: var(--panel); color: var(--ink); border: 1px solid var(--gold); border-radius: 10px; }
.leaflet-popup-tip { background: var(--panel); border: 1px solid var(--gold); }
.leaflet-popup-content { margin: 12px 14px; }
.popup-title { font-size: 16px; color: var(--gold-bright); font-weight: 600; margin-bottom: 4px; }
.popup-meta { font-size: 12.5px; color: var(--ink-dim); margin-bottom: 8px; }
.popup-img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.popup-link { font-size: 13px; }

/* ===== Itinerari ===== */
.itin-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.itin-tab {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft);
  border-radius: 10px; padding: 12px 16px; cursor: pointer; text-align: left; flex: 1 1 240px;
  transition: border-color .15s, transform .1s, background .15s; font-family: inherit;
}
.itin-tab:hover { border-color: var(--gold); transform: translateY(-2px); }
.itin-tab.active { border-color: var(--gold); background: var(--panel-2); box-shadow: 0 0 0 1px var(--gold) inset; }
.itin-tab .it-name { color: var(--gold-bright); font-size: 17px; font-weight: 600; display: block; }
.itin-tab .it-focus { color: var(--ink-dim); font-size: 13px; display: block; margin-top: 3px; }

.itin-detail { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.itin-detail .it-summary { color: var(--ink-soft); margin: 0 0 6px; }
.itin-detail .it-bestfor { color: var(--gold); font-size: 14px; margin: 0 0 20px; font-style: italic; }
.itin-day { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.itin-day:first-of-type { border-top: none; }
.itin-day .d-label { flex: 0 0 150px; color: var(--gold-bright); font-weight: 600; font-size: 14.5px; }
.itin-day .d-text { color: var(--ink-soft); font-size: 15px; }
.itin-day .d-text b { color: var(--ink); }
.itin-chiplist { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.itin-chiplist .lbl { color: var(--ink-dim); font-size: 13px; margin-right: 4px; }
.placechip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.placechip:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ===== Controls / filtri ===== */
.controls { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
#search { flex: 1 1 320px; }
input[type="search"], select {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; font-size: 15px; font-family: inherit;
}
input[type="search"]:focus, select:focus { outline: none; border-color: var(--gold); }
select { cursor: pointer; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.filter-label { color: var(--ink-dim); font-size: 13px; margin-right: 4px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 14px; font-size: 13.5px; cursor: pointer; font-family: inherit;
  transition: all .12s;
}
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--gold); color: #1a1308; border-color: var(--gold); font-weight: 600; }

.count { color: var(--ink-dim); font-size: 14px; margin: 8px 0 18px; }

/* ===== Cards ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform .12s, border-color .15s; scroll-margin-top: 80px;
}
.card:hover { transform: translateY(-3px); border-color: var(--gold); }
.card.flash { border-color: var(--gold-bright); box-shadow: 0 0 0 2px var(--gold) inset, var(--shadow); }
.card-img-wrap { position: relative; height: 200px; background: linear-gradient(135deg, #2c2418, #1a1510); cursor: pointer; }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-fallback { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color: var(--gold); font-size: 48px; opacity:.5; }
.card-rank { position: absolute; top: 10px; left: 10px; background: rgba(21,17,12,.85); border: 1px solid var(--gold); color: var(--gold-bright); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; font-weight: 600; }
.card-natdot { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); }
.card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.card-type { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 4px; }
.card-title { font-size: 21px; color: var(--ink); margin: 0 0 2px; }
.card-gr { color: var(--ink-dim); font-size: 14px; margin-bottom: 10px; }
.card-tagline { color: var(--ink-soft); font-size: 14.5px; font-style: italic; margin-bottom: 14px; }
.card-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; margin-bottom: 12px; }
.card-facts dt { color: var(--ink-dim); }
.card-facts dd { margin: 0; color: var(--ink-soft); }
.card-langs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.lang-tag { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; font-size: 12px; color: var(--ink-soft); }
.card-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft);
  border-radius: 8px; padding: 8px 13px; font-size: 13.5px; cursor: pointer; font-family: inherit;
  transition: all .12s;
}
.btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn-primary { border-color: var(--gold); color: var(--gold-bright); }

.card-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.card-detail[hidden] { display: none; }
.detail-block { margin-bottom: 14px; }
.detail-block h4 { margin: 0 0 5px; color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.detail-block p { margin: 0; color: var(--ink-soft); }
.detail-block ul { margin: 0; padding-left: 18px; color: var(--ink-soft); }
.detail-block li { margin-bottom: 3px; }
.detail-sources a { font-size: 12.5px; margin-right: 10px; }
.acc-warn { color: #e6b277; }

/* ===== Logistica ===== */
.logistics { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.log-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.log-card.full { grid-column: 1 / -1; }
.log-head { padding: 16px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.log-head h3 { margin: 0; font-size: 18px; color: var(--gold-bright); }
.log-head .chev { color: var(--gold); transition: transform .2s; }
.log-card.open .chev { transform: rotate(90deg); }
.log-body { padding: 0 20px 18px; font-size: 14.5px; color: var(--ink-soft); }
.log-body[hidden] { display: none; }
.log-body p { margin: 0 0 10px; }
.log-body table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 13.5px; }
.log-body td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.log-body td:last-child { text-align: right; color: var(--ink); white-space: nowrap; }
.log-sources { font-size: 12px; color: var(--ink-dim); margin-top: 8px; }
.log-sources a { font-size: 12px; }

/* ===== Lightbox ===== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 82vh; border-radius: 8px; box-shadow: var(--shadow); }
.lightbox-cap { color: var(--ink-soft); margin-top: 14px; font-size: 14px; text-align: center; max-width: 700px; }
.lightbox-close { position: absolute; top: 18px; right: 24px; background: none; border: none; color: #fff; font-size: 40px; cursor: pointer; line-height: 1; }

/* ===== Footer ===== */
.site-footer { padding: 40px 0 60px; text-align: center; color: var(--ink-dim); }
.site-footer p { max-width: 800px; margin: 0 auto 10px; }
.tiny { font-size: 12.5px; color: var(--ink-dim); }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .logistics { grid-template-columns: 1fr; }
  .itin-day { flex-direction: column; gap: 4px; }
  .itin-day .d-label { flex-basis: auto; }
  #map { height: 420px; }
  .site-header { padding: 44px 0 30px; }
}
