/*
 * Kentian Honour Roll - front-end styles, built to mockup v5 (approved by Simon on 4 Nov 2026;
 * kentian-society repo, design/assets/style.css) and the Webstein Design Standards: one section padding
 * (96px desktop, 64px phone), content across the full content width (1120px), three type sizes (48/32/18px),
 * tan title band with white below it, boxes on a white section in tan.
 *
 * Everything is scoped to .khr (the wrapper on every plugin page) so it can't clash with the
 * theme. Colours, fonts and sizes come from the theme's own tokens when it defines them (--navy, --gold,
 * --section, --fs-1 ...); the values after the comma are the design's, used on any other theme.
 */
.khr {
  --khr-navy: var(--navy, #14243b);
  --khr-navy-2: var(--navy-2, #1f3556);
  --khr-gold: var(--gold, #b8954e);
  --khr-gold-text: var(--gold-text, #7d6128);
  --khr-gold-light: var(--gold-light, #e8d9b5);
  --khr-red: var(--red, #9b2c2c);
  --khr-paper: var(--paper, #f7f3ea);
  --khr-white: var(--white, #ffffff);
  --khr-ink: var(--ink, #1d1d1f);
  --khr-muted: var(--muted, #55565a);
  --khr-line: var(--line, #e2dccd);
  --khr-radius: var(--radius, 4px);
  --khr-max: var(--max, 1120px);
  --khr-gutter: var(--gutter, 24px);
  --khr-section: var(--section, 96px);
  --khr-fs-1: var(--fs-1, 3rem);
  --khr-fs-2: var(--fs-2, 2rem);
  --khr-fs-3: var(--fs-3, 1.125rem);
  --khr-serif: var(--serif, "Playfair Display", Georgia, "Times New Roman", serif);
  --khr-sans: var(--sans, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-family: var(--khr-sans); font-size: var(--khr-fs-3); color: var(--khr-ink); line-height: 1.6;
}
@media (max-width: 820px) {
  .khr { --khr-section: var(--section, 64px); --khr-fs-1: var(--fs-1, 2.25rem); --khr-fs-2: var(--fs-2, 1.5rem); }
}
.khr *, .khr *::before, .khr *::after { box-sizing: border-box; }
.khr img { max-width: 100%; height: auto; display: block; }
.khr a { color: var(--khr-navy-2); text-underline-offset: 4px; }
.khr a:hover { color: var(--khr-red); }
.khr :focus-visible { outline: 3px solid var(--khr-navy-2); outline-offset: 4px; }

.khr h1, .khr h2, .khr h3 { font-family: var(--khr-serif); font-weight: 600; line-height: 1.2; color: var(--khr-navy); margin: 0 0 16px; text-wrap: balance; }
.khr h1 { font-size: var(--khr-fs-1); }
.khr h2 { font-size: var(--khr-fs-2); }
.khr h3, .khr .h3 { font-size: var(--khr-fs-3); font-weight: 700; }
.khr p { margin: 0 0 16px; }
.khr .wrap { max-width: calc(var(--khr-max) + 2 * var(--khr-gutter)); margin: 0 auto; padding: 0 var(--khr-gutter); }

/* Sections and the title band */
.khr .section { padding: var(--khr-section) 0; }
.khr .section-white { background: var(--khr-white); }
.khr .section-paper { background: var(--khr-paper); }
.khr .hero { background: var(--khr-paper); }
.khr .hero .wrap { padding-top: var(--khr-section); padding-bottom: var(--khr-section); }
.khr .hero .wrap > :last-child, .khr .section .wrap > :last-child { margin-bottom: 0; }
.khr .crumbs { color: var(--khr-muted); margin-bottom: 16px; }
.khr .crumbs a { color: var(--khr-navy-2); } /* 44px tap box: the shared rule below */
.khr .eyebrow { text-wrap: balance; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--khr-gold-text); margin-bottom: 8px; display: block; }
.khr .lead { color: var(--khr-muted); }
.khr .years { color: var(--khr-gold-text); font-weight: 600; }
.khr .hero .lead:last-child, .khr .hero .years { margin-bottom: 0; }
.khr h1 .given { display: block; font-size: var(--khr-fs-2); font-weight: 500; }

/* Buttons: one style */
.khr .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--khr-navy-2); color: var(--khr-white); text-decoration: none; padding: 16px 24px; border-radius: var(--khr-radius);
  font-weight: 600; border: 2px solid var(--khr-navy-2); font-size: var(--khr-fs-3); line-height: 1.2; cursor: pointer; font-family: var(--khr-sans);
}
.khr .btn:hover { background: var(--khr-navy); border-color: var(--khr-navy); color: var(--khr-white); }
.khr .btn-outline { background: transparent; color: var(--khr-navy-2); }
.khr .btn-outline:hover { background: var(--khr-navy-2); color: var(--khr-white); }
.khr .btn svg { width: 16px; height: 16px; }

.khr .grid { display: grid; gap: 24px; }
.khr .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.khr .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.khr .two-col h2 { margin-bottom: 24px; }

/* Boxes on a white section take the tan (Simon, 4 Nov) */
.khr .section-white :is(.gate, .story, .relative, .details, .keyfacts, .docs a, .docs .doc-text, .research-cta, .fate, .ksshs) { background: var(--khr-paper); }

/* Conflict cards (honour-board feel). On the index all six are the same size, the "View" line across one row. */
.khr .conflict {
  background: var(--khr-navy); color: var(--khr-white); border-radius: var(--khr-radius); padding: 32px 32px 24px;
  text-decoration: none; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--khr-navy);
  position: relative; transition: transform .15s, box-shadow .15s;
}
.khr .conflict::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(184,149,78,.45); border-radius: 2px; pointer-events: none; }
.khr a.conflict:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,36,59,.25); color: var(--khr-white); }
.khr .conflict .conflict-title { color: var(--khr-gold-light); letter-spacing: .04em; text-transform: uppercase; margin: 0; }
.khr .conflict .dates { color: #d9dfe8; }
.khr .conflict .count { margin-top: 8px; color: var(--khr-gold-light); }
.khr .conflict .go { margin-top: auto; padding-top: 16px; font-weight: 600; color: var(--khr-white); }
.khr .rolls-grid { grid-auto-rows: 1fr; }
.khr .after-grid { margin: 32px 0; }
.khr .sub-rolls { margin-top: 48px; }
.khr .history + .sub-rolls { margin-top: 0; }
.khr .research-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: var(--khr-white); border: 1px solid var(--khr-line); border-top: 4px solid var(--khr-gold); border-radius: var(--khr-radius); padding: 24px 32px; margin-top: 32px; }
.khr .research-cta p { margin: 0; color: var(--khr-muted); max-width: 52ch; }
.khr .research-cta .h3 { margin-bottom: 4px; }
.khr .two-col .research-cta .h3 { margin-bottom: 24px; } /* the profile's Family relationships box, as the mockup */
.khr .research-cta > div > :last-child:last-child { margin-bottom: 0; } /* a box's last item (a public profile has only the heading) */
.khr .research-cta-stack { margin-top: 24px; }
.khr .two-col > div > .research-cta:first-child { margin-top: 0; }

/* Conflict roll: John's history, the A-Z bar and the names */
.khr .history { margin-bottom: 48px; }
.khr .history > :last-child { margin-bottom: 0; }
.khr .az { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 32px; padding: 0; list-style: none; }
.khr .az li { margin: 0; }
.khr .az a, .khr .az span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 8px;
  border: 1px solid var(--khr-line); background: var(--khr-white); border-radius: 4px; text-decoration: none; font-weight: 600; color: var(--khr-navy);
}
.khr .az a:hover { border-color: var(--khr-gold); background: var(--khr-paper); }
.khr .az span { color: #b4b4b4; }
.khr .letter { font-size: var(--khr-fs-2); color: var(--khr-gold-text); border-bottom: 1px solid var(--khr-line); padding-bottom: 8px; margin: 32px 0 8px; }
.khr .names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 32px; }
.khr .names li { border-bottom: 1px solid var(--khr-line); margin: 0; }
.khr .names a { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; text-decoration: none; color: var(--khr-ink); }
.khr .names a:hover { background: var(--khr-paper); }
.khr .names .nm b { font-weight: 700; letter-spacing: .02em; }
.khr .names .sub { color: var(--khr-muted); }
/* Roll tags on their own line under the name, so neighbouring rows line up (2 Nov 2026) */
.khr .names .tags { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.khr .tag { display: inline-block; width: fit-content; font-weight: 600; letter-spacing: .04em; padding: 0 8px; border-radius: 4px; background: var(--khr-paper); color: var(--khr-red); border: 1px solid #e8cfcf; }

/* Name search and the All names link (Round 23 Nov): above the roll cards on the Nominal Rolls page and above the list on All names.
   The box takes the password box's input style; its border is the muted text colour so the box edge passes WCAG 3:1. */
.khr .name-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; margin-bottom: 48px; }
.khr .name-search { flex: 1 1 320px; min-width: 0; max-width: 560px; margin: 0; } /* min-width 0: the form may shrink below its input's natural width, so it fits a 320px phone (review 23 Nov, finding 1) */
.khr .name-search label { display: block; font-weight: 600; margin-bottom: 8px; }
.khr .name-search-row { display: flex; gap: 8px; }
.khr .name-search .btn { flex: none; }
.khr .name-search input { flex: 1; min-width: 0; padding: 12px 16px; font-size: var(--khr-fs-3); border: 1px solid var(--khr-muted); border-radius: 4px; font-family: var(--khr-sans); background: var(--khr-white); color: var(--khr-ink); }
.khr .link-target { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
/* A link alone on its line (KHR_Tap_Targets marks them in rich text; the Museum email is its own line in the "Photo unavailable" box) is 44px tall (review 23 Nov, finding 2) */
/* 44px tap box that doesn't move anything you see (review round 2 of 23 Nov, item 5): padding makes the box 44px around one line of
   text and the same negative margin gives the room back, so the line takes the space its text did before (a wrapped link too).
   Same rule as the theme's. A browser without the lh unit drops the last two declarations and keeps the plain 44px. */
/* Links in the plugin's own lists (A-Z bar, roll names, Links and documents, the home roll board) keep their own sizes and
   spacing: they are already 44px or more, and the page-wide marker must not override them (review round 3 of 23 Nov). */
.khr .crumbs a, .khr a.khr-tap:not(:is(.az, .names, .docs, .roll-board) a), .khr .photo-frame .inner > a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding-block: calc((44px - 1lh) / 2); margin-block: calc((1lh - 44px) / 2);
}
.khr .search-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-bottom: 32px; }
.khr .search-status .lead { margin: 0; }

/* Profile: tan section with the photo and key facts, then a white section with the details and links */
/* The photo frame keeps its 4:5 shape at every width and sits at the top of its column at its own height (Simon, review 16 Nov) */
.khr .profile { display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: start; }
.khr .photo-frame { position: relative; background: var(--khr-white); padding: 16px; border: 1px solid var(--khr-line); border-radius: 2px; box-shadow: 0 8px 24px rgba(20,36,59,.08); }
.khr .photo-frame .inner { aspect-ratio: 4 / 5; background: #ece6d8; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--khr-muted); gap: 8px; }
.khr .photo-frame .inner strong { font-family: var(--khr-serif); color: var(--khr-navy); }
.khr .photo-frame .inner.has-photo { padding: 0; position: relative; }
.khr .photo-frame .inner.has-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; } /* one crop for every photo: 15% from the top keeps all 31 heads whole (Banfield's cap was cut at the centre; Round 23 Nov, item 11) */
.khr .photo-frame i { position: absolute; width: 24px; height: 24px; background: var(--khr-navy); z-index: 1; }
.khr .photo-frame i:nth-of-type(1) { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.khr .photo-frame i:nth-of-type(2) { top: 0; right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.khr .photo-frame i:nth-of-type(3) { bottom: 0; left: 0; clip-path: polygon(0 0, 0 100%, 100% 100%); }
.khr .photo-frame i:nth-of-type(4) { bottom: 0; right: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.khr .keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border: 1px solid var(--khr-line); border-radius: var(--khr-radius); background: var(--khr-white); margin: 24px 0 32px; }
/* 16px sides (was 24px) so a service number and its conflict label fit on one line (Tommy, review 16 Nov) */
.khr .keyfacts div { padding: 16px; border-right: 1px solid var(--khr-line); border-bottom: 1px solid var(--khr-line); }
.khr .keyfacts dt { letter-spacing: .08em; text-transform: uppercase; color: var(--khr-muted); font-weight: 600; }
.khr .keyfacts dd { margin: 4px 0 0; font-weight: 600; color: var(--khr-navy); }
.khr .fate { border-left: 4px solid var(--khr-red); background: var(--khr-white); padding: 16px 24px; border-radius: 0 var(--khr-radius) var(--khr-radius) 0; margin: 0 0 32px; }
.khr .profile .fate { margin-bottom: 0; }
.khr .profile > div > :last-child { margin-bottom: 0; }
.khr .fate .eyebrow { color: var(--khr-red); margin-bottom: 4px; }
.khr .details { display: grid; grid-template-columns: 240px 1fr; margin: 0; background: var(--khr-white); border: 1px solid var(--khr-line); border-radius: var(--khr-radius); }
.khr .details dt, .khr .details dd { padding: 12px 24px; border-bottom: 1px solid var(--khr-line); margin: 0; }
.khr .details dt { font-weight: 600; color: var(--khr-muted); }
.khr .details dt:last-of-type, .khr .details dd:last-of-type { border-bottom: 0; }
.khr .docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.khr .docs li { margin: 0; }
.khr .docs a, .khr .docs .doc-text { display: flex; align-items: center; gap: 12px; background: var(--khr-white); border: 1px solid var(--khr-line); border-radius: var(--khr-radius); padding: 12px 16px; text-decoration: none; color: var(--khr-ink); }
.khr .docs a:hover { border-color: var(--khr-gold); }
.khr .docs .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--khr-paper); display: grid; place-items: center; color: var(--khr-navy); flex: none; font-weight: 700; }
.khr .docs small { display: block; color: var(--khr-muted); font-size: inherit; }
.khr .two-col h2.group-next { margin-top: 48px; } /* Stories under Links and documents (Round 23 Nov, item 15) */
.khr .ksshs-lead { margin-bottom: 0; }

/* Relationships: locked (explanation on the left, password box on the right) and unlocked */
.khr .gate { margin: 0; background: var(--khr-white); border: 1px solid var(--khr-line); border-top: 4px solid var(--khr-gold); border-radius: var(--khr-radius); padding: 32px; }
.khr .gate > :last-child { margin-bottom: 0; }
.khr .gate .gate-error { margin: 0 0 16px; padding: 8px 16px; border-left: 4px solid var(--khr-red); background: var(--khr-white); color: var(--khr-red); font-weight: 600; }
.khr .gate label { display: block; font-weight: 600; margin-bottom: 8px; }
.khr .gate input { width: 100%; padding: 12px 16px; font-size: var(--khr-fs-3); border: 1px solid #b9b2a2; border-radius: 4px; font-family: var(--khr-sans); margin-bottom: 16px; }
.khr .lock { width: 48px; height: 48px; border-radius: 50%; background: var(--khr-paper); display: grid; place-items: center; margin-bottom: 16px; color: var(--khr-navy); }
.khr .lock svg { width: 24px; height: 24px; }
.khr .ksshs { background: var(--khr-white); border: 1px solid var(--khr-line); border-radius: var(--khr-radius); padding: 24px; margin-bottom: 32px; }
.khr .ksshs p:last-child { margin-bottom: 0; }
.khr .conflict-group { margin-bottom: 32px; }
.khr .conflict-group h2 { display: flex; align-items: center; gap: 12px; font-size: var(--khr-fs-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--khr-navy); }
.khr .conflict-group h2::after { content: ""; flex: 1; height: 1px; background: var(--khr-line); }
.khr .relatives { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.khr .relative { background: var(--khr-white); border: 1px solid var(--khr-line); border-radius: var(--khr-radius); padding: 16px 24px; display: flex; flex-direction: column; gap: 4px; }
.khr .relative .rel { letter-spacing: .08em; text-transform: uppercase; color: var(--khr-gold-text); font-weight: 700; }
.khr .relative .who { font-weight: 700; color: var(--khr-navy); }
.khr .relative .info { color: var(--khr-muted); }
/* The link sits at the bottom of the card, so links in a row line up whatever the name length (Design Standards rule 5) */
.khr .relative a { margin-top: auto; display: inline-flex; align-items: center; align-self: flex-start; gap: .25em; min-height: 44px; font-weight: 600; } /* gap: the space before the arrow, which a flex box drops */
.khr .privacy-note { color: var(--khr-muted); border-top: 1px solid var(--khr-line); padding-top: 16px; margin: 16px 0 0; }

/* Story Hub */
.khr .stories { display: grid; gap: 24px; }
.khr .story { display: grid; grid-template-columns: 320px 1fr; gap: 24px; background: var(--khr-white); border: 1px solid var(--khr-line); border-radius: var(--khr-radius); overflow: hidden; text-decoration: none; color: var(--khr-ink); }
.khr a.story:hover { border-color: var(--khr-gold); color: var(--khr-ink); }
.khr .story .img { background: #ece6d8; min-height: 200px; display: grid; place-items: center; color: var(--khr-muted); text-align: center; padding: 24px; }
.khr .story .img.has-image { padding: 0; position: relative; }
.khr .story .img.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; } /* faces stay in: a top crop cut close portraits at the eyes, 30% cut Paul van Rijsewijk's mouth on phones */
.khr .story .body { padding: 24px 24px 24px 0; display: flex; flex-direction: column; gap: 8px; }
.khr .story h2 { margin: 0; }
.khr .story-lede { color: var(--khr-muted); margin: 0; }
.khr .story .go { margin-top: 8px; font-weight: 600; color: var(--khr-navy-2); }
/* Story photo: centred, never wider than its file nor taller than about 80% of the window; caption under it */
.khr .story-image { margin: 0 0 32px; text-align: center; }
.khr .story-image img { display: inline-block; width: auto; height: auto; max-width: 100%; max-height: 80vh; border-radius: var(--khr-radius); vertical-align: top; }
.khr .story-image figcaption { margin-top: 8px; font-size: 1rem; color: var(--khr-muted); line-height: 1.5; text-align: center; }

/* Rich text from Page Texts (Story Hub introduction, accuracy note): normal body text in the text column */
.khr .page-text { margin-bottom: 48px; }
.khr .page-text > :last-child { margin-bottom: 0; }
.khr .page-text a { color: var(--khr-navy-2); }
.khr .entry-content ul, .khr .entry-content ol { padding-left: 24px; }
/* The last block in a section has no bottom margin, whatever block it is (DESIGN-DECISIONS.md) */
.khr .entry-content > :last-child:last-child, .khr .entry-content .wp-block-group > :last-child:last-child { margin-bottom: 0; }

.khr .screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }

@media (min-width: 821px) {
  .khr .az { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); }
  .khr .az a, .khr .az span { min-width: 0; width: 100%; }
}
/*
 * Three-column card grids (roll cards, Relationships groups): a short last row
 * is centred (DESIGN-DECISIONS.md, 3 Nov). The grid has twice the tracks and
 * each card spans two, so a last row of one or two cards can start half a card in.
 */
@media (min-width: 640px) and (max-width: 1060px) {
  .khr .relatives { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .khr .relatives > * { grid-column: span 2; }
  .khr .relatives > :last-child:nth-child(2n+1) { grid-column: 2 / span 2; }
}
@media (min-width: 1061px) {
  .khr .grid-3, .khr .relatives { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .khr .grid-3 > *, .khr .relatives > * { grid-column: span 2; }
  .khr .grid-3 > :last-child:nth-child(3n+1), .khr .relatives > :last-child:nth-child(3n+1) { grid-column: 3 / span 2; }
  .khr .grid-3 > :nth-last-child(2):nth-child(3n+1), .khr .relatives > :nth-last-child(2):nth-child(3n+1) { grid-column: 2 / span 2; }
}
@media (min-width: 821px) and (max-width: 1060px) {
  .khr .grid-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .khr .grid-3 > * { grid-column: span 2; }
  .khr .grid-3 > :last-child:nth-child(2n+1) { grid-column: 2 / span 2; }
}
@media (max-width: 820px) {
  .khr .grid-3, .khr .two-col { grid-template-columns: 1fr; }
  .khr .two-col { gap: 64px; }
  .khr .profile { grid-template-columns: 1fr; gap: 24px; }
  .khr .profile > div:last-child { order: -1; }
  .khr .photo-frame { max-width: 280px; }
  .khr .details { grid-template-columns: 1fr; }
  .khr .details dt { border-bottom: 0; padding-bottom: 0; }
  .khr .story { grid-template-columns: 1fr; }
  .khr .story .img { min-height: 0; aspect-ratio: 3 / 2; } /* stacked: a fixed shape, not a wide 200px strip, so faces stay in at tablet widths */
  .khr .story .body { padding: 0 24px 24px; }
  .khr .names { grid-template-columns: 1fr; }
}
