/* CallSliven — reports page: filters, list of reports and map */


/* ═════════ Page head ═════════ */
.page-head{padding:96px 0 16px;background:
  radial-gradient(45% 120% at 92% 0%, rgba(63,174,95,.12), transparent 70%),
  linear-gradient(180deg, var(--g-50), #fff)}
.page-head-inner{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;flex-wrap:wrap}
.page-head h1{font-size:clamp(28px,3vw,40px);color:var(--ink);animation:rise .8s var(--ease) both}
.page-lead{margin-top:6px;color:var(--muted);font-size:17px;animation:rise .8s .1s var(--ease) both}
.page-lead b{color:var(--g-700)}
.page-head .btn{animation:rise .8s .15s var(--ease) both}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* ═════════ Filters ═════════ */
.filters{position:sticky;top:64px;z-index:40;background:rgba(255,255,255,.94);border-bottom:1px solid var(--line);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:box-shadow .35s}
.filters.stuck{box-shadow:0 12px 30px -24px rgba(18,68,36,.5)}
.filters .wrap{display:flex;flex-direction:column;gap:10px;padding-top:12px;padding-bottom:12px}
.filter-top{display:flex;flex-wrap:wrap;gap:10px;align-items:center}

.r-search{flex:1 1 220px;display:flex;align-items:center;gap:10px;min-height:46px;padding:0 16px;border-radius:999px;border:1.5px solid var(--line);background:#fff;
  transition:border-color .3s, box-shadow .35s var(--ease)}
.r-search:focus-within{border-color:var(--g-500);box-shadow:0 0 0 4px rgba(63,174,95,.16)}
.r-search svg{width:18px;height:18px;flex:none;color:var(--g-700)}
.r-search input{flex:1;min-width:0;border:0;outline:0;background:none;font:inherit;font-size:15px;color:var(--ink)}
.r-search input::placeholder{color:#8A998E}

.dd-slot{flex:0 1 auto;min-width:170px}
.dd-slot.sort{min-width:160px}
.dd-slot .dd-menu{z-index:60}
.dd-slot[hidden]{display:none}
.segmented{position:relative;display:flex;padding:4px;border-radius:999px;background:var(--g-50);border:1.5px solid var(--line)}
.segmented button{position:relative;z-index:1;border:0;background:none;min-height:36px;padding:0 14px;border-radius:999px;font-size:14px;font-weight:600;color:var(--muted);transition:color .3s}
.segmented button.active{color:#fff}
.segmented .seg-pill{position:absolute;z-index:0;top:4px;bottom:4px;border-radius:999px;background:linear-gradient(135deg, var(--g-600), var(--g-700));
  box-shadow:0 6px 16px -8px rgba(31,122,58,.8);transition:transform .45s var(--ease), width .45s var(--ease)}



.active-bar{display:flex;align-items:center;gap:14px;font-size:14px;color:var(--muted)}
.active-bar[hidden]{display:none}
.link-btn{border:0;background:none;padding:0;font:inherit;font-size:14px;font-weight:700;color:var(--g-700);cursor:pointer}
.link-btn:hover{text-decoration:underline;text-underline-offset:3px}

/* ═════════ Results: list + map ═════════ */
.results{display:grid;grid-template-columns:minmax(340px,430px) minmax(0,1fr);gap:20px;padding-top:18px;padding-bottom:50px;align-items:start}
.report-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}

.rcard{position:relative;display:grid;grid-template-columns:52px 1fr auto;gap:6px 16px;align-items:start;padding:18px 18px 18px 16px;border-radius:20px;
  background:#fff;border:1.5px solid var(--line);box-shadow:0 10px 26px -22px rgba(18,68,36,.4);
  transition:border-color .3s, box-shadow .4s var(--ease), transform .4s var(--ease);
  animation:cardIn .55s var(--ease) both;animation-delay:calc(var(--i, 0) * 45ms)}
@keyframes cardIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.rcard:hover,.rcard.hl{border-color:var(--g-500);transform:translateY(-2px);box-shadow:0 0 0 4px rgba(63,174,95,.12), 0 22px 40px -26px rgba(31,122,58,.55)}
.rcard .r-ico{grid-row:1/3;width:52px;height:52px;border-radius:16px;display:grid;place-items:center;color:#fff;background:linear-gradient(140deg, var(--g-500), var(--g-700));box-shadow:0 8px 18px -10px rgba(31,122,58,.7)}
.rcard .r-ico svg{width:24px;height:24px}
.rcard h2{margin:0;font-size:17px;font-weight:600;line-height:1.35;color:var(--ink)}
.rcard h2 a::after{content:"";position:absolute;inset:0;border-radius:inherit} /* whole card clickable */
.rcard:hover h2{color:var(--g-700)}
.r-sub{grid-column:2;font-size:14px;color:var(--muted)}
.r-meta{grid-column:2/4;display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:6px;font-size:13px;color:var(--muted)}
.r-meta .m{display:inline-flex;align-items:center;gap:5px}
.r-meta svg{width:15px;height:15px;color:var(--g-700)}
.r-id{font-weight:700;color:#8A998E}
.rcard .pub-pill{grid-column:3;grid-row:1;justify-self:end}

.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:48px 20px;border-radius:22px;border:1.5px dashed var(--g-200);background:var(--g-50)}
.empty[hidden]{display:none}
.empty-ico{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;background:#fff;color:var(--g-700);box-shadow:var(--shadow)}
.empty-ico svg{width:28px;height:28px}
.empty h2{font-size:20px;font-weight:600}
.empty p{color:var(--muted);max-width:340px}
.empty .btn{min-height:44px;margin-top:6px}

/* map */
.map-col{position:sticky;top:var(--map-top, 250px)}
.map-wrap{position:relative;height:calc(100vh - var(--map-top, 250px) - 16px);min-height:540px;border-radius:24px;overflow:hidden;border:1.5px solid var(--line);
  box-shadow:0 24px 50px -32px rgba(18,68,36,.55);background:var(--g-50);
  /* Leaflet gives its layers z-index 400–1000. Without this they compete with the whole page and cover the
     navigation (z-index 60) — on phones the open menu showed the map on top of it. isolation keeps them inside the map. */
  isolation:isolate}
#map{position:absolute;inset:0;font-family:var(--sans)}
.map-fallback{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center;color:var(--muted)}
.map-legend{position:absolute;z-index:500;left:12px;bottom:12px;display:flex;flex-wrap:wrap;gap:4px 6px;padding:6px 8px;border-radius:14px;background:rgba(255,255,255,.94);
  box-shadow:0 8px 20px -12px rgba(0,0,0,.35);font-size:12.5px;font-weight:600}
.map-legend i{width:10px;height:10px;border-radius:50%;background:var(--c);flex:none;transition:box-shadow .25s}
/* each status in the legend is a quick filter */
.map-legend button{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 8px;border:0;border-radius:999px;background:none;
  font:inherit;font-size:12.5px;font-weight:600;color:var(--ink);cursor:pointer;transition:background .25s, opacity .25s}
.map-legend button:hover{background:var(--g-50)}
.map-legend button[aria-pressed="true"]{background:var(--g-100)}
.map-legend button[aria-pressed="true"] i{box-shadow:0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent)}
.map-legend button.off{opacity:.45}
.map-legend button.off:hover{opacity:.8}
.map-note{position:absolute;z-index:500;right:12px;top:12px;margin:0;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.94);font-size:12px;color:var(--muted);
  box-shadow:0 8px 20px -12px rgba(0,0,0,.35)}

/* map pins: category icon in a circle coloured by status */
.pin{--c:#5D6B61;width:38px;height:38px;border-radius:50% 50% 50% 6px;transform:rotate(-45deg);display:grid;place-items:center;background:var(--c);
  border:3px solid #fff;box-shadow:0 8px 16px -6px rgba(0,0,0,.45);transition:transform .3s var(--ease), box-shadow .3s}
.pin svg{width:18px;height:18px;color:#fff;transform:rotate(45deg)}
.pin.hl{transform:rotate(-45deg) scale(1.25);box-shadow:0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent), 0 10px 20px -6px rgba(0,0,0,.5)}
.leaflet-marker-icon.pin-wrap{background:none;border:0}
.leaflet-marker-icon.pin-wrap.hl{z-index:1000 !important}
.leaflet-popup-content-wrapper{border-radius:16px;box-shadow:0 18px 40px -16px rgba(0,0,0,.4)}
.leaflet-popup-content{margin:14px 16px;font-family:var(--sans);font-size:14px;line-height:1.45;min-width:200px}
.pop-cat{font-size:11.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--g-700)}
.pop-title{display:block;margin:4px 0 8px;font-size:15.5px;font-weight:600;color:var(--ink)}
.pop-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pop-link{font-weight:700;color:var(--g-700) !important}
.leaflet-container a.leaflet-popup-close-button{top:6px;right:6px}

/* mobile list/map switch */
.view-toggle{display:none}

/* ═════════ Responsive ═════════ */
@media (max-width:1024px){
  .results{grid-template-columns:minmax(300px,360px) minmax(0,1fr)}
  .rcard{grid-template-columns:48px 1fr}
  .rcard .r-ico{width:48px;height:48px}
  .rcard .pub-pill{grid-column:2;grid-row:auto;justify-self:start;margin-top:4px}
  .r-meta{grid-column:2}
}
@media (max-width:860px){
  .filters{position:relative;top:auto;z-index:45}
  .results{grid-template-columns:1fr}
  .map-col{display:none;position:relative;top:auto}
  .map-wrap{height:calc(100svh - 260px);min-height:360px}
  .results.show-map .map-col{display:block}
  .results.show-map .list-col{display:none}
  .view-toggle{position:fixed;z-index:55;left:50%;bottom:20px;translate:-50% 0;  /* 'translate', not 'transform': the rise animation uses transform and would undo the centring */
    display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 22px;border:0;border-radius:999px;
    background:var(--ink);color:#fff;font-weight:700;font-size:15px;box-shadow:0 14px 30px -12px rgba(0,0,0,.6);animation:rise .6s .3s var(--ease) both}
  .view-toggle svg{width:18px;height:18px}
  .view-toggle .i-list{display:none}
  .view-toggle[aria-pressed="true"] .i-list{display:block}
  .view-toggle[aria-pressed="true"] .i-map{display:none}
  .map-legend{right:12px}
}
@media (max-width:600px){
  .page-head{padding-top:96px}
  .page-head .btn{width:100%}
  /* two dropdowns per row, so four filters don't make the bar too tall */
  .filter-top .dd-slot{flex:1 1 calc(50% - 5px);min-width:0}
  .filter-top .segmented{flex:1 1 100%;order:1}   /* period last, so the four dropdowns pair up */
  .dd-slot .dd-menu{width:100%;max-width:none;min-width:220px}
  #dd-status .dd-menu,#dd-sort .dd-menu{left:auto;right:0}
  .segmented button{flex:1}
  .rcard{padding:14px}
}
@media (prefers-reduced-motion:reduce){
  .rcard,.page-head h1,.page-lead,.page-head .btn{animation:none}
}
/* ═════════ Real data: status pill, loading, "show more", errors ═════════ */
.pub-pill{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 12px;border-radius:999px;white-space:nowrap;font-size:12.5px;font-weight:700;
  color:var(--c);background:color-mix(in srgb, var(--c) 13%, #fff);border:1px solid color-mix(in srgb, var(--c) 22%, transparent)}
.pub-pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.r-more{font-weight:600;color:var(--g-700)}
.list-loading{display:flex;flex-direction:column;gap:12px}
.list-loading[hidden]{display:none}
.sk{height:104px;border-radius:20px;background:linear-gradient(90deg,var(--g-50),var(--g-100),var(--g-50));background-size:200% 100%;animation:shimmer 1.4s linear infinite}
@keyframes shimmer{to{background-position:-200% 0}}
.more{width:100%;margin-top:14px;min-height:48px;background:var(--g-50);color:var(--g-800);border:1.5px solid var(--g-200)}
.more:hover{background:var(--g-100);border-color:var(--g-500)}
.more .spin{display:none;width:18px;height:18px;border-radius:50%;border:2.5px solid var(--g-200);border-top-color:var(--g-700);animation:spin .8s linear infinite}
.more.loading .spin{display:block}
@keyframes spin{to{transform:rotate(360deg)}}
.alert-box{padding:14px 16px;margin-bottom:12px;border-radius:16px;background:#FCEDEB;color:#B4342A;font-weight:600;font-size:14.5px}
.empty .btn[hidden]{display:none}
.pin{--c:#6B7A70}
.leaflet-popup-content .pub-pill{height:26px;font-size:12px}
@media (prefers-reduced-motion:reduce){ .sk{animation:none} }
