/* ============================================================
   chemistry-department-reforms-magadh-university.html — page styles
   Gallery treatments for the 8 evidence photos (before/after
   classroom pair, 4-up CCTV grid, 2-up cleaning row), caption
   badges, the zoom note, and the click-to-zoom lightbox that
   the source page's own footer note promises.
   ============================================================ */

/* -- hero subhead (the source page's own strapline) -- */
.cdr-hero-sub {
  margin: -8px 0 20px;
  font-family: var(--font-nav);
  font-size: 14.5px;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .62);
}
.cdr-hero-sub em {
  font-style: italic;
  color: var(--gold-soft);
}

/* -- galleries: figures sit inside grids, so the grid owns the
      top margin and each ab-figure resets its own -- */
.cdr-gallery { display: grid; gap: 22px; margin-top: 34px; }
.cdr-gallery .ab-figure { margin: 0; }

.cdr-gallery--2 { grid-template-columns: repeat(2, 1fr); }
.cdr-gallery--4 { grid-template-columns: repeat(4, 1fr); gap: 18px; }

@media (max-width: 900px) {
  .cdr-gallery--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cdr-gallery--2 { grid-template-columns: 1fr; }
}

/* classroom pair: wide crops, equal height */
.cdr-gallery--2 .ab-figure img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* cleaning + board pair: keep the whole photo visible, like the source */
.cdr-gallery--2.cdr-gallery--contain .ab-figure img {
  object-fit: contain;
  background: var(--line);
}

/* CCTV grid: tall evidence tiles — the originals are portrait,
   so a 3:4 frame keeps the camera and its mount in shot */
.cdr-gallery--4 .ab-figure img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.cdr-gallery--4 .ab-figure figcaption { font-size: 12px; }

/* captions carry a badge, so let it drop to its own line when tight */
.cdr-gallery .ab-figure figcaption { flex-wrap: wrap; gap: 8px 10px; }

/* -- small pill badge inside figcaptions (students / cctv / landscape) -- */
.cdr-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* -- zoom instruction note under the last gallery -- */
.cdr-zoomnote {
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-nav);
  font-size: 13.5px;
  color: var(--muted);
}
.cdr-zoomnote strong { color: var(--ink); }
.cdr-zoomnote__tags {
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  white-space: nowrap;
}

/* -- click-to-zoom lightbox -- */
.cdr-zoom { cursor: zoom-in; }
.cdr-zoom:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.cdr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: rgba(12, 12, 18, .92);
  cursor: zoom-out;
}
.cdr-lightbox.active { display: flex; }
.cdr-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .6);
}

/* -- the sequence of events, as a timeline -- */
.cdr-timeline { max-width: 78ch; }
.cdr-timeline > li > p:last-child { margin-bottom: 0; }

/* -- observed gaps vs. the changes that followed -- */
.ab-card__icon + p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}
.cdr-icon--gap {
  background: linear-gradient(135deg, rgba(150, 62, 62, .14), rgba(27, 42, 94, .07));
  color: #8E4141;
}
.cdr-icon--fix {
  background: linear-gradient(135deg, rgba(97, 206, 112, .20), rgba(201, 168, 76, .12));
  color: #2E7D3C;
}

/* prose that follows a grid needs its own breathing room */
.cdr-flow-gap { margin-top: 38px; }

/* -- the remembered exchange: the reply line inside the quote -- */
.ab-quote .cdr-quote-reply {
  margin-top: 14px;
  font-size: clamp(17px, 1.7vw, 20px);
  color: var(--navy);
}

/* -- lessons list inside the callout -- */
.cdr-lessons {
  margin: 0;
  padding-left: 1.25em;
}
.cdr-lessons li {
  margin: .5em 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body-c);
}
.cdr-lessons li::marker { color: var(--gold); }

/* -- signature line -- */
.cdr-sign {
  margin: 26px 0 0;
  font-size: 15px;
  color: var(--muted);
}
.cdr-sign strong { color: var(--ink); }

/* The problem/fix glyph colours need lifting on a dark surface, or they read
   as near-black smudges. The bare :not() selector must stay INSIDE the media
   query — on its own it would also match light mode. */
:root[data-theme="dark"] .cdr-icon--gap { color: #E39191; }
:root[data-theme="dark"] .cdr-icon--fix { color: #7FD98F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cdr-icon--gap { color: #E39191; }
  :root:not([data-theme="light"]) .cdr-icon--fix { color: #7FD98F; }
}
