/*
 * 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); }
.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-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: 40px; height: 40px; 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; }

/* 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; }
.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 .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: repeat(auto-fill, minmax(280px, 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); }
.khr .relative a { margin-top: 8px; font-weight: 600; }
.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%; }
}
@media (min-width: 1061px) {
  .khr .grid-3 > :last-child:nth-child(3n+1) { grid-column: 2; }
}
@media (min-width: 821px) and (max-width: 1060px) {
  .khr .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@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; }
}
