/* Portraits of the sovereign, /portraits (the owner's pick HI4, 17 Nov 2026). Loaded by that page only
   (render(..., ['css' => ['feat-portraits.css']])); view app/views/portraits.php. Every class begins .pt-.
   Dark colours: php tools/build_dark_css.php after a colour change. */

.pt-head { margin: .4rem 0 1.2rem; max-width: 72ch; }
.pt-head h1 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); color: var(--navy); margin: .3rem 0 .45rem; line-height: 1.15; }
.pt-head p:last-child { color: var(--muted); font-size: 1.05rem; }
.pt-kicker { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-ink); }
.pt-label { font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pt-nw { white-space: nowrap; }

.pt-sec { margin-top: 1.4rem; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 1.3rem 1.5rem 1.5rem; }
.pt-sec > h2 { color: var(--navy); font-size: 1.28rem; margin-bottom: .3rem; }
.pt-lede { color: var(--muted); margin-bottom: 1rem; max-width: 74ch; }
.pt-fine { font-size: .8rem; color: var(--muted); margin-top: 1.2rem; max-width: 95ch; line-height: 1.5; }
.pt-fine b { color: var(--ink); }
.pt-credit { display: block; font-size: .72rem; color: var(--muted); line-height: 1.3; padding: 0 .3rem; }

.pt-frame { display: grid; place-items: center; background: var(--thead); border-radius: 8px; aspect-ratio: 380 / 220; padding: .45rem; overflow: hidden; }
.pt-frame img { width: 100%; height: 100%; object-fit: contain; }

/* the five reigns */
.pt-reigns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
.pt-reign { display: flex; flex-direction: column; gap: .55rem; background: var(--card); border: 2px solid transparent; border-radius: 16px;
  padding: .7rem .7rem .8rem; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: border-color .15s ease; }
.pt-reign .pt-frame { aspect-ratio: 380 / 200; }
.pt-reign:hover { border-color: #cfdcfb; }
.pt-reign:focus-visible, .pt-card:focus-visible, .pt-chip:focus-visible, .pt-after a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pt-reign[aria-current="page"] { border-color: var(--accent); background: #f7faff; }
.pt-rt { display: flex; flex-direction: column; gap: .1rem; }
.pt-rt b { color: var(--navy); font-size: 1.02rem; line-height: 1.2; }
.pt-rr, .pt-rp { font-size: .84rem; color: var(--muted); }
.pt-rp strong { color: var(--ink); font-size: 1.05rem; }
.pt-reign[aria-current="page"] .pt-rp strong { color: var(--accent-strong); }

/* the chosen reign */
.pt-stage { margin-top: 1rem; }
.pt-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 1.4rem 2rem; align-items: start; }
.pt-top h2 { color: var(--navy); font-size: clamp(1.5rem, 3.4vw, 2rem); margin: .15rem 0 .35rem; }
.pt-count { font-size: clamp(1.05rem, 2.4vw, 1.3rem); line-height: 1.35; }
.pt-count strong { color: var(--accent-strong); font-size: 1.25em; }
.pt-first { margin-top: .5rem; color: var(--muted); font-size: .95rem; }
.pt-first a { color: var(--ink); }
.pt-yl { background: var(--thead); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem .85rem; }
.pt-yl[hidden] { display: none; }
.pt-yl-rail { position: relative; margin-top: .3rem; padding-bottom: 8px; }
.pt-yl-after { position: absolute; bottom: 0; right: 0; height: 6px; border-radius: 0 4px 4px 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, #e7c465 0 4px, #f6e7bd 4px 8px); }
.pt-yl input { position: relative; width: 100%; height: 44px; margin: 0; accent-color: var(--accent); background: transparent; }
.pt-yl-ends { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-yl-end { color: var(--amber-ink); font-weight: 700; text-align: center; }
.pt-yl-say { margin-top: .45rem; font-size: .95rem; }
.pt-yl-say b { color: var(--navy); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.pt-tf { margin-top: 1.2rem; display: flex; gap: .4rem .8rem; align-items: baseline; }
.pt-tf .pt-label { flex: none; }
.pt-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.pt-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: .25rem .75rem; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); font: inherit; font-size: .86rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.pt-chip small { font-size: .76rem; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-chip:hover { border-color: var(--accent); }
.pt-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #ffffff; }
.pt-chip[aria-pressed="true"] small { color: #c9d8f3; }
.pt-chip.pt-notyet { opacity: .45; }
.pt-chip[hidden] { display: none; }
.pt-chip-more { border-style: dashed; color: var(--accent-strong); font-weight: 700; }

/* the wall */
.pt-wall-say { margin: 1rem 0 .7rem; font-size: .9rem; color: var(--muted); }
.pt-wall-say b { color: var(--ink); }
.pt-wall { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: .8rem; }
.pt-wall li { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.pt-wall li[hidden] { display: none; }
.pt-card { flex: 1; display: flex; flex-direction: column; gap: .45rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: .5rem .5rem .6rem; color: var(--ink); text-decoration: none; }
.pt-card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.pt-card .pt-frame { aspect-ratio: 380 / 210; }
.pt-txt { display: flex; flex-direction: column; line-height: 1.3; padding: 0 .2rem; min-width: 0; }
.pt-yr { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent-strong); font-size: .92rem; }
.pt-txt b { color: var(--navy); font-size: .95rem; }
.pt-v { font-size: .86rem; color: var(--muted); }
.pt-tag-after { align-self: flex-start; margin-top: .2rem; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #5b430c; background: #f6e7bd; border: 1px solid #e7c465; border-radius: 6px; padding: .05rem .4rem; }
.pt-empty { padding: 1.4rem; text-align: center; color: var(--muted); background: var(--thead); border-radius: 12px; margin-top: .6rem; }
.pt-empty[hidden] { display: none; }
.pt-more-row { margin-top: 1rem; text-align: center; }
.pt-more { min-height: 44px; font: inherit; font-weight: 700; }
.pt-more[hidden] { display: none; }

/* time line, one bar per territory */
.pt-tl-key { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; font-size: .84rem; color: var(--muted); margin: .2rem 0 .7rem; }
.pt-tl-key i { display: inline-block; vertical-align: middle; margin-right: .35rem; }
.pt-kb { width: 22px; height: 10px; border-radius: 3px; background: var(--accent); }
.pt-ke { width: 0; height: 14px; border-left: 2px dashed #c8962a; }
.pt-tl-list, .pt-dc-list { list-style: none; }
.pt-tl-row { display: grid; grid-template-columns: minmax(0, 230px) minmax(0, 1fr) 7.6rem; gap: .9rem; align-items: center; min-height: 32px; }
.pt-tl-list .pt-tl-row { border-top: 1px solid var(--row); }
.pt-tl-name { font-size: .92rem; line-height: 1.25; }
.pt-tl-name small { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.pt-tl-track { position: relative; height: 30px; display: block; }
.pt-g { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.pt-end { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed #c8962a; z-index: 1; }
.pt-bar { position: absolute; top: 8px; height: 14px; background: var(--accent); border-radius: 4px; min-width: 6px; z-index: 2; }
.pt-tl-yrs { font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-tl-axis { min-height: 24px; }
.pt-tl-axis .pt-tl-track { height: 22px; }
.pt-tick { position: absolute; top: 2px; transform: translateX(-50%); font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-tick.pt-tk-first { transform: none; }
.pt-tick.pt-tk-last { transform: translateX(-100%); }

/* after the reign */
.pt-after { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.pt-af { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem 1.05rem; background: var(--card); display: flex; flex-direction: column; gap: .6rem; }
.pt-af-on { border-color: #e7c465; background: #fffaf0; }
.pt-af h3 { color: var(--navy); font-size: 1.05rem; }
.pt-af h3 small { display: block; font-weight: 500; color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.pt-af ul { list-style: none; display: grid; gap: .45rem; }
.pt-af li a { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: .7rem; align-items: center; color: var(--ink); text-decoration: none; border-radius: 8px; min-height: 44px; }
.pt-af li a:hover .pt-what b { text-decoration: underline; }
.pt-th { width: 92px; aspect-ratio: 380 / 210; border-radius: 6px; background: var(--thead); display: grid; place-items: center; overflow: hidden; }
.pt-th img { width: 100%; height: 100%; object-fit: contain; }
.pt-what { line-height: 1.3; font-size: .92rem; }
.pt-what b { color: var(--navy); }
.pt-what small { display: block; color: var(--muted); font-size: .82rem; }
.pt-af-go { align-self: flex-start; margin-top: auto; min-height: 44px; display: inline-flex; align-items: center; }
.pt-af-none { color: var(--muted); font-size: .92rem; margin-top: .8rem; }

/* Pick numbers by decade */
.pt-dc-row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) minmax(0, 19rem); gap: .9rem; align-items: center; }
.pt-dc-list .pt-dc-row { min-height: 30px; border-top: 1px solid var(--row); }
.pt-dc-lab { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; font-size: .92rem; }
.pt-dc-track { position: relative; height: 30px; display: block; }
.pt-dc-axis .pt-dc-track { height: 20px; }
.pt-dc-axis .pt-tick { top: 0; }
.pt-dc-bar { position: absolute; left: 0; top: 7px; height: 16px; display: flex; border-radius: 0 4px 4px 0; overflow: hidden; z-index: 1; }
.pt-dc-bar i { display: block; height: 100%; background: #c4d4ea; border-right: 1px solid var(--card); }
.pt-dc-bar i:last-child { border-right: 0; }
.pt-dc-bar i.pt-on { background: var(--accent); }
.pt-dc-tot { position: absolute; top: 5px; margin-left: 6px; z-index: 2; font-weight: 800; font-variant-numeric: tabular-nums; font-size: .92rem; }
.pt-dc-split { font-size: .84rem; color: var(--muted); line-height: 1.3; }
.pt-dc-split b { color: var(--accent-strong); }
.pt-dc-zero .pt-dc-lab, .pt-dc-zero .pt-dc-tot { color: var(--muted); }

@media (max-width: 1000px) {
  .pt-reigns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pt-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .pt-dc-row { grid-template-columns: 3.6rem minmax(0, 1fr); gap: 0 .5rem; }
  .pt-dc-split { grid-column: 2 / -1; padding-bottom: .3rem; }
  .pt-dc-axis > span:last-child { display: none; }
}
@media (max-width: 640px) {
  .pt-sec { padding: 1.1rem 1rem 1.2rem; }
  .pt-reigns { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .pt-reign { flex-direction: row; align-items: center; gap: .7rem; padding: .35rem .5rem; min-height: 56px; border-radius: 12px; }
  .pt-reign .pt-frame { width: 84px; flex: none; padding: .15rem; }
  .pt-rt { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; }
  .pt-rt b { width: 100%; font-size: .98rem; }
  .pt-first a { display: inline-block; min-height: 44px; padding: .55rem 0 .35rem; }
  .pt-tf { flex-direction: column; }
  .pt-chip { min-height: 44px; }
  .pt-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .pt-card { padding: .4rem .4rem .5rem; }
  .pt-after { grid-template-columns: minmax(0, 1fr); }
  .pt-tl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0 .6rem; padding: .3rem 0 .1rem; }
  .pt-tl-row .pt-tl-track { grid-column: 1 / -1; grid-row: 2; height: 24px; }
  .pt-bar { top: 5px; }
  .pt-tl-axis .pt-tl-track { grid-row: 1; height: 20px; }
  .pt-tl-axis > span { display: none; }
  .pt-tick.pt-odd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-reign { transition: none; }
}
