/* ============================================================
   biztechai.in — Professional Legal/Tech Blog Stylesheet
   Manuscript paper + left TOC sidebar
   ============================================================ */

:root {
  --primary: #002e5d;
  --primary-light: #1a4a7a;
  --accent: #2E75B6;
  --accent-light: #4A9BE0;
  --gold: #c4a006;
  --text: #2D3748;
  --text-light: #718096;
  --text-lighter: #A0AEC0;
  --bg: #FFFFFF;
  --bg-alt: #F7F8FA;
  --bg-desk: #f2f0ed;
  --bg-dark: #0F2337;
  --border: #E2E8F0;
  --border-light: #EDF2F7;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 15px 45px rgba(0,0,0,0.1);
  --container: 1140px;
  --content-width: 750px;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Lora', 'Georgia', serif;
  --font-heading: 'Inter', system-ui, sans-serif;
  --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg-desk);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Accessibility --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow { max-width: var(--content-width); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.3;
  font-weight: 700;
}
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.375rem; margin-top: 2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.5rem; font-family: var(--font-body); font-weight: 600; }

p { margin-bottom: 1.25rem; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; display: block; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-name {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.accent { color: var(--accent); }

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}
.nav-item a {
  display: block;
  padding: 0.5rem 0.875rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-item a:hover,
.nav-item.active a {
  color: var(--accent);
  background: var(--bg-alt);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.nav-toggle.is-active .hamburger { background: transparent; }
.nav-toggle.is-active .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle.is-active .hamburger::after { top: 0; transform: rotate(-45deg); }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero-description {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); color: #fff; }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; }

/* --- Sections (homepage) --- */
.section { padding: 4rem 0; }
.section--alt { background: var(--bg-alt); }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.section-header h2 { margin: 0; font-size: 1.5rem; }
.section-link { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }

/* --- Post Grid (homepage/listing) --- */
.post-grid { display: grid; gap: 1.5rem; }
.post-grid--2 { grid-template-columns: repeat(2, 1fr); }
.post-grid--3 { grid-template-columns: repeat(3, 1fr); }

.post-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  transition: all var(--transition);
}
.post-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}
.post-card h2, .post-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.card-image {
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
}
.card-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.card-excerpt {
  font-size: 0.925rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.card-meta {
  font-size: 0.8125rem;
  color: var(--text-lighter);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   DESK + MANUSCRIPT LAYOUT
   ============================================================ */

.desk-surface {
  background-color: var(--bg-desk);
  padding: 40px 20px;
  min-height: calc(100vh - 64px);
}

/* Grid: TOC on left (max 25%), manuscript on right */
.desk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3fr;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* When there's no TOC, manuscript centers itself */
.desk-layout:has(.desk-main:first-child) {
  grid-template-columns: 1fr;
  max-width: 850px;
}

.desk-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================================
   TOC PANEL — left sidebar on the desk
   ============================================================ */

.toc-panel {
  position: sticky;
  top: 84px; /* below the sticky header */
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}

.toc-sticky {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-lighter);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.toc-panel nav#TableOfContents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-panel nav#TableOfContents ul ul {
  padding-left: 0.75rem;
}

.toc-panel nav#TableOfContents a {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  color: var(--text-light);
  line-height: 1.4;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all var(--transition);
  text-decoration: none;
}

.toc-panel nav#TableOfContents a:hover {
  color: var(--primary);
  background: rgba(0, 46, 93, 0.04);
  border-left-color: var(--text-lighter);
}

.toc-panel nav#TableOfContents a.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(0, 46, 93, 0.06);
  border-left-color: var(--primary);
}

/* Scrollbar styling for TOC */
.toc-panel::-webkit-scrollbar { width: 4px; }
.toc-panel::-webkit-scrollbar-track { background: transparent; }
.toc-panel::-webkit-scrollbar-thumb { background: var(--text-lighter); border-radius: 4px; }

/* ============================================================
   MANUSCRIPT — the paper sheet
   ============================================================ */

.manuscript {
  background-color: #ffffff;
  max-width: 850px;
  width: 100%;
  padding: 80px 90px;
  box-shadow: var(--shadow-lg);
  position: relative;
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
}

.manuscript::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-color: var(--primary);
}

.manuscript::after {
  content: "biztechai.in";
  position: absolute;
  top: 40px;
  right: 40px;
  font-family: var(--font-body);
  font-size: 10px;
  color: #ddd;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 1px solid #eee;
  padding: 4px 8px;
}

.manuscript .header-section {
  text-align: center;
  border-bottom: 2px solid #333;
  margin-bottom: 40px;
  padding-bottom: 30px;
}

.manuscript .document-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  display: block;
  margin-bottom: 15px;
}

.manuscript h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  color: #111;
  margin: 0;
  line-height: 1.2;
}

.manuscript .intro-text {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.6;
  color: #222;
  margin-bottom: 40px;
  padding: 0 5px;
  font-style: italic;
}

.manuscript .manuscript-image { margin-bottom: 2rem; }
.manuscript .manuscript-image img { width: 100%; border: 1px solid #f0f0f0; }
.manuscript .manuscript-image figcaption {
  font-size: 0.85rem;
  color: #999;
  text-align: center;
  padding-top: 0.5rem;
}

/* --- Manuscript Content --- */
.manuscript-content {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.7;
  color: #333;
  text-align: justify;
}

.manuscript-content h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: #111;
  margin-top: 15px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.manuscript-content h2 {
  font-family: var(--font-serif);
  font-size: 25px;
  color: var(--primary);
  margin-top: 12px;
  margin-bottom: 12px;
}

.manuscript-content h3 {
  font-family: var(--font-serif);
  font-size: 23px;
  color: #222;
  margin-top: 30px;
  margin-bottom: 10px;
}

.manuscript-content h4 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-top: 8px;
  margin-bottom: 8px;
}

.manuscript-content p { margin-bottom: 18px; }

.manuscript-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.manuscript-content strong,
.manuscript-content b {
  color: var(--primary);
  font-weight: 700;
}

/* Lists */
.manuscript-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}
.manuscript-content ul > li {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
  color: #333;
  padding: 18px 20px;
  margin-bottom: 12px;
  background-color: #fcfcfc;
  border: 1px solid #f0f0f0;
}
.manuscript-content ul > li b,
.manuscript-content ul > li strong {
  color: var(--primary);
  font-variant: small-caps;
  font-size: 19px;
}

/* Nested lists */
.manuscript-content ul ul {
  margin-top: 15px;
  border-left: 2px solid var(--primary);
  padding-left: 15px;
}
.manuscript-content ul ul li {
  background-color: #f9f9f9;
  border: none;
  padding: 10px 15px;
  margin-bottom: 5px;
  font-size: 16px;
}

/* Ordered lists */
.manuscript-content ol {
  padding-left: 1.5rem;
  margin: 0 0 20px 0;
}
.manuscript-content ol > li {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
  color: #333;
  padding: 8px 0;
  margin-bottom: 4px;
}

/* Blockquotes */
.manuscript-content blockquote {
  border-left: 3px solid var(--primary);
  margin: 25px 0;
  padding: 20px 25px;
  background-color: #f8f7f4;
  font-style: italic;
  color: #444;
}
.manuscript-content blockquote p:last-child { margin-bottom: 0; }

/* Code */
.manuscript-content pre {
  background: #1a1a2e;
  color: #E2E8F0;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}
.manuscript-content code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.9em;
}
.manuscript-content :not(pre) > code {
  background: #f5f4f0;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--primary);
}

/* Tables */
.manuscript-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 16px;
  font-family: var(--font-serif);
}
.manuscript-content th,
.manuscript-content td {
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  text-align: left;
}
.manuscript-content th {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.manuscript-content tr:nth-child(even) { background: #fafafa; }

.manuscript-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 35px 0;
}

/* --- Manuscript Footer --- */
.manuscript-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-family: var(--font-body);
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* --- Previous / Next Navigation --- */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 30px;
  max-width: 850px;
  width: 100%;
}
.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.08);
  transition: all var(--transition);
  max-width: 48%;
}
.post-nav-link:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.post-nav-prev { align-items: flex-start; }
.post-nav-next { align-items: flex-end; margin-left: auto; text-align: right; }
.post-nav-arrow { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.post-nav-title { font-size: 0.9rem; color: #555; line-height: 1.4; }
.post-nav-link:hover .post-nav-title { color: var(--primary); }

/* --- CTA Section --- */
.cta-section { padding: 4rem 0; }
.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  text-align: center;
  padding: 3.5rem 2rem;
  border-radius: var(--radius);
}
.cta-box h2 { color: #fff; margin-bottom: 0.75rem; font-size: 1.75rem; }
.cta-box p { color: rgba(255,255,255,0.85); max-width: 500px; margin: 0 auto 1.5rem; }

/* --- Archive/List Pages --- */
.archive-page { padding: 2rem 0 4rem; }
.archive-header { margin-bottom: 2rem; }
.archive-header h1 { margin-bottom: 0.25rem; }
.archive-description { color: var(--text-light); font-size: 1.05rem; }
.archive-count { font-size: 0.875rem; color: var(--text-lighter); margin-top: 0.25rem; }

/* --- Static Pages --- */
.page-single { padding: 2rem 0 4rem; }
.page-header { margin-bottom: 2rem; }
.page-content { line-height: 1.8; }
.page-content h2 { font-size: 1.5rem; }
.page-updated { font-size: 0.85rem; color: var(--text-lighter); margin-top: 2rem; }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.page-link {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.page-link:hover { background: var(--accent); color: #fff; }
.page-info { font-size: 0.85rem; color: var(--text-lighter); }

/* --- Breadcrumbs --- */
.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.8125rem; }
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
}
.breadcrumbs li::after { content: '/'; color: var(--text-lighter); margin-left: 0.25rem; }
.breadcrumbs li:last-child::after { display: none; }
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs li:last-child { color: var(--text-lighter); }

/* --- Footer --- */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.7);
  padding: 3.5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-col h3, .footer-col h4 { color: #fff; font-family: var(--font-body); margin-bottom: 1rem; }
.footer-col h3 { font-size: 1.25rem; }
.footer-col h4 { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col p { font-size: 0.9rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 0.9rem; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
}
.footer-disclaimer {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.5rem;
  font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
  .desk-layout {
    grid-template-columns: 1fr;
    max-width: 850px;
  }
  .toc-panel {
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 20px;
  }
}

@media (max-width: 960px) {
  .post-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .hero-title { font-size: 2.25rem; }
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3rem 0; }

  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; }
  .nav-item a { padding: 0.75rem 1rem; }

  .post-grid--2,
  .post-grid--3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: center; }
  .section-header { flex-direction: column; gap: 0.5rem; }

  /* Manuscript responsive */
  .desk-surface { padding: 0; }
  .manuscript {
    padding: 40px 25px;
    box-shadow: none;
    border-left: none;
    border-right: none;
  }
  .manuscript::after { display: none; }
  .manuscript h1 { font-size: 24px; }
  .manuscript .intro-text { font-size: 17px; }
  .post-nav {
    flex-direction: column;
    padding: 0 20px;
  }
  .post-nav-link { max-width: 100%; }
  .post-nav-next { align-items: flex-start; text-align: left; margin-left: 0; }
}

/* --- Print --- */
@media print {
  .site-header, .site-footer, .nav-toggle,
  .post-nav, .cta-section, .toc-panel { display: none; }
  .desk-surface { background: none; padding: 0; }
  .desk-layout { display: block; }
  .manuscript { box-shadow: none; border: none; padding: 0; }
  .manuscript::before, .manuscript::after { display: none; }
  body { font-size: 12pt; line-height: 1.6; color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* ============================================================
   ACCESSIBILITY ENHANCEMENTS
   Append this to the END of static/css/style.css
   ============================================================ */

/* --- 1. Focus Visible â€” keyboard users see a clear outline --- */
*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove outline on mouse click but keep it for keyboard */
*:focus:not(:focus-visible) {
  outline: none;
}

/* --- 2. Minimum Touch Targets â€” 44x44px per WCAG 2.5.5 --- */
.nav-item a,
.social-btn,
.post-nav-link,
.bci-btn,
.btn,
.tag,
.share-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* --- 3. Reduced Motion â€” respect user preference --- */
@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;
  }

  .post-card:hover {
    transform: none;
  }

  .social-btn:hover {
    transform: none;
  }

  .bci-overlay.hidden {
    transition: none;
  }
}

/* --- 4. High Contrast Mode â€” Windows accessibility --- */
@media (forced-colors: active) {
  .manuscript {
    border: 2px solid CanvasText;
  }

  .manuscript::before {
    background: Highlight;
  }

  .bci-btn-accept {
    border: 2px solid ButtonText;
  }

  .social-btn {
    border: 1px solid ButtonText;
  }

  .toc-panel nav#TableOfContents a.active {
    border-left-color: Highlight;
  }

  .post-card:hover {
    border-color: Highlight;
  }
}

/* --- 5. Text Scaling â€” don't break layout at 200% zoom --- */
@media (min-resolution: 192dpi) {
  .manuscript {
    padding: 60px 50px;
  }
}

/* --- 6. Visible skip link improvement --- */
.skip-link:focus {
  top: 0;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  z-index: 999999;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* --- 7. Selection contrast --- */
::selection {
  background: var(--accent);
  color: #fff;
}

/* --- 8. Link underlines in content â€” always visible, not just on hover --- */
.manuscript-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* --- 9. Consent modal â€” trap focus styling --- */
.bci-overlay .bci-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
