/*
  ep.gov.lk public stylesheet, direction P (design/DESIGN.md). Tokens are copied from
  design-lab/src/tokens.css, group P, light theme (the real design). One external file:
  the CSP allows no inline style (SECURITY V3). Sizes are in em from the P base, as in the
  prototype (p.css): the page is set at 13 px and every em is a parliament pixel / 13.
  Breakpoints are container queries on the page (.p), as in the prototype, so an admin
  preview at phone width follows them.
*/
/* Noto Sans for Latin, Sinhala and Tamil (OFL 1.1, @fontsource 5.3.0, as in the design
   lab), each script loaded only when a page uses it (unicode-range). Two weights a script,
   400 and 700 (PRF-04, 11.4 LC2); the files are re-encoded by app/dev/fonts/subset.py,
   every character of each script's block kept (SPRINT-12-NOTES, 11.4) */
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/static/fonts/noto-sans-latin-400.5b452b66.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/static/fonts/noto-sans-latin-700.c660c021.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Noto Sans Sinhala';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/static/fonts/noto-sans-sinhala-400.22bf1bca.woff2') format('woff2');
  unicode-range: U+0964-0965,U+0D81-0DF4,U+200C-200D,U+25CC;
}

@font-face {
  font-family: 'Noto Sans Sinhala';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/static/fonts/noto-sans-sinhala-700.ab827273.woff2') format('woff2');
  unicode-range: U+0964-0965,U+0D81-0DF4,U+200C-200D,U+25CC;
}

@font-face {
  font-family: 'Noto Sans Tamil';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/static/fonts/noto-sans-tamil-400.2ff923c6.woff2') format('woff2');
  unicode-range: U+0964-0965,U+0B82-0BFA,U+200C-200D,U+20B9,U+25CC;
}

@font-face {
  font-family: 'Noto Sans Tamil';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/static/fonts/noto-sans-tamil-700.95474986.woff2') format('woff2');
  unicode-range: U+0964-0965,U+0B82-0BFA,U+200C-200D,U+20B9,U+25CC;
}

:root {
  color-scheme: light;
  --p-page: #faf7f2;
  --p-card: #ffffff;
  --p-ground: #5c1620;
  --p-ground-deep: #44101a;
  --p-band: #7a1f2b;
  --p-on-dark: #ffffff;
  --p-on-dark-muted: #f1deda;
  --p-ink: #1c1c1c;
  --p-muted: #5f524c;
  --p-heading: #7a1f2b;
  --p-link-2: #855b08;
  --p-saffron: #e0a526;
  --p-on-saffron: #1c1c1c;
  --p-saffron-pale: #f6e3b4;
  --p-tint-1: #c8d4e8;
  --p-tint-2: #f3eadc;
  --p-panel: #f3eadc;
  --p-rule: #e2d6c6;
  --p-blue: #1f4e9c;
  --p-focus: #1f4e9c;
  --p-focus-on-dark: #e0a526;
  --p-font: 'Noto Sans';
  --font-sinhala: 'Noto Sans Sinhala';
  --font-tamil: 'Noto Sans Tamil';
  --leading-indic: 1.8;
  /* ACC-06 (11.4-T5): each script's line height and size, against Latin's. The lab gives Sinhala and Tamil
     the taller line and no other size, so both sizes are 1; a change here moves that script's pages alone */
  --leading-si: var(--leading-indic);
  --leading-ta: var(--leading-indic);
  --size-si: 1;
  --size-ta: 1;
  /* PRF-04 (11.4 LC2): Latin has two weights. The lab's medium, 500, is set at 400 and its semibold, 600, at
     700: the faces the browser picks when 500 and 600 are missing (CSS Fonts 4, font matching) */
  --p-weight-medium: 400;
  --p-weight-semibold: 700;
  --focus-width: 3px;
  --p-max: 1440px;
  --p-base-latin: 0.8125em;
  --p-base: var(--p-base-latin);
  --p-ribbon-interval: 7000ms;
  --p-menu-delay: 150ms;
  --motion-on: 1;
  --motion-base: 480ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-on: 0;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  /* the sticky header never hides the focused element (WCAG 2.4.11) */
  scroll-padding-top: 8rem;
}

body,
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

summary {
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

[hidden] {
  display: none !important;
}

.p {
  /* the page is the query container, as in the prototype (p.css) */
  container: p / inline-size;
  min-height: 100vh;
  color: var(--p-ink);
  background: var(--p-page);
  font-family: var(--p-font), var(--font-sinhala), var(--font-tamil), system-ui, sans-serif;
  font-size: var(--p-base);
  line-height: 1.385;
}

/* a page in Sinhala or Tamil: its base size from the script's token, and its own script's face before the
   other's, so a sign the two share (the danda, U+0964) fetches no other script's file */
.p:lang(si) {
  --p-base: calc(var(--p-base-latin) * var(--size-si));
}

.p:lang(ta) {
  --p-base: calc(var(--p-base-latin) * var(--size-ta));
  font-family: var(--p-font), var(--font-tamil), var(--font-sinhala), system-ui, sans-serif;
}

.p :lang(si) {
  line-height: var(--leading-si);
}

.p :lang(ta) {
  line-height: var(--leading-ta);
}

/* 11.4-T2, T3 (F2, PRF-04): a language's name in its own script, any other text of the frame in another script,
   and an untranslated title in a list or card, set in the system's fonts, so unicode-range fetches no other
   script's file for it (REQ:602 allows a system fallback; a system with no Sinhala or Tamil font, as a bare Linux,
   shows boxes there). The class covers the element and everything in it: what is in Sinhala or Tamil by its lang
   takes the system's fonts, unless the page is in that language. Latin in it stays Noto Sans, already loaded. */
.p .p-sysfont:lang(si),
.p .p-sysfont :lang(si),
.p .p-sysfont:lang(ta),
.p .p-sysfont :lang(ta) {
  font-family: var(--p-font), system-ui, sans-serif;
}

.p:lang(si) .p-sysfont:lang(si),
.p:lang(si) .p-sysfont :lang(si),
.p:lang(ta) .p-sysfont:lang(ta),
.p:lang(ta) .p-sysfont :lang(ta) {
  font-family: inherit;
}

.p a {
  color: inherit;
  text-decoration: none;
}

.p :focus-visible {
  outline: var(--focus-width) solid var(--p-focus);
  outline-offset: 0.15em;
}

.p-header :focus-visible,
.p-sitefoot :focus-visible,
.p-band :focus-visible,
.p-in-hero :focus-visible {
  outline-color: var(--p-focus-on-dark);
}

.p-header-card :focus-visible,
.p-mega-panel :focus-visible,
.p-navs :focus-visible {
  outline-color: var(--p-focus);
}

.p-main:focus {
  outline: none;
}

.p-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.p-skip {
  position: absolute;
  top: 0.5em;
  left: 0.5em;
  z-index: 60;
  padding: 0.6em 1em;
  font-weight: 700;
  color: var(--p-on-saffron);
  background: var(--p-saffron);
  transform: translateY(-400%);
}

.p a.p-skip {
  color: var(--p-on-saffron);
}

.p-skip:focus {
  transform: none;
}

.p-icon {
  width: 2.6em;
  height: 2.6em;
}

.p-icon-xs {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.3em;
}

.p-arrow {
  display: block;
  width: 2.77em;
  height: 0.92em;
  transition: transform calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease);
}

.p-wrap {
  max-width: var(--p-max);
  margin-inline: auto;
  padding-inline: max(16px, 5%);
}

/* ── the announcements ribbon (site notices, HOM-07) ────────────────────── */

.p-ribbon {
  background: var(--p-card);
  border-bottom: 1px solid var(--p-rule);
}

.p-ribbon-inner {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.4em 5%;
}

.p-ribbon-items {
  flex: 1;
  min-width: 0;
}

.p-ribbon-item {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.p-ribbon-item + .p-ribbon-item {
  margin-top: 0.3em;
}

/* with JavaScript, one announcement at a time */
.p-ribbon-one .p-ribbon-item {
  display: none;
}

.p-ribbon-one .p-ribbon-item[data-current] {
  display: flex;
  margin-top: 0;
}

.p-ribbon-level {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  flex: none;
  padding: 0.2em 0.7em 0.2em 0.5em;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.p-ribbon-level .p-icon {
  width: 1.3em;
  height: 1.3em;
}

.p-level-info {
  color: var(--p-card);
  background: var(--p-blue);
}

.p-level-notice {
  color: var(--p-on-saffron);
  background: var(--p-saffron);
}

.p-level-emergency {
  color: var(--p-on-dark);
  background: var(--p-band);
}

.p-ribbon-live {
  flex: none;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--p-band);
}

.p-ribbon[data-playing='true'] .p-ribbon-live {
  animation: p-live calc(var(--motion-base) * 4) ease-in-out infinite;
}

@keyframes p-live {
  50% {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .p-ribbon[data-playing='true'] .p-ribbon-live {
    animation: none;
  }
}

.p-ribbon-text {
  flex: 1;
  min-width: 0;
}

.p .p-ribbon-text a {
  font-weight: 700;
  color: var(--p-heading);
  text-decoration: underline;
}

.p-ribbon-count {
  color: var(--p-muted);
}

.p-ribbon-tools {
  display: flex;
  gap: 0.2em;
}

.p-ribbon-tools button,
.p-ribbon-close {
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  padding: 0;
  color: var(--p-heading);
  background: none;
  border: 1px solid var(--p-rule);
  border-radius: 50%;
  cursor: pointer;
}

.p-ribbon-tools .p-icon,
.p-ribbon-close .p-icon {
  width: 0.9em;
  height: 0.9em;
}

.p-ribbon-close {
  border-color: transparent;
}

.p-ribbon-play,
[aria-pressed='true'] > .p-ribbon-pause {
  display: none;
}

[aria-pressed='true'] > .p-ribbon-play {
  display: block;
}

/* ── 1. the header: utility strip ─────────────────────────────────────── */

.p-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--p-ground);
}

.p-utility {
  display: flex;
  justify-content: flex-end;
  height: 3.077em;
  overflow: hidden;
}

.p-utility-links {
  display: flex;
  align-items: center;
  gap: 0.2em;
  padding-inline: 0.8em;
  background: var(--p-ground);
}

.p .p-utility-links a {
  display: inline-block;
  padding: 0.35em 0.6em;
  font-size: 0.92em;
  font-weight: 700;
  color: var(--p-on-dark);
}

.p .p-utility-links a:hover {
  text-decoration: underline;
}

.p-clock {
  display: flex;
  align-items: center;
  padding-inline: 1.2em;
  font-size: 0.92em;
  white-space: nowrap;
  color: var(--p-on-dark-muted);
  background: var(--p-ground);
}

.p-social {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding-inline: 1em;
  background: color-mix(in srgb, var(--p-page) 88%, transparent);
}

.p .p-social a {
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  color: var(--p-ink);
}

.p-social .p-icon {
  width: 1.5em;
  height: 1.5em;
}

.p .p-search-square {
  display: grid;
  place-items: center;
  width: 3.077em;
  color: var(--p-on-saffron);
  background: var(--p-saffron);
}

.p-search-square .p-icon {
  width: 1.5em;
  height: 1.5em;
}

.p-lang {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9em;
  min-width: 17.5em;
  padding-inline: 1.2em 1.4em;
  white-space: nowrap;
  color: var(--p-on-dark);
  background: var(--p-ground);
}

.p-lang ul {
  display: flex;
  align-items: center;
}

.p-lang li + li::before {
  content: '|';
  content: '|' / '';
  margin-inline: 0.15em;
  color: var(--p-on-dark-muted);
}

.p .p-lang a,
.p-lang [aria-current] {
  display: inline-block;
  padding: 0.3em 0.35em;
  color: var(--p-on-dark);
}

.p .p-lang a:hover {
  text-decoration: underline;
}

.p-lang [aria-current] {
  font-weight: 700;
  box-shadow: inset 0 -0.15em 0 var(--p-saffron);
}

.p .p-access {
  display: grid;
  place-items: center;
  color: var(--p-on-dark);
}

.p-access .p-icon {
  width: 1.85em;
  height: 1.85em;
}

/* ── 2. the header card, the main menu and the "My cases" tile ─────────── */

.p-card-row {
  position: relative;
  display: flex;
  justify-content: flex-end;
  height: 6.2em;
}

.p-header-card {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  min-width: 0;
  margin-left: 3%;
  padding: 0 1.4em;
  background: var(--p-card);
}

/* the lockup as the official letterhead: emblem, flag, a thin divider, then the name in
   Tamil, Sinhala and English, bold, all in one colour (DESIGN rules) */
.p-lockup {
  display: flex;
  align-items: center;
  gap: 0.7em;
  flex: none;
}

.p-emblem {
  width: auto;
  height: 4.6em;
}

.p-lockup .p-flag {
  width: auto;
  height: 2.1em;
  align-self: center;
  border: 1px solid var(--p-rule);
}

.p-lockup-rule {
  align-self: stretch;
  width: 1px;
  margin-block: 0.5em;
  background: currentColor;
  color: var(--p-heading);
  opacity: 0.55;
}

.p-names {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  color: var(--p-heading);
}

.p .p-lockup .p-names > span {
  font-size: 0.95em;
  line-height: 1.35;
  letter-spacing: 0;
}

/* desktop menu: each item a disclosure whose panel overlays the page */
.p-mainnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 0.75em;
}

.p-mega-desk {
  min-width: 0;
}

.p .p-mega-top {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 1em 0 0.9em;
  font-size: 0.923em;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--p-ink);
}

.p .p-mega-top:hover,
.p-mega-d[open] > .p-mega-top {
  color: var(--p-heading);
  box-shadow: inset 0 -0.22em 0 var(--p-saffron);
}

.p-mega-chevron {
  width: 0.85em;
  height: 0.85em;
  transition: transform calc(var(--motion-base) * 0.4 * var(--motion-on)) var(--motion-ease);
}

.p-mega-d[open] > summary .p-mega-chevron {
  transform: rotate(180deg);
}

.p-mega-li-more {
  display: none;
}

.p-mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 8;
  max-height: calc(100vh - 9em);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--p-card);
  border-top: 3px solid var(--p-saffron);
  box-shadow: 0 1em 2em color-mix(in srgb, var(--p-ink) 22%, transparent);
}

/* the light backdrop under an open panel: the page beneath never moves */
.p-mega-desk .p-mega-d[open]::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 7;
  height: 100vh;
  background: color-mix(in srgb, var(--p-ink) 12%, transparent);
  pointer-events: none;
}

/* links left, the feature in its own column (design-lab p.css .p-mega-inner); a panel with no feature has the width */
.p-mega-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20em;
  gap: 3em;
  align-items: start;
  max-width: var(--p-max);
  margin-inline: auto;
  padding: 1.6em 4% 1.8em;
}

.p-mega-inner > :only-child {
  grid-column: 1 / -1;
}

.p-mega-main {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  min-width: 0;
}

.p-mega-search {
  display: flex;
  align-items: center;
  gap: 0.6em;
  max-width: 30em;
  padding: 0 0.9em;
  background: var(--p-page);
  border: 1px solid var(--p-muted);
}

.p-mega-search .p-icon {
  width: 1.2em;
  height: 1.2em;
  color: var(--p-muted);
}

.p-mega-search input {
  flex: 1;
  min-width: 0;
  height: 2.8em;
  font: inherit;
  color: var(--p-ink);
  background: transparent;
  border: 0;
}

.p-mega-count {
  font-size: 0.9em;
  color: var(--p-muted);
  white-space: nowrap;
}

/* column flow: groups of different lengths pack like the old site's nested menu */
.p-mega-groups {
  column-count: var(--cols, 4);
  column-gap: 2.2em;
}

.p-mega-groups[data-cols='3'] {
  --cols: 3;
}

.p-mega-groups[data-cols='2'] {
  --cols: 2;
}

.p-mega-groups[data-cols='1'] {
  --cols: 1;
}

.p-mega-group {
  break-inside: avoid;
  margin-bottom: 1.3em;
}

.p-mega-heading {
  margin-bottom: 0.4em;
  padding-bottom: 0.4em;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-link-2);
  border-bottom: 1px solid var(--p-rule);
}

.p .p-mega-group a {
  display: block;
  padding-block: 0.3em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--p-heading);
}

.p .p-mega-group a:hover {
  text-decoration: underline;
}

.p-mega-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.8em;
  padding-top: 1em;
  border-top: 1px solid var(--p-rule);
}

.p .p-mega-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 24px;
  font-weight: 700;
  color: var(--p-heading);
}

.p-mega-footer a:hover .p-arrow,
.p-cases:hover .p-arrow {
  transform: translateX(calc(0.4em * var(--motion-on)));
}

/* the drawer (tablet and phone) is not shown on desktop */
.p-drawer {
  display: none;
}

.p-cases {
  display: flex;
  flex: none;
  width: 9.7em;
}

.p-cases-icon {
  display: grid;
  place-items: center;
  width: 3.6em;
  flex: none;
  color: var(--p-on-saffron);
  background: var(--p-saffron);
}

.p-cases-icon .p-icon {
  width: 2.6em;
  height: 2.6em;
  stroke-width: 1.8;
}

.p-cases-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 0.15em;
  padding: 0 0.8em;
  color: var(--p-on-saffron);
  background: var(--p-saffron-pale);
}

.p-cases-text strong {
  font-weight: 700;
  white-space: nowrap;
}

.p-cases-text > span {
  display: none;
}

@container p (max-width: 98.5em) {
  .p-mainnav {
    gap: 0 0.55em;
  }

  .p .p-mega-top {
    font-size: 0.86em;
  }
}

@container p (max-width: 90.5em) {
  .p-header-card {
    margin-left: 1.5%;
    padding-inline: 1em;
    gap: 0.6em;
  }

  .p-mainnav {
    gap: 0 0.45em;
  }

  .p .p-mega-top {
    font-size: 0.82em;
  }
}

@container p (max-width: 84.6em) {
  .p-mega-groups {
    --cols: 3;
  }
}

/* between tablet and wide desktop, News and Contact us fold into "More" */
@container p (max-width: 84.6em) and (min-width: 64.01em) {
  .p-mega-desk .p-mega-li-news,
  .p-mega-desk .p-mega-li-contact {
    display: none;
  }

  .p-mega-desk .p-mega-li-more {
    display: list-item;
  }

  .p .p-mega-top {
    font-size: 0.86em;
  }
}

/* desktops short of wide give the clock's and the social icons' room to the utility strip's links, which have no other place
   there; the footer keeps the social links (PL-8) */
@container p (max-width: 97em) and (min-width: 64.01em) {
  .p-utility .p-clock,
  .p-utility .p-social {
    display: none;
  }
}

/* ── tablet and phone: the drawer ─────────────────────────────────────── */

@container p (max-width: 64em) {
  .p-utility-links,
  .p-mega-desk {
    display: none;
  }

  .p-drawer {
    display: block;
    margin-left: auto;
  }

  .p-menu-button {
    display: grid;
    place-items: center;
    width: 3.4em;
    height: 3.4em;
    border: 1px solid var(--p-rule);
  }

  .p-burger {
    display: block;
    width: 1.6em;
    height: 1.1em;
    border-block: 2px solid var(--p-ink);
    background: linear-gradient(var(--p-ink), var(--p-ink)) center / 100% 2px no-repeat;
  }

  .p-header-card {
    width: 100%;
  }

  .p-cases {
    width: auto;
    min-width: 0;
  }

  .p-cases-icon {
    display: none;
  }

  .p-drawer-backdrop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 4;
    height: 200vh;
    background: color-mix(in srgb, var(--p-ink) 45%, transparent);
  }

  .p-navs {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    width: min(85%, 26em);
    height: calc(100vh - 6em);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--p-card);
    box-shadow: -0.5em 0.5em 1.5em color-mix(in srgb, var(--p-ink) 25%, transparent);
  }

  .p-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.7em;
    padding: 0.6em 1.2em;
    background: var(--p-card);
    border-bottom: 1px solid var(--p-rule);
  }

  .p-drawer-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--p-heading);
  }

  .p-drawer-close {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    min-height: 3.4em;
    padding: 0 0.9em;
    font: inherit;
    font-weight: 700;
    color: var(--p-ink);
    background: none;
    border: 1px solid var(--p-rule);
    cursor: pointer;
  }

  .p-drawer-close .p-icon {
    width: 1.1em;
    height: 1.1em;
  }

  .p-drawer-search {
    display: flex;
    align-items: center;
    gap: 0.6em;
    margin: 0.9em 1.2em 0.4em;
    padding: 0 0.9em;
    background: var(--p-page);
    border: 1px solid var(--p-muted);
  }

  .p-drawer-search .p-icon {
    width: 1.2em;
    height: 1.2em;
    color: var(--p-muted);
  }

  .p-drawer-search input {
    flex: 1;
    min-width: 0;
    height: 3.4em;
    font: inherit;
    font-size: 1.077em;
    color: var(--p-ink);
    background: transparent;
    border: 0;
  }

  .p-mega-drawer {
    padding: 0.4em 1.2em;
  }

  .p-mega-drawer .p-mainnav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .p .p-mega-drawer .p-mega-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 3.4em;
    padding: 0.4em 0;
    font-size: 1em;
    border-bottom: 1px solid var(--p-rule);
  }

  .p .p-mega-drawer .p-mega-top:hover,
  .p-mega-drawer .p-mega-d[open] > .p-mega-top {
    box-shadow: none;
  }

  .p-mega-drawer .p-mega-panel {
    position: static;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .p-mega-drawer .p-mega-inner {
    display: block;
    padding: 0;
  }

  .p-mega-drawer .p-mega-main {
    gap: 0;
  }

  .p-mega-drawer .p-mega-groups {
    column-count: 1;
    padding: 0 0 0.6em 0.6em;
  }

  .p-mega-drawer .p-mega-group {
    margin: 0;
    border-bottom: 1px solid var(--p-rule);
  }

  .p .p-mega-gbtn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 3.4em;
    padding: 0.3em 0;
    font-size: 0.92em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--p-link-2);
  }

  .p-mega-group[open] > .p-mega-gbtn .p-mega-chevron {
    transform: rotate(180deg);
  }

  .p-mega-drawer .p-mega-group ul {
    padding: 0 0 0.6em 0.8em;
  }

  .p .p-mega-drawer .p-mega-group a {
    display: flex;
    align-items: center;
    min-height: 3.4em;
    padding-block: 0.2em;
  }

  .p-mega-drawer .p-mega-footer {
    flex-direction: column;
    gap: 0;
    padding: 0.2em 0 0.8em 0.6em;
    border: 0;
  }

  .p .p-mega-drawer .p-mega-footer a {
    min-height: 3.4em;
  }

  .p-drawer-foot {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    margin-top: auto;
    padding: 1.2em;
    background: var(--p-panel);
    border-top: 1px solid var(--p-rule);
  }

  .p-drawer-links {
    display: flex;
    flex-direction: column;
  }

  .p .p-drawer-links a {
    display: flex;
    align-items: center;
    min-height: 3.4em;
    font-weight: 700;
    color: var(--p-heading);
  }

  .p-drawer-lang {
    display: flex;
    gap: 0.4em;
  }

  .p .p-drawer-lang a,
  .p-drawer-lang [aria-current] {
    display: inline-flex;
    align-items: center;
    min-height: 3.4em;
    padding: 0 0.9em;
    font-weight: 700;
    color: var(--p-heading);
    border: 1px solid var(--p-rule);
  }

  .p-drawer-lang [aria-current] {
    color: var(--p-on-dark);
    background: var(--p-band);
    border-color: var(--p-band);
  }

  .p .p-drawer-cases {
    display: flex;
    align-items: center;
    gap: 0.6em;
    min-height: 3em;
    padding: 0 1em;
    font-weight: 700;
    color: var(--p-on-saffron);
    background: var(--p-saffron);
  }

  .p-drawer-cases .p-icon {
    width: 1.6em;
    height: 1.6em;
  }

  .p-drawer-cases .p-arrow {
    margin-left: auto;
  }
}

/* ── phone (390 px) ──────────────────────────────────────────────────────── */

@container p (max-width: 40em) {
  .p-ribbon-inner {
    flex-wrap: wrap;
    gap: 0.4em 0.6em;
    padding-inline: 4%;
  }

  .p-ribbon-item {
    flex-wrap: wrap;
    gap: 0.4em 0.6em;
  }

  .p-ribbon-text {
    flex-basis: 100%;
  }

  /* with JavaScript: the level and the controls on one line, the text below */
  .p-ribbon-one .p-ribbon-items,
  .p-ribbon-one .p-ribbon-item[data-current] {
    display: contents;
  }

  .p-ribbon-level {
    order: 1;
  }

  .p-ribbon-live {
    order: 2;
  }

  .p-ribbon-tools {
    order: 3;
    margin-left: auto;
  }

  .p-ribbon-close {
    order: 4;
  }

  .p-ribbon-one .p-ribbon-text {
    order: 5;
  }

  .p-clock {
    display: none;
  }

  .p-social {
    padding-inline: 0.5em;
  }

  .p-lang {
    min-width: 0;
    padding-inline: 0.6em;
    gap: 0.5em;
  }

  .p-card-row {
    height: 5.8em;
  }

  .p-header-card {
    margin-left: 1.5%;
    padding: 0.7em 1em;
    gap: 0.6em;
  }

  .p-lockup {
    gap: 0.45em;
  }

  .p-emblem {
    height: 3.8em;
  }

  .p-lockup .p-flag {
    height: 1.5em;
  }

  .p .p-lockup .p-names > span {
    font-size: 0.82em;
  }

  .p-menu-button {
    width: 2.5em;
  }

  .p-cases-text {
    width: 7.5em;
    padding: 0.6em;
  }

  /* longer Sinhala and Tamil labels wrap inside the tile */
  .p-cases-text strong {
    white-space: normal;
    line-height: 1.25;
  }

  .p-navs {
    width: 100%;
  }
}

/* the narrowest phones: the flag gives way, so the menu button and "My cases" stay side by side in every language */
@container p (max-width: 380px) {
  .p-lockup .p-flag,
  .p-lockup-rule {
    display: none;
  }

  .p-lockup {
    flex: 0 1 auto;
    min-width: 0;
  }

  .p-header-card {
    padding-inline: 0.6em;
  }

  .p-cases-text {
    width: auto;
    padding-inline: 0.45em;
  }

  /* one name, in the page's language: three would stand taller than the card */
  .p:lang(si) .p-names > :not([lang='si']),
  .p:lang(ta) .p-names > :not([lang='ta']),
  .p:lang(en) .p-names > :not([lang='en']) {
    display: none;
  }
}

/* ── the footer: one continuous maroon band, the council, the links, the bar ── */

.p-sitefoot {
  position: relative;
  margin-top: 2em;
  overflow: hidden;
  color: var(--p-on-dark);
  background: var(--p-ground);
}

.p-sf-rule {
  display: block;
  height: 0.35em;
  background: linear-gradient(90deg, var(--p-band) 0 33.33%, var(--p-saffron) 33.33% 66.66%, var(--p-blue) 66.66% 100%);
}

.p-sf-mid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2.5em 4em;
  max-width: var(--p-max);
  margin-inline: auto;
  padding: 2.5em 5% 3em;
}

/* the emblem and the flag side by side, very faint, fully inside */
.p-sf-watermark {
  position: absolute;
  top: 1.5em;
  bottom: 1.5em;
  right: 4%;
  display: flex;
  align-items: center;
  gap: 1.4em;
  opacity: 0.08;
  pointer-events: none;
}

.p-sf-wm-emblem {
  width: auto;
  height: 100%;
}

.p-sf-wm-flag {
  width: auto;
  height: 45%;
}

.p-sf-about,
.p-sf-cols {
  position: relative;
}

.p-sf-about {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.p-footer-lockup .p-names,
.p-footer-lockup .p-lockup-rule {
  color: var(--p-on-dark);
}

.p-footer-lockup .p-emblem {
  height: 5em;
}

.p-footer-lockup .p-flag {
  border-color: transparent;
}

.p-sf-line {
  color: var(--p-on-dark-muted);
}

.p-sf-contact {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-size: 0.95em;
  color: var(--p-on-dark-muted);
}

.p-sf-contact li {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
}

.p-sf-contact .p-icon-xs {
  flex: none;
  margin-top: 0.25em;
  color: var(--p-saffron);
}

.p .p-sf-contact a {
  /* a target of 24 px however the line wraps (WCAG 2.5.8): the phone and email stand alone, not in a sentence */
  display: inline-block;
  min-height: 24px;
  color: var(--p-on-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.p-sf-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5em 2em;
}

/* on wide screens the columns are always open: the summary is only a heading */
.p-sf-col > summary {
  cursor: default;
  pointer-events: none;
}

.p-sf-col .p-mega-chevron {
  display: none;
}

.p-sf-heading {
  margin-bottom: 0.7em;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-saffron);
}

.p .p-sf-col a {
  position: relative;
  display: inline-block;
  padding-block: 0.35em;
  color: var(--p-on-dark);
}

.p .p-sf-col a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.2em;
  height: 2px;
  background: var(--p-saffron);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform calc(var(--motion-base) * 0.6 * var(--motion-on)) var(--motion-ease);
}

.p .p-sf-col a:hover::after,
.p .p-sf-col a:focus-visible::after {
  transform: scaleX(1);
}

.p-sf-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1.6em;
  padding: 1em 5% 1.2em;
  font-size: 0.875em;
  color: var(--p-on-dark-muted);
  background: var(--p-ground-deep);
}

.p-sf-policies,
.p-sf-lang {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em 1em;
}

.p .p-sf-bottom a {
  color: var(--p-on-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.p-sf-lang {
  margin-left: auto;
}

.p-sf-lang li + li::before {
  content: '·';
  content: '·' / '';
  margin-right: 1em;
  color: var(--p-on-dark-muted);
}

.p-sf-lang [aria-current] {
  font-weight: 700;
  color: var(--p-on-dark);
}

.p .p-sf-bottom .p-sf-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.6em;
  padding: 0 1em;
  font-weight: 700;
  color: var(--p-on-dark);
  text-decoration: none;
  border: 1px solid var(--p-on-dark-muted);
  border-radius: 1.3em;
}

.p .p-sf-bottom .p-sf-top:hover {
  color: var(--p-ground);
  background: var(--p-on-dark);
}

@container p (max-width: 64em) {
  .p-sf-mid {
    grid-template-columns: minmax(0, 1fr);
  }

  .p-sf-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container p (max-width: 40em) {
  .p-sf-mid {
    padding-inline: 5%;
  }

  .p-sf-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .p-sf-col {
    border-bottom: 1px solid color-mix(in srgb, var(--p-on-dark) 22%, transparent);
  }

  /* on a phone the columns are disclosures */
  .p-sf-col > summary {
    cursor: pointer;
    pointer-events: auto;
  }

  .p-sf-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 3.4em;
    margin: 0;
  }

  .p-sf-col .p-mega-chevron {
    display: block;
  }

  .p-sf-col[open] .p-mega-chevron {
    transform: rotate(180deg);
  }

  .p-sf-col ul {
    padding-bottom: 0.8em;
  }

  .p .p-sf-col a {
    display: flex;
    align-items: center;
    min-height: 2.75em;
  }

  .p-sf-watermark {
    top: auto;
    height: 12em;
    bottom: 1em;
  }

  .p-sf-lang {
    margin-left: 0;
  }
}

/* ── pages of M0 that the next stories replace: set at the reading size ───── */

.p-band,
.p-section {
  font-size: 1.23em;
}

.p-band {
  padding-block: 2.2em 2.4em;
  color: var(--p-on-dark);
  background: var(--p-band);
}

.p-page-title {
  font-size: 2.2em;
  font-weight: 700;
  line-height: 1.15;
}

.p-section {
  padding-block: 2em 3em;
}

.p-section h2 {
  margin-bottom: 0.8em;
  font-size: 1.4em;
  color: var(--p-heading);
}

.p .p-section a {
  color: var(--p-heading);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.p-links li + li {
  margin-top: 0.5em;
}

.p-links a,
.p .p-all,
.p-mt p a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.p .p-button {
  display: inline-block;
  min-height: 24px;
  margin-top: 1em;
  padding: 0.6em 1.2em;
  font-weight: 700;
  color: var(--p-on-saffron);
  background: var(--p-saffron);
  text-decoration: none;
}

/* ── the institution page (PT-05) and its about page (PT-06): Institution.tsx ─ */

.p-in {
  position: relative;
}

/* hero: the official maroon flag texture over the ground, the name, the head featured */
.p-in-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 2em 3em;
  padding: 2.6em 5% 3em;
  color: var(--p-on-dark);
  background: var(--p-ground);
}

.p-in-hero-has-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.p-in-hero::before,
.p-ph::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--p-saffron) 7%, transparent) 0 0.35em,
      transparent 0.35em 1.4em,
      color-mix(in srgb, var(--p-blue) 9%, transparent) 1.4em 1.75em,
      transparent 1.75em 2.8em
    ),
    linear-gradient(90deg, var(--p-ground) 0, color-mix(in srgb, var(--p-ground) 92%, var(--p-band)) 45%, var(--p-band) 100%);
}

.p-in-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
  margin-bottom: 1.8em;
  font-size: 0.92em;
  color: var(--p-on-dark-muted);
}

.p-in-crumbs li + li::before {
  content: '›';
  content: '›' / '';
  margin-right: 0.3em;
}

.p .p-in-crumbs a {
  color: var(--p-on-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* WCAG 2.5.8: a trail that wraps on a phone puts its links on rows close together. Each crumb keeps its arrow beside its link */
@container p (max-width: 40em) {
  .p-in-crumbs li {
    display: flex;
  }

  .p .p-in-crumbs a {
    display: inline-block;
    min-height: 1.5rem;
  }
}

.p-in-names {
  font-size: 1.05em;
  color: var(--p-on-dark-muted);
}

.p-in-title {
  max-width: 18em;
  margin: 0.1em 0 0.3em;
  font-size: 3em;
  font-weight: 700;
  line-height: 1.05;
  color: var(--p-on-dark);
}

.p-in-parent,
.p-in-address {
  color: var(--p-on-dark-muted);
}

.p .p-in-parent a {
  font-weight: 700;
  color: var(--p-on-dark);
  text-decoration: underline;
}

.p-in-address {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 0.3em;
}

.p-in-address .p-icon-xs {
  flex: none;
  color: var(--p-saffron);
}

.p-in-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  margin-top: 1.6em;
}

.p-in-fact {
  display: flex;
  align-items: baseline;
  gap: 0.45em;
  padding: 0.5em 1em;
  background: color-mix(in srgb, var(--p-on-dark) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--p-on-dark) 30%, transparent);
  border-radius: 2em;
}

.p-in-fact-num {
  font-size: 1.5em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--p-saffron);
}

/* the in-page tabs: sticky under the header */
.p-in-tabs {
  position: sticky;
  top: 9.277em;
  z-index: 20;
  background: var(--p-card);
  border-bottom: 1px solid var(--p-rule);
  box-shadow: 0 0.3em 0.8em color-mix(in srgb, var(--p-ink) 8%, transparent);
}

.p-in-tabs ul {
  display: flex;
  gap: 0.2em;
  padding-inline: 5%;
  overflow-x: auto;
  scrollbar-width: none;
}

.p .p-in-tabs a {
  display: block;
  padding: 0.95em 0.8em;
  font-size: 0.92em;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--p-ink);
}

.p .p-in-tabs a:hover,
.p .p-in-tabs a[aria-current='true'] {
  color: var(--p-heading);
  box-shadow: inset 0 -0.22em 0 var(--p-saffron);
}

.p-in-body {
  max-width: var(--p-max);
  margin-inline: auto;
}

.p-in-sec {
  padding: 3em 5% 1em;
  scroll-margin-top: 12.5em;
}

.p-in-sec:focus {
  outline: none;
}

.p-in-mtband {
  padding-bottom: 0;
}

.p-in-mtband .p-mt {
  margin: 0;
}

.p-h2 {
  overflow-wrap: anywhere;
  position: relative;
  display: inline-block;
  padding-bottom: 0.15em;
  font-size: 2em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--p-heading);
}

.p-h2::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--p-rule);
}

.p-in-sec > .p-h2 {
  margin-bottom: 1.1em;
}

.p-in-sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5em 1em;
  margin-bottom: 1em;
}

.p-in-h3 {
  margin: 1.4em 0 0.6em;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--p-heading);
}

.p-in-note {
  margin: 0.8em 0;
  color: var(--p-muted);
}

/* about */
.p-in-about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.4em;
}

.p-in-about-text > p {
  margin-bottom: 0.6em;
}

.p-in-vm {
  margin-bottom: 1em;
  padding: 1em 1.2em;
  background: var(--p-card);
  border-left: 0.3em solid var(--p-saffron);
}

.p-in-vm-label {
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-link-2);
}

.p-in-vm-text {
  font-size: 1.15em;
  font-weight: var(--p-weight-medium);
  line-height: 1.4;
}

.p-in-functions li {
  display: flex;
  gap: 0.6em;
  padding-block: 0.4em;
}

.p-in-functions .p-icon-xs {
  flex: none;
  margin-top: 0.25em;
  color: var(--p-band);
}

/* the people beside the about text: the RTI officers, and the page's other languages */
.p-in-people {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.p-in-langnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em;
  padding: 0.8em 1em;
  font-size: 0.95em;
  background: var(--p-card);
  border: 1px dashed var(--p-rule);
}

.p .p-in-langnote a {
  font-weight: 700;
  color: var(--p-heading);
  text-decoration: underline;
}

.p-lc-grid.p-in-officers {
  grid-template-columns: minmax(0, 1fr);
}

/* the machine translation notice (LNG-06): text, never colour alone */
.p-mt {
  margin: 0 0 1em;
  padding: 0.8em 1em;
  color: var(--p-ink);
  background: var(--p-saffron-pale);
  border-left: 0.3em solid var(--p-saffron);
}

.p-mt strong {
  display: block;
}

.p .p-mt a {
  color: var(--p-link-2);
  text-decoration: underline;
}

.p-placeholder {
  font-style: italic;
  color: var(--p-link-2);
}

/* the page hero band of inner pages (PageHero.tsx) */
.p-ph {
  position: relative;
  isolation: isolate;
  padding: 2.2em 5% 2.4em;
  color: var(--p-on-dark);
  background: var(--p-ground);
}

.p-ph .p-in-crumbs ol {
  margin-bottom: 1.2em;
}

.p-ph-title {
  overflow-wrap: anywhere; /* a long Tamil or Sinhala word wraps, on every page with this hero */
  font-size: 2.8em;
  font-weight: 700;
  line-height: 1.05;
  color: var(--p-on-dark);
}

.p-ph-line {
  margin-top: 0.4em;
  font-size: 1.1em;
  color: var(--p-on-dark-muted);
}

.p .p-ph-line a {
  color: var(--p-on-dark);
  text-decoration: underline;
}

.p-ph-tools {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-top: 1.6em;
}

/* ── contact cards: always visible, compact, one Save contact (ContactCard.tsx) ── */

.p-lc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5em, 1fr));
  align-items: stretch;
  gap: 1em;
}

.p-lc {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.8em 1.5em 1.4em;
  text-align: center;
  background: var(--p-card);
  box-shadow: 0 0.2em 0.8em color-mix(in srgb, var(--p-ink) 9%, transparent);
  border-bottom: 0.25em solid transparent;
  transition:
    transform calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease),
    box-shadow calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease),
    border-color calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease);
}

.p-lc:hover,
.p-lc:focus-within {
  border-bottom-color: var(--p-saffron);
  box-shadow: 0 0.8em 1.8em color-mix(in srgb, var(--p-ink) 15%, transparent);
  transform: translateY(calc(-0.25em * var(--motion-on)));
}

/* a circular portrait: a thin saffron ring, and a blue ring offset outside it */
.p-gvc-ring {
  display: block;
  overflow: hidden;
  border-radius: 50%;
}

.p-gvc-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.p-gvc-ring.p-lc-ring {
  flex: none;
  width: 7.5em;
  height: 7.5em;
  margin: 0.4em 0 1.2em;
  background: color-mix(in srgb, var(--p-band) 10%, var(--p-card));
  box-shadow:
    0 0 0 0.2em var(--p-saffron),
    0 0 0 0.45em var(--p-card),
    0 0 0 0.6em var(--p-blue);
}

.p-lc-silhouette {
  display: block;
  width: 72%;
  margin: 18% auto 0;
  fill: color-mix(in srgb, var(--p-band) 22%, var(--p-card));
}

.p-lc-who {
  width: 100%;
}

.p-lc-post {
  font-size: 1.1em;
  font-weight: 700;
  line-height: 1.25;
  color: var(--p-heading);
}

.p-lc-name {
  margin-top: 0.2em;
  font-weight: var(--p-weight-medium);
}

.p-lc-inst {
  font-size: 0.92em;
  color: var(--p-muted);
}

/* a target of its own: a label's link can stand right above it */
.p .p-lc-inst a {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
  color: var(--p-muted);
}

.p .p-lc-inst a:hover {
  color: var(--p-heading);
  text-decoration: underline;
}

.p-lc-note {
  margin-top: 0.7em;
  font-size: 0.88em;
  line-height: 1.45;
  color: var(--p-muted);
}

/* the card's contacts and Save contact sit at the bottom, so equal cards line up */
.p-lc-reach {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.p-lc-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  width: 100%;
  margin-top: 0.9em;
  font-size: 0.92em;
}

.p-lc-primary .p-lc-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  max-width: 100%;
}

.p-lc-row .p-icon-xs {
  flex: none;
  align-self: center;
  color: var(--p-blue);
}

.p .p-lc-primary a {
  /* a 24 px target (WCAG 2.5.8), a little taller than the lab's 17 px rows */
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 24px;
  color: var(--p-heading);
  overflow-wrap: anywhere;
}

.p .p-lc-others-reach a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.p .p-lc-primary a:hover {
  text-decoration: underline;
}

.p-lc-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  margin-top: auto;
  padding-top: 0.8em;
}

.p .p-lead-act {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 2.4em;
  padding: 0 0.8em;
  font-size: 0.9em;
  font-weight: var(--p-weight-semibold);
  color: var(--p-heading);
  background: var(--p-panel);
}

.p .p-lead-act:hover {
  color: var(--p-on-dark);
  background: var(--p-band);
}

/* the wide variant: one card across the row, portrait, who, then the contacts in one line */
.p-lc.p-lc-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 2em;
  text-align: left;
}

.p-lc-wide .p-gvc-ring.p-lc-ring {
  margin: 0.6em;
}

.p-lc-wide .p-lc-reach {
  flex-direction: row;
  flex-wrap: wrap;
  width: auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6em 1.4em;
}

.p-lc-wide .p-lc-primary {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.4em 1.6em;
  width: auto;
  margin-top: 0;
}

.p-lc-wide .p-lc-actions {
  margin-top: 0;
  padding-top: 0;
}

.p-lc-below {
  grid-column: 1 / -1;
  margin-top: 1.4em;
}

/* a card with two or more office phones names each one's type (DIR-01) */
.p-lc-type {
  color: var(--p-muted);
}

/* posts with no line of their own: one compact row under the cards */
.p-lc-others {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1.2em;
  margin-top: 1em;
  padding: 1em 1.2em;
  background: var(--p-card);
  border-left: 0.25em solid var(--p-saffron);
}

.p-lc-below .p-lc-others {
  margin-top: 0;
  background: var(--p-panel);
}

.p-lc-others-title {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--p-heading);
}

.p-lc-others-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.p-lc-others-list li {
  padding: 0.25em 0.75em;
  font-size: 0.88em;
  background: var(--p-panel);
  border-radius: 1em;
}

.p-lc-below .p-lc-others-list li {
  background: var(--p-card);
}

.p .p-lc-others-list a {
  color: var(--p-heading);
  text-decoration: underline;
}

.p-lc-others-reach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1em;
  margin-left: auto;
  font-size: 0.9em;
  color: var(--p-muted);
}

.p .p-lc-others-reach a {
  color: var(--p-heading);
}

.p .p-lc-others-reach a:hover {
  text-decoration: underline;
}

@container p (max-width: 64em) {
  .p-in-hero-has-head,
  .p-in-about {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container p (max-width: 56em) {
  .p-lc.p-lc-wide {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .p-lc-wide .p-lc-reach {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 0.8em;
  }
}

@container p (max-width: 40em) {
  .p-in-title {
    font-size: 2.1em;
  }

  .p-in-tabs {
    top: 8.877em;
  }

  .p-ph-title {
    font-size: 2em;
  }

  .p-lc.p-lc-wide {
    display: flex;
    text-align: center;
  }

  .p-lc-wide .p-lc-reach,
  .p-lc-wide .p-lc-primary {
    flex-direction: column;
    justify-content: center;
  }

  .p-lc-below {
    width: 100%;
    text-align: left;
  }

  .p-lc-others-reach {
    margin-left: 0;
  }
}

/* ── admin preview of a draft (ADM-17): the label, language and width; the phone
   width is the design's 390 px frame ──────────────────────────────────────── */

.p-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em 1.6em;
  padding: 0.6em 16px;
  font-size: 1.1em;
  color: var(--p-on-saffron);
  background: var(--p-saffron);
}

.p .p-preview-bar a {
  color: var(--p-on-saffron);
  text-decoration: underline;
}

.p-preview-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em;
}

.p .p-preview-opts a,
.p-preview-opts [aria-current] {
  display: inline-block;
  min-width: 24px;
  min-height: 24px;
  padding: 0.2em 0.5em;
}

.p-preview-opts [aria-current] {
  font-weight: 700;
  box-shadow: inset 0 -0.15em 0 var(--p-on-saffron);
}

html:has(.p-preview-phone) {
  background: var(--p-rule);
}

.p.p-preview-phone {
  max-width: 390px;
  margin-inline: auto;
  box-shadow: 0 0 0 1px var(--p-muted);
}

/* a preview is not a site: its sticky header would cover the bar */
.p-preview .p-header {
  position: relative;
}

/* Sinhala and Tamil menu labels are longer than the English ones the design was drawn
   with: News and Contact us fold into "More" up to the wide desktop, and the "My cases"
   tile grows with its label */
@container p (max-width: 98.5em) and (min-width: 64.01em) {
  .p:lang(si) .p-mega-desk .p-mega-li-news,
  .p:lang(si) .p-mega-desk .p-mega-li-contact,
  .p:lang(ta) .p-mega-desk .p-mega-li-news,
  .p:lang(ta) .p-mega-desk .p-mega-li-contact {
    display: none;
  }

  .p:lang(si) .p-mega-desk .p-mega-li-more,
  .p:lang(ta) .p-mega-desk .p-mega-li-more {
    display: list-item;
  }
}

@container p (min-width: 40.01em) {
  .p-cases {
    width: auto;
    min-width: 9.7em;
  }
}

/* ── E3.4 the head in the hero, the RTI block, leadership and officers ─────── */

/* the heads of the institution beside the name: one, or two side by side (PL-3) */
.p-in-hero-heads {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em 2em;
  align-items: flex-start;
}

/* the head of institution beside the name (Institution.tsx p-in-hero-head) */
.p-in-hero-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
  min-width: 15em;
  text-align: center;
}

.p-gvc-ring.p-in-ring-hero {
  width: 11em;
  height: 11em;
  margin: 0.6em 0.6em 1em;
  background: color-mix(in srgb, var(--p-on-dark) 14%, var(--p-ground));
  box-shadow:
    0 0 0 0.22em var(--p-saffron),
    0 0 0 0.55em var(--p-ground),
    0 0 0 0.72em var(--p-blue);
}

.p-gvc-silhouette {
  display: block;
  width: 72%;
  margin: 22% auto 0;
  fill: color-mix(in srgb, var(--p-on-dark) 35%, var(--p-ground));
}

.p-in-head-label {
  font-size: 0.85em;
  color: var(--p-on-dark-muted);
}

.p-in-head-post {
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--p-on-dark);
}

.p-in-head-name {
  margin-bottom: 0.4em;
  color: var(--p-on-dark);
}

/* phone and email as quiet text on maroon (ContactCard.tsx ContactLine) */
.p-gvd-lines {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.2em 0;
  max-width: 100%;
  margin-top: 0.5em;
  font-size: 0.9em;
}

.p-gvd-lines li {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  max-width: 100%;
}

.p-gvd-lines li + li::before {
  content: '\00b7';
  margin-inline: 0.55em 0.15em;
  color: var(--p-on-dark-muted);
}

.p-gvd-lines .p-icon-xs {
  flex: none;
  align-self: center;
  color: var(--p-on-dark-muted);
}

.p .p-gvd-lines a {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 24px;
  font-weight: 400;
  color: var(--p-on-dark);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.p .p-gvd-lines a:hover {
  text-decoration: underline;
}

/* the Save contact pill on maroon (SavePill) */
.p-gv-actions {
  display: flex;
  gap: 0.5em;
}

.p .p-gvd-actions {
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.9em;
}

.p .p-gv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  height: 2.9em;
  padding: 0 1.05em;
  font-size: 0.92em;
  font-weight: var(--p-weight-medium);
  color: var(--p-on-dark);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--p-on-dark-muted);
  border-radius: 1.7em;
  transition:
    background-color calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease),
    color calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease);
}

.p .p-gv-btn:hover {
  color: var(--p-ground);
  background: var(--p-on-dark);
}

.p-gv-btn .p-icon {
  width: 1.15em;
  height: 1.15em;
}

.p-in-hero-head :focus-visible,
.p-in-rti :focus-visible,
.p-ph :focus-visible {
  outline-color: var(--p-focus-on-dark);
}

/* a card's role, above the post, in the officers lists */
.p-lc-role {
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-link-2);
}

.p-lc-grid.p-in-officers-wide {
  grid-template-columns: repeat(auto-fill, minmax(15.5em, 1fr));
  margin-top: 1.6em;
}

/* right to information (RTI Act s.26) */
.p-in-rti {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2em;
  padding: 2em 2.2em;
  color: var(--p-on-dark);
  background: var(--p-ground);
  border-top: 0.35em solid var(--p-saffron);
}

.p-in-rti-title {
  font-size: 1.85em;
  font-weight: 700;
  color: var(--p-on-dark);
}

.p-in-rti-label {
  margin: 0.2em 0 1em;
  color: var(--p-on-dark-muted);
}

.p-in-rti-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5em 1.4em;
}

.p-in-rti-list dt {
  grid-column: 1;
  font-weight: 700;
  color: var(--p-saffron);
}

.p-in-rti-list dd {
  grid-column: 2;
}

.p-in-rti-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1em;
}

.p .p-in-rti-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 3.4em;
  padding: 0 1.4em;
  font-weight: 700;
  color: var(--p-on-saffron);
  text-decoration: none;
  background: var(--p-saffron);
  border-radius: 1.7em;
}

.p .p-in-rti-link {
  color: var(--p-on-dark);
  text-decoration: underline;
}

/* the page hero's tools: a large search, filter chips and the view switch (PageHero) */
.p-ph-search {
  display: flex;
  align-items: center;
  gap: 0.7em;
  max-width: 40em;
  padding: 0 0.4em 0 1.1em;
  background: var(--p-card);
  box-shadow: 0 0.4em 1em color-mix(in srgb, var(--p-ink) 25%, transparent);
}

.p-ph-search > .p-icon {
  flex: none;
  width: 1.4em;
  height: 1.4em;
  color: var(--p-muted);
}

.p-ph-search input {
  flex: 1;
  min-width: 0;
  height: 3.6em;
  font: inherit;
  font-size: 1.077em;
  color: var(--p-ink);
  background: transparent;
  border: 0;
}

.p .p-ph-go {
  flex: none;
  min-height: 2.8em;
  padding: 0 1.1em;
  font: inherit;
  font-weight: 700;
  color: var(--p-on-dark);
  background: var(--p-band);
  border: 0;
  border-radius: 1.4em;
  cursor: pointer;
}

.p-ph-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em;
}

.p-ph-filter label {
  font-weight: 700;
}

.p-ph-filter select {
  min-width: 0;
  max-width: 100%;
  height: 2.8em;
  padding: 0 0.8em;
  font: inherit;
  color: var(--p-ink);
  background: var(--p-card);
  border: 1px solid var(--p-rule);
}

.p-ph-filter .p-ph-go {
  color: var(--p-on-saffron);
  background: var(--p-saffron);
}

.p-ph-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45em;
}

.p-ph-chiplist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
}

.p .p-ph-chiplist a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 2.6em;
  padding: 0 1.1em;
  font-weight: 700;
  color: var(--p-on-dark);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--p-on-dark-muted);
  border-radius: 1.3em;
  transition:
    background-color calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease),
    color calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease);
}

.p .p-ph-chiplist a:hover {
  background: color-mix(in srgb, var(--p-on-dark) 14%, transparent);
}

.p .p-ph-chiplist a[aria-current='true'] {
  color: var(--p-ground);
  background: var(--p-on-dark);
  border-color: var(--p-on-dark);
}

.p-ph-view {
  margin-left: auto;
}

/* Governance and contacts (Leadership.tsx) */
.p-lp-body {
  max-width: var(--p-max);
  margin-inline: auto;
  padding: 0 5% 2em;
}

.p-lp-group {
  padding-top: 2em;
}

.p-lp-gtitle {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1.2em;
  padding: 0.8em 0;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--p-heading);
  border-bottom: 2px solid var(--p-saffron);
}

.p .p-lp-gtitle a {
  color: var(--p-heading);
}

.p-lead-group-count {
  padding: 0 0.5em;
  font-size: 0.7em;
  color: var(--p-on-dark);
  background: var(--p-band);
  border-radius: 1em;
}

.p .p-lc-others-list a {
  color: var(--p-heading);
  text-decoration: underline;
}

.p-sys-none {
  padding: 1.6em 0 0;
  color: var(--p-muted);
}

/* the table view: a clean table, sticky header */
.p-lt-wrap {
  max-height: 70vh;
  margin-top: 2em;
  overflow: auto;
  background: var(--p-card);
  box-shadow: 0 0.2em 0.8em color-mix(in srgb, var(--p-ink) 9%, transparent);
}

.p-lt {
  width: 100%;
  min-width: 48em;
  border-collapse: collapse;
}

.p-lt th,
.p-lt td {
  padding: 0.8em 1em;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--p-rule);
}

.p-lt th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.88em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-on-dark);
  background: var(--p-ground);
}

.p-lt td:first-child {
  font-weight: 700;
  color: var(--p-heading);
}

.p .p-lt td a {
  color: var(--p-heading);
}

.p-lt-email {
  max-width: 16em;
  overflow-wrap: anywhere;
}

.p-lt tbody tr:hover {
  background: var(--p-page);
}

@container p (max-width: 64em) {
  .p-in-hero-head {
    align-items: flex-start;
    text-align: left;
  }

  .p-in-hero-head .p-gvd-lines,
  .p .p-in-hero-head .p-gvd-actions {
    justify-content: flex-start;
  }

  .p-in-rti {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container p (max-width: 40em) {
  .p-gvc-ring.p-in-ring-hero {
    width: 8em;
    height: 8em;
  }

  .p-in-hero-head .p-gvd-lines {
    flex-direction: column;
    align-items: flex-start;
  }

  .p-in-hero-head .p-gvd-lines li + li::before {
    content: none;
  }

  .p-in-rti {
    padding: 1.6em 1.2em;
  }

  .p-in-rti-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1em;
  }

  .p-in-rti-list dt,
  .p-in-rti-list dd {
    grid-column: 1;
  }

  .p-in-rti-list dd {
    margin-bottom: 0.6em;
  }

  .p-ph-view {
    margin-left: 0;
  }

  .p-lp-gtitle {
    font-size: 1.2em;
  }
}

/* ── The heads of the province on the leadership view (LeadersHome.tsx Hybrid) ── */

.p-lp-heads {
  padding-top: 2.6em;
}

.p-lp-heads > .p-h2 {
  margin-bottom: 1em;
}

.p-gv-d .p-gvd {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.4em;
  padding: 3em 3.5%;
  color: var(--p-on-dark);
  background-color: var(--p-ground);
  background-image: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--p-saffron) 7%, transparent) 0 0.35em,
    transparent 0.35em 1.4em,
    color-mix(in srgb, var(--p-blue) 9%, transparent) 1.4em 1.75em,
    transparent 1.75em 2.8em
  );
}

.p-gvd-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3em;
}

.p-gvd .p-gvc-ring {
  background: color-mix(in srgb, var(--p-on-dark) 14%, var(--p-ground));
  box-shadow:
    0 0 0 0.22em var(--p-saffron),
    0 0 0 0.55em var(--p-ground),
    0 0 0 0.72em var(--p-blue);
}

.p-gvd .p-gvc-ring.p-gvd-ring-big {
  width: 17em;
  height: 17em;
  margin: 0.9em;
  box-shadow:
    0 0 0 0.35em var(--p-saffron),
    0 0 0 0.85em var(--p-ground),
    0 0 0 1.1em var(--p-blue);
}

.p-gvc-ring.p-gvd-ring {
  width: 8.5em;
  height: 8.5em;
  margin: 0.6em;
}

.p-gvd-maintext,
.p-gvd-rowtext {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.p-gv-other {
  margin-bottom: 0.2em;
  font-size: 0.85em;
  color: var(--p-on-dark-muted);
}

.p-gvd-post {
  font-size: 2.6em;
  font-weight: 700;
  line-height: 1.05;
  color: var(--p-on-dark);
}

.p-gvc-post {
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.1;
  color: var(--p-on-dark);
}

.p-gvd .p-gvc-name {
  margin-top: 0.3em;
  color: var(--p-on-dark);
}

.p-gvd .p-gvd-name {
  font-size: 1.1em;
}

.p-gv-vacant {
  display: inline-block;
  margin-top: 0.35em;
  padding: 0.1em 0.8em;
  font-size: 0.92em;
  font-weight: var(--p-weight-medium);
  color: var(--p-on-dark);
  border: 1px solid var(--p-on-dark-muted);
  border-radius: 1em;
}

.p .p-gvd-read {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 24px;
  margin-top: 0.4em;
  font-weight: var(--p-weight-medium);
  color: var(--p-on-dark);
  text-decoration: none;
}

.p .p-gvd-read:hover {
  text-decoration: underline;
}

.p-gvd .p-gvc-office {
  margin-top: 1em;
  font-size: 0.9em;
  color: var(--p-on-dark-muted);
}

.p .p-gvd .p-gvc-office a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: var(--p-on-dark-muted);
}

.p-gvd .p-gvd-lines {
  justify-content: flex-start;
}

.p .p-gvd .p-gvd-actions {
  justify-content: flex-start;
  margin-top: 1.2em;
}

.p-gvd-side {
  display: grid;
  grid-auto-rows: 1fr;
  align-content: center;
}

.p-gvd-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2.2em;
  padding-block: 2em;
}

.p-gvd-row + .p-gvd-row {
  border-top: 1px solid color-mix(in srgb, var(--p-on-dark) 28%, transparent);
}

.p-gvd :focus-visible {
  outline-color: var(--p-focus-on-dark);
}

@container p (max-width: 72em) {
  .p-gv-d .p-gvd {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container p (max-width: 48em) {
  .p-gvd-main {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .p-gvd-main .p-gvd-maintext {
    align-items: center;
  }

  .p-gvd-main .p-gvd-lines,
  .p .p-gvd-main .p-gvd-actions {
    justify-content: center;
  }

  .p-gvd .p-gvc-ring.p-gvd-ring-big {
    width: 13em;
    height: 13em;
  }
}

@container p (max-width: 40em) {
  .p-gv-d .p-gvd {
    padding: 2.4em 5%;
  }

  .p-gvd-post {
    font-size: 2em;
  }

  .p-gvd-side {
    grid-auto-rows: auto;
  }

  .p-gvd-row {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .p-gvd-row .p-gvd-rowtext {
    align-items: center;
  }

  .p-gvd-row .p-gvd-lines,
  .p .p-gvd-row .p-gvd-actions {
    justify-content: center;
  }

  .p-gvd .p-gvd-lines {
    flex-direction: column;
    align-items: center;
  }

  .p-gvd .p-gvd-lines li + li::before {
    content: none;
  }
}

/* ── documents: file tiles with a page preview (Institution.tsx, E4.6) ── */
.p-in-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12em, 14em));
  gap: 1em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p .p-in-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
  height: 100%;
  padding: 1.4em 1em 1.1em;
  text-align: center;
  color: var(--p-ink);
  text-decoration: none;
  background: var(--p-card);
  box-shadow: 0 0.3em 1em color-mix(in srgb, var(--p-ink) 9%, transparent);
  transition:
    transform calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease),
    box-shadow calc(var(--motion-base) * 0.5 * var(--motion-on)) var(--motion-ease);
}

.p .p-in-file:hover {
  transform: translateY(calc(-0.3em * var(--motion-on)));
  box-shadow: 0 0.9em 1.8em color-mix(in srgb, var(--p-ink) 15%, transparent);
}

.p-in-file-preview {
  position: relative;
  width: 4.6em;
}

.p-in-file-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.p-in-file-page {
  fill: var(--p-page);
  stroke: var(--p-rule);
  stroke-width: 2;
}

.p-in-file-fold {
  fill: none;
  stroke: var(--p-rule);
  stroke-width: 2;
}

.p-in-file-lines {
  stroke: var(--p-rule);
  stroke-width: 3;
}

.p-in-file-type {
  position: absolute;
  bottom: 0.4em;
  left: -0.4em;
  padding: 0.05em 0.5em;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--p-on-dark);
  background: var(--p-band);
}

.p-in-file-title {
  font-weight: 700;
  color: var(--p-heading);
}

.p-in-file-meta {
  font-size: 0.85em;
  color: var(--p-muted);
}

@container p (max-width: 40em) {
  .p-in-files {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* the hero photo behind the name (Institution.tsx: full-bleed photo under the maroon
   texture, sprint 4B): an <img> with its alt text, as inline styles are not allowed (CSP) */
.p-in-hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 40%;
}

.p-in-hero-has-photo::before {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--p-saffron) 7%, transparent) 0 0.35em,
      transparent 0.35em 1.4em,
      color-mix(in srgb, var(--p-blue) 9%, transparent) 1.4em 1.75em,
      transparent 1.75em 2.8em
    ),
    linear-gradient(90deg, var(--p-ground) 0, color-mix(in srgb, var(--p-ground) 92%, transparent) 45%, color-mix(in srgb, var(--p-ground) 70%, transparent) 100%);
}
