/* Revenue & Disaster Management Department, Govt. of Meghalaya — site stylesheet */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #150202;
  --muted: #606060;
  --line: #C6C6C6;
  --brand: #162F6A;
  --brand-d: #162F6A;
  --brand-l: #D2DFFF;
  --on-brand: #ffffff;
  --on-brand-muted: #ffffff;
  --accent: #A3BBF3;
  --link: #214AAB;
  --link-hover: #162F6A;
  --focus: #162F6A;
  --chip: #EBEAEA;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(21, 2, 2, .06), 0 10px 28px -14px rgba(21, 2, 2, .16);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --border-w: 1px;
}

/* Accessibility colour schemes (replace the old alternate stylesheets) */
html[data-contrast="hc-dark"] {
  --bg: #000; --surface: #000; --ink: #ffeb3b; --muted: #ffeb3b; --line: #ffeb3b;
  --brand: #000; --brand-d: #000; --brand-l: #111; --on-brand: #ffeb3b; --on-brand-muted: #ffeb3b;
  --accent: #ffeb3b; --link: #ffeb3b; --link-hover: #fff; --chip: #111; --focus: #fff;
  --shadow: none; --border-w: 2px;
}
html[data-contrast="hc-light"] {
  --bg: #fff; --surface: #fff; --ink: #000; --muted: #000; --line: #000;
  --brand: #000; --brand-d: #000; --brand-l: #fff; --on-brand: #fff; --on-brand-muted: #fff;
  --accent: #000; --link: #0000b8; --link-hover: #000; --chip: #fff; --focus: #b80000;
  --shadow: none; --border-w: 2px;
}
html[data-spacing="wide"] body { letter-spacing: .06em; word-spacing: .12em; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--link-hover); text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); text-wrap: balance; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 80%; max-width: none; margin-inline: auto; padding-inline: 0; }

/* Skip link */
.skip {
  position: absolute; left: .75rem; top: -4rem; z-index: 100; padding: .6rem 1rem;
  background: var(--accent); color: #000; font-weight: 600; border-radius: 0 0 8px 8px; transition: top .15s;
}
.skip:focus { top: 0; color: #000; }

/* ---------- Masthead (white header: emblem, name, search, accessibility) ---------- */
body { border-top: 3px solid var(--brand-d); }
html[data-contrast="hc-dark"] body { border-top-color: var(--ink); }
.masthead { background: var(--surface); border-bottom: var(--border-w) solid var(--line); }
.masthead .wrap { display: grid; grid-template-columns: 48% 22% 12% minmax(0, 1fr); column-gap: clamp(.75rem, 1.2vw, 1.5rem); align-items: center; padding-block: 1.5rem; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 3.1rem; height: auto; border-radius: 6px; background: var(--brand-l); padding: .15rem; flex: none; }
.brand-sub { display: block; font-size: 1.05rem; color: var(--ink); line-height: 1.2; }
.brand-name { display: block; font-size: clamp(1.15rem, 1rem + .9vw, 1.65rem); font-weight: 700; line-height: 1.2; color: var(--ink); letter-spacing: -.005em; }
.head-tools { display: contents; }
.brand { grid-column: 1; grid-row: 1; min-width: 0; }
.department-logo { display: block; grid-column: 3; grid-row: 1; justify-self: end; width: 6.5rem; height: 6.5rem; max-height: none; object-fit: contain; }
.brand img { width: 6.5rem; height: 6.5rem; max-width: none; object-fit: contain; background: none; padding: 0; border-radius: 0; flex: none; }
html[data-contrast="hc-dark"] .brand img { filter: invert(1); }
.search { display: flex; grid-column: 2; grid-row: 1; min-width: 0; width: 100%; border: 1px solid #c9d0c6; border-bottom: 3px solid var(--brand); border-radius: 8px 8px 4px 4px; background: var(--surface); overflow: hidden; }
html[data-contrast] .search { border: 2px solid var(--ink); }
.search input[type=search] { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: .6rem .8rem; color: var(--ink); background: transparent; border: 0; }
.search input[type=search]:focus-visible { outline-offset: -3px; }
.search button { display: grid; place-items: center; width: 3rem; color: var(--brand); background: transparent; border: 0; border-left: 1px solid var(--line); cursor: pointer; }
html[data-contrast] .search button { color: var(--ink); }
.search button:hover { background: var(--brand-l); }
svg.i, .search svg, .tool-btn svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* three header tools: skip to content | Bhashini language | accessibility */
.tool-icons { display: flex; grid-column: 4; grid-row: 1; align-items: center; justify-self: end; flex-wrap: nowrap; white-space: nowrap; }
.tool-icons > * { display: flex; align-items: center; flex: 0 0 auto; }
.tool-icons > .tool-btn:not(:first-child), .tool-icons > .bhashini-plugin-container:not(:empty) { border-left: 1.5px solid var(--brand); border-radius: 0; margin-left: .35rem; padding-left: .35rem; }
html[data-contrast] .tool-icons > .tool-btn:not(:first-child) { border-left-color: var(--ink); }
.tool-btn { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; color: var(--brand); background: transparent; border: 0; border-radius: 8px; cursor: pointer; text-decoration: none; }
html[data-contrast] .tool-btn { color: var(--ink); }
.tool-btn:hover, .tool-btn[aria-expanded="true"] { background: var(--brand-l); color: var(--brand); }
.tool-btn svg { width: 1.7rem; height: 1.7rem; }
.tool-btn svg.header-login-icon { width: 1.5rem; height: 1.5rem; stroke: none; }
.bhashini-plugin-container { min-width: 0; }
.bhashini-plugin-container:empty { display: none; }

/* ---------- Accessibility drawer ---------- */
.a11y-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 190; }
.a11y-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 200; width: min(24rem, 100vw); overflow-y: auto; background: var(--surface); color: var(--ink); box-shadow: -8px 0 32px rgba(0,0,0,.25); padding: 1.1rem 1.25rem 1.5rem; }
.a11y-backdrop[hidden], .a11y-drawer[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.a11y-head h2 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.2rem; font-weight: 500; }
.a11y-head-ico svg, .a11y-close svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.a11y-head-ico { color: var(--brand); display: grid; }
html[data-contrast] .a11y-head-ico { color: var(--ink); }
.a11y-close { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; background: none; border: 0; border-radius: 8px; color: var(--ink); cursor: pointer; }
.a11y-close:hover { background: var(--brand-l); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tile {
  display: grid; justify-items: center; align-content: center; gap: .5rem; min-height: 5.6rem; padding: .8rem .4rem; text-align: center;
  font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.25;
  color: var(--brand); background: var(--surface); border: 1.5px solid var(--brand); border-radius: 8px; cursor: pointer;
}
html[data-contrast] .tile { color: var(--ink); border: 2px solid var(--ink); }
.tile:hover { background: var(--brand-l); }
.tile[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
html[data-contrast="hc-dark"] .tile[aria-pressed="true"] { background: #ffeb3b; color: #000; }
html[data-contrast="hc-light"] .tile[aria-pressed="true"] { background: #000; color: #fff; }
.tile-ico { display: grid; place-items: center; height: 1.9rem; }
.tile-ico svg { width: 1.9rem; height: 1.9rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile-txt { font-size: 1.5rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.tile .state { display: block; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .85; }
.tile .state:empty { display: none; }
.a11y-foot { margin-top: 1rem; display: grid; gap: .9rem; }
.tile-wide { min-height: 3.2rem; grid-auto-flow: column; justify-content: center; gap: .6rem; }
.tile-wide .tile-ico { height: 1.4rem; } .tile-wide .tile-ico svg { width: 1.3rem; height: 1.3rem; }
.a11y-link { text-align: center; font-size: .95rem; }

/* user-selected display options */
html[data-invert="on"] { filter: invert(1) hue-rotate(180deg); }
html[data-invert="on"] img, html[data-invert="on"] video { filter: invert(1) hue-rotate(180deg); }
html[data-sat="low"] body { filter: saturate(.45); }
html[data-sat="high"] body { filter: saturate(2.2); }
html[data-sat="mono"] body { filter: grayscale(1); }
html[data-links="on"] main a, html[data-links="on"] footer a, html[data-links="on"] nav a { background: #ffeb3b !important; color: #000 !important; outline: 2px solid #000; text-decoration: underline !important; }
html[data-images="hide"] img { visibility: hidden; }
html[data-cursor="default"] *, html[data-cursor="default"] *::before { cursor: default !important; }

/* ---------- Primary navigation ---------- */
.primary { background: var(--brand); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.primary .wrap { position: relative; }
.nav-toggle {
  display: none; width: 100%; font: inherit; font-weight: 600; text-align: left; padding: .85rem 0; color: var(--on-brand);
  background: none; border: 0; cursor: pointer; align-items: center; justify-content: space-between;
}
.nav-toggle svg { width: 1.4rem; height: 1.4rem; }
.primary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.primary li a {
  display: block; padding: .85rem .95rem; color: var(--on-brand); text-decoration: none; font-size: .95rem; font-weight: 500;
  border-bottom: 3px solid transparent;
}
.primary li a:hover { background: rgba(255,255,255,.1); color: var(--on-brand); }
.primary li a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 700; background: rgba(0,0,0,.14); }
html[data-contrast="hc-light"] .primary li a:hover { background: #333; }

/* ---------- Hero (home) ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -20%, rgba(214,160,58,.28), transparent 60%),
    linear-gradient(135deg, var(--brand-d), var(--brand));
  color: var(--on-brand); padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.hero .eyebrow { display: inline-block; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 .75rem; }
html[data-contrast="hc-light"] .hero .eyebrow { color: #fff; }
.hero h1 { color: var(--on-brand); font-size: clamp(1.9rem, 1.2rem + 3vw, 3.2rem); letter-spacing: -.02em; margin: 0 0 1rem; max-width: 20ch; }
.hero p.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--on-brand-muted); max-width: 60ch; margin: 0 0 1.75rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.3rem; border-radius: 999px; font-weight: 600;
  text-decoration: none; border: 2px solid transparent; font-size: 1rem;
}
.btn-primary { background: var(--accent); color: #1c1503; }
.btn-primary:hover { background: var(--brand-d); color: var(--on-brand); }
.btn-ghost { color: var(--on-brand); border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: var(--on-brand); }
html[data-contrast="hc-dark"] .btn-primary { background: #ffeb3b; color: #000; }
html[data-contrast="hc-light"] .btn-primary { background: #fff; color: #000; }

/* Full-width homepage carousel */
.home-carousel { position: relative; isolation: isolate; width: 100%; max-width: none; height: 600px; margin-inline: 0; overflow: hidden; color: var(--on-brand); background: var(--brand-d); }
.carousel-viewport { width: 100%; height: 100%; }
.home-carousel-slide {
  display: grid;
  grid-template-columns: minmax(0, .35fr) minmax(0, .65fr);
  height: 100%;
  min-height: 0;
}
.home-carousel-slide[hidden] { display: none !important; }
.carousel-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1.5rem, 5vw, 6rem);
  overflow: hidden;
  background:
    radial-gradient(36rem 28rem at 100% 100%, rgba(163,187,243,.18), transparent 68%),
    linear-gradient(135deg, var(--brand-d), var(--brand));
}
.carousel-copy::after {
  position: absolute;
  right: -8rem;
  bottom: -13rem;
  width: 26rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 2rem rgba(255,255,255,.035), 0 0 0 4rem rgba(255,255,255,.025);
  content: "";
  pointer-events: none;
}
.carousel-eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.2rem;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.carousel-eyebrow span { display: inline-block; width: 2rem; height: 2px; background: currentColor; }
html[data-contrast="hc-light"] .carousel-eyebrow { color: #fff; }
.carousel-copy h2 {
  max-width: 16ch;
  margin: 0 0 1.1rem;
  color: var(--on-brand);
  font-size: clamp(2rem, 2.8vw, 3rem);
  letter-spacing: -.035em;
  line-height: 1.07;
}
.carousel-lead { max-width: 48ch; margin: 0 0 1.8rem; color: var(--on-brand-muted); font-size: clamp(1rem, 1.1vw, 1.25rem); line-height: 1.65; }
.home-carousel .actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.home-carousel .btn { position: relative; z-index: 1; }
.carousel-visual { position: relative; min-width: 0; min-height: 100%; overflow: hidden; background: var(--brand-d); }
.carousel-visual::before {
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 -1px;
  width: clamp(4rem, 8vw, 9rem);
  background: var(--brand);
  clip-path: polygon(100% 0, 66% 3%, 94% 6%, 50% 10%, 87% 14%, 42% 18%, 82% 22%, 38% 26%, 78% 30%, 32% 34%, 73% 38%, 27% 42%, 68% 46%, 23% 50%, 63% 54%, 18% 58%, 58% 62%, 14% 66%, 53% 70%, 9% 74%, 48% 78%, 7% 82%, 40% 86%, 4% 90%, 32% 94%, 0 97%, 20% 100%, 0 100%, 0 0);
  filter: drop-shadow(2px 0 2px rgba(255,255,255,.35));
  content: "";
  pointer-events: none;
}
.carousel-visual::after { position: absolute; z-index: 1; inset: 0; background: linear-gradient(115deg, rgba(22,47,106,.2), transparent 42%), linear-gradient(0deg, rgba(0,0,0,.16), transparent 38%); content: ""; pointer-events: none; }
.carousel-visual img { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: center; filter: saturate(1.08) contrast(1.03) brightness(1.03); animation: carousel-image-enter .7s ease-out both; }
@keyframes carousel-image-enter { from { transform: scale(1.035); } to { transform: scale(1); } }
.carousel-controls {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .2rem;
  padding: .35rem;
  border: var(--border-w) solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}
.carousel-control { display: grid; width: 2.6rem; height: 2.6rem; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--brand); background: transparent; cursor: pointer; }
.carousel-control:hover { background: var(--brand-l); }
.carousel-control svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.carousel-control .rotation-pause, .carousel-control .rotation-play { fill: currentColor; stroke: none; }
.carousel-control .rotation-play { display: none; }
.carousel-rotation[aria-pressed="false"] .rotation-pause { display: none; }
.carousel-rotation[aria-pressed="false"] .rotation-play { display: block; }
.carousel-count { display: flex; align-items: baseline; gap: .2rem; padding: 0 .25rem; color: var(--brand); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.carousel-count-total { color: var(--muted); font-size: .7rem; }
.carousel-dots { display: flex; align-items: center; gap: .35rem; padding: 0 .25rem; }
.carousel-dots button { width: .62rem; height: .62rem; padding: 0; border: 0; border-radius: 999px; background: var(--muted); cursor: pointer; transition: width .2s ease, background-color .2s ease; }
.carousel-dots button[aria-current="true"] { width: 1.45rem; background: var(--brand); }

/* ---------- Page header band ---------- */
.pagehead { background: var(--brand-l); border-bottom: var(--border-w) solid var(--line); padding: 1.5rem 0 1.6rem; }
.crumbs { font-size: .875rem; color: var(--muted); margin: 0 0 .6rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.pagehead .kicker { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--brand); margin: 0 0 .25rem; }
html[data-contrast] .pagehead .kicker { color: var(--ink); }
.pagehead h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.35rem); letter-spacing: -.015em; padding-left: .9rem; border-left: 5px solid var(--accent); }
html[data-contrast="hc-light"] .pagehead h1 { border-left-color: #000; }

/* ---------- Layout ---------- */
main { display: block; padding: 2rem 0 3.5rem; }
.layout { display: grid; gap: 2rem; align-items: start; }
.layout.has-side { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.card {
  background: var(--surface); border: var(--border-w) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.prose { padding: clamp(1.25rem, 3vw, 2.25rem); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose li { max-width: none; }
.prose h2 { font-size: 1.45rem; margin: 2rem 0 .75rem; padding-bottom: .4rem; border-bottom: var(--border-w) solid var(--line); }
.prose h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; color: var(--brand); }
html[data-contrast] .prose h3 { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .35rem 0; }
.prose figure, .prose p > img { margin: 1rem 0; }
.prose img { border-radius: 8px; }
.prose .org-chart img, .prose p > img[alt*="Organisational"] { border: var(--border-w) solid var(--line); background: #fff; padding: .5rem; width: 100%; max-width: 100%; }

/* Directorate navigation */
.subnav {
  display: grid;
  grid-template-columns: minmax(15rem, max-content) minmax(0, 1fr);
  align-items: center;
  gap: .65rem 1.25rem;
  padding: 1rem 1.25rem .85rem;
  border-top: 3px solid var(--accent);
}
.subnav h2 {
  margin: 0;
  color: var(--brand);
  font-size: .9rem;
  line-height: 1.35;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.subnav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  margin: 0;
  padding: .3rem;
  list-style: none;
  border: var(--border-w) solid var(--line);
  border-radius: 10px;
  background: var(--brand);
}
.subnav a {
  display: block;
  padding: .58rem .85rem;
  border-radius: 8px;
  color: var(--on-brand);
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}
.subnav a:hover { background: var(--surface); color: var(--ink); }
.subnav a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 -3px var(--accent);
}
.subnav .back {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  margin: 0;
  padding: .6rem 0 0;
  border-top: var(--border-w) solid var(--line);
}
.subnav .back a {
  padding: .35rem .55rem;
  color: var(--link);
  font-size: .875rem;
  font-weight: 600;
}

/* ---------- Document lists (notifications, reports, acts) ---------- */
.filter { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: 0 0 1rem; }
.filter label { font-weight: 600; }
.filter input {
  flex: 1 1 16rem; max-width: 28rem; font: inherit; padding: .6rem .9rem; border: 1px solid #8a968f; border-radius: 8px; background: var(--surface); color: var(--ink);
}
html[data-contrast] .filter input { border: 2px solid var(--ink); }
.filter .count { color: var(--muted); font-size: .9rem; }
.prose ul.doc-list { list-style: none; padding: 0; margin: 1rem 0; border-top: var(--border-w) solid var(--line); }
.prose ul.doc-list li.doc {
  max-width: none; margin: 0; display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between;
  padding: .9rem .5rem; border-bottom: var(--border-w) solid var(--line);
}
li.doc:hover { background: var(--brand-l); }
html[data-contrast] li.doc:hover { background: transparent; }
li.doc .doc-link { font-weight: 500; flex: 1; min-width: 0; overflow-wrap: anywhere; }
li.doc .doc-meta { display: inline-flex; gap: .5rem; align-items: center; flex: none; font-size: .8125rem; color: var(--muted); padding-top: .2rem; white-space: nowrap; }
.badge {
  display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  background: #fbe9e7; color: #8a2a17; border: 1px solid #f2c4bb;
}
.badge.img { background: #e8f0fb; color: #1d4f91; border-color: #c3d6f2; }
html[data-contrast] .badge { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.no-results { padding: 1rem .5rem; color: var(--muted); }

/* Links that open elsewhere */
.prose a[target="_blank"]:not(.doc-link)::after, .aside-card a[target="_blank"]::after, .foot a[target="_blank"]::after {
  content: "↗"; font-size: .8em; margin-left: .2em; text-decoration: none; display: inline-block;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; border: var(--border-w) solid var(--line); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: .975rem; background: var(--surface); }
table.data caption { text-align: left; font-weight: 600; padding: .75rem 1rem; }
table.data th, table.data td { padding: .75rem 1rem; text-align: left; vertical-align: top; border-bottom: var(--border-w) solid var(--line); }
table.data th { background: var(--brand-l); font-size: .875rem; letter-spacing: .02em; }
html[data-contrast] table.data th { background: transparent; border-bottom: 2px solid var(--ink); }
table.data tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--brand-l) 45%, transparent); }
html[data-contrast] table.data tbody tr:nth-child(even) td { background: transparent; }
table.data tr:last-child td { border-bottom: 0; }
@media (max-width: 720px) {
  table.data.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display: block; width: 100%; }
  table.data.stack tr { padding: .5rem 0; border-bottom: 4px solid var(--line); }
  table.data.stack td { border: 0; padding: .3rem 1rem; }
  table.data.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  table.data.stack td:empty { display: none; }
}

/* ---------- Home ---------- */
.section-title { font-size: 1.35rem; margin: 0 0 1rem; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: -2.5rem; position: relative; z-index: 2; padding: 0; list-style: none; }
.quick a {
  display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; text-decoration: none; color: var(--ink);
  background: var(--surface); border: var(--border-w) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.quick a:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--ink); }
.quick .ico { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 10px; display: grid; place-items: center; background: var(--brand-l); color: var(--brand); }
html[data-contrast] .quick .ico { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
.quick svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick strong { display: block; line-height: 1.2; }
.quick small { color: var(--muted); font-size: .85rem; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; margin-top: 2.5rem; align-items: start; }
.panel { padding: 1.5rem; }
.panel + .panel { margin-top: 1.5rem; }
.panel .more { display: inline-block; margin-top: 1rem; font-weight: 600; }
.panel ul.doc-list { margin-top: 0; }
.panel ul.doc-list { list-style: none; padding: 0; border-top: var(--border-w) solid var(--line); }
.panel li.doc { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; padding: .8rem .25rem; border-bottom: var(--border-w) solid var(--line); margin: 0; }
.aside-card { padding: 1.25rem 1.25rem 1.1rem; }
.aside-card + .aside-card { margin-top: 1.25rem; }
.aside-card h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.aside-card ul { list-style: none; margin: 0; padding: 0; }
.aside-card li { border-bottom: var(--border-w) solid var(--line); }
.aside-card li:last-child { border-bottom: 0; }
.aside-card li a { display: block; padding: .5rem 0; font-size: .95rem; }
.about-strip { margin-top: 2.5rem; padding: clamp(1.25rem, 3vw, 2rem); }
.about-strip p { max-width: none; }

/* Homepage layout inspired by the government service portal reference */
.home-main { padding: 0; }
.announcement-strip { background: #f1f1f1; border-block: 1px solid var(--line); }
.announcement-strip .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; min-height: 3.5rem; }
.announcement-label { display: flex; align-items: center; gap: .5rem; color: var(--brand); font-size: .88rem; font-weight: 800; white-space: nowrap; }
.announcement-label svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.announcement-track { display: flex; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
.announcement-track::-webkit-scrollbar { display: none; }
.announcement-item { display: flex; flex: 0 0 auto; align-items: center; gap: .5rem; max-width: 30rem; padding: .45rem .85rem; border-left: 1px solid var(--line); color: var(--ink); font-size: .84rem; font-weight: 600; text-decoration: none; }
.announcement-item:hover { color: var(--brand); background: rgba(22,47,106,.05); }
.announcement-item svg { flex: none; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.announcement-more { color: var(--brand); font-size: .84rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.home-spotlight { background: #efefef; border-bottom: 1px solid var(--line); }
.home-spotlight .wrap { display: grid; grid-template-columns: 10rem minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(1.5rem, 3vw, 2.5rem); }
.spotlight-image { width: 9rem; aspect-ratio: 1; justify-self: center; overflow: hidden; border: .4rem solid var(--surface); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
.spotlight-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.spotlight-copy .home-eyebrow, .home-eyebrow { margin: 0 0 .35rem; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.spotlight-copy h2 { margin: 0 0 .35rem; color: var(--brand); font-size: clamp(1.3rem, 2vw, 1.8rem); }
.spotlight-copy p:last-of-type { max-width: 72ch; margin: 0; }
.spotlight-copy a { display: inline-block; margin-top: .55rem; font-size: .9rem; font-weight: 700; }
.home-about .wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(17rem, .85fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(2.5rem, 5vw, 4rem); }
.home-about-copy h2 { margin: 0 0 .75rem; color: var(--brand); font-size: clamp(1.45rem, 2vw, 1.9rem); }
.home-about-copy p { margin: 0 0 .8rem; }
.home-about-copy .text-link { display: inline-block; margin-top: .2rem; font-weight: 700; }
.home-about-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.home-action-card { display: flex; min-height: 6rem; flex-direction: column; justify-content: space-between; gap: .5rem; padding: .9rem 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); text-decoration: none; transition: border-color .18s, transform .18s; }
.home-action-card:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.home-action-card strong { color: var(--brand); font-size: .94rem; }
.home-action-card small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.home-action-arrow { align-self: flex-end; color: var(--brand); font-size: 1.1rem; line-height: 1; }
.home-services-band { padding-block: clamp(2rem, 4vw, 3.5rem); background: #efefef; border-block: 1px solid var(--line); }
.home-services-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(18rem, .85fr); align-items: start; gap: clamp(1.5rem, 3vw, 2.5rem); }
.home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.home-section-heading h2 { margin: 0; color: var(--brand); font-size: clamp(1.3rem, 1.8vw, 1.65rem); }
.home-section-heading .home-eyebrow { margin-bottom: .25rem; }
.home-section-heading > a { flex: none; font-size: .86rem; font-weight: 700; }
.home-service-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.home-service-card { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; min-height: 5.2rem; padding: .8rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); text-decoration: none; transition: border-color .18s, transform .18s; }
.home-service-card:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.home-service-icon { display: grid; width: 2.4rem; height: 2.4rem; place-items: center; border-radius: 5px; color: var(--brand); background: var(--brand-l); }
.home-service-icon svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-service-card strong, .home-service-card small { display: block; }
.home-service-card strong { color: var(--brand); font-size: .9rem; }
.home-service-card small { margin-top: .12rem; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.home-service-arrow { color: var(--brand); font-size: 1.2rem; }
.home-updates { padding: 1.25rem; background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.home-updates .home-eyebrow { color: var(--accent); }
.home-updates h2 { margin: 0 0 .65rem; color: var(--on-brand); font-size: 1.35rem; }
.home-update-list { list-style: none; margin: 0; padding: 0; }
.home-update-list li + li { border-top: 1px solid rgba(255,255,255,.28); }
.home-update-list a { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; padding: .68rem .1rem; color: var(--on-brand); font-size: .84rem; line-height: 1.4; text-decoration: none; }
.home-update-list a:hover { color: var(--on-brand); text-decoration: underline; }
.home-update-list .update-arrow { flex: none; font-size: 1.1rem; }
.home-updates .more { display: inline-block; margin-top: .55rem; color: var(--on-brand); font-size: .86rem; font-weight: 700; }
.home-resources { padding-block: clamp(2.5rem, 5vw, 4rem); }
.home-resource-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(17rem, .8fr); align-items: start; gap: clamp(1.5rem, 3vw, 2.5rem); }
.home-resources .audiences { margin: 0; }
.home-resources .audiences h2 { margin: 0 0 1rem; color: var(--brand); font-size: clamp(1.3rem, 1.8vw, 1.65rem); }
.home-resources .audience-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.home-resources .audience-grid a { padding: .85rem; border-top-width: 3px; border-radius: 5px; }
.home-resources .audience-grid strong { color: var(--brand); font-size: .88rem; }
.home-resources .audience-grid small { font-size: .78rem; line-height: 1.4; }
.home-important { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); }
.home-important h2 { margin: 0 0 .65rem; color: var(--brand); font-size: 1.25rem; }
.home-important-list { list-style: none; margin: 0; padding: 0; }
.home-important-list li + li { border-top: 1px solid var(--line); }
.home-important-list a { display: flex; justify-content: space-between; gap: .6rem; padding: .58rem .1rem; color: var(--ink); font-size: .86rem; line-height: 1.35; text-decoration: none; }
.home-important-list a:hover { color: var(--brand); }
.home-important-list span:last-child { flex: none; color: var(--brand); }
.home-field-band { padding-block: clamp(2.5rem, 5vw, 4rem); color: var(--on-brand); background: var(--brand-d); }
.home-field-band .home-section-heading { align-items: end; margin-bottom: 1.25rem; }
.home-field-band .home-section-heading h2 { color: var(--on-brand); }
.home-field-band .home-section-heading p { margin: .3rem 0 0; color: var(--on-brand-muted); font-size: .9rem; }
.home-field-band .home-eyebrow { color: var(--accent); }
.home-field-band .gallery-link { flex: none; color: var(--on-brand); font-weight: 700; }
.home-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.home-photo-card { position: relative; display: block; min-width: 0; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.home-photo-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.home-photo-card::after { position: absolute; inset: 30% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.8)); content: ""; }
.home-photo-card span { position: absolute; z-index: 1; right: 1rem; bottom: .85rem; left: 1rem; color: #fff; font-size: .9rem; font-weight: 700; }
.home-photo-card:hover { color: #fff; }
.home-photo-card:hover img { transform: scale(1.04); }

@media (max-width: 960px) {
  .home-about .wrap, .home-services-grid, .home-resource-grid { grid-template-columns: minmax(0, 1fr); }
  .home-about-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .announcement-strip .wrap { grid-template-columns: minmax(0, 1fr) auto; gap: .45rem .75rem; padding-block: .45rem; }
  .announcement-track { grid-column: 1 / -1; grid-row: 2; width: 100%; border-top: 1px solid var(--line); }
  .announcement-item { max-width: 78vw; padding: .5rem .65rem; }
  .home-spotlight .wrap { grid-template-columns: 6.25rem minmax(0, 1fr); gap: 1rem; }
  .spotlight-image { width: 5.75rem; border-width: .25rem; }
  .home-about .wrap { gap: 1.5rem; padding-block: 2.25rem; }
  .home-about-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-services-band { padding-block: 2rem; }
  .home-section-heading { flex-wrap: wrap; align-items: flex-start; }
  .home-resource-grid { gap: 1.5rem; }
  .home-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-photo-card:last-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
}
@media (max-width: 520px) {
  .announcement-label { font-size: .8rem; }
  .announcement-more { font-size: .8rem; }
  .home-spotlight .wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: .75rem; padding-block: 1.25rem; text-align: center; }
  .spotlight-image { width: 5.5rem; }
  .spotlight-copy h2 { font-size: 1.35rem; }
  .home-about-actions, .home-service-cards, .home-resources .audience-grid, .home-photo-grid { grid-template-columns: minmax(0, 1fr); }
  .home-photo-card:last-child { grid-column: auto; aspect-ratio: 16 / 10; }
  .home-action-card { min-height: 5rem; }
  .home-service-card { min-height: 4.8rem; }
}

/* ---------- Gallery ---------- */
.gallery-carousel { width: 100%; min-width: 0; margin-block: .5rem 1rem; }
.gallery-carousel-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .65rem; min-width: 0; margin: 0 0 .8rem; }
.gallery-carousel-button { display: grid; flex: 0 0 2.8rem; width: 2.8rem; height: 2.8rem; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--brand); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: background-color .18s, color .18s, transform .18s; }
.gallery-carousel-button:hover:not(:disabled) { color: var(--on-brand); background: var(--brand); transform: translateY(-1px); }
.gallery-carousel-button:disabled { opacity: .42; cursor: default; box-shadow: none; }
.gallery-carousel-button svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gallery-carousel-count { min-width: 4.6rem; color: var(--brand); text-align: center; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gallery { display: flex; width: 100%; min-width: 0; gap: 1rem; overflow-x: auto; padding: .25rem .1rem .9rem; scroll-snap-type: x mandatory; scroll-padding-inline: .1rem; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; scrollbar-color: var(--brand) var(--chip); scrollbar-width: thin; }
.gallery:focus-visible { outline-offset: 4px; }
.gallery a { position: relative; display: block; flex: 0 0 min(32rem, calc((100% - 2rem) / 3)); min-width: 0; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--chip); border: var(--border-w) solid var(--line); box-shadow: var(--shadow); scroll-snap-align: start; text-decoration: none; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; transition: transform .35s ease; }
.gallery a:hover img { transform: scale(1.045); }
.gallery-caption { position: absolute; inset: auto 0 0; display: -webkit-box; overflow: hidden; padding: 2.5rem 1rem .9rem; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; font-size: .95rem; font-weight: 600; line-height: 1.35; text-shadow: 0 1px 2px rgba(0,0,0,.55); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (max-width: 1100px) { .gallery a { flex-basis: min(32rem, calc((100% - 1rem) / 2)); } }
@media (max-width: 700px) {
  .gallery-carousel-controls { gap: .45rem; margin-bottom: .55rem; }
  .gallery { gap: .75rem; padding-bottom: .75rem; scroll-padding-inline: .05rem; }
  .gallery a { flex-basis: 88%; aspect-ratio: 4 / 3; }
  .gallery-caption { padding: 2rem .8rem .75rem; font-size: clamp(.8rem, 2.5vw, .9rem); }
}
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.25rem; list-style: none; padding: 0 !important; }
.videos li { max-width: none !important; margin: 0 !important; }
.videos a { display: block; text-decoration: none; color: var(--ink); }
.videos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.videos span { display: block; margin-top: .4rem; font-weight: 500; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; color: #fff; }
dialog.lightbox::backdrop { background: rgba(0,0,0,.88); }
.lightbox figure { margin: 0; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; place-items: center; padding: 3.5rem 4rem 1rem; gap: 1rem; }
.lightbox img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox figcaption { text-align: center; max-width: 60ch; }
.lb-btn { position: fixed; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; width: 2.8rem; height: 2.8rem; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; }
.lb-next { right: 1rem; top: 50%; }

/* Help page chips */
.chip { display: inline-block; padding: .05rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--chip); font-weight: 600; font-size: .9em; }

/* ---------- Footer ---------- */
.foot { background: var(--brand-d); color: var(--on-brand-muted); border-top: 4px solid var(--accent); font-size: .95rem; }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding: 2.5rem 0 2rem; }
.foot h2 { color: var(--on-brand); font-size: 1rem; margin: 0 0 .75rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: .35rem 0; }
.foot a { color: var(--on-brand); }
.foot a:hover { color: var(--on-brand); text-decoration-thickness: .16em; }
.foot p { margin: 0 0 .5rem; }
.foot .legal { border-top: 1px solid rgba(255,255,255,.2); padding: 1rem 0 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; font-size: .875rem; }
html[data-contrast] .foot .legal { border-top-color: var(--on-brand); }
.totop { color: var(--on-brand); }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 3rem 1rem; }
.notfound .code { font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; color: var(--brand); line-height: 1; margin: 0; }
html[data-contrast] .notfound .code { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .layout.has-side { grid-template-columns: 1fr; }
  .subnav { position: static; }
  .subnav ul { gap: .25rem; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
  .foot .cols > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary ul { display: none; flex-direction: column; padding-bottom: .5rem; }
  .primary.open ul { display: flex; }
  .primary li a { border-bottom: 0; border-left: 4px solid transparent; padding: .75rem .5rem; }
  .primary li a[aria-current="page"] { border-left-color: var(--accent); }
}
@media (max-width: 1100px) {
  .home-carousel-slide { grid-template-columns: minmax(0, .4fr) minmax(0, .6fr); }
  .carousel-copy { padding: 1rem 1.75rem; }
  .carousel-eyebrow { margin-bottom: .55rem; font-size: .68rem; }
  .carousel-copy h2 { margin-bottom: .65rem; font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
  .carousel-lead { margin-bottom: .8rem; font-size: .95rem; line-height: 1.45; }
  .home-carousel .actions { gap: .4rem; }
  .home-carousel .btn { padding: .55rem .8rem; font-size: .9rem; }
}
@media (max-width: 800px) {
  .home-carousel { height: auto; }
  .home-carousel-slide { grid-template-columns: minmax(0, 1fr); grid-template-rows: 15rem auto; height: auto; min-height: 0; }
  .carousel-visual { grid-column: 1; grid-row: 1; min-height: 15rem; border-left: 0; border-bottom: 4px solid var(--accent); }
  .carousel-visual::before { display: none; }
  .carousel-copy { grid-column: 1; grid-row: 2; padding: 2rem 1.25rem 4.5rem; }
  .carousel-copy h2 { font-size: clamp(2rem, 7vw, 3rem); }
  .carousel-lead { font-size: 1rem; }
  .carousel-controls { top: 11.2rem; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }
  .carousel-control { width: 2.35rem; height: 2.35rem; }
}
@media (max-width: 560px) {
  .subnav { grid-template-columns: minmax(0, 1fr); padding: .9rem; }
  .subnav h2 { font-size: .82rem; }
  .subnav ul { gap: .2rem; }
  .subnav a { padding: .5rem .65rem; font-size: .88rem; }
  li.doc, .prose ul.doc-list li.doc, .panel li.doc { flex-direction: column; gap: .35rem !important; }
  .foot .cols { grid-template-columns: 1fr; }
  .lightbox figure { padding: 3.5rem .5rem 1rem; }
  .lb-prev { left: .25rem; } .lb-next { right: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .carousel-visual img { animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .primary, .search, .skip, .a11y-drawer, .tool-icons, .subnav, .foot .cols, .filter, .hero .actions, .lb-btn { display: none !important; }
  .carousel-controls, .home-carousel .actions { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border: 0; }
  a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
  .pagehead { background: none; border: 0; }
}

/* long obfuscated e-mail addresses must wrap on narrow screens */
table.data td, .prose p { overflow-wrap: anywhere; }

@media (max-width: 1280px) {
  .masthead .wrap { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: .75rem; }
  .brand { grid-column: 1 / -1; grid-row: 1; }
  .search { grid-column: 1; grid-row: 2; }
  .department-logo { grid-column: 2; grid-row: 2; }
  .tool-icons { grid-column: 3; grid-row: 2; }
}
@media (max-width: 400px) { .tiles { grid-template-columns: 1fr; } }

@media (max-width: 700px) {
  .wrap { width: calc(100% - 2rem); }
  .masthead .wrap { grid-template-columns: minmax(0, 1fr) auto; row-gap: .65rem; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .department-logo { grid-column: 1; grid-row: 3; justify-self: start; }
  .tool-icons { grid-column: 2; grid-row: 3; justify-self: end; }
}
