/* =========================================================
   Modern Business Theme – RISC OS CMS
   Self-contained; no external CDN, no web fonts.
   CSP-compliant: all styles in this file.
   ========================================================= */

/* ---- Custom Properties ---------------------------------------- */
:root {
  --color-primary:   #2563eb;
  --color-primary-h: #1d4ed8;
  --color-text:      #111827;
  --color-muted:     #6b7280;
  --color-border:    #e5e7eb;
  --color-bg:        #f9fafb;
  --color-surface:   #ffffff;
  --color-accent:    #0ea5e9;
  --max-width:       860px;
  --max-wide:        1100px;
  --radius:          8px;
  --font-sans:       system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif:      Georgia, "Times New Roman", Times, serif;
  --font-mono:       "Cascadia Code", "Fira Code", Consolas, monospace;
  --transition:      0.2s ease;
  --shadow:          0 1px 4px rgba(0,0,0,.08);
  --shadow-md:       0 4px 16px rgba(0,0,0,.10);
}

/* ---- Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--color-surface); }
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--color-primary); text-decoration: underline; }
a:hover { text-decoration: none; }

/* ---- Base typography ------------------------------------------ */
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-surface);
}

/* ---- Layout container ----------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Skip link ------------------------------------------------- */
.skip-link {
  position: absolute; top: -100%; left: 8px;
  background: var(--color-primary); color: #fff;
  padding: 8px 16px; border-radius: 0 0 var(--radius) var(--radius);
  z-index: 1000; font-size: 14px;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ---- Site header ---------------------------------------------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.site-logo {
  text-decoration: none; flex-shrink: 0;
}
.logo-text {
  font-size: 20px; font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.logo-text:hover { color: var(--color-primary); }

/* ---- Navigation ----------------------------------------------- */
.site-nav .nav-list {
  display: flex; align-items: center; gap: 0;
  list-style: none;
}
.nav-link {
  display: block; padding: 8px 14px;
  font-size: 15px; font-weight: 500;
  color: var(--color-muted); text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--color-text); background: var(--color-bg); }
.nav-link.is-current { color: var(--color-primary); font-weight: 600; }

/* Mobile toggle */
/* ---- Mobile hamburger toggle (v5.9.128 checkbox-label hack) ----
   The hidden <input type="checkbox" id="navToggleCheck"> is
   placed just before the nav inside .header-inner. Its
   <label class="nav-toggle"> toggles the checkbox without JS.
   `.nav-toggle-cb:checked ~ .site-nav` then shows the menu.
   Works even when JavaScript is blocked or fails to load
   (CSP, Cloudflare proxies, browser quirks, etc.). The JS
   class `.is-open` is preserved as a parallel mechanism so
   existing JS code continues to work for keyboard escape
   handling and click-outside-to-close.
   ------------------------------------------------------------- */
.nav-toggle-cb {
  /* v5.9.129: standard "sr-only" visually-hidden pattern.
     NO pointer-events:none -- that can block label-click
     from toggling the checkbox in some browsers (notably
     iOS Safari, despite the CSS spec saying synthetic
     clicks from label activation should still get through).
     Position off-screen with left:-9999px so even with full
     interactivity the checkbox never affects layout. */
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  opacity: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--radius);
}
.nav-toggle span {
  display: block; height: 2px; background: var(--color-text);
  border-radius: 1px; transition: transform var(--transition), opacity var(--transition);
}
/* Animated X when nav is open (both via JS .is-open class
   and via the :checked checkbox state). */
.nav-toggle.is-open span:nth-child(1),
.nav-toggle-cb:checked ~ .header-inner .nav-toggle span:nth-child(1),
.nav-toggle-cb:checked + .site-logo ~ .nav-toggle span:nth-child(1),
#navToggleCheck:checked ~ .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2),
#navToggleCheck:checked ~ .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3),
#navToggleCheck:checked ~ .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Hero section --------------------------------------------- */
.hero-section {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  padding: 80px 0;
  text-align: center;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900; letter-spacing: -0.02em;
  color: var(--color-text); margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 1.2rem; color: var(--color-muted);
  max-width: 540px; margin: 0 auto 28px;
}
.btn-hero {
  display: inline-block; padding: 14px 28px;
  background: var(--color-primary); color: #fff;
  border-radius: var(--radius); font-weight: 600; font-size: 16px;
  text-decoration: none; transition: background var(--transition);
}
.btn-hero:hover { background: var(--color-primary-h); text-decoration: none; }

/* ---- Buttons -------------------------------------------------- */
.btn {
  display: inline-block; padding: 10px 22px;
  border-radius: var(--radius); font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  border: 2px solid transparent;
  line-height: 1.4;
}
.btn-primary  { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover  { background: var(--color-primary-h); text-decoration: none; }
.btn-outline  { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover  { background: var(--color-primary); color: #fff; text-decoration: none; }

/* ---- Section headings ----------------------------------------- */
.section-heading {
  font-size: 1.6rem; font-weight: 800; margin: 48px 0 24px;
  letter-spacing: -0.02em;
}

/* ---- Post grid (homepage) ------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}
.post-card {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card-body { padding: 20px; }
.post-card-title { font-size: 1.1rem; font-weight: 700; margin: 8px 0; }
.post-card-title a { color: var(--color-text); text-decoration: none; }
.post-card-title a:hover { color: var(--color-primary); }
.view-all-wrap { text-align: center; margin: 8px 0 48px; }

/* ---- Post list (blog index) ----------------------------------- */
.blog-header { padding: 40px 0 20px; border-bottom: 2px solid var(--color-border); margin-bottom: 40px; }
.blog-title { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; }

.post-list { display: flex; flex-direction: column; gap: 0; }
.post-list-item {
  padding: 32px 0;
  border-bottom: 1px solid var(--color-border);
}
.post-list-item:last-child { border-bottom: none; }
.post-list-title { font-size: 1.4rem; font-weight: 700; margin: 8px 0 12px; letter-spacing: -0.01em; }
.post-list-title a { color: var(--color-text); text-decoration: none; }
.post-list-title a:hover { color: var(--color-primary); }

/* ---- Meta info ------------------------------------------------ */
.post-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--color-muted); margin-bottom: 8px;
}
.post-meta time, .post-meta span { display: inline; }
.post-author { color: var(--color-muted); }

/* ---- Excerpt -------------------------------------------------- */
.post-excerpt { color: var(--color-muted); font-size: 15px; margin-bottom: 12px; }
.post-excerpt p { margin: 0; }
.read-more-link { font-size: 14px; font-weight: 600; color: var(--color-primary); text-decoration: none; }
.read-more-link:hover { text-decoration: underline; }

/* ---- Single post ---------------------------------------------- */
.single-post { max-width: var(--max-width); margin: 0 auto; padding: 48px 0; }
.post-header  { margin-bottom: 32px; }
.post-title   { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -0.02em; margin: 12px 0; line-height: 1.25; }
.post-tags    { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag-link     { font-size: 13px; background: #eff6ff; color: var(--color-primary); padding: 3px 10px; border-radius: 14px; text-decoration: none; font-weight: 500; }
.tag-link:hover { background: var(--color-primary); color: #fff; }
.post-footer  { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--color-border); }
.back-link    { font-weight: 600; font-size: 14px; color: var(--color-primary); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ---- Page content --------------------------------------------- */
.page-container { padding-top: 48px; padding-bottom: 48px; }
.page-header    { margin-bottom: 32px; }
.page-title     { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -0.02em; }

/* ---- Prose (rendered Markdown) -------------------------------- */
.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6 {
  font-weight: 800; line-height: 1.3; margin: 2em 0 .6em; letter-spacing: -0.01em;
}
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.2rem; }
.prose p  { margin-bottom: 1.3em; }
.prose ul,.prose ol { margin: 0 0 1.3em 1.5em; }
.prose li { margin-bottom: .4em; }
.prose a  { color: var(--color-primary); }
.prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 8px 16px; margin: 1.5em 0;
  background: #eff6ff; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-muted); font-style: italic;
}
.prose pre {
  background: #1e2532; color: #a8b3c8;
  padding: 16px; border-radius: var(--radius);
  overflow-x: auto; margin: 1.5em 0;
}
.prose code { font-family: var(--font-mono); font-size: .9em; background: #f0f4ff; padding: 2px 5px; border-radius: 4px; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.prose th { background: var(--color-bg); text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--color-border); font-size: 14px; }
.prose td { padding: 8px 12px; border-bottom: 1px solid var(--color-border); }
.prose hr { border: none; border-top: 2px solid var(--color-border); margin: 2em 0; }

/* ---- Pagination ----------------------------------------------- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 40px 0;
}
.pagination-link { font-weight: 600; font-size: 15px; text-decoration: none; }
.pagination-link:hover { text-decoration: underline; }
.pagination-info { color: var(--color-muted); font-size: 14px; }

/* ---- Footer --------------------------------------------------- */
.site-footer {
  background: #1e2532; color: #a8b3c8;
  padding: 40px 0; margin-top: 64px;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.footer-brand { font-size: 17px; font-weight: 700; color: #fff; }
.footer-tagline { font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 8px; }
.footer-nav a { color: #a8b3c8; text-decoration: none; font-size: 14px; }
.footer-nav a:hover { color: #fff; }

/* ---- Site main ------------------------------------------------ */
.site-main { min-height: 60vh; }

/* ---- Empty state ---------------------------------------------- */
.empty-state { color: var(--color-muted); padding: 40px 0; font-size: 15px; }

/* ---- Responsive ----------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero-section { padding: 48px 0; }
  .post-grid { grid-template-columns: 1fr; }
  .single-post { padding: 24px 0; }
  .page-container { padding-top: 24px; padding-bottom: 24px; }

  /* Mobile nav: hidden by default. Open state set by EITHER
     the JS `.is-open` class OR the v5.9.128 checkbox-hack
     (`.nav-toggle-cb:checked ~ .site-nav`). Both mechanisms
     paint the same `display: block`, so a JS-less or
     CSP-blocked client still gets a working menu. */
  .site-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    z-index: 99;
    padding: 8px 0;
  }
  .site-nav.is-open,
  #navToggleCheck:checked ~ .site-nav { display: block; }
  .site-nav .nav-list { flex-direction: column; gap: 0; padding: 0 16px; }
  .nav-link { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid var(--color-border); }
  .nav-link:last-child { border-bottom: none; }
  .nav-toggle { display: flex; }
  .header-inner { position: relative; }
}

@media (min-width: 641px) {
  .nav-toggle { display: none; }
  .site-nav   { display: block !important; }
}


/* ---- Branding ------------------------------------------------- */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.site-logo-image {
  max-height: 38px;
  width: auto;
}
.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.hero-logo-wrap-page {
  justify-content: flex-start;
}
.hero-logo {
  max-height: 96px;
  width: auto;
}

/* ---- Forced dark mode ---------------------------------------- */
body.site-body[data-theme="dark"] {
  --color-primary: #60a5fa;
  --color-primary-h: #3b82f6;
  --color-text: #e5e7eb;
  --color-muted: #9ca3af;
  --color-border: #334155;
  --color-bg: #0f172a;
  --color-surface: #111827;
  --color-accent: #38bdf8;
  --shadow: 0 1px 4px rgba(0,0,0,.30);
  --shadow-md: 0 8px 20px rgba(0,0,0,.35);
}
/* Ensure html background matches body in forced dark mode */
html:has(body.site-body[data-theme="dark"]) { background: #111827; }
body.site-body[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #172554 0%, #0f172a 100%);
}
body.site-body[data-theme="dark"] .tag-link {
  background: #1e3a8a;
  color: #dbeafe;
}
body.site-body[data-theme="dark"] .prose blockquote {
  background: #172554;
  color: #cbd5e1;
}
body.site-body[data-theme="dark"] .prose code {
  background: #1e293b;
}

@media (prefers-color-scheme: dark) {
  body.site-body[data-theme="auto"] {
    --color-primary: #60a5fa;
    --color-primary-h: #3b82f6;
    --color-text: #e5e7eb;
    --color-muted: #9ca3af;
    --color-border: #334155;
    --color-bg: #0f172a;
    --color-surface: #111827;
    --color-accent: #38bdf8;
    --shadow: 0 1px 4px rgba(0,0,0,.30);
    --shadow-md: 0 8px 20px rgba(0,0,0,.35);
  }
  body.site-body[data-theme="auto"] .hero-section {
    background: linear-gradient(135deg, #172554 0%, #0f172a 100%);
  }
  body.site-body[data-theme="auto"] .tag-link {
    background: #1e3a8a;
    color: #dbeafe;
  }
  body.site-body[data-theme="auto"] .prose blockquote {
    background: #172554;
    color: #cbd5e1;
  }
  body.site-body[data-theme="auto"] .prose code {
    background: #1e293b;
  }
}

/* ---- Photo Albums ---------------------------------------------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.album-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}
.album-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.album-cover {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--color-bg);
  overflow: hidden;
}
.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-cover-empty {
  background: linear-gradient(135deg, var(--color-border), var(--color-bg));
}
.album-body { padding: 1rem; }
.album-title { margin: 0 0 .25rem 0; font-size: 1.15rem; }
.album-meta  { margin: 0; color: var(--color-muted); font-size: .9rem; }
.album-description {
  margin: .5rem 0 0 0;
  color: var(--color-muted);
  font-size: .95rem;
  line-height: 1.5;
}

.breadcrumbs {
  margin: 1rem 0;
  font-size: .9rem;
  color: var(--color-muted);
}
.breadcrumbs a { color: var(--color-primary); }

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}
.photo-item {
  margin: 0;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.photo-item a { display: block; }
.photo-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.photo-item a:hover img { transform: scale(1.03); }
.photo-caption {
  padding: .5rem .75rem;
  font-size: .9rem;
  color: var(--color-muted);
  background: var(--color-surface);
}

/* ---- Homepage intro card + CTA buttons ---------------------- */
/* Optional editable intro rendered on the default homepage layout.
   Content comes from Admin -> Settings -> Homepage intro page.
   Buttons come from the Admin -> Menus -> Homepage menu. */
.home-intro-card {
  margin: 32px auto 16px;
  padding: 0;
}
.homepage-ctas {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--color-border);
}
.homepage-ctas .btn { margin: 0; }

/* =============================================================
   ALBUM LIGHTBOX
   =============================================================
   Full-viewport overlay shown when a gallery photo is clicked.
   Caption is parked in a slim bar at the bottom that doesn't
   cover the image. Counter ("3 / 12") sits alongside.
   Colors pulled from the theme's existing custom properties, so
   the overlay visually belongs to whichever theme is active.
   ============================================================= */

html.lightbox-lock, html.lightbox-lock body { overflow: hidden; }

.lightbox {
  position: fixed; inset: 0;
  display: none;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.92);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  padding: 48px 56px 96px;
  box-sizing: border-box;
}
.lightbox.is-open { display: flex; align-items: center; justify-content: center; }

.lightbox-stage {
  max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 144px);
  width: auto; height: auto;
  display: block;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  pointer-events: auto;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 28px; line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.lightbox-close:hover, .lightbox-close:focus-visible {
  background: var(--color-primary, #fff);
  border-color: var(--color-primary, #fff);
  color: #000;
  outline: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 34px; line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav:hover, .lightbox-nav:focus-visible {
  background: var(--color-primary, #fff);
  border-color: var(--color-primary, #fff);
  color: #000;
  outline: none;
}

.lightbox-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 72px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  color: #fff;
  font-size: 14px;
  display: flex; align-items: baseline; gap: 20px;
  pointer-events: none;
  min-height: 48px;
}
.lightbox-counter {
  color: var(--color-primary, #fff);
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.lightbox-caption {
  flex: 1 1 auto;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  max-height: 3em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 600px) {
  .lightbox { padding: 16px 16px 88px; }
  .lightbox-nav { width: 44px; height: 44px; font-size: 26px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; width: 40px; height: 40px; font-size: 24px; }
  .lightbox-info { padding: 10px 14px; font-size: 13px; }
  .lightbox-image { max-height: calc(100vh - 120px); }
}

.lightbox:not(.is-open) { display: none !important; }

/* v5.9.1: Protective marking banner. Public-facing render of a wiki
   page that carries a non-UNCLASSIFIED marking. CMS pages + blog
   posts don't render this on the public side -- they're always
   UNCLASSIFIED and don't need a label externally.
   v5.9.3: per-marking background colour comes from a `marking-bg-N`
   class emitted in a per-page nonced `<style>` block (see
   markings.style_block_for). Previously the colour was an inline
   `style="background: ..."` which the strict CSP `style-src 'self'
   'nonce-...'` blocked. */
.marking-banner {
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 13px;
  text-transform: uppercase;
  margin: 0 0 20px 0;
  border-radius: 4px;
}
.marking-banner-bottom {
  margin: 28px 0 16px 0;
}
.marking-bg-unclassified { background: #6b7280; }

/* v5.9.2: image-width utility classes -- see admin.css for the
   rationale. CSP applies to public pages too. */
.img-w-1   { width: 1%;   } .img-w-2   { width: 2%;   } .img-w-3   { width: 3%;   } .img-w-4   { width: 4%;   } .img-w-5   { width: 5%;   }
.img-w-6   { width: 6%;   } .img-w-7   { width: 7%;   } .img-w-8   { width: 8%;   } .img-w-9   { width: 9%;   } .img-w-10  { width: 10%;  }
.img-w-11  { width: 11%;  } .img-w-12  { width: 12%;  } .img-w-13  { width: 13%;  } .img-w-14  { width: 14%;  } .img-w-15  { width: 15%;  }
.img-w-16  { width: 16%;  } .img-w-17  { width: 17%;  } .img-w-18  { width: 18%;  } .img-w-19  { width: 19%;  } .img-w-20  { width: 20%;  }
.img-w-21  { width: 21%;  } .img-w-22  { width: 22%;  } .img-w-23  { width: 23%;  } .img-w-24  { width: 24%;  } .img-w-25  { width: 25%;  }
.img-w-26  { width: 26%;  } .img-w-27  { width: 27%;  } .img-w-28  { width: 28%;  } .img-w-29  { width: 29%;  } .img-w-30  { width: 30%;  }
.img-w-31  { width: 31%;  } .img-w-32  { width: 32%;  } .img-w-33  { width: 33%;  } .img-w-34  { width: 34%;  } .img-w-35  { width: 35%;  }
.img-w-36  { width: 36%;  } .img-w-37  { width: 37%;  } .img-w-38  { width: 38%;  } .img-w-39  { width: 39%;  } .img-w-40  { width: 40%;  }
.img-w-41  { width: 41%;  } .img-w-42  { width: 42%;  } .img-w-43  { width: 43%;  } .img-w-44  { width: 44%;  } .img-w-45  { width: 45%;  }
.img-w-46  { width: 46%;  } .img-w-47  { width: 47%;  } .img-w-48  { width: 48%;  } .img-w-49  { width: 49%;  } .img-w-50  { width: 50%;  }
.img-w-51  { width: 51%;  } .img-w-52  { width: 52%;  } .img-w-53  { width: 53%;  } .img-w-54  { width: 54%;  } .img-w-55  { width: 55%;  }
.img-w-56  { width: 56%;  } .img-w-57  { width: 57%;  } .img-w-58  { width: 58%;  } .img-w-59  { width: 59%;  } .img-w-60  { width: 60%;  }
.img-w-61  { width: 61%;  } .img-w-62  { width: 62%;  } .img-w-63  { width: 63%;  } .img-w-64  { width: 64%;  } .img-w-65  { width: 65%;  }
.img-w-66  { width: 66%;  } .img-w-67  { width: 67%;  } .img-w-68  { width: 68%;  } .img-w-69  { width: 69%;  } .img-w-70  { width: 70%;  }
.img-w-71  { width: 71%;  } .img-w-72  { width: 72%;  } .img-w-73  { width: 73%;  } .img-w-74  { width: 74%;  } .img-w-75  { width: 75%;  }
.img-w-76  { width: 76%;  } .img-w-77  { width: 77%;  } .img-w-78  { width: 78%;  } .img-w-79  { width: 79%;  } .img-w-80  { width: 80%;  }
.img-w-81  { width: 81%;  } .img-w-82  { width: 82%;  } .img-w-83  { width: 83%;  } .img-w-84  { width: 84%;  } .img-w-85  { width: 85%;  }
.img-w-86  { width: 86%;  } .img-w-87  { width: 87%;  } .img-w-88  { width: 88%;  } .img-w-89  { width: 89%;  } .img-w-90  { width: 90%;  }
.img-w-91  { width: 91%;  } .img-w-92  { width: 92%;  } .img-w-93  { width: 93%;  } .img-w-94  { width: 94%;  } .img-w-95  { width: 95%;  }
.img-w-96  { width: 96%;  } .img-w-97  { width: 97%;  } .img-w-98  { width: 98%;  } .img-w-99  { width: 99%;  } .img-w-100 { width: 100%; }

/* v5.9.49: top-right login/admin button. Sits inside
   .header-inner after the nav. The flex layout in the
   existing header already places the right-most child
   at the right edge; the button just needs typography
   + colours that fit each theme's palette. */
.site-login-btn {
  display: inline-block;
  margin-left: 12px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid currentColor;
  opacity: 0.85;
  transition: opacity 0.15s, background-color 0.15s;
  white-space: nowrap;
}
.site-login-btn:hover,
.site-login-btn:focus {
  opacity: 1;
  text-decoration: none;
  outline: none;
}
@media (max-width: 720px) {
  /* On narrow viewports the nav collapses behind the
     hamburger; the login button stays visible but moves
     to a more pragmatic spot. */
  .site-login-btn {
    margin-left: 6px;
    padding: 4px 10px;
    font-size: 0.85rem;
  }
}

/* =================================================================
 * v5.9.78 — Phase 1 UX improvements (reduced-motion, print, forced-colors)
 * ================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .btn, .nav-link, .post-card, .pagination-link {
    border: 1px solid ButtonText;
  }
  a:focus, .btn:focus, .nav-link:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

@media print {
  /* Hide site chrome; the article is the artefact. */
  .site-header,
  .site-footer,
  .nav-toggle,
  .skip-link,
  .pagination,
  #lightbox {
    display: none !important;
  }

  /* Force light-on-white regardless of theme/dark-mode. */
  body, .site-body, .site-main {
    background: #fff !important;
    color: #000 !important;
  }

  a, a:visited {
    color: #000 !important;
    text-decoration: underline;
  }

  /* Show external URLs after each link for offline reading. */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
    font-style: italic;
  }

  /* Headings stay with their content; long blocks wrap. */
  h1, h2, h3 { page-break-after: avoid; }
  pre, code { white-space: pre-wrap !important; word-wrap: break-word !important; }
  img { max-width: 100% !important; page-break-inside: avoid; }
}
