/* ====================================================================== */
/*  Interactive continent map — wide hit zones over map labels, immediate */
/*  hover tooltips, optional flag overlays, admin coordinate editor.      */
/* ====================================================================== */

.hoe-map{
  /* Flag colors keyed to the terrain types painted on the continent map. */
  --flag-capital:   #c0392b;  /* cities & city-states — bold red */
  --flag-imperial:  #d3a44b;  /* imperial core regions — gold */
  --flag-kingdom:   #e07b39;  /* independent kingdoms — amber */
  --flag-mountains: #7d8a9a;  /* mountain realms — slate */
  --flag-plains:    #b8a050;  /* plains / steppes — khaki */
  --flag-forest:    #3f8d59;  /* ancient elven forests — deep green */
  --flag-desert:    #c79a3e;  /* deserts / Umbra Profunda — sand */
  --flag-sea:       #4a8ba8;  /* sea regions — teal-blue */
  --flag-other:     #a78a4a;  /* fallback */
  --flag-pole:      #1a1208;
  --flag-stroke:    rgba(8, 6, 2, 0.85);
  position: relative;
  display: grid;
  /* Single column by default. Toolbar always spans the full width via
     grid-column: 1 / -1 so the admin panel doesn't reflow it sideways. */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem 1rem;
  margin: 0.6rem 0 1.2rem;
}

.hoe-map.has-admin{
  grid-template-columns: minmax(0, 1fr) 340px;
}

/* ====================================================================== */
/*  Card wrapper — intro + toolbar + map sit inside a single bordered     */
/*  parchment-style block so they read as one cohesive piece.             */
/* ====================================================================== */

.hoe-map-card{
  position: relative;
  margin: 1rem 0 1.6rem;
  padding: 1.1rem 1.1rem 1rem;
  background:
    radial-gradient(ellipse at top, rgba(var(--t-accent-rgb, 201, 162, 39), 0.08), transparent 60%),
    linear-gradient(180deg, rgba(20, 16, 28, 0.65) 0%, rgba(12, 10, 20, 0.7) 100%);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.4);
  border-radius: 14px;
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.hoe-map-card::before{
  /* Decorative inner gold hairline — mimics an illuminated manuscript frame */
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.18);
  border-radius: 10px;
  pointer-events: none;
}

.hoe-map-card__intro{
  position: relative;
  z-index: 1;
  margin-bottom: 0.9rem;
}
.hoe-map-card__title{
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--gold-light);
  margin: 0 0 0.4rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-shadow: 0 0 18px rgba(var(--t-accent-rgb, 201, 162, 39), 0.18);
}
.hoe-map-card__icon{
  font-size: 1.4rem;
  line-height: 1;
}
.hoe-map-card__lead{
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.98rem;
  color: var(--text);
  /* No max-width — lead spans the full card width so wrapping happens
     only at the card's edge, not at an arbitrary character count. */
  margin: 0 0 0.7rem;
  line-height: 1.55;
}
.hoe-map-card__lead strong{ color: var(--gold-light); font-weight: 600; }

/* Link to the standalone map page — rendered inside the toolbar next to
   the toggle buttons when show_full_link is set on the macro. */
.hoe-map-toolbar__open-full{
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  padding: 0.4rem 0.85rem;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: #0d0d1a;
  background: var(--gold);
  border: 1px solid var(--gold-light);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hoe-map-toolbar__open-full:hover,
.hoe-map-toolbar__open-full:focus-visible{
  background: var(--gold-light);
  text-decoration: none;
  transform: translateX(1px);
  color: #0d0d1a;
}
.hoe-map-toolbar__open-full-icon{ font-size: 0.95rem; line-height: 1; }
.hoe-map-toolbar__open-full-arrow{
  font-family: 'Cinzel', serif;
  font-weight: 700;
  transition: transform 0.15s ease;
}
.hoe-map-toolbar__open-full:hover .hoe-map-toolbar__open-full-arrow{
  transform: translateX(2px);
}
@media (max-width: 600px){
  .hoe-map-toolbar__open-full{
    margin-left: 0;
    margin-top: 0.3rem;
    flex-basis: 100%;
    justify-content: center;
  }
}
.hoe-map-card__legend{
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'Crimson Text', Georgia, serif;
}
.hoe-map-card__cta{
  display: flex;
  justify-content: flex-end;
  margin: 0.55rem 0 0;
  position: relative;
  z-index: 1;
}

/* Preview card variant — slightly tighter, used inside /svet lore section */
.hoe-map-card--preview{
  padding: 0.85rem 0.9rem 0.85rem;
}
.hoe-map-card--preview .hoe-map-card__title{ font-size: 1.1rem; }
.hoe-map-card--preview .hoe-map-card__lead{ font-size: 0.92rem; }
.hoe-map-card--preview::before{ inset: 5px; border-radius: 9px; }

/* When the card wraps the map, drop the map's own outer margin so it
   doesn't double-space inside the card. */
.hoe-map-card .hoe-map{
  margin: 0;
  position: relative;
  z-index: 1;
}

/* ====================================================================== */
/*  Toolbar (toggles above the map)                                        */
/* ====================================================================== */

.hoe-map-toolbar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hoe-map-toggle{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem 0.35rem 0.55rem;
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.45);
  background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.06);
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.hoe-map-toggle:hover{
  background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.14);
  color: var(--gold-light);
  border-color: rgba(var(--t-accent-rgb, 201, 162, 39), 0.7);
}
.hoe-map-toggle[aria-pressed="true"]{
  background: var(--gold);
  color: #0d0d1a;
  border-color: var(--gold-light);
  box-shadow: 0 0 12px rgba(255, 217, 122, 0.25);
}
.hoe-map-toggle__box{
  display: inline-block;
  width: 14px; height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
  flex: 0 0 auto;
}
.hoe-map-toggle[aria-pressed="true"] .hoe-map-toggle__box::after{
  content: "✓";
  position: absolute;
  left: 1px; top: -4px;
  font-size: 13px;
  line-height: 1;
  font-family: 'Cinzel', serif;
  font-weight: 700;
}
.hoe-map-toolbar__hint{
  margin-left: auto;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.85rem;
}

/* ====================================================================== */
/*  Map stage + image                                                      */
/* ====================================================================== */

.hoe-map__stage{
  position: relative;
  width: 100%;
  border-radius: var(--t-card-radius, 10px);
  overflow: hidden;
  background: var(--bg-deep);
  box-shadow: 0 6px 30px rgba(0,0,0,0.55);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.25);
  user-select: none;
  isolation: isolate;
}

.hoe-map__image{
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.hoe-map__markers{
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ====================================================================== */
/*  Hit zone (wide, mostly invisible — sits over the painted label)        */
/* ====================================================================== */

.hoe-map__marker{
  position: absolute;
  /* (x, y) marks the centre of the label */
  transform: translate(-50%, -50%);
  /* width comes from inline --w (%), height stays small */
  width: var(--w, 8%);
  height: 22px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  border-radius: 4px;
}
.hoe-map__marker:focus{ outline: none; }

/* Subtle reddish frame on hover — visible against the parchment map, but
   gentle enough not to swamp the label underneath. */
.hoe-map__marker:hover,
.hoe-map__marker:focus-visible,
.hoe-map__marker.is-active{
  background: rgba(180, 60, 50, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(220, 90, 70, 0.75),
    0 0 14px rgba(180, 60, 50, 0.28);
}

/* ====================================================================== */
/*  Flag overlay (only when "symbols" toggle is on)                        */
/* ====================================================================== */

.hoe-map__marker-flag{
  position: absolute;
  /* Anchored at the left-centre of the hit zone, pointing right.
     Hidden by default — only painted when .has-symbols flag is set. */
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  display: none;
}
.hoe-map.has-symbols .hoe-map__marker-flag{ display: block; }

.hoe-map__marker-pole{
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 2px;
  background: var(--flag-pole);
  border-radius: 1px;
  box-shadow: 0 0 0 0.5px var(--flag-stroke);
}
.hoe-map__marker-pennant{
  position: absolute;
  left: 3px;
  top: 4px;
  width: 0;
  height: 0;
  border-left: 11px solid var(--flag-color, var(--flag-other));
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6));
}
.hoe-map__marker[data-importance="legendary"] .hoe-map__marker-flag{
  width: 22px; height: 20px;
}
.hoe-map__marker[data-importance="legendary"] .hoe-map__marker-pennant{
  border-left-width: 13px;
  border-top-width: 5px;
  border-bottom-width: 5px;
}

.hoe-map__marker[data-kind="capital"]   { --flag-color: var(--flag-capital); }
.hoe-map__marker[data-kind="imperial"]  { --flag-color: var(--flag-imperial); }
.hoe-map__marker[data-kind="kingdom"]   { --flag-color: var(--flag-kingdom); }
.hoe-map__marker[data-kind="mountains"] { --flag-color: var(--flag-mountains); }
.hoe-map__marker[data-kind="plains"]    { --flag-color: var(--flag-plains); }
.hoe-map__marker[data-kind="forest"]    { --flag-color: var(--flag-forest); }
.hoe-map__marker[data-kind="desert"]    { --flag-color: var(--flag-desert); }
.hoe-map__marker[data-kind="sea"]       { --flag-color: var(--flag-sea); }

.hoe-map.has-symbols .hoe-map__marker:hover .hoe-map__marker-flag,
.hoe-map.has-symbols .hoe-map__marker.is-active .hoe-map__marker-flag{
  transform: translateY(-50%) scale(1.2);
}

/* ====================================================================== */
/*  Tooltip — fixed-positioned in <body> so it overflows the stage        */
/* ====================================================================== */

.hoe-map-tip{
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  max-width: 320px;
  padding: 0.7rem 0.85rem 0.8rem;
  background: linear-gradient(180deg, rgba(20,16,28,0.97) 0%, rgba(12,10,20,0.97) 100%);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.55);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6), 0 0 18px rgba(var(--t-accent-rgb, 201, 162, 39), 0.2);
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.45;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0s linear 0.14s;
  /* tail position controlled via CSS var set inline by JS */
  --tail-left: 50%;
}
.hoe-map-tip.is-visible{
  opacity: 1;
  visibility: visible;
  transition: opacity 0.14s ease;
}
.hoe-map-tip::after{
  content: "";
  position: absolute;
  left: var(--tail-left);
  bottom: -7px;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: rgba(12,10,20,0.97);
  border-right: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.55);
  border-bottom: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.55);
}
.hoe-map-tip.is-below::after{
  top: -7px; bottom: auto;
  border-right: 0; border-bottom: 0;
  border-left: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.55);
  border-top: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.55);
}

.hoe-map-tip__close{
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.hoe-map-tip__close:hover{
  background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.18);
  color: var(--gold-light);
}
.hoe-map-tip__title{
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold-light);
  margin: 0 0 0.25rem;
  padding-right: 1.5rem;  /* room for the close button */
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.03em;
}
.hoe-map-tip__icon{ font-size: 1.05rem; line-height: 1; }
.hoe-map-tip__icon:empty{ display: none; }
.hoe-map-tip__meta{
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}
.hoe-map-tip__meta:empty{ display: none; margin-bottom: 0; }
.hoe-map-tip__desc{
  margin: 0 0 0.55rem;
  color: var(--text);
}
.hoe-map-tip__cta{
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: #0d0d1a;
  background: var(--gold);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--gold-light);
  text-decoration: none;
  transition: background 0.15s ease;
}
.hoe-map-tip__cta:hover{ background: var(--gold-light); }

/* ====================================================================== */
/*  Legend (full-page map only)                                            */
/* ====================================================================== */

.lore-map__legend{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.hoe-map__legend-item{
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.hoe-map__legend-pennant{
  display: inline-block;
  width: 0; height: 0;
  border-left: 11px solid var(--flag-other);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}
.hoe-map__legend-pennant--capital   { border-left-color: var(--flag-capital); }
.hoe-map__legend-pennant--imperial  { border-left-color: var(--flag-imperial); }
.hoe-map__legend-pennant--kingdom   { border-left-color: var(--flag-kingdom); }
.hoe-map__legend-pennant--mountains { border-left-color: var(--flag-mountains); }
.hoe-map__legend-pennant--plains    { border-left-color: var(--flag-plains); }
.hoe-map__legend-pennant--forest    { border-left-color: var(--flag-forest); }
.hoe-map__legend-pennant--desert    { border-left-color: var(--flag-desert); }
.hoe-map__legend-pennant--sea       { border-left-color: var(--flag-sea); }

/* ====================================================================== */
/*  Preview embed (inside /svet 'continent' section)                       */
/* ====================================================================== */

.hoe-map--preview .hoe-map__stage{
  border-radius: var(--t-section-radius, 8px);
}
.hoe-map__preview-footer{
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}
.hoe-map__preview-link{
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.hoe-map__preview-link:hover{ color: var(--gold-light); }

/* ====================================================================== */
/*  Admin coordinate editor (?admin=1)                                     */
/* ====================================================================== */

.hoe-map--admin .hoe-map__stage{
  cursor: crosshair;
}

.hoe-map--admin .hoe-map__marker{
  background: rgba(232, 196, 74, 0.18);
  box-shadow: inset 0 0 0 1px rgba(232, 196, 74, 0.65);
}
.hoe-map--admin .hoe-map__marker.is-dirty{
  background: rgba(255, 217, 122, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 217, 122, 0.9);
}
.hoe-map--admin .hoe-map__marker:hover,
.hoe-map--admin .hoe-map__marker:focus-visible,
.hoe-map--admin .hoe-map__marker.is-active{
  /* Admin keeps the gold frame so coordinate work stays readable */
  background: rgba(232, 196, 74, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(255, 217, 122, 0.9),
    0 0 12px rgba(255, 217, 122, 0.25);
}

/* Live drag preview shown while the admin draws a hit zone */
.hoe-map__drag-preview{
  position: absolute;
  background: rgba(255, 217, 122, 0.2);
  border: 1px dashed rgba(255, 217, 122, 0.9);
  pointer-events: none;
  z-index: 5;
  border-radius: 4px;
}

.hoe-map__crosshair{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.hoe-map__crosshair-x,
.hoe-map__crosshair-y{
  position: absolute;
  background: rgba(232, 196, 74, 0.6);
  pointer-events: none;
}
.hoe-map__crosshair-x{ left: 0; right: 0; height: 1px; }
.hoe-map__crosshair-y{ top: 0; bottom: 0; width: 1px; }
.hoe-map__crosshair-readout{
  position: absolute;
  background: rgba(12,10,20,0.92);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.6);
  padding: 0.2rem 0.45rem;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--gold-light);
  border-radius: 4px;
  transform: translate(10px, 10px);
  white-space: nowrap;
}

.hoe-map__admin[hidden]{ display: none !important; }
.hoe-map__admin{
  /* Sticks alongside the map as the user scrolls — keeps the list reachable
     while clicking deep into the map. */
  position: sticky;
  top: 1rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #12121e);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.35);
  border-radius: 8px;
  padding: 0.6rem 0.6rem 0.55rem;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}
.hoe-map__admin-header{
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-bottom: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.25);
  padding-bottom: 0.45rem;
  margin-bottom: 0.4rem;
}
.hoe-map__admin-header strong{
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
}
.hoe-map__admin-hint{
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
}
.hoe-map__admin-search{
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.35);
  border-radius: 5px;
  padding: 0.3rem 0.55rem;
  width: 100%;
  margin-top: 0.15rem;
  outline: none;
}
.hoe-map__admin-search:focus{
  border-color: rgba(var(--t-accent-rgb, 201, 162, 39), 0.85);
  background: rgba(0, 0, 0, 0.55);
}
.hoe-map__admin-search::placeholder{
  color: var(--text-dim);
  font-style: italic;
}
.hoe-map__admin-counter{
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: monospace;
  letter-spacing: 0.04em;
}
.hoe-map__admin-status{
  min-height: 1.1em;
  font-size: 0.78rem;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
}
.hoe-map__admin-status.is-error{ color: #e87a5f; }
.hoe-map__admin-status.is-ok{ color: #6dbf7c; }

.hoe-map__admin-list{
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.15);
  border-radius: 6px;
}
.hoe-map__admin-row{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.5rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.08);
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--text);
}
.hoe-map__admin-row[hidden]{ display: none; }
.hoe-map__admin-row:last-child{ border-bottom: 0; }
.hoe-map__admin-row:hover{ background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.08); }
.hoe-map__admin-row.is-selected{
  background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.18);
  outline: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.55);
}
.hoe-map__admin-row.is-placed::before{
  content: "●";
  color: var(--gold-light);
  margin-right: 0.25rem;
  font-size: 0.7rem;
}
.hoe-map__admin-row.is-unplaced::before{
  content: "○";
  color: var(--text-dim);
  margin-right: 0.25rem;
  font-size: 0.7rem;
}
.hoe-map__admin-row.is-dirty{
  background: rgba(255, 217, 122, 0.15);
}
.hoe-map__admin-row--sub{
  padding-left: 1.4rem;
  background: rgba(255, 255, 255, 0.015);
}
.hoe-map__admin-row--sub .hoe-map__admin-name{
  font-size: 0.8rem;
  color: var(--text-muted);
}
.hoe-map__admin-row--sub .hoe-map__admin-name::before{
  content: "↳ ";
  color: var(--text-dim);
  margin-right: 0.15rem;
}
.hoe-map__admin-coords{
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hoe-map__admin-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  border-top: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.25);
  padding-top: 0.5rem;
}
.hoe-map__btn{
  flex: 1 1 auto;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  background: var(--gold);
  color: #0d0d1a;
  border: 1px solid var(--gold-light);
  border-radius: 5px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.hoe-map__btn:hover{ background: var(--gold-light); }
.hoe-map__btn--ghost{
  background: transparent;
  color: var(--gold-light);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.5);
}
.hoe-map__btn--ghost:hover{
  background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.15);
}
.hoe-map__btn:disabled{ opacity: 0.45; cursor: not-allowed; }

/* ====================================================================== */
/*  Standalone map page (/svet/mapa)                                       */
/*    - Hero band (title + lead + toggles) spans the full container width  */
/*    - Below: map on the left, type-of-territory navigation on the right  */
/*    - Container is centered with a left margin large enough that the     */
/*      floating ko-fi tab (position: fixed; left: 0) sits next to it      */
/*      without overlapping the map.                                       */
/* ====================================================================== */

.lore-content--map{
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
}

/* ── Hero band ── */
.map-hero{
  margin: 0.7rem 0 1rem;
  padding: 1.1rem 1.3rem;
  background:
    radial-gradient(ellipse at top, rgba(var(--t-accent-rgb, 201, 162, 39), 0.1), transparent 65%),
    linear-gradient(180deg, rgba(20, 16, 28, 0.7) 0%, rgba(12, 10, 20, 0.78) 100%);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.4);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  position: relative;
}
.map-hero::before{
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.16);
  border-radius: 8px;
  pointer-events: none;
}
.map-hero__text{ position: relative; z-index: 1; }
.map-hero__title{
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  color: var(--gold-light);
  margin: 0 0 0.4rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-shadow: 0 0 18px rgba(var(--t-accent-rgb, 201, 162, 39), 0.2);
}
.map-hero__icon{ font-size: 1.4rem; line-height: 1; }
.map-hero__lead{
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1rem;
  color: var(--text);
  /* No max-width — let the description span the full hero card width so
     it collapses to fewer line-wraps and frees more vertical space for
     the map below. */
  margin: 0 0 0.7rem;
  line-height: 1.55;
}
.map-hero__lead strong{ color: var(--gold-light); font-weight: 600; }
.map-hero .hoe-map-toolbar{ margin-top: 0.3rem; }

/* ── Body: map + side nav ── */
.map-body{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
@media (min-width: 1100px){
  .map-body{
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
  /* The MAP is sticky — it stays in view while the user scrolls through
     the (potentially tall) type navigation on the right, so hovering a
     nav item highlights a marker that's still on screen rather than
     scrolling the page back to the top. We cap the stage at 70vh (a hair
     under 3/4 viewport) so it ALSO fits below the page hero before the
     user has scrolled past it — without that cap the natural image
     height clips at the viewport bottom at-rest. Image is 1600x1000
     (continent.webp). */
  .map-body > .hoe-map{
    position: sticky;
    /* Site navbar is sticky at top:0 and ~59px tall — sticking the map
       any higher would slide its top behind the navbar (the compass and
       "Zmrzlé kameny" label get clipped). 4.5rem (72px) clears the
       navbar with ~13px breathing room. */
    top: 4.5rem;
    align-self: start;
  }
  .map-body > .hoe-map .hoe-map__stage{
    /* MUST match the natural ratio of continent.webp (1448 × 1086) so the
       marker % coordinates land on the right pixels — if stage and image
       ratios diverge, the image either letterboxes or overflows and all
       markers visually shift. */
    aspect-ratio: 1448 / 1086;
    /* Reserve the navbar offset (4.5rem) + bottom breathing room
       (~5rem). The map fills the remaining viewport at the most
       readable size. */
    max-height: calc(100vh - 10rem);
    width: auto;
    max-width: 100%;
    margin: 0 auto;
  }
  /* Nav flows naturally — page scrolls when its categories grow long.
     The hover-spill on truncated sub-location labels still extends past
     the panel edge unimpeded. */
  .hoe-map-nav{
    position: static;
  }
}

/* ── Type-of-territory navigation panel ── */
.hoe-map-nav{
  background: var(--bg-card, #12121e);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.35);
  border-radius: 10px;
  padding: 0.85rem 0.75rem 0.55rem;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}
.hoe-map-nav__title{
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}
.hoe-map-nav__hint{
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.22);
}

.hoe-map-nav__cat{
  margin: 0 0 0.15rem;
  border-bottom: 1px dashed rgba(var(--t-accent-rgb, 201, 162, 39), 0.12);
}
.hoe-map-nav__cat:last-child{ border-bottom: 0; }
.hoe-map-nav__cat[open] .hoe-map-nav__cat-toggle{ color: var(--gold-light); }

.hoe-map-nav__cat-toggle{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.35rem;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  user-select: none;
  border-radius: 4px;
  transition: background 0.12s ease, color 0.12s ease;
}
.hoe-map-nav__cat-toggle::-webkit-details-marker{ display: none; }
.hoe-map-nav__cat-toggle::before{
  content: "▸";
  display: inline-block;
  width: 0.8rem;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}
.hoe-map-nav__cat[open] .hoe-map-nav__cat-toggle::before{ transform: rotate(90deg); }
.hoe-map-nav__cat-toggle:hover{
  background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.08);
  color: var(--gold-light);
}
.hoe-map-nav__cat-label{ flex: 1 1 auto; }
.hoe-map-nav__cat-count{
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(var(--t-accent-rgb, 201, 162, 39), 0.08);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.22);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

.hoe-map-nav__locs{
  list-style: none;
  margin: 0.15rem 0 0.55rem;
  padding: 0 0 0 1.4rem;
}
.hoe-map-nav__loc{
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 0.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: 5px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.3;
  transition: background 0.12s ease, color 0.12s ease;
}
.hoe-map-nav__loc:hover,
.hoe-map-nav__loc:focus-visible,
.hoe-map-nav__loc.is-active{
  background: rgba(180, 60, 50, 0.16);
  outline: none;
  color: var(--gold-light);
  text-decoration: none;
}
/* Truncate the inline label with ellipsis; on hover spill the full text
   over the right edge of the nav so the player can still read it. */
.hoe-map-nav__loc-text{
  font-family: 'Crimson Text', Georgia, serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.hoe-map-nav__loc:hover .hoe-map-nav__loc-text,
.hoe-map-nav__loc:focus-visible .hoe-map-nav__loc-text{
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 2.2rem 0 0.45rem;
  background: linear-gradient(90deg, var(--bg-card, #12121e) 0%, var(--bg-card, #12121e) 60%, var(--bg-card, #12121e) 100%);
  border: 1px solid rgba(var(--t-accent-rgb, 201, 162, 39), 0.55);
  border-radius: 5px;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.45);
  z-index: 10;
  overflow: visible;
  white-space: nowrap;
  width: auto;
  max-width: calc(100vw - 1rem);
  color: var(--gold-light);
}
.hoe-map-nav__loc--sub .hoe-map-nav__loc-text{
  color: var(--text-muted);
  font-size: 0.82rem;
}
.hoe-map-nav__loc--sub .hoe-map-nav__loc-text::before{
  content: "↳ ";
  color: var(--text-dim);
  margin-right: 0.1rem;
}
.hoe-map-nav__loc:hover .hoe-map-nav__loc--sub .hoe-map-nav__loc-text,
.hoe-map-nav__loc--sub:hover .hoe-map-nav__loc-text{
  color: var(--gold-light);
}
.hoe-map-nav__loc-arrow{
  font-family: 'Cinzel', serif;
  color: var(--gold);
  opacity: 0.55;
  font-size: 0.85rem;
  transition: transform 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}
.hoe-map-nav__loc:hover .hoe-map-nav__loc-arrow,
.hoe-map-nav__loc:focus-visible .hoe-map-nav__loc-arrow{
  opacity: 1;
  color: var(--gold-light);
  transform: translateX(2px);
}

/* ── Map marker highlight (driven by nav hover) ── */
.hoe-map__marker.is-highlighted{
  background: rgba(232, 196, 74, 0.32);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 217, 122, 0.95),
    0 0 18px rgba(255, 217, 122, 0.55);
  z-index: 4;
}
.hoe-map__marker.is-highlighted::after{
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 8px;
  border: 2px solid rgba(255, 217, 122, 0.85);
  animation: hoe-map-highlight-pulse 1.4s ease-out infinite;
  pointer-events: none;
}
@keyframes hoe-map-highlight-pulse{
  0%   { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce){
  .hoe-map__marker.is-highlighted::after{ animation: none; opacity: 0.5; }
}

/* ====================================================================== */
/*  Responsive                                                             */
/* ====================================================================== */

@media (max-width: 900px){
  .hoe-map.has-admin{
    grid-template-columns: minmax(0, 1fr);
  }
  .hoe-map__admin{ max-height: 360px; }
}
@media (max-width: 600px){
  .hoe-map-tip{ font-size: 0.85rem; max-width: 240px; }
  .hoe-map-toolbar{ font-size: 0.72rem; }
  .hoe-map-toolbar__hint{ display: none; }
}
