/*
  DBIM inner-page content styling for the CISF site.
  Provides the "dbim-prose" content container and a few reusable content
  components (cards, stat grids, callouts, definition lists) built on DBIM
  design tokens so inner pages look native to the DBIM theme.
  Loaded after the core DBIM stylesheets.
*/

/* ---- Prose content container ---- */
.dbim-prose {
  max-width: 1100px;
  color: var(--dbim-color-ink, #1b1b1b);
  font-size: 1rem;
  line-height: 1.75;
}
.dbim-prose > *:first-child { margin-top: 0; }
.dbim-prose > *:last-child { margin-bottom: 0; }

.dbim-prose p { margin: 0 0 1rem; }
.dbim-prose h2 {
  margin: 2rem 0 1rem;
  padding-bottom: .5rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.3;
  color: var(--dbim-color-primary, #1a3a6b);
  border-bottom: 2px solid var(--dbim-color-border, #d9e1ea);
}
.dbim-prose h3 {
  margin: 1.5rem 0 .75rem;
  font-size: 1.15rem;
  color: var(--dbim-color-primary, #1a3a6b);
}
.dbim-prose ul,
.dbim-prose ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.dbim-prose li { margin: 0 0 .4rem; }
.dbim-prose a { color: var(--dbim-color-link, #1a5aa8); }
.dbim-prose img { max-width: 100%; height: auto; border-radius: 8px; }
.dbim-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: .95rem;
}
.dbim-prose th,
.dbim-prose td {
  padding: .6rem .8rem;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  text-align: left;
  vertical-align: top;
}
.dbim-prose thead th {
  background: var(--dbim-color-primary, #1a3a6b);
  color: #fff;
}
.dbim-prose tbody tr:nth-child(even) { background: #f4f7fb; }

/* ---- Lead paragraph ---- */
.dbim-lead {
  font-size: 1.12rem;
  line-height: 1.7;
  color: #3a4654;
  margin: 0 0 1.5rem;
}

/* ---- Stat grid ---- */
.dbim-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}
.dbim-stats li {
  margin: 0;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-top: 4px solid var(--dbim-color-primary, #1a3a6b);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgb(16 43 78 / 5%);
}
.dbim-stats strong {
  display: block;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  color: var(--dbim-color-primary, #1a3a6b);
  line-height: 1.2;
}
.dbim-stats span {
  display: block;
  margin-top: .35rem;
  font-size: .9rem;
  color: #5d6b7a;
}

/* ---- Content card ---- */
.dbim-card {
  margin: 0 0 1.5rem;
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  background: #fff;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgb(16 43 78 / 4%);
}
.dbim-card > *:first-child { margin-top: 0; }
.dbim-card > *:last-child { margin-bottom: 0; }

/* ---- Callout ---- */
.dbim-callout {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: #eef4fa;
  border-left: 4px solid var(--dbim-color-primary, #1a3a6b);
  border-radius: 8px;
  color: var(--dbim-color-primary, #1a3a6b);
  font-weight: 600;
}

/* ---- Two-column list ---- */
.dbim-list-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem 2rem;
}
@media (max-width: 640px) { .dbim-list-2 { grid-template-columns: 1fr; } }

/* ---- Link list of documents / rows reuse dbim-rows from core where present ---- */
.dbim-doclist { margin: 0; padding: 0; list-style: none; }
.dbim-doclist li { margin: 0 0 .5rem; }
.dbim-doclist a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 8px;
  text-decoration: none;
  color: var(--dbim-color-ink, #1b1b1b);
}
.dbim-doclist a:hover { background: #f4f7fb; }
.dbim-doclist .dbim-icon { flex: 0 0 auto; color: var(--dbim-color-primary, #1a3a6b); }

/* ---- Accordion (details/summary) ---- */
.dbim-accordion {
  margin: 0 0 .75rem;
  background: #fff;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 10px;
  overflow: hidden;
}
.dbim-accordion > summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dbim-color-primary, #1a3a6b);
  cursor: pointer;
  list-style: none;
}
.dbim-accordion > summary::-webkit-details-marker { display: none; }
.dbim-accordion > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--dbim-color-primary, #1a3a6b);
}
.dbim-accordion[open] > summary {
  color: #fff;
  background: var(--dbim-color-primary, #1a3a6b);
}
.dbim-accordion[open] > summary::after { content: "\2212"; color: #fff; }
.dbim-accordion > summary:hover { background: #eef4fa; }
.dbim-accordion[open] > summary:hover { background: var(--dbim-color-primary, #1a3a6b); }
.dbim-accordion > summary:focus-visible { outline: 3px solid #88b8f4; outline-offset: -4px; }
.dbim-accordion__body { padding: 0; }
.dbim-accordion__body table { margin: 0; }
.dbim-accordion__body th { width: 38%; background: #f4f7fb; color: var(--dbim-color-primary, #1a3a6b); }

/* ---- Do / Don't lists ---- */
.dbim-dos,
.dbim-donts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 640px) { .dbim-dos, .dbim-donts { grid-template-columns: 1fr; } }
.dbim-dos li,
.dbim-donts li { position: relative; padding-left: 1.75rem; }
.dbim-dos li::before {
  content: "\2714"; position: absolute; left: 0; top: .05em;
  color: #1f7a3d; font-weight: 700;
}
.dbim-donts li::before {
  content: "\2716"; position: absolute; left: 0; top: .05em;
  color: #b4232a; font-weight: 700;
}
.dbim-card--dos { border-top: 4px solid #1f7a3d; }
.dbim-card--donts { border-top: 4px solid #b4232a; }

/* ---- Scrollable table wrapper ---- */
.dbim-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.dbim-table-scroll table { margin: 0; border: 0; min-width: 560px; }

/* ---- Small helpers for committee / directory tables ---- */
.she-role {
  display: inline-block;
  padding: .25rem .6rem;
  background: #eef4fa;
  color: var(--dbim-color-primary, #1a3a6b);
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.she-muted { color: #5d6b7a; }
.she-italic { font-style: italic; }

/* =========================================================================
   Archive list — mirrors the CRPF archive layout (filter bar + news cards +
   View PDF button + file-size tag). Self-contained so it needs no external
   CSS framework.
   ========================================================================= */

/* Filter / search bar */
.dbim-filterbar {
  background: #f4f7fb;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 10px;
  padding: 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
}
.dbim-filterbar__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr .9fr auto;
  gap: 1rem;
  align-items: end;
}
@media (max-width: 760px) { .dbim-filterbar__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .dbim-filterbar__grid { grid-template-columns: 1fr; } }
.dbim-field { display: flex; flex-direction: column; gap: .35rem; }
.dbim-field label { font-size: .85rem; font-weight: 600; color: var(--dbim-color-primary, #1a3a6b); }
.dbim-field input,
.dbim-field select {
  padding: .6rem .75rem;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 8px;
  font-size: .95rem;
  background: #fff;
  color: #1b1b1b;
}
.dbim-field input:focus,
.dbim-field select:focus { outline: 2px solid var(--dbim-color-primary, #1a3a6b); outline-offset: 1px; }
.dbim-filterbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  background: var(--dbim-color-primary, #1a3a6b);
  color: #fff;
  border: 1px solid var(--dbim-color-primary, #1a3a6b);
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  white-space: nowrap;
}
.dbim-filterbar__btn:hover { background: #142c52; }

/* Result count */
.dbim-list-count { margin: 0 0 1rem; color: #5d6b7a; font-size: .9rem; }

/* News / document card */
.dbim-newscard {
  position: relative;
  background: #f4f7fb;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-left: 4px solid var(--dbim-color-primary, #1a3a6b);
  border-radius: 8px;
  padding: .85rem 1rem;
  margin: 0 0 .85rem;
}
.dbim-newscard__date {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .25rem;
  color: var(--dbim-color-primary, #1a3a6b);
  font-size: .85rem;
  font-weight: 600;
}
.dbim-newscard__note { margin: 0 0 .25rem; color: #5d6b7a; font-size: .82rem; }
.dbim-newscard__title { margin: 0; padding-right: 9rem; font-size: 1rem; line-height: 1.5; }
.dbim-newscard__title a { color: #1b1b1b; text-decoration: none; font-weight: 600; }
.dbim-newscard__title a:hover { color: var(--dbim-color-primary, #1a3a6b); text-decoration: underline; }
.dbim-newscard__action {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}
@media (max-width: 620px) {
  .dbim-newscard__title { padding-right: 0; }
  .dbim-newscard__action { position: static; transform: none; margin-top: .6rem; display: inline-block; }
}

/* View PDF button */
.dbim-view-pdf {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  background: var(--dbim-color-primary, #1a3a6b);
  color: #fff;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.dbim-view-pdf:hover { background: #142c52; color: #fff; }
.dbim-view-pdf .dbim-file { font-weight: 400; opacity: .9; }

/* Empty state */
.dbim-noresults {
  padding: 1.25rem;
  background: #eef4fa;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 8px;
  color: var(--dbim-color-primary, #1a3a6b);
}

/* ---- Photo / album gallery (inner pages) ---------------------------- */
/* CRPF-style uniform card grid: fixed 3:2 tiles, cover-cropped, captions
   below. Rendered on inner pages (photos.php) which load dbim-inner.css. */
.dbim-albums { margin: 1.5rem 0 0; }
.dbim-albums__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--dbim-color-primary, #1a3a6b);
}
.dbim-albums__title .dbim-icon { flex: 0 0 auto; }
.dbim-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dbim-album {
  display: flex;
  flex-direction: column;
  color: var(--dbim-color-primary, #1a3a6b);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--dbim-color-border, #d9e1ea);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.dbim-album:hover,
.dbim-album:focus-visible {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  transform: translateY(-2px);
}
.dbim-album img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  background: var(--dbim-color-border, #eef2f7);
}
.dbim-album__title {
  display: block;
  padding: .7rem .85rem;
  font-size: .92rem;
  line-height: 1.35;
  font-weight: 500;
}
.dbim-album:hover .dbim-album__title { text-decoration: underline; }
@media (max-width: 480px) {
  .dbim-album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
}
