/* ============================================================
   منصة ذاكرة الألم — Hero (Archival Folders)
   Inherits palette & fonts from css/style.css
   ============================================================ */

:root {
  /* Archival tones derived from the site's identity palette */
  --pm-paper: var(--bg);            /* Old Paper */
  --pm-folder: #e8e1d3;  /* #E7DDCB */
  --pm-folder-2: #ddcfb6;
  --pm-folder-3: #d3c19f;
  --pm-ink: var(--text-primary);
  --pm-muted: var(--text-secondary);
  --pm-line: var(--border-color1);
  --pm-subnav-h: 54px;
}

/* ============================================================
   HEADER — Brand group (two logos side by side)
   ============================================================ */
/* Pain-memory page only: nudge the fixed header down (base is top:0 in style.css).
   Scoped here because this stylesheet loads only on pain-memory.html. */
.site-header { top: 55px; }

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand-divider {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--border-color1);
  opacity: .6;
}

/* ============================================================
   SECONDARY NAVBAR — fixed dark bar under the site-header
   ============================================================ */
.pm-subnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 49;
  height: var(--pm-subnav-h);
  background: #1d2606;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 10px 28px -14px rgba(0, 0, 0, .55);
}
.pm-subnav__inner {
  width: 100%;
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  scrollbar-width: none;          /* Firefox */
}
.pm-subnav__inner::-webkit-scrollbar { display: none; }

/* Featured tabs — emphasized pills pinned to the right (RTL start) */
.pm-subnav__tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pm-tab {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  background-color: rgba(255,255,255,.06);
  color: #fff;
  white-space: nowrap;
  border: 1.5px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  transition: 0.25s all;
}
.pm-tab:hover {
  background: rgba(255, 255, 255, .10);
  border-color: var(--accent);
}
.pm-tab.active {
  color: #1d2606;
  background: var(--accent);
  border-color: var(--accent);
}

.pm-subnav__list {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}
.pm-subnav__list a {
  position: relative;
  display: inline-block;
  padding: 8px 11px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border-radius: 6px;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.pm-subnav__list a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 11px;
  left: 11px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .3s var(--ease);
}
.pm-subnav__list a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}
.pm-subnav__list a:hover::after,
.pm-subnav__list a.active::after { transform: scaleX(1); }
.pm-subnav__list a.active { color: var(--accent); }

/* Subnav links cloned into the mobile menu (js/pain-memory.js).
   Hidden by default; revealed only when the subnav collapses (≤900px). */
.pm-nav-extra { display: none; }

/* ≤900px: drop the secondary navbar, raise the header to the top,
   and surface the subnav links inside the hamburger menu instead. */
@media (max-width: 900px) {
  .pm-subnav { display: none; }
  .site-header { top: 0; }
  .pm-nav-extra { display: block; }
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
.pm-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + var(--pm-subnav-h) + 48px) 0 88px;
  background: var(--pm-paper);
  overflow: hidden;
}

/* ---------- Layered background ---------- */
.pm-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.pm-hero__paper {
  position: absolute;
  inset: 0;
  background-image: url("../images/bg-pian.png");
  background-size: cover;
  background-position: center;
  opacity: 0.7;
  mix-blend-mode: multiply;
}
.pm-hero__blob {
  position: absolute;
  border-radius: 100%;
  filter: blur(70px);
}
.pm-hero__blob--a {
  inset: 20% -10% auto auto;
  width: 50%;
  height: 120%;
  background: var(--pm-folder);
  opacity: .25;
  transform: rotate(12deg);
}
.pm-hero__blob--b {
  inset: auto auto 10% -5%;
  width: 40%;
  height: 80%;
  background: var(--accent);
  opacity: .12;
  transform: rotate(-6deg);
}
.pm-hero__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--pm-ink);
  opacity: .04;
}

/* ============================================================
   CONTAINER LAYOUT
   ============================================================ */
.pm-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: stretch;
  gap: 55px;
}

/* In RTL the intro sits on the right (start), the archive on the left (end). */
.pm-hero__intro {
  flex: 0 0 42%;
  max-width: 42%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pm-hero__archive {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   INTRO — Typography
   ============================================================ */
.pm-hero__title {
  font-size: clamp(44px, 5.4vw, 68px);
  font-weight: 700;
  line-height: 1.12;
  color: var(--pm-ink);
  margin-bottom: 22px;
}
.pm-hero__accent {
  position: relative;
  display: inline-block;
  color: var(--secondary);
}
.pm-hero__underline {
  position: absolute;
  right: 0;
  bottom: -10px;
  width: 100%;
  height: 12px;
  color: var(--primary);
  opacity: .4;
}

.pm-hero__subtitle {
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.5;
  color: var(--pm-muted);
  padding-right: 16px;
  border-right: 3px solid rgba(62, 90, 10, .25);
  margin-bottom: 24px;
}


/* ---------- Actions ---------- */
.pm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 52px;
}
.pm-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease),
    border-color .3s var(--ease), transform .3s var(--ease);
}
.pm-btn--solid {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(42, 62, 5, .6);
}
.pm-btn--solid:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
.pm-btn--ghost {
  background: transparent;
  color: var(--pm-ink);

  border: 1px solid rgba(30, 30, 30, .28);
}
.pm-btn--ghost:hover {
  background: var(--pm-folder);
}

@media (max-width: 720px){
  .pm-hero{
    padding: 120px 0;
  }
  .pm-hero__actions{
    margin: 0 auto;
    flex-wrap: nowrap;
  }
  .pm-btn{
    padding: 15px;
  }
.pm-nav{
    display: none !important;
  }
}
/* ============================================================
   ARCHIVE — right column: eyebrow, lead, navigation
   ============================================================ */
.pm-hero__lead {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.9;
  color: var(--pm-muted);
  max-width: 44ch;
  margin: 6px 0 30px;
}

/* Archive navigation (prev / counter / next) */
.pm-nav { display: flex; align-items: center; gap: 16px; }
.pm-nav__btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
    background: var(--pm-folder);
  color: var(--pm-ink);
  border: 1px solid rgba(30, 30, 30, .28);
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);

}
.pm-nav__btn:hover,
.pm-nav__btn:focus-visible {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pm-nav__count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  color: var(--pm-muted);
}
.pm-nav__count b { font-family: 'Amiri', serif; font-size: 24px; font-weight: 700; color: var(--pm-ink); }
.pm-nav__count i { font-style: normal; opacity: .5; }

/* ============================================================
   ARCHIVE STACK — physical folder stack (left column)
   ============================================================ */
.pm-archive {
margin-right: 100px;
  min-width: 0;
  align-self: stretch;
}
.pm-stack {
  --card-w: clamp(258px, 25vw, 356px);
  --card-h: clamp(380px, 37vw, 520px);
  --fan-x: 50px;                 /* horizontal shift between stacked files */
  --fan-y: 9px;                  /* vertical shift between stacked files */
  /* --fan-base: 30px;              extra left peek applied to every inactive file */
  --fan-count: 6;                /* inactive files behind the active one */
  position: relative;
  width: calc(var(--card-w) + var(--fan-x) * var(--fan-count) + var(--fan-base));
  height: var(--card-h);
  outline: none;
  touch-action: pan-y;
}

/* One archive file — outer box carries the JS-driven fan transform (x/y/scale) */
.pm-file {
  position: absolute;
  top: 0;
  right: 0;                     /* RTL: active anchored to the right, stack fans left */
  width: var(--card-w);
  height: var(--card-h);
  cursor: pointer;
  transform-origin: right center;
  will-change: transform, opacity;
}

/* Inner sheet — the visible paper. Kept separate so the hover tilt (below)
   never collides with the fan transform JS sets on .pm-file. */
.pm-file__inner {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(246, 239, 226, 0), rgba(246, 239, 226, 0)),
    url("../images/bg-slid.png") center / cover no-repeat;
  box-shadow: 0 26px 52px -26px rgba(30, 24, 14, .55);
  transform-origin: 50% 100%;   /* hinged at the bottom edge */
  transition: transform .55s var(--ease), box-shadow .55s var(--ease);
  will-change: transform;
}

/* Hover a side (inactive) file: its top edge leans gently to the left,
   the bottom stays pinned. */
.pm-file:not(.is-active):hover .pm-file__inner {
  transform: rotate(-3deg);
  box-shadow: -12px 30px 48px -22px rgba(30, 24, 14, .5);
}
@media (prefers-reduced-motion: reduce) {
  .pm-file__inner { transition: none; }
  .pm-file:not(.is-active):hover .pm-file__inner { transform: none; }
}

/* Spine — the only part visible when a file is inactive */
.pm-file__spine {
  position: absolute;
  inset: 0;
  padding: 18px 22px 22px ;
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 16px;
  /* background: linear-gradient(90deg, var(--pm-folder-3) 0%, var(--pm-folder) 55%); */
  border-radius: 14px;
}
.pm-file__spine-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(255, 255, 255, .3);
  border: 1.5px solid rgba(115, 85, 31, .35);
  border-radius: 6px;
}
.pm-file__spine-title {
  writing-mode: vertical-rl;
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--pm-ink);
  opacity: .78;
  max-height: calc(var(--card-h) - 86px);
  overflow: hidden;
}

/* Face — the full case file, shown only when active */
.pm-file__face {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(246, 239, 226, 0), rgba(246, 239, 226, 0)),
    url("../images/bg-slid.png") center / cover no-repeat;
  opacity: 0;                    /* crossfaded in by JS */
}
.pm-file__num {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(255, 255, 255, .35);
  border: 2px solid rgba(115, 85, 31, .3);
  border-radius: 8px;
}
.pm-file__title {
  margin-top: 26px;
  font-size: clamp(19px, 1.9vw, 25px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--pm-ink);
}
.pm-file__range {
  margin-top: 6px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--secondary);
}
.pm-file__photo {
  position: relative;
  margin-top: 16px;
  height: clamp(120px, 30%, 190px);
  overflow: hidden;
  border: 1px solid var(--pm-folder-3);
  border-radius: 8px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .22);
}
.pm-file__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(.4) contrast(1.05) brightness(.95) grayscale(.25);
}
.pm-file__desc {
  flex: 1 1 auto;
  margin-top: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: clamp(12px, 1vw, 13.5px);
  line-height: 1.7;
  color: var(--pm-muted);
  overflow: hidden;
}
.pm-file__stats {
  display: flex;
  justify-content: space-around;
  gap: 6px;
  padding: 11px 0;
  margin: 12px 0 14px;
  border-top: 1px dotted rgba(95, 77, 54, .4);
  border-bottom: 1px dotted rgba(95, 77, 54, .4);
}
.pm-file__stat b {
  display: block;
  font-family: 'Amiri', serif;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 700;
  color: var(--pm-ink);
  font-variant-numeric: tabular-nums;
}
.pm-file__stat span {
  font-family: 'Cairo', sans-serif;
  font-size: 11px;
  color: var(--pm-muted);
}
.pm-file__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #232323;
  border-radius: 8px;
  transition: background .3s var(--ease);
}
.pm-file__cta:hover { background: #000; }

/* Active file: spine hidden, face shown (JS also sets transform/opacity) */
.pm-file.is-active { cursor: default; }
.pm-file.is-active .pm-file__spine { opacity: 0; }
.pm-file.is-active .pm-file__face { opacity: 1; }

/* Grabbing feedback while dragging the stack */
.pm-stack.is-grabbing { cursor: grabbing; }

/* ============================================================
   ARCHIVE STACK — Responsive
   ============================================================ */
@media (max-width: 1180px) {
  .pm-hero__inner { flex-direction: column; gap: 44px; align-items: center;}
  .pm-hero__intro { flex-basis: auto; max-width: 640px;  }
  .pm-archive { width: 50%; align-self: auto; order: 1;margin: 0; }   /* folder above text on smaller screens */
}
@media (max-width: 720px) {
  .pm-stack { --card-w: clamp(230px, 74vw, 300px); --card-h: clamp(340px, 108vw, 500px); --fan-x: 24px; }
  .pm-hero__lead { font-size: 15px; }
    .pm-archive { width: 95%; }
}
/* ============================================================
   STATISTICS SECTION
   ============================================================ */
.pm-stats {
  background:
    radial-gradient(120% 80% at 50% 0%, var(--bg-body) 0%, var(--bg) 60%);
  padding: clamp(56px, 8vw, 112px) clamp(16px, 4vw, 40px);
}

.pm-stats-head { text-align: center; max-width: 720px; margin: 0 auto clamp(40px, 6vw, 78px); }
.eyebrow-line { width: 30px; height: 2px; background: var(--accent); display: inline-block; }
.pm-stats-head h2 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  color: var(--primary-dark);
  margin: 0 0 14px;
  letter-spacing: -.5px;
}
.pm-stats-sub {
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.9;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* Slider shell that holds the arrows around the grid */
.pm-stats-slider {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
}
.pm-stats-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--primary-dark);
  background: var(--surface);
  border: 1px solid var(--surface-alt);
  box-shadow: 0 18px 42px -20px rgba(42, 62, 5, .5);
  cursor: pointer;
  z-index: 6;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.pm-stats-arrow svg { width: 22px; height: 22px; }
.pm-stats-arrow:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pm-stats-arrow--prev { right: -12px; }        /* RTL: previous on the right */
.pm-stats-arrow--next { left: -12px; }
.pm-stats-arrow--prev:hover { transform: translateY(-50%) translateX(4px); }
.pm-stats-arrow--next:hover { transform: translateY(-50%) translateX(-4px); }
.pm-stats-arrow[disabled] { opacity: .5; pointer-events: none; }

/* Page dots */
.pm-stats-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: clamp(26px, 3vw, 40px);
}
.pm-stats-dots button {
  width: 9px; height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(62, 90, 10, .22);
  cursor: pointer;
  transition: background .3s var(--ease), transform .3s var(--ease), width .3s var(--ease);
}
.pm-stats-dots button.active {
  width: 26px;
  border-radius: 6px;
  background: var(--accent);
}

/* Radial grid: cards in corners, center composition between */
.pm-stats-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  gap: clamp(20px, 3vw, 38px) clamp(12px, 5vw, 12px);
}
.pm-pos-tr { grid-column: 1; grid-row: 1; }
.pm-pos-tl { grid-column: 3; grid-row: 1; }
.pm-pos-br { grid-column: 1; grid-row: 2; }
.pm-pos-bl { grid-column: 3; grid-row: 2; }
.pm-stats-center { grid-column: 2; grid-row: 1 / span 2; }

/* Center concentric rings + logo */
.pm-stats-center {
  position: relative;
  width: clamp(190px, 22vw, 290px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: scale(2);
}
.pm-ring { position: absolute; border-radius: 50%; }
.pm-ring-1 { inset: 2%;   border: 1.5px solid var(--border-color1); }
.pm-ring-2 { inset: 9%; border: 1.5px solid var(--border-color1); }
.pm-ring-3 { 
  inset: 16%;
   border: 1.5px solid rgba(62,90,10,.12);
   }
.pm-center-logo {
  position: relative;
  z-index: 2;
  width: 46%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  /* box-shadow: 0 14px 36px -14px rgba(42,62,5,.35); */
}
.pm-center-logo img { width: 100%; height: auto; }

/* Cards (entire card is a link) */
.pm-stat-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--surface-alt);
  border-radius: 18px;
  padding: 26px 26px 24px;
  text-align: right;
  color: inherit;
  box-shadow: 0 16px 44px -26px rgba(42,62,5,.45);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);

}
.pm-stat-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 30px 56px -28px rgba(42,62,5,.5);
  border-color: rgba(180,146,88,.6);
}
.pm-card-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 8px;
}
.pm-stat-number {
  font-size: clamp(42px, 4.4vw, 58px);
  font-weight: 900;
  line-height: 1.02;
  color: var(--primary-dark);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pm-stat-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

/* Bottom-left "go to details" badge holding a ~300deg arrow */
.pm-card-go {
  align-self: flex-end;        /* left side in RTL */
  margin-top: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--primary);
  background: var(--bg);
  border: 1px solid rgba(62,90,10,.2);
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.pm-card-go svg {
  width: 18px; height: 18px;
  transform: rotate(220deg);
  transition: all 0.4s;
}
.pm-stat-card:hover .pm-card-go {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pm-stat-card:hover .pm-card-go svg { transform: rotate(180deg) }

/* ---- Statistics responsive ---- */
@media (max-width: 980px) {
  /* arrows anchored at the bottom-centre, clear of the stacked cards */
  .pm-stats-slider { padding-bottom: 78px; }
  .pm-stats-arrow { top: auto; bottom: 6px; transform: none; }
  .pm-stats-arrow--prev { right: calc(50% - 62px); }
  .pm-stats-arrow--next { left: calc(50% - 62px); }
  .pm-stats-arrow--prev:hover, .pm-stats-arrow--next:hover { transform: translateY(-3px); }

  .pm-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    align-items: stretch;
    gap: clamp(18px, 3vw, 30px);
  }
  .pm-stats-center { display: none; }
  .pm-pos-tr, .pm-pos-tl, .pm-pos-br, .pm-pos-bl { grid-column: auto; grid-row: auto; }
  .pm-stat-card { max-width: 420px; justify-self: stretch; }
}

@media (max-width: 560px) {
  .pm-stats-grid { grid-template-columns: 1fr; }
  .pm-stat-card { max-width: 100%; }
  /* .pm-stats-center { width: clamp(180px, 60vw, 230px);} */
}

/* ---- Statistic details dialog (statistics/_dialog.blade.php) ----
   A native <dialog>: the panel fills it, so a click on the dialog element itself is a backdrop click. */
.pm-stat-dialog {
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  overflow: visible;
}
.pm-stat-dialog::backdrop {
  background: rgba(20, 24, 12, .55);
  backdrop-filter: blur(0.1875rem);
}
.pm-stat-dialog[open] { animation: pm-stat-dialog-in .28s var(--ease); }
.pm-stat-dialog[open]::backdrop { animation: pm-stat-dialog-fade .28s var(--ease); }
@keyframes pm-stat-dialog-in { from { opacity: 0; transform: translateY(0.75rem) scale(.97); } }
@keyframes pm-stat-dialog-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pm-stat-dialog[open], .pm-stat-dialog[open]::backdrop { animation: none; }
}
html:has(.pm-stat-dialog[open]) { overflow: hidden; }

.pm-stat-dialog__panel {
  position: relative;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 0.0625rem solid var(--surface-alt);
  border-top: 0.25rem solid var(--accent);
  border-radius: 1.125rem;
  padding: 2rem 2rem 1.75rem;
  text-align: start;
  box-shadow: 0 1.875rem 4.375rem -1.75rem rgba(42,62,5,.55);
}
.pm-stat-dialog__close {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 0.0625rem solid rgba(62,90,10,.2);
  background: var(--bg);
  color: var(--primary);
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.pm-stat-dialog__close svg { width: 1.125rem; height: 1.125rem; }
.pm-stat-dialog__close:hover,
.pm-stat-dialog__close:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pm-stat-dialog__close:focus-visible { outline: 0.125rem solid var(--accent); outline-offset: 0.125rem; }

.pm-stat-dialog__kicker {
  margin: 0 0 0.375rem;
  padding-inline-end: 3rem;      /* clear of the close button */
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--secondary);
}
.pm-stat-dialog__title {
  margin: 0;
  padding-inline-end: 3rem;
  font-size: 1.375rem;
  font-weight: 900;
  line-height: 1.5;
  color: var(--primary-dark);
}
/* the number as a badge: the card's counter type on the paper ground, with a gold rule */
.pm-stat-dialog__number {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0.875rem;
  background: var(--bg);
  border: 0.0625rem solid rgba(180,146,88,.45);
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--primary-dark);
  text-align: center;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.pm-stat-dialog__details p {
  margin: 0 0 0.875rem;
  font-size: 0.96875rem;
  line-height: 2;
  color: var(--text-secondary);
}
.pm-stat-dialog__details p:last-child { margin-bottom: 0; }

.pm-stat-dialog__event {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  background: rgba(62,90,10,.07);
  border: 0.0625rem solid rgba(62,90,10,.18);
  color: var(--primary);
  font-weight: 700;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.pm-stat-dialog__event[hidden] { display: none; }
.pm-stat-dialog__event-label {
  padding: 0.125rem 0.625rem;
  border-radius: 62.4375rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
}
.pm-stat-dialog__event-name { flex: 1; min-width: 0; font-size: 0.9375rem; }
.pm-stat-dialog__event svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
[dir="ltr"] .pm-stat-dialog__event svg { transform: scaleX(-1); }
.pm-stat-dialog__event:hover { background: var(--primary); color: #fff; }
.pm-stat-dialog__event:hover .pm-stat-dialog__event-label { background: #fff; color: var(--primary); }

@media (max-width: 560px) {
  .pm-stat-dialog__panel { padding: 1.5rem 1.25rem 1.25rem; }
  .pm-stat-dialog__title { font-size: 1.1875rem; }
}

/* ============================================================
   VICTIMS DATABASE — Official archive folders (بيانات الضحايا)
   ============================================================ */
.vdb {
  --vdb-bg: #161616;
  --vdb-paper: #e1d2be;
  --vdb-paper-2: #d3c0a4;
  --vdb-edge: #b89f7a;
  --vdb-ink: #33281d;        /* strongest text (name) */
  --vdb-ink-2: #6a5845;      /* secondary text */
  --vdb-filenum: #5f4d36;
  --vdb-accent: #8a6e3e;
  --vdb-hover: #b49258;
  --vdb-title: #e1d2be;
  --vdb-desc: #d2c6b3;

  position: relative;
  background: var(--vdb-bg);
  padding: 80px 0 100px;
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + var(--pm-subnav-h) + 12px);
}

/* Subtle archival atmosphere — never above ~5% opacity */
.vdb__overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 84% 18%, rgba(225, 210, 190, .5), transparent 22%),
    radial-gradient(circle at 12% 82%, rgba(225, 210, 190, .4), transparent 26%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
  background-size: auto, auto, auto;
  background-position: center;
  opacity: .05;
}

.vdb__container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Section header ---------- */
.vdb__head {
  text-align: center;
  margin-bottom: 60px;
}
.vdb__title {
  font-family: 'Noto Kufi Arabic', 'Cairo', sans-serif;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.2;
  color: #F5F2EB;
  margin-bottom: 22px;
}
.vdb__divider {
  display: block;
  width: 96px;
  height: 3px;
  margin: 0 auto 22px;
  background: var(--vdb-hover);
  border-radius: 2px;
  position: relative;
}
.vdb__divider::before,
.vdb__divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vdb-hover);
  transform: translateY(-50%) rotate(45deg);
}
.vdb__divider::before { right: -14px; }
.vdb__divider::after  { left: -14px; }
.vdb__desc {
  font-family: 'Cairo', sans-serif;
  font-size: 18px;
  line-height: 1.9;
  color: var(--vdb-desc);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- Cards grid (3 x 2 desktop) ---------- */
.vdb__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* ============================================================
   ARCHIVE FOLDER CARD — folder2.png is the whole card;
   the victim's data is laid out on top of it.
   The folder aspect-ratio is locked so the image never
   distorts, and the photo lives in a fixed-width column so
   it can never blow up or spill outside the folder.
   ============================================================ */
.vfolder {
  position: relative;
  width: 100%;
  margin-top: 4px;
  cursor: pointer;
  transition: transform .3s ease, filter .3s ease;
}

.vfolder__inner {
  position: relative;
  aspect-ratio: 1536 / 1024;                       /* = folder2.png */
  background: url("../images/folder2.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 9px rgba(0, 0, 0, .26));
  transition: filter .3s ease;
  padding: 70px 30px 50px;
}

/* Data overlay, seated inside the folder's cream area */
.vfolder__content {
  /* position: absolute;
  inset: 17% 15% 14% 14.5%;                     */
  display: grid;
  grid-template-columns: 1fr 32%;                  /* RTL: details (right) | photo (left) */
  grid-template-rows: 1fr;  
  width: 100%;                       /* one row → photo & details side by side */
  align-items: center;
  column-gap: clamp(10px, 1.8vw, 18px);
}

/* Photo (left) — fixed-width column, portrait 3:4, always contained */
.vfolder__photo {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 100%;
  align-self: center;
  justify-self: center;
  padding: 4px;
  background: #fbf7ef;
  border: 1px solid var(--vdb-edge);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .3), 0 3px 7px rgba(0, 0, 0, .22);
}
.vfolder__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04) brightness(.97);
  opacity: .95;
}
/* Silver paper clip */
.vfolder__photo::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 12px;
  width: 11px;
  height: 34px;
  border: 3px solid #9a9a9a;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, .3);
  transform: rotate(-10deg);
  z-index: 3;
}

/* Details (right) */
.vfolder__details {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.vfolder__name {
  font-family: 'Noto Kufi Arabic', 'Cairo', sans-serif;
  font-size: clamp(16px, 1.9vw, 23px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--vdb-ink);
  padding-bottom: clamp(5px, 1vw, 9px);
  margin-bottom: clamp(5px, 1vw, 9px);
  border-bottom: 1px solid rgba(95, 77, 54, .3);
}

/* Info rows: label (right) + value (left) */
.vfolder__info { display: flex; flex-direction: column; }
.vfolder__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(2px, .5vw, 5px) 0;
  border-bottom: 1px dashed;
}
.vfolder__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-family: 'Cairo', sans-serif;
  font-size: clamp(10.5px, 1.1vw, 15px);
  font-weight: 700;
  color: var(--vdb-ink-2);
}
/* SVG icon badge */
.vfolder__icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: clamp(22px, 2.1vw, 26px);
  aspect-ratio: 1;
  border-radius: 7px;
  color: var(--vdb-accent);
  background: rgba(138, 110, 62, .13);
  border: 1px solid rgba(138, 110, 62, .22);
}
.vfolder__svg {
  width: 62%;
  height: 62%;
  stroke: currentColor;
}
.vfolder__value {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(10.5px, 1.1vw, 13px);
  font-weight: 700;
  color: var(--vdb-ink);
  text-align: left;
  min-width: 0;
}

/* Faded circular archive stamp (behind the data) */
.vfolder__stamp {
  position: absolute;
  bottom: 3%;
  left: 4%;
  width: clamp(48px, 9%, 78px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px double var(--vdb-accent);
  display: grid;
  place-items: center;
  text-align: center;
  font-family: 'Noto Kufi Arabic', 'Cairo', sans-serif;
  font-size: clamp(8px, .95vw, 10px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--vdb-accent);
  opacity: .12;
  transform: rotate(-15deg);
  mix-blend-mode: multiply;
  z-index: 0;
  pointer-events: none;
}
.vfolder__content > :not(.vfolder__stamp) { position: relative; z-index: 1; }

/* Hover: lift the folder */
.vfolder:hover { transform: translateY(-6px); }
.vfolder:hover .vfolder__inner { filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .38)); }
.vfolder:focus-visible { outline: 3px solid var(--vdb-hover); outline-offset: 4px; border-radius: 6px; }

/* ============================================================
   VICTIMS DATABASE — Responsive
   ============================================================ */
@media (max-width: 1360px) {
  .vdb__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 840px) {
  .vdb { padding: 60px 0 72px; }
  .vdb__title { font-size: 34px; }
  .vdb__desc { font-size: 16px; }
  .vdb__grid { grid-template-columns: 1fr; gap: 24px; }
  .vfolder { width: min(100%, 520px); margin-inline: auto; }
  .vfolder__name { font-size: clamp(20px, 5vw, 26px); }
  .vfolder__label,
  .vfolder__value { font-size: clamp(12px, 3.2vw, 15px); }
}

/* Phones: keep the natural landscape folder and the side-by-side
   layout (it stays legible down to ~320px); just enlarge the type
   a little and widen the photo column for a comfortable read. */
@media (max-width: 480px) {
  .vfolder__content {
    inset: 16% 13% 13% 13%;
    grid-template-columns: 1fr 33%;
    column-gap: clamp(10px, 3vw, 16px);
  }
  .vfolder__name { font-size: clamp(15px, 4.2vw, 22px); }
  .vfolder__label,
  .vfolder__value { font-size: clamp(10.5px, 2.9vw, 13px); }
  .vfolder__icon { width: clamp(20px, 5.4vw, 24px); }
}
/* ---------- /pain-memory/statistics (statistics/index.blade.php) ----------
   The landing's .pm-stat-card in a 2-column (phone) / 4-column grid: below 1024px a
   card is only ~160px wide, so 5–6 digit counters (182000) need a smaller size. */
@media (max-width: 1023px) {
  .pm-stats-page .pm-stat-card { padding: 1rem 0.875rem; }
  .pm-stats-page .pm-stat-number { font-size: 1.625rem; }
  .pm-stats-page .pm-card-title { font-size: 0.9375rem; }
}
