/* Patriotic Officers register ---------------------------------------------
   Values taken from the reference theme (wp-content/themes/plu-theme/style.css,
   the .plu-officers-* and .plu-data-table blocks), then confirmed against the
   rendered page. Scoped to this page's own classes and loaded through
   {% block page_css %}, so plu.css is untouched. */

/* The reference centres content on a 1360px container measured against the
   VIEWPORT. Ours sat inside .plu-shell, which caps at 1180 and pads 20 a side,
   leaving the register 220px short at 1440. The page has to leave the shell. */
.plu-officers-page { width: 100vw; margin-left: calc(50% - 50vw); }

/* Hero: style.css:1193-1195 */
.plu-officers-hero {
  min-height: 430px; display: grid; grid-template-columns: 1fr auto;
  align-items: end; gap: 40px;
  padding: 120px max(56px, calc((100vw - 1360px) / 2 + 24px)) 70px;
  background: #050505; color: #fff;
  border-bottom: 4px solid var(--plu-yellow);
}
/* The base rule is clamp(54px, 6vw, 86px) and a LATER rule overrides it.
   Measured on the reference: 72 at 1440, 48 at 768, 32 at 320. */
.plu-officers-hero h1 {
  /* line-height 1, not the base rule's 1.02 - same override as the size. */
  margin: 0; font-size: clamp(48px, 5.6vw, 72px); line-height: 1; font-weight: 900;
}
.plu-officers-hero .plu-eyebrow { color: var(--plu-yellow); }
.plu-officers-hero aside {
  min-width: 160px; min-height: 58px; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  background: var(--plu-yellow); color: #000;
  font-weight: 900; text-transform: uppercase;
}
.plu-officers-hero aside b { font-size: 20px; }

/* Content and toolbar: style.css:1196-1198 */
.plu-officers-content { max-width: 1360px; margin-inline: auto; padding: 60px 24px 80px; }
.plu-officers-toolbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.plu-officers-toolbar > a:first-child {
  font-weight: 900; text-transform: uppercase;
  text-decoration-color: var(--plu-red); text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}
.plu-mini-button {
  display: inline-flex; min-height: 38px; align-items: center; padding: 0 18px;
  background: #050505; color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 900; text-transform: uppercase; border-radius: 2px;
}

/* Search: style.css:1100-1101, 1113-1114 */
/* padding:16px is measured on the reference and is NOT in the base rule -
   an override adds it. Without it the input ran 34px wide. */
.plu-table-search { display: flex; gap: 10px; margin: 20px 0; padding: 16px; }
/* flex:1 - the reference lets this fill the row (1160px of a 1312px form at
   1440). Capping it at the 460px min-width alone left it a quarter as wide. */
.plu-table-search input {
  flex: 1 1 0%; min-width: min(460px, 100%); min-height: 46px;
  border: 1px solid #cfcfc6; padding: 0 14px; font: inherit;
}
.plu-table-search button {
  min-height: 46px; border: 0; background: #050505; color: #fff; padding: 0 20px;
  font: inherit; font-weight: 900; text-transform: uppercase; cursor: pointer;
}

/* Table: style.css:1106, 1115-1120 */
.plu-table-summary { margin: 16px 0 10px; color: rgba(0,0,0,.62); font-size: 13px; font-weight: 700; }
.plu-data-table-wrap {
  overflow-x: auto; background: #fff; border: 1px solid var(--plu-line);
  box-shadow: var(--plu-shadow);
}
.plu-data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.plu-data-table th {
  background: #050505; color: #fff; text-align: left;
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
}
.plu-data-table th, .plu-data-table td { padding: 14px 16px; border-bottom: 1px solid var(--plu-line); }
.plu-data-table td strong { color: #000; }

/* Rows: style.css:1205-1213 */
.plu-officers-table .plu-officer-row { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.plu-officers-table .plu-officer-row td { position: relative; background: #fff; transition: background .18s ease, border-color .18s ease; }
.plu-officers-table .plu-officer-row:nth-child(even) td { background: #fffdf0; }
.plu-officers-table .plu-officer-row:hover td,
.plu-officers-table .plu-officer-row:focus td { background: #fff8a8; border-bottom-color: #e4d900; }
.plu-officers-table .plu-officer-row:focus { outline: 3px solid var(--plu-red); outline-offset: -3px; }
.plu-po-badge {
  display: inline-flex; min-width: 76px; justify-content: center; padding: 7px 10px;
  background: #050505; color: var(--plu-yellow) !important;
  border-left: 4px solid var(--plu-red); font-size: 12px; letter-spacing: .04em;
}
.plu-officer-name { font-weight: 900; color: #111; }
.plu-location-chip { display: inline-block; padding: 6px 9px; background: #f0f0ec; color: #333; font-size: 12px; font-weight: 800; }
.plu-status-chip { display: inline-flex; align-items: center; gap: 7px; color: #087f3e; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.plu-officer-view { border: 0; background: transparent; color: #111; font: inherit; font-size: 12px; font-weight: 900; text-transform: uppercase; cursor: pointer; }

/* Pagination: style.css:1107-1112. The reference marks the current page with
   .page-numbers.current; ours uses aria-current, which is the same state. */
.plu-table-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 28px 0 0; }
.plu-table-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 0; padding: 0; list-style: none; }
.plu-table-pagination li { margin: 0; }
.plu-table-pagination a, .plu-table-pagination span {
  display: grid; min-width: 42px; min-height: 42px; place-items: center; padding: 7px 12px;
  border: 1px solid #cfcfc6; background: #fff; color: #111;
  font-size: 13px; font-weight: 900; text-decoration: none;
}
.plu-table-pagination a:hover { border-color: #111; background: #fff200; }
.plu-table-pagination span[aria-current="page"] { border-color: #111; background: #111; color: #fff200; }

/* Visually hidden, for the header the reference marks screen-reader-only. */
.plu-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Profile dialog. The reference's own modal, same hooks. */
.plu-officer-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; }
.plu-officer-modal[hidden] { display: none; }
.plu-officer-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.plu-officer-modal__dialog {
  position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  display: grid; grid-template-columns: 180px 1fr; gap: 24px;
  padding: 28px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.plu-officer-modal__close {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px;
  border: 0; background: transparent; color: #111; font-size: 28px; cursor: pointer;
}
.plu-officer-modal__portrait {
  display: grid; place-items: center; min-height: 180px;
  background: var(--plu-yellow); color: #050505; font-size: 46px; font-weight: 900;
}
.plu-officer-modal__number {
  display: inline-flex; padding: 6px 10px; background: #050505;
  color: var(--plu-yellow); font-size: 12px; font-weight: 900; letter-spacing: .04em;
}
.plu-officer-modal__content h2 { margin: 10px 0 4px; font-size: 26px; }
.plu-officer-modal__role { margin: 0; color: rgba(0,0,0,.62); font-weight: 800; }
.plu-officer-modal__meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.plu-officer-modal__meta span { padding: 6px 9px; background: #f0f0ec; font-size: 12px; font-weight: 800; }
.plu-officer-modal__summary { color: rgba(0,0,0,.7); line-height: 1.65; }
.plu-officer-modal__content a { font-weight: 900; }

/* Below 760 the reference does NOT scroll this table sideways - it restacks
   each row as a card and drops the header row entirely. Its generic
   scroll-the-table rule is written as
   `.plu-data-table-wrap:not(.plu-officers-table-wrap)`, excluding this table on
   purpose. Porting the desktop rule alone left the 720px table escaping its
   wrapper and pushing the document to 707px at a 320px viewport. */
@media (max-width: 760px) {
  .plu-table-search { flex-direction: column; }
  .plu-officers-hero { grid-template-columns: 1fr; padding: 80px 20px 30px; min-height: 0; }
  .plu-officers-toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .plu-officer-modal__dialog { grid-template-columns: 1fr; }

  .plu-officers-table-wrap { width: 100%; overflow: visible; box-shadow: none; background: transparent; border: 0; }
  .plu-officers-table { width: 100%; min-width: 0; display: block; }
  .plu-officers-table thead { display: none; }
  .plu-officers-table tbody { display: grid; gap: 12px; }
  .plu-officers-table .plu-officer-row {
    width: 100%; display: grid;
    grid-template-columns: minmax(88px, .34fr) minmax(0, 1fr);
    gap: 8px 14px; padding: 16px;
    border: 1px solid var(--plu-line); border-left: 4px solid var(--plu-yellow);
    background: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.045);
  }
  .plu-officers-table .plu-officer-row td,
  .plu-officers-table .plu-officer-row:nth-child(even) td { display: block; padding: 0; border: 0; background: transparent; }
  .plu-officers-table .plu-officer-row td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .plu-officers-table .plu-officer-row td:nth-child(2) { grid-column: 2; font-size: 16px; line-height: 1.35; }
  .plu-officers-table .plu-officer-row td:nth-child(3) { grid-column: 2; color: rgba(0,0,0,.62); font-size: 12px; }
  .plu-officers-table .plu-officer-row td:nth-child(4) { grid-column: 1; }
  .plu-officers-table .plu-officer-row td:nth-child(5) { grid-column: 2; align-self: center; }
  .plu-officers-table .plu-officer-row td:nth-child(6) { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--plu-line); }
  .plu-officer-view { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; }
  .plu-po-badge { min-width: 82px; }
  /* The empty-state row is not a .plu-officer-row, so it needs its own
     treatment once tbody becomes a grid. */
  .plu-officers-table tbody tr:not(.plu-officer-row) { display: block; }
  .plu-officers-table tbody tr:not(.plu-officer-row) td { display: block; padding: 18px; background: #fff; border: 1px solid var(--plu-line); }
  .plu-table-pagination a, .plu-table-pagination span { min-width: 40px; min-height: 40px; padding: 6px 9px; }
}

@media (max-width: 420px) {
  /* Measured on the reference at 320: h1 32px, content padding 38px 14px 60px.
     Its hero also reserves a 240px band for the banner photograph; we have no
     photograph, so that band is deliberately not reproduced - an empty 240px
     of black would read as breakage. */
  .plu-officers-hero h1 { font-size: 32px; line-height: 1.08; }
  .plu-officers-content { padding: 38px 14px 60px; }
}
