/* =============================================================
   INSIDE PAGES
   The shared layout for every page except the homepage: a photo
   header with the angled bottom edge, content sections, and a
   closing band. Colours, type, buttons, nav and footer come from
   theme.css, which loads first.
   ============================================================= */

/* ---------- Page header ----------
   Each page sets its own photo with style="--photo: url(...)".
   The photo is tinted from the banner purple down into the page
   background, and the bottom edge is cut at the wordmark's angle. */
.page-head {
  position: relative;
  min-height: 62vh;
  display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 4rem) 0 clamp(5rem, 9vw, 7rem);
  background:
    linear-gradient(180deg, rgba(20,2,31,.55) 0%, rgba(20,2,31,.15) 35%, rgba(20,2,31,.55) 70%, var(--night) 100%),
    linear-gradient(90deg, rgba(20,2,31,.7) 0%, rgba(20,2,31,0) 65%),
    var(--photo, none) var(--photo-pos, center) / cover no-repeat,
    var(--night);
  clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}
.page-head h1 { font-size: clamp(3.4rem, 8vw, 7rem); }
.page-head .lead { margin-top: 1.25rem; color: #F6E9F8; }
.crumb { font-weight: 600; color: var(--peach); margin-bottom: .75rem; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--cream); }

/* ---------- Section headings ---------- */
.section-head { margin-bottom: 2.5rem; }
.section-head .lead { color: var(--muted); }

/* ---------- Chain of command ----------
   Administration on top, a trunk line down, then one branch per
   department. On phones it turns into a vertical tree. */
.chart { display: grid; }
.chart-top {
  justify-self: center;
  padding: 1rem 2.25rem;
  background: var(--cream); color: var(--violet);
  transform: skewX(var(--skew));
  text-align: center;
}
.chart-top > div { transform: skewX(12deg); }
.chart-top strong { display: block; font: italic 900 1.9rem/1 "Saira Extra Condensed"; }
.chart-top span { font-size: .9rem; font-weight: 600; }
.chart-trunk { justify-self: center; width: 2px; height: 2.25rem; background: var(--neon); }
.chart-branches { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 2px solid var(--neon); }
.chart-branches li { position: relative; padding: 2rem .75rem 0; text-align: center; }
.chart-branches li::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 1.5rem; background: var(--neon); }
.chart-branches a { text-decoration: none; }
.chart-branches abbr { font: italic 900 1.4rem/1 "Saira Extra Condensed"; color: var(--peach); text-decoration: none; }
.chart-branches strong { display: block; margin-top: .4rem; color: var(--cream); font-weight: 600; line-height: 1.3; }
.chart-branches a:hover strong { color: var(--peach); }

/* ---------- Department list ----------
   Each department is a row: a large outlined abbreviation on the
   left, its details on the right, separated by thin rules. */
.dept-list li {
  display: grid; grid-template-columns: 11rem 1fr; gap: 2rem;
  padding: 2.25rem 0; border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}
.dept-list li:last-child { border-bottom: 1px solid var(--line); }
.dept-code {
  font: italic 900 4.5rem/.9 "Saira Extra Condensed";
  color: transparent; -webkit-text-stroke: 2px var(--neon);
}
.dept-list h3 { font-size: 1.45rem; color: var(--cream); line-height: 1.2; }
.dept-list p { margin-top: .5rem; max-width: 46em; }
.dept-list .reports { margin-top: .75rem; font-size: .92rem; color: var(--muted); }
.dept-list .reports strong { color: var(--cream); font-weight: 600; }

/* ---------- Rank ladder ----------
   A real order, highest to lowest, shown as slanted steps. */
.ladder { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.ladder li { padding: .55rem 1.2rem; transform: skewX(var(--skew)); background: rgba(224,64,251,.14); box-shadow: inset 0 0 0 1px rgba(224,64,251,.35); }
.ladder li span { display: inline-block; transform: skewX(12deg); color: var(--cream); font-weight: 600; }
.ladder li:first-child { background: var(--cream); box-shadow: none; }
.ladder li:first-child span { color: var(--violet); }

/* A note for content that's on its way */
.pending { margin-top: 2rem; padding: 1.5rem 0 0; border-top: 1px dashed rgba(224,64,251,.4); color: var(--muted); max-width: 40em; }
.pending strong { color: var(--cream); font-weight: 600; }

/* ---------- Text and photo side by side ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.lean-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }

/* ---------- Closing band ----------
   The plaster wall with an angled top and bottom, used for the
   call to action at the end of a page. */
.page-cta {
  background: var(--plaster);
  background-blend-mode: soft-light, normal;
  clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
  padding: clamp(6rem, 11vw, 9rem) 0 clamp(4rem, 8vw, 6rem);
}
.page-cta .lead { color: #fff; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 860px) {
  .page-head { min-height: 52vh; clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%); }
  .split { grid-template-columns: 1fr; }

  .chart-top { justify-self: start; margin-left: .25rem; }
  .chart-trunk { justify-self: start; margin-left: 1.5rem; }
  .chart-branches { grid-template-columns: 1fr; border-top: 0; border-left: 2px solid var(--neon); margin-left: 1.5rem; }
  .chart-branches li { text-align: left; padding: .9rem 0 .9rem 1.75rem; }
  .chart-branches li::before { top: 1.6rem; left: 0; width: 1.25rem; height: 2px; }
  .chart-branches abbr { font-size: 1.15rem; }
  .chart-branches strong { display: inline; margin: 0 0 0 .5rem; }

  .dept-list li { grid-template-columns: 1fr; gap: .5rem; }
  .dept-code { font-size: 3rem; }
  .page-cta { clip-path: polygon(0 4%, 100% 0, 100% 100%, 0 100%); }
}

/* ---------- Path to duty ----------
   The steps a member goes through before serving. It's a real
   sequence, so it's numbered, joined by one line across the top. */
.path { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 2rem; margin-top: 2.5rem; counter-reset: p; position: relative; }
.path::before { content: ""; position: absolute; left: 0; right: 0; top: 1.4rem; height: 2px; background: linear-gradient(90deg, var(--neon), rgba(224,64,251,.15)); }
.path li { counter-increment: p; position: relative; padding-top: 4rem; }
.path li::before {
  content: counter(p);
  position: absolute; top: 0; left: 0;
  width: 2.9rem; height: 2.9rem; display: grid; place-items: center;
  background: var(--night); box-shadow: inset 0 0 0 2px var(--neon);
  transform: skewX(var(--skew));
  font: italic 900 1.5rem/1 "Saira Extra Condensed"; color: var(--cream);
}
.path h3 { color: var(--cream); font-size: 1.2rem; margin-bottom: .35rem; }
.path p { color: var(--muted); }

/* ---------- Agency roster ----------
   Agencies listed in rows, two columns wide: outlined abbreviation,
   name, and jurisdiction, with a small status tag. */
.roster-group + .roster-group { margin-top: 3.5rem; }
.roster-group h3.group-title { font: italic 900 2rem/1 "Saira Extra Condensed"; color: var(--peach); margin-bottom: 1rem; }
.roster { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
.roster li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.25rem; align-items: start; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.roster .code { font: italic 900 2.6rem/1 "Saira Extra Condensed"; color: var(--peach); letter-spacing: .01em; }
.roster h4 { color: var(--cream); font-size: 1.1rem; line-height: 1.25; }
.roster p { color: var(--muted); margin-top: .25rem; font-size: .97rem; }
.tag { display: inline-block; margin-top: .55rem; padding: .1rem .6rem; transform: skewX(var(--skew)); background: rgba(255,245,200,.08); font-size: .8rem; font-weight: 600; color: var(--muted); }
.tag span { display: inline-block; transform: skewX(12deg); }

@media (max-width: 860px) {
  .path { grid-template-columns: 1fr; gap: 1.5rem; padding-left: 4rem; }
  .path::before { left: 1.4rem; right: auto; top: .5rem; bottom: .5rem; width: 2px; height: auto; background: linear-gradient(180deg, var(--neon), rgba(224,64,251,.15)); }
  .path li { padding-top: 0; }
  .path li::before { left: -4rem; }
  .roster { grid-template-columns: 1fr; }
}

/* ---------- Gallery ----------
   A grid of photos. The first one is shown large; every photo opens
   full screen when clicked (the lightbox in site.js). */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 14rem; grid-auto-flow: dense; gap: .75rem; }
.gallery-item { position: relative; overflow: hidden; cursor: zoom-in; margin: 0; }
.gallery-item:first-child { grid-column: span 2; grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }   /* two wide shots keep the last row full */
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.5rem 1rem .75rem;
  background: linear-gradient(180deg, transparent, rgba(20,2,31,.85));
  font: italic 900 1.35rem/1 "Saira Extra Condensed"; color: var(--cream);
}
.fineprint { margin-top: 1.5rem; color: var(--muted); font-size: .9rem; max-width: 52em; }

.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 4rem; background: rgba(20, 2, 31, .96);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; }
.lightbox-caption { position: absolute; bottom: 1.25rem; left: 0; right: 0; text-align: center; font: italic 900 1.5rem/1 "Saira Extra Condensed"; color: var(--cream); }
.lightbox-close, .lightbox-nav { position: absolute; background: none; border: 0; color: rgba(255,245,200,.6); cursor: pointer; padding: .75rem; line-height: 1; }
.lightbox-close:hover, .lightbox-nav:hover { color: var(--cream); }
.lightbox-close { top: 1rem; right: 1.5rem; font-size: 2.2rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 2.8rem; }
.lightbox-prev { left: .75rem; }
.lightbox-next { right: .75rem; }

/* ---------- FAQ ----------
   Each question opens and closes on its own (plain <details>, no
   script needed). */
.faq { max-width: 52rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.25rem 0; font-size: 1.2rem; font-weight: 600; color: var(--cream);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: italic 900 2rem/1 "Saira Extra Condensed"; color: var(--neon); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 1.5rem; max-width: 46em; }
.faq details > div p + p { margin-top: .75em; }
.faq a { color: var(--peach); }
.faq-group + .faq-group { margin-top: 3rem; }
.faq-group h2 { font: italic 900 2rem/1 "Saira Extra Condensed"; color: var(--peach); margin-bottom: 1rem; }

/* ---------- Socials (Media page) ---------- */
.socials-list li { display: grid; grid-template-columns: 3.5rem 1fr auto; gap: 1.5rem; align-items: center; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.socials-list li:last-child { border-bottom: 1px solid var(--line); }
.socials-list img { width: 2.25rem; height: 2.25rem; filter: invert(1); opacity: .85; }
.socials-list h3 { color: var(--cream); font-size: 1.3rem; }
.socials-list p { color: var(--muted); }
.socials-list .soon img { opacity: .3; }

@media (max-width: 860px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 8rem; }
  .gallery-item:first-child { grid-column: span 2; grid-row: auto; }
  .gallery-item.wide { grid-column: auto; }
  .gallery-item:last-child { grid-column: span 2; }
  .lightbox { padding: 1rem; }
  .socials-list li { grid-template-columns: 2.5rem 1fr; }
  .socials-list li > a.btn, .socials-list li > .tag { grid-column: 2; justify-self: start; }
}

/* A department-style list without the big codes (About page) */
.dept-list.plain li { grid-template-columns: 1fr; }

/* ---------- Legal pages ----------
   Long-form text: a readable column with numbered section headings
   (the sections are referred to by number, so the numbers mean
   something here). */
.legal { max-width: 46rem; }
.legal .updated { color: var(--muted); margin-bottom: 2.5rem; }
.legal h2 { font: italic 900 2rem/1.05 "Saira Extra Condensed"; color: var(--cream); margin: 2.75rem 0 .75rem; }
.legal h2:first-of-type { margin-top: 0; }
.legal p + p, .legal ul + p, .legal p + ul { margin-top: .9em; }
.legal ul { list-style: none; }
.legal li { position: relative; padding-left: 1.4rem; margin-top: .45em; }
.legal li::before { content: ""; position: absolute; left: 0; top: .7em; width: .55rem; height: .55rem; background: var(--neon); transform: skewX(var(--skew)); }
.legal strong { color: var(--cream); font-weight: 600; }
.legal a { color: var(--peach); }
