/* =====================================================================
   Découvrir Sétif — interactive city map (page-templates/template-setif.php)
   The layer (base map + labels + drawings) is panned and zoomed as one;
   labels and drawings are scaled back by --pz so they keep their size.
   ===================================================================== */

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sx-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* category colours (fills only ever carry night text) */
.c-patrimoine     { --c: var(--orange); }
.c-memoire        { --c: var(--night); }
.c-culture        { --c: var(--blue); }
.c-foi            { --c: #3BA57A; }
.c-nature-loisirs { --c: var(--green); }
.c-sport          { --c: var(--yellow); }
.c-ville          { --c: #8B91A8; }

.sx-hero { padding-bottom: 28px; }
.sx { padding: 30px 0 24px; }
.sx-tools { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(11, 12, 38, .12); }
.chip.is-on .sx-dot { box-shadow: 0 0 0 1.5px #fff; }

/* ---------------------------------------------------------------- stage */
.sx-stage { position: relative; margin-top: 22px; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: #F3EEE3; }
.sx-map { position: relative; height: clamp(460px, 74vh, 800px); overflow: hidden; cursor: grab; touch-action: none; outline: none; user-select: none; -webkit-user-select: none; }
.sx-map:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }
.sx-map.is-drag { cursor: grabbing; }
.sx-layer { position: absolute; left: 0; top: 0; width: var(--lw, 100%); transform-origin: 0 0; --pz: 1; } /* no will-change: the browser then redraws the vector map sharp at every zoom */
.sx-layer.is-anim { transition: transform .55s var(--ease); }
.sx-base { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }

/* district names */
.sx-lab {
  position: absolute; z-index: 1; transform: translate(-50%, -50%) scale(var(--pz)); pointer-events: none; white-space: nowrap;
  font: 600 11.5px/1 var(--text); letter-spacing: .16em; text-transform: uppercase; color: rgba(11, 12, 38, .52);
  text-shadow: 0 0 2px #F3EEE3, 0 0 4px #F3EEE3, 0 0 8px #F3EEE3;
}
.sx-lab--major { font: 800 17px/1 var(--display); letter-spacing: -.01em; text-transform: none; color: var(--night); }
.sx-lab--nature { font-style: italic; letter-spacing: .02em; text-transform: none; font-size: 13px; color: #3F7A22; }
.sx-lab[dir="rtl"] { letter-spacing: 0; text-transform: none; font-size: 13px; }
.sx-lab--major[dir="rtl"] { font: 400 19px/1 var(--ar-display); }

/* the Park Mall */
.sx-mall { position: absolute; z-index: 1; display: flex; align-items: center; gap: 8px; transform: translate(-23px, -50%) scale(var(--pz)); transform-origin: 23px 50%; text-decoration: none; }
.sx-mall-ic { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--night), 0 8px 18px rgba(11, 12, 38, .26); }
.sx-mall-ic img { width: 32px; height: 32px; }
.sx-mall-ic::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--night); animation: sx-halo 2.6s var(--ease) infinite; }
.sx-mall-t { padding: 7px 11px; border-radius: var(--r-pill); background: var(--night); color: #fff; font: 600 12.5px/1 var(--text); white-space: nowrap; }
@keyframes sx-halo { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }

/* places */
.sx-pin {
  position: absolute; z-index: 2; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: #fff; color: var(--night);
  box-shadow: 0 0 0 2.5px var(--c), 0 6px 16px rgba(11, 12, 38, .2);
  transform: translate(-50%, -50%) scale(var(--pz)); transition: box-shadow var(--t-ui) var(--ease), opacity var(--t-ui) var(--ease);
}
.sx-pin-ic { display: grid; place-items: center; width: 40px; height: 40px; transition: transform var(--t-ui) var(--ease); }
.sx-pin-ic svg { width: 40px; height: 40px; overflow: visible; }
.sx-pin-n {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--night); color: #fff; font: 700 11px/20px var(--text); text-align: center; box-shadow: 0 0 0 2px #fff;
}
.sx-pin-t {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 6px 10px; border-radius: var(--r-pill);
  background: #fff; color: var(--night); font: 600 12.5px/1.1 var(--text); white-space: nowrap; box-shadow: 0 4px 14px rgba(11, 12, 38, .16);
  opacity: 0; pointer-events: none; transition: opacity var(--t-ui) var(--ease);
}
.sx-pin:hover, .sx-pin:focus-visible, .sx-pin.is-on { z-index: 5; box-shadow: 0 0 0 4px var(--c), 0 10px 24px rgba(11, 12, 38, .28); outline: none; }
.sx-pin:hover .sx-pin-ic, .sx-pin.is-on .sx-pin-ic { transform: scale(1.12) translateY(-1px); }
.sx-pin:hover .sx-pin-t, .sx-pin:focus-visible .sx-pin-t, .sx-pin.is-on .sx-pin-t { opacity: 1; }
.sx-pin.is-off { opacity: .16; pointer-events: none; }
[dir="rtl"] .sx-pin-t { font-weight: 700; }

/* grouped places ("n lieux"), opened by zooming in */
.sx-pin.is-hid { display: none; }
.sx-cluster {
  position: absolute; z-index: 2; width: 62px; height: 62px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 3px var(--night), 0 0 0 7px rgba(255, 255, 255, .85), 0 8px 22px rgba(11, 12, 38, .26);
  transform: translate(-50%, -50%) scale(var(--pz)); transition: box-shadow var(--t-ui) var(--ease);
}
.sx-cluster-ic { display: flex; align-items: center; }
.sx-cluster-ic svg { width: 30px; height: 30px; }
.sx-cluster-ic svg + svg { margin-left: -9px; }
.sx-cluster-n { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--night); color: #fff; font: 700 12.5px/24px var(--text); text-align: center; box-shadow: 0 0 0 2px #fff; }
.sx-cluster:hover, .sx-cluster:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--night), 0 0 0 7px var(--yellow), 0 10px 26px rgba(11, 12, 38, .3); }
.sx-cluster:hover .sx-pin-t, .sx-cluster:focus-visible .sx-pin-t { opacity: 1; }

/* zoom, legend, hint */
.sx-zoom { position: absolute; z-index: 8; top: 16px; right: 16px; display: flex; flex-direction: column; border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(11, 12, 38, .16); overflow: hidden; }
.sx-zoom button { width: 46px; height: 46px; border: 0; background: #fff; color: var(--night); font: 500 24px/1 var(--text); cursor: pointer; display: grid; place-items: center; }
.sx-zoom button + button { border-top: 1px solid var(--line); }
.sx-zoom button:hover { background: var(--stone); }
.sx-zoom .ico { width: 20px; height: 20px; }
.sx-legend { position: absolute; z-index: 6; left: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .92); font: 500 12.5px/1 var(--text); color: var(--ink-2); pointer-events: none; }
.sx-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sx-legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid; border-radius: 2px; }
.sx-legend .lg-tram { border-color: var(--orange); }
.sx-legend .lg-road { border-color: var(--yellow); }
.sx-legend .lg-green { width: 14px; height: 10px; border: 0; background: #C9DEB0; }
.sx-hint { position: absolute; z-index: 9; left: 50%; bottom: 70px; margin: 0; padding: 9px 15px; border-radius: var(--r-pill); background: rgba(11, 12, 38, .86); color: #fff; font: 500 13px/1 var(--text); transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .3s; }
.sx-hint.is-show { opacity: 1; }
.sx-credit { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }
.sx-credit a { color: inherit; }

/* story panel */
.sx-panel {
  position: absolute; z-index: 10; top: 16px; left: 16px; width: min(390px, calc(100% - 96px)); max-height: calc(100% - 32px); overflow: auto;
  padding: 26px 26px 24px; border-radius: 14px; background: #fff; box-shadow: 0 22px 50px rgba(11, 12, 38, .24);
  animation: sx-in .45s var(--ease);
}
@keyframes sx-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.sx-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--stone); color: var(--night); cursor: pointer; display: grid; place-items: center; }
.sx-panel[dir="rtl"] .sx-close { right: auto; left: 12px; }
.sx-close:hover { background: var(--sand); }
.sx-close .ico { width: 18px; height: 18px; }
.sx-pv-art { position: relative; width: 132px; height: 132px; border-radius: 50%; background: var(--stone); display: grid; place-items: center; box-shadow: inset 0 0 0 3px var(--c); }
.sx-pv-art svg { width: 100px; height: 100px; }
.sx-pv-art b { position: absolute; top: 4px; right: 4px; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 14px; background: var(--night); color: #fff; font: 700 13px/28px var(--text); text-align: center; }
.sx-panel h3 { margin-top: 16px; }
.sx-panel .sx-story { max-height: none; }

/* --------------------------------------------------------------- the list */
.sx-cards { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sx-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 22px; align-items: start; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: #fff; scroll-margin-top: 120px; transition: box-shadow var(--t-ui) var(--ease); }
.sx-card.is-off { display: none; }
.sx-card.is-hl { box-shadow: 0 0 0 2px var(--night); }
.sx-card-art { position: relative; width: 96px; height: 96px; border-radius: 50%; background: var(--stone); display: grid; place-items: center; box-shadow: inset 0 0 0 2.5px var(--c); }
.sx-card-art svg { width: 70px; height: 70px; }
.sx-card-art b { position: absolute; top: -2px; right: -2px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--night); color: #fff; font: 700 12.5px/26px var(--text); text-align: center; box-shadow: 0 0 0 2px #fff; }
.sx-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 10px; }
.sx-meta .tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.sx-date { font: 700 13.5px/1 var(--text); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sx-story { margin: 10px 0 0; color: var(--ink-2); }
.sx-act { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 0; }
.sx-km { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: auto; font-size: 13.5px; color: var(--ink-3); }
.sx-km .ico { width: 16px; height: 16px; }

@media (max-width: 1000px) {
  .sx-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sx-map { height: 68vh; min-height: 420px; }
  .sx-stage { margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .sx-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 64%; padding: 20px; animation-name: sx-up; }
  @keyframes sx-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
  .sx-pv-art { width: 92px; height: 92px; }
  .sx-pv-art svg { width: 70px; height: 70px; }
  .sx-legend { display: none; }
  .sx-zoom { top: 10px; right: 10px; }
  .sx-card { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 18px; }
  .sx-card-art { width: 64px; height: 64px; }
  .sx-card-art svg { width: 48px; height: 48px; }
  .sx-pin { width: 44px; height: 44px; }
  .sx-pin-ic, .sx-pin-ic svg { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-mall-ic::after { animation: none; }
  .sx-layer.is-anim { transition: none; }
  .sx-panel { animation: none; }
}
