/* TIM Theme — V4 public components (map, data explorer, mobile shell, low-data mode, consent, sharing).
   One file for both directions: logical properties only (inline-start/end), so RTL needs no copy. */

/* ---------- Map v2 ---------- */
:root{--map-0:#E9EDEB;--map-1:#F3D6D3;--map-2:#E6A8A2;--map-3:#CF7068;--map-4:#A9352E;--map-5:#6D0F11;--map-stroke:#fff;--map-town:#0B3B2E;--map-town-ring:#fff}
[data-bs-theme=dark]{--map-0:#18231F;--map-1:#3A2220;--map-2:#5E2D29;--map-3:#8E3A33;--map-4:#C24E43;--map-5:#F07A6E;--map-stroke:#0A1511;--map-town:#F2E6C9;--map-town-ring:#0A1511}
.map2{display:block;width:100%;height:auto;max-height:78vh;touch-action:manipulation}
.map2 .prov{fill:var(--map-0);stroke:var(--map-stroke);stroke-width:calc(1.2px * var(--s,1));stroke-linejoin:round;transition:fill .2s,opacity .2s}
.map2 .lvl-1{fill:var(--map-1)}.map2 .lvl-2{fill:var(--map-2)}.map2 .lvl-3{fill:var(--map-3)}.map2 .lvl-4{fill:var(--map-4)}.map2 .lvl-5{fill:var(--map-5)}
.map2 .prov.is-dim{opacity:.35}
.map2 .prov.is-active{fill:var(--map-1);stroke:var(--bs-body-color);stroke-width:calc(2px * var(--s,1))}
.map2 a:hover .prov,.map2 a:focus .prov{stroke:var(--bs-body-color);stroke-width:calc(2px * var(--s,1))}
.map2 a:focus{outline:none}
.map2 a:focus-visible .prov,.map2 a:focus-visible .town{stroke:var(--bs-focus-ring-color,#0B3B2E);stroke-width:calc(3px * var(--s,1))}
.map2 .town{fill:var(--map-5);fill-opacity:.85;stroke:var(--map-town-ring);stroke-width:calc(1px * var(--s,1))}
.map2 a:hover .town{fill-opacity:1}
.map2-legend span{display:inline-block;width:1rem;height:.7rem;border-radius:2px;vertical-align:middle}
.map2-legend .lvl-1{background:var(--map-1)}.map2-legend .lvl-2{background:var(--map-2)}.map2-legend .lvl-3{background:var(--map-3)}.map2-legend .lvl-4{background:var(--map-4)}.map2-legend .lvl-5{background:var(--map-5)}
.map2-faces{display:flex;flex-wrap:wrap;gap:.35rem}
.map2-faces img{width:56px;height:56px;object-fit:cover;border-radius:.375rem;background:var(--tim-tint)}
.map2-towns{max-height:22rem;overflow:auto;padding-inline-end:.25rem}
.map2-table td,.map2-table th{white-space:nowrap}
[data-map2].is-loading .map2-figure{opacity:.6;transition:opacity .15s}
@media (prefers-reduced-motion:reduce){.map2 .prov{transition:none}}

/* ---------- Figure deck: grid on wide screens, swipe strip on phones ---------- */
.deck-track{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.75rem;outline:none}
.deck-track:focus-visible{box-shadow:0 0 0 .2rem var(--bs-focus-ring-color,rgba(11,59,46,.35));border-radius:.375rem}
.deck-nav{display:flex;align-items:center;justify-content:flex-end;gap:.5rem;margin-top:.5rem}
.deck-nav .btn{min-width:2.75rem;min-height:2.75rem}
[dir=rtl] .deck-nav .icon{transform:scaleX(-1)}
@media (max-width:767.98px){
  .deck-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:.25rem;scroll-padding-inline:0}
  .deck-track::-webkit-scrollbar{display:none}
  .deck-item{flex:0 0 42%;scroll-snap-align:start}
  .deck-nav:not([hidden]){display:flex}
}
@media (max-width:359.98px){.deck-item{flex-basis:46%}}
@media (min-width:768px){.deck-nav{display:none !important}}

/* ---------- Mobile shell: bottom bar and "More" sheet ---------- */
.tim-bottom-nav{position:fixed;inset-inline:0;bottom:0;z-index:1030;display:flex;background:var(--tim-surface,#fff);border-top:1px solid var(--bs-border-color);padding-bottom:env(safe-area-inset-bottom)}
.tim-bottom-nav a{flex:1 1 0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.1rem;min-height:3.4rem;padding:.35rem .1rem;font-size:.72rem;line-height:1.1;color:var(--bs-secondary-color);text-decoration:none;text-align:center}
.tim-bottom-nav a .icon{width:1.35rem;height:1.35rem}
.tim-bottom-nav a.is-on,.tim-bottom-nav a:hover{color:var(--bs-emphasis-color)}
.tim-bottom-nav a.is-on .icon{color:#8c1015}
@media (max-width:767.98px){body{padding-bottom:calc(3.6rem + env(safe-area-inset-bottom))}}
.tim-sheet.offcanvas-bottom{height:auto;max-height:80vh;border-top-left-radius:1rem;border-top-right-radius:1rem}
.tim-sheet-links{display:grid;grid-template-columns:1fr 1fr;gap:.25rem .75rem;margin-bottom:.75rem}
.tim-sheet-links a{display:block;padding:.55rem .25rem;text-decoration:none}
.btn-link-foot{background:none;border:0;padding:0;color:inherit;text-decoration:underline;font:inherit}

/* ---------- Low Data mode (اینترنت کم‌مصرف): text first, photos on request, no motion ---------- */
html[data-lowdata="1"] .pc-photo img,html[data-lowdata="1"] [data-lowdata-defer]:not(.is-shown),html[data-lowdata="1"] .lowdata-hide{display:none !important}
html[data-lowdata="1"] *,html[data-lowdata="1"] *::before,html[data-lowdata="1"] *::after{animation:none !important;transition:none !important;scroll-behavior:auto !important}
.lowdata-show-photo{display:none}
html[data-lowdata="1"] .lowdata-show-photo{display:inline-flex}
[data-lowdata-toggle][aria-pressed=true]{background:var(--tim-tint);font-weight:600}

/* ---------- Consent banner (§35): small, bottom, never blocks reading ---------- */
.tim-consent{position:fixed;inset-inline:0;bottom:0;z-index:1040;background:var(--tim-surface,#fff);border-top:2px solid #8c1015;box-shadow:0 -4px 16px rgba(0,0,0,.08)}
@media (max-width:767.98px){.tim-consent{bottom:calc(3.4rem + env(safe-area-inset-bottom))}}
.tim-consent .h6{font-weight:700}
.player-consent{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;text-align:center;padding:1rem;height:100%;background:rgba(0,0,0,.75);color:#fff;font-size:.9rem}
.player-consent .btn{min-height:2.5rem}

/* ---------- Content blocks (CMS) and What happened ---------- */
.cms-faces{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.35rem}
.cms-faces img{width:72px;height:90px;object-fit:cover;border-radius:.375rem;background:var(--tim-tint)}
.cms-stat .h2{font-variant-numeric:tabular-nums}
.cms-quote{border-inline-start:4px solid #8c1015;padding:.25rem 0 .25rem 1rem;padding-inline-start:1rem;margin:1rem 0;font-size:1.1rem}
.cms-callout.cms-memorial{border-inline-start:4px solid #8c1015}
.cms-callout.cms-info{border-inline-start:4px solid #0B3B2E}
.timeline .tl-data{padding-top:0}
.timeline .tl-data .cms-stat,.timeline .tl-data .cms-people{margin-bottom:.5rem}
.timeline .tl-data{padding-bottom:1rem}.timeline .tl-data::before{display:none}
