/* Production Lamina theme: approved palette and reading surfaces.
   Geometry, media and page controllers remain owned by existing components. */
body[data-site-theme="lamina"] {
  --theme-ground: #edf3f7;
  --theme-ink: #173043;
  --theme-muted: #506778;
  --theme-nav: #142c40;
  --theme-accent: #185f73;
  --theme-link: #17677d;
  --theme-hover: #e4f2f5;
  --theme-hero: #10283b;
  --theme-hero-ink: #f3fbff;
  --theme-paper: #ffffff;
  --theme-line: #cbdde6;
  --theme-row: #edf5f8;
  --theme-table-head: #254e63;
  --theme-footer: #142c40;
  --theme-shadow: 0 8px 26px rgba(20, 44, 64, .05);
  --theme-radius: 5px;
}
body[data-site-theme="lamina"] {
  color: var(--theme-ink);
  background: var(--theme-ground);
  background-attachment: fixed;
}
body[data-site-theme="lamina"]::before,
body[data-site-theme="lamina"]::after { content: none; }
body[data-site-theme="lamina"] > div > img[alt="pattern"] { visibility: hidden; }
body[data-site-theme="lamina"] .navbar {
  border-bottom-color: rgba(255, 255, 255, .14);
  box-shadow: 0 2px 12px rgba(18, 33, 41, .13) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-site-theme="lamina"] .navbar .nav-link { color: #f4f7f6; }
body[data-site-theme="lamina"] .navbar .nav-link:hover,
body[data-site-theme="lamina"] .navbar .nav-link:focus-visible,
body[data-site-theme="lamina"] .navbar .nav-link[aria-expanded="true"] { color: #ffffff; }

body[data-site-theme="lamina"] .dropdown-menu {
  background: var(--theme-paper);
  border-color: var(--theme-line);
  box-shadow: var(--theme-shadow);
  backdrop-filter: none;
}
body[data-site-theme="lamina"] .dropdown-item { color: var(--theme-ink); }
body[data-site-theme="lamina"] .dropdown-item:hover,
body[data-site-theme="lamina"] .dropdown-item:focus,
body[data-site-theme="lamina"] .dropdown-item:active { background: var(--theme-hover); color: var(--theme-accent); }

/* Animate the label inside its padded hit area, not the full-width item box. */
body[data-site-theme="lamina"] .navbar .dropdown-item {
  --dropdown-item-shift: .25rem;
  transform: none;
  transition: background-color .2s ease, color .2s ease, padding-inline-start .2s ease, padding-inline-end .2s ease;
}
body[data-site-theme="lamina"] .navbar .dropdown-item:is(:hover, :focus-visible) {
  padding-inline-start: calc(var(--bs-dropdown-item-padding-x, 1rem) + var(--dropdown-item-shift));
  padding-inline-end: calc(var(--bs-dropdown-item-padding-x, 1rem) - var(--dropdown-item-shift));
}
@media (prefers-reduced-motion: reduce) {
  body[data-site-theme="lamina"] .navbar .dropdown-item { --dropdown-item-shift: 0px; transition: none; }
}

body[data-site-theme="lamina"] > header {
  background: var(--theme-hero) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom-color: var(--theme-line) !important;
  box-shadow: none !important;
  isolation: isolate;
  overflow: hidden;
}
body[data-site-theme="lamina"] > header h1.text-white { color: var(--theme-hero-ink) !important; }

body[data-site-theme="lamina"] .container.content {
  background: var(--theme-paper);
  border-color: var(--theme-line);
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body[data-site-theme="lamina"] .content h2,
body[data-site-theme="lamina"] .content h3,
body[data-site-theme="lamina"] .content h4 { color: var(--theme-accent); }
body[data-site-theme="lamina"] .content strong { color: var(--theme-ink); }
body[data-site-theme="lamina"] .content a { color: var(--theme-link); }
body[data-site-theme="lamina"] .content a:hover { color: var(--theme-accent); }
body[data-site-theme="lamina"] .content p[style*="color: #6c757d"] { color: var(--theme-muted) !important; }

/* Inline legacy table declarations stay present for compatibility. Recolor
   without changing border widths, cell padding or the collapsed table model. */
body[data-site-theme="lamina"] .content table {
  background: var(--theme-paper);
  border-color: var(--theme-line);
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body[data-site-theme="lamina"] .content thead,
body[data-site-theme="lamina"] .content thead tr,
body[data-site-theme="lamina"] .content thead th { background: var(--theme-table-head) !important; color: #ffffff !important; }
body[data-site-theme="lamina"] .content thead::before { background: none; }
body[data-site-theme="lamina"] .content tbody { background: var(--theme-paper); }
body[data-site-theme="lamina"] .content tbody tr:nth-child(odd) { background: var(--theme-paper) !important; }
body[data-site-theme="lamina"] .content tbody tr:nth-child(even) { background: var(--theme-row) !important; }
body[data-site-theme="lamina"] .content td,
body[data-site-theme="lamina"] .content th { border-color: var(--theme-line) !important; }
body[data-site-theme="lamina"] .content td { color: var(--theme-ink); }

body[data-site-theme="lamina"] footer.bg-dark {
  background: var(--theme-footer) !important;
  box-shadow: none;
  backdrop-filter: none;
}
body[data-site-theme="lamina"] footer a { color: #ffffff; }
body[data-site-theme="lamina"] footer a:hover { color: #e3f2ec; }

body[data-site-theme="lamina"] .content :target { animation-name: lamina-reference-glow; }
@keyframes lamina-reference-glow {
  0%, 67% { color: var(--theme-accent); text-shadow: 0 0 12px rgba(166, 210, 223, .17); }
  100% { color: inherit; text-shadow: none; }
}
body[data-site-theme="lamina"] ::selection { background: var(--theme-accent); color: #ffffff; }


body[data-site-theme="lamina"] > header { border-bottom-color: #668b9e !important; }
body[data-site-theme="lamina"] > header > .container { position: relative; z-index: 2; }
.gel-hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  contain: strict;
}
.gel-hero canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 500ms ease;
}
.gel-hero__fallback {
  position: absolute;
  inset: 0;
  background: #10283b var(--gel-artwork, url("../../images/decor/gel-macro-v2.png")) 70% 50% / cover no-repeat;
}
.gel-hero[data-render-state="ready"] canvas { opacity: 1; }
.gel-hero[data-render-state="ready"] .gel-hero__fallback { opacity: 0; }
body[data-site-theme="lamina"] > header::after,
body[data-site-theme="lamina"] .hero.inhome::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(90deg, rgba(17, 41, 59, .55), rgba(17, 41, 59, .20) 28%, transparent 57%),
    linear-gradient(rgba(146, 203, 215, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 203, 215, .055) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
}
@media (max-width: 768px) {
  body[data-site-theme="lamina"] .container.content { border-radius: 0; }
  body[data-site-theme="lamina"] > header::after,
  body[data-site-theme="lamina"] .hero.inhome::after {
    background-image:
      linear-gradient(90deg, rgba(10, 31, 48, .94), rgba(10, 31, 48, .68) 42%, rgba(10, 31, 48, .12)),
      linear-gradient(rgba(146, 203, 215, .04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(146, 203, 215, .04) 1px, transparent 1px);
  }
}
@media (prefers-reduced-motion: reduce) { .gel-hero canvas { transition: none; } }
