/* ==========================================================================
   martin.griss.com — Modernized Editorial Stylesheet
   Palette: Mauve Purple & Warm Alabaster (inspired by CoPilot Pass 1)
   WCAG 2.1 AA/AAA Contrast Verified | Zero-Dependency Responsive CSS
   ========================================================================== */

:root {
  /* Signature Mauve Purple Palette */
  --mauve-deep: #4A2545;       /* Deep plum-mauve for primary headings & dark accents (12.4:1 on paper) */
  --mauve: #6E3B6E;            /* Rich signature mauve purple for links, buttons, borders (7.6:1 on paper) */
  --mauve-hover: #562A56;      /* Darker mauve for interactive hover states */
  --mauve-mid: #8D5B8E;        /* Classic dusty mauve for frames, accents, tags */
  --mauve-soft: #C4A1C6;       /* Soft dusty mauve for subtle borders & dividers */
  --mauve-tint: #F3EBF5;       /* Pale mauve blush for tinted sections & callouts */
  --mauve-tint-strong: #E9DCEB;/* Slightly richer blush for active pills & hovers */

  /* Warm Editorial Surfaces & Neutrals */
  --paper: #FAF7FB;            /* Soft mauve-tinted alabaster page canvas */
  --surface: #FFFFFF;          /* Pure white elevated card surface */
  --ink: #271C2B;              /* Deep aubergine-charcoal body text (14.8:1 on paper) */
  --muted: #5B4A62;            /* Muted mauve-slate secondary text (7.5:1 on paper) */
  --sand: #E6D8C5;             /* Warm sandstone shadow echoing Reuse Rabbi stone tablets */
  --border: #DDD0E2;           /* Refined mauve-tinted hairline border */
  --border-subtle: #EAE1EE;

  /* Attribution & Semantic Accents */
  --attr-color: #5C4B66;       /* Muted mauve-slate for discrete attribution footer (7.3:1 on paper) */
  --attr-hover: #4A2545;
  --badge-pdf-bg: #F3EBF5;
  --badge-pdf-ink: #562A56;
  --badge-htm-bg: #EEF4F8;
  --badge-htm-ink: #244C66;

  /* Typography */
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout & Spacing */
  --max-width: 1120px;
  --max-prose: 72ch;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(74, 37, 69, 0.06);
  --shadow-md: 0 8px 24px rgba(74, 37, 69, 0.09);
  --shadow-lg: 0 16px 38px rgba(74, 37, 69, 0.14);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.03rem;
  line-height: 1.68;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--mauve);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

a:hover {
  color: var(--mauve-deep);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--mauve);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--mauve-deep);
  line-height: 1.2;
  margin-top: 0;
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  margin-bottom: 0.6rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul, ol {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.45rem;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip Link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  top: -120px;
  left: 1rem;
  z-index: 1000;
  background: var(--mauve-deep);
  color: #FFFFFF;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: 0.75rem;
  color: #FFFFFF;
}

/* Container */
.wrap {
  width: min(var(--max-width), calc(100% - 2.25rem));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(860px, calc(100% - 2.25rem));
  margin-inline: auto;
}

/* ==========================================================================
   Site Header & Sticky Responsive Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 251, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 4.1rem;
  padding: 0.55rem 0;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--mauve-deep);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-brand:hover {
  color: var(--mauve);
}

.site-brand .brand-tag {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--mauve);
  background: var(--mauve-tint);
  border: 1px solid var(--border);
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  color: var(--mauve-deep);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.nav-toggle:hover {
  background: var(--mauve-tint);
  border-color: var(--mauve-mid);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.78rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--mauve-deep);
  font-weight: 600;
  font-size: 0.94rem;
  min-height: 40px;
}

.site-nav a:hover {
  background: var(--mauve-tint);
  color: var(--mauve-deep);
}

.site-nav a[aria-current="page"] {
  background: var(--mauve-tint);
  color: var(--mauve-deep);
  box-shadow: inset 0 -2.5px 0 var(--mauve);
}

/* Breadcrumbs */
.breadcrumb {
  padding: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--mauve-soft);
}

.breadcrumb a {
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Hero Section (CoPilot Pass 1 Arched Reuse Rabbi Tablet Aesthetic)
   ========================================================================== */
.hero {
  padding: clamp(2.25rem, 5vw, 4rem) 0 clamp(2.5rem, 5vw, 3.75rem);
  background: radial-gradient(circle at 82% 24%, rgba(155, 107, 158, 0.12), transparent 52%),
              linear-gradient(180deg, var(--paper) 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(2rem, 4.5vw, 3.75rem);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mauve);
  background: var(--mauve-tint);
  border: 1px solid var(--border);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-size: clamp(2.65rem, 6.2vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
  color: var(--mauve-deep);
}

.lede {
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
  line-height: 1.58;
  color: var(--ink);
  margin-bottom: 1rem;
}

.hero-note {
  color: var(--muted);
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary {
  background: var(--mauve);
  color: #FFFFFF;
  border-color: var(--mauve);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--mauve-deep);
  border-color: var(--mauve-deep);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--mauve-deep);
  border-color: var(--mauve-mid);
}

.btn-secondary:hover {
  background: var(--mauve-tint);
  border-color: var(--mauve);
  color: var(--mauve-deep);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--mauve);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--mauve-tint);
  color: var(--mauve-deep);
}

/* Signature Arched Stone-Tablet Frame for Reuse Rabbi Artwork */
.hero-figure {
  margin: 0;
  text-align: center;
  justify-self: center;
  max-width: 340px;
  width: 100%;
}

.tablet {
  background: #FFFFFF;
  border: 3px solid var(--mauve-mid);
  border-radius: 50% 50% 14px 14px / 42% 42% 14px 14px;
  overflow: hidden;
  box-shadow: 14px 14px 0 var(--sand), var(--shadow-md);
  padding: 0.5rem 0.5rem 0;
}

.tablet img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 48% 48% 8px 8px / 40% 40% 8px 8px;
}

.hero-figure figcaption {
  margin-top: 1.15rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--muted);
}

/* Subpage Hero Banner */
.page-hero {
  padding: clamp(1.75rem, 3.8vw, 2.75rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, var(--mauve-tint) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  margin: 0.35rem 0 0.65rem;
}

.page-hero .page-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 66ch;
  margin-bottom: 0;
}

/* ==========================================================================
   Sections, Cards & Grids
   ========================================================================== */
.section {
  padding: clamp(2.25rem, 4.5vw, 3.5rem) 0;
}

.section-tinted {
  background: var(--mauve-tint);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-header p {
  color: var(--muted);
  max-width: 64ch;
  margin-bottom: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-accent {
  border-top: 4px solid var(--mauve);
}

.card-heritage {
  border-top: 4px solid var(--mauve-mid);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCF9FD 100%);
}

.card h2,
.card h3 {
  color: var(--mauve-deep);
}

.card-link-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}

.card-link-list li {
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-link-list li:last-child {
  border-bottom: none;
}

.card-link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.58rem 0.25rem;
  text-decoration: none;
  font-weight: 500;
  min-height: 42px;
}

.card-link-list a:hover {
  color: var(--mauve-deep);
  text-decoration: underline;
}

.card-link-list .item-plain {
  display: block;
  padding: 0.5rem 0.25rem;
  color: var(--ink);
}

.card-footer-link {
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 600;
  font-size: 0.94rem;
}

/* Career Highlights / Timeline */
.milestones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.milestone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mauve);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
}

.milestone .era {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mauve);
  margin-bottom: 0.2rem;
}

.milestone strong {
  display: block;
  font-family: var(--font-serif);
  color: var(--mauve-deep);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.milestone span {
  font-size: 0.88rem;
  color: var(--muted);
}

.timeline {
  border-left: 3px solid var(--mauve-mid);
  padding-left: 1.35rem;
  margin: 1.25rem 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.35rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.78rem;
  top: 0.35rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--mauve);
  border: 2px solid var(--paper);
}

.timeline-item h3 {
  margin-bottom: 0.2rem;
  font-size: 1.08rem;
}

.timeline-item .meta {
  font-size: 0.86rem;
  color: var(--mauve);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

/* Editorial Prose & Callout Notes */
.prose {
  max-width: var(--max-prose);
}

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.35rem, 3vw, 2.35rem);
  box-shadow: var(--shadow-sm);
}

.note {
  background: var(--mauve-tint);
  border-left: 4px solid var(--mauve);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.96rem;
}

.note strong {
  color: var(--mauve-deep);
}

/* Two-Column Content + Sidebar Layout */
.content-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 2rem;
  align-items: start;
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
  vertical-align: middle;
}

.badge-pdf {
  background: var(--badge-pdf-bg);
  color: var(--badge-pdf-ink);
  border: 1px solid var(--mauve-soft);
}

.badge-pdf:hover {
  background: var(--mauve);
  color: #FFFFFF;
  border-color: var(--mauve);
}

.badge-htm {
  background: var(--badge-htm-bg);
  color: var(--badge-htm-ink);
  border: 1px solid #BFD3E2;
}

.badge-htm:hover {
  background: #244C66;
  color: #FFFFFF;
  border-color: #244C66;
}

.badge-archive {
  background: #F4EFE7;
  color: #5C4A33;
  border: 1px solid var(--sand);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mauve-deep);
  background: var(--mauve-tint);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* ==========================================================================
   Interactive Publications Library Controls
   ========================================================================== */
.pub-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.pub-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.pub-search {
  flex: 1 1 260px;
  padding: 0.65rem 0.95rem;
  font-size: 0.98rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 44px;
}

.pub-search:focus {
  border-color: var(--mauve);
  background: #FFFFFF;
}

.pub-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.filter-pill {
  background: var(--paper);
  color: var(--mauve-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  min-height: 36px;
}

.filter-pill:hover {
  background: var(--mauve-tint);
  border-color: var(--mauve-mid);
}

.filter-pill[aria-pressed="true"] {
  background: var(--mauve);
  color: #FFFFFF;
  border-color: var(--mauve);
}

.pub-status {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.pub-year-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.pub-year-group h2 {
  font-size: 1.35rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.9rem;
  border-bottom: 2px solid var(--mauve-tint-strong);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.pub-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-item[hidden],
.pub-year-group[hidden] {
  display: none;
}

/* Archival Paper Figures & Tables */
.paper-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.4rem, 3.5vw, 2.75rem);
  box-shadow: var(--shadow-sm);
}

.paper-article figure {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-align: center;
}

.paper-article figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.paper-article table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.94rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.paper-article th,
.paper-article td,
.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

.paper-article th,
.data-table th {
  background: var(--mauve-tint);
  color: var(--mauve-deep);
  font-weight: 700;
}

.paper-article pre,
.paper-article code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.paper-article pre {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}

/* ==========================================================================
   Heritage & Photo Galleries (Northview '62 & is-70)
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.15rem;
}

.gallery-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.gallery-thumb {
  display: block;
  background: var(--mauve-tint);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  width: 100%;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.gallery-thumb:hover img {
  transform: scale(1.03);
}

.gallery-caption {
  padding: 0.8rem 0.95rem;
  font-size: 0.88rem;
  line-height: 1.45;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.gallery-caption .gallery-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}

.doc-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.05rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 52px;
}

.doc-card:hover {
  border-color: var(--mauve);
  background: var(--mauve-tint);
  color: var(--mauve-deep);
}

.doc-card .doc-title {
  font-weight: 600;
  line-height: 1.38;
}

.doc-card .doc-size {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.video-card video {
  width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
  background: #1A121D;
}

/* Accessible Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(24, 14, 28, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-inner {
  max-width: min(1000px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.lightbox-inner img {
  max-height: 76vh;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  color: #FAF7FB;
  font-size: 0.95rem;
}

.lightbox-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.9rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

.lightbox-btn:hover {
  background: var(--mauve);
}

/* ==========================================================================
   Site Footer & Mandatory Selvasoft Solutions LLC Attribution
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: linear-gradient(180deg, var(--mauve-tint) 0%, #EFE5F2 100%);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.4rem;
  color: var(--ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--mauve-deep);
  margin: 0.15rem 0 0.5rem;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mauve);
  margin: 0 0 0.65rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.35rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.94rem;
}

.footer-links a:hover {
  color: var(--mauve-deep);
  text-decoration: underline;
}

.copy-email-btn {
  margin-left: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mauve-deep);
  cursor: pointer;
}

.copy-email-btn:hover {
  background: var(--mauve);
  color: #FFFFFF;
  border-color: var(--mauve);
}

/* Mandatory Small Italic Referential Attribution Footer */
.developer-attribution,
#developer-attribution {
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--attr-color);
  padding: 1.1rem 0.75rem 0.35rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.developer-attribution a,
#developer-attribution a {
  color: var(--mauve);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.developer-attribution a:hover,
#developer-attribution a:hover,
.developer-attribution a:focus-visible,
#developer-attribution a:focus-visible {
  color: var(--attr-hover);
}

/* Compact Footer Variant for Archive / Subpages */
.site-footer-compact {
  padding: 1.5rem 0 1.25rem;
}

.footer-compact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 920px) {
  .hero-grid,
  .content-sidebar,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-figure {
    max-width: 290px;
  }

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

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--border-subtle);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.65rem 0.75rem;
    min-height: 44px;
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Print Optimization */
@media print {
  .site-header,
  .pub-controls,
  .actions,
  .copy-email-btn,
  .lightbox {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
  }

  .card,
  .prose-card,
  .paper-article {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}
