
/* Lexend Light (300) */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/Lexend-VariableFont_wght.ttf') format('ttf'); 
}

/* Lexend Regular (400) */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Lexend-VariableFont_wght.ttf') format('ttf'); 
}

/* Lexend Medium (500) */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Lexend-VariableFont_wght.ttf') format('ttf'); 
}

/* Lexend Semi-Bold (600) */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Lexend-VariableFont_wght.ttf') format('ttf'); 
}

/* DM Mono Regular (400) */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/DMMono-Regular.ttf') format('ttf');
}

/* DM Mono Medium (500) */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/DMMono-Medium.ttf') format('ttf');
}

/* --- Lawgame Theme: Restored Visual Identity --- */

:root {
    /* Core Tokens */
    --bg-workspace: #F3F4F6;
    --bg-dots: #9CA3AF; /* Visible Grey Dots */
    --panel-solid: #FFFFFF;
    --panel-border: #E5E7EB;
    
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;

    --primary-blue: #2563EB;
    --primary-blue-hover: #1D4ED8;
    --accent-bg: rgba(37, 99, 235, 0.05);

    /* Typography */
    --font-ui: 'Lexend', system-ui, -apple-system, sans-serif;
    --font-code: 'DM Mono', monospace;

    /* Effects */
    --shadow-deep: 0 25px 50px -12px rgba(0, 0, 0, 0.15); /* Stronger shadow */
    --radius-panel: 16px;
    --radius-inner: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-workspace: #0F1115;
        --bg-dots: #4B5563;
        --panel-solid: #1F2937;
        --panel-border: #374151;
        --text-primary: #F9FAFB;
        --text-secondary: #D1D5DB;
        --text-muted: #9CA3AF;
        --accent-bg: rgba(37, 99, 235, 0.15);
        --shadow-deep: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    }
}

/* --- Base Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-ui);
    background-color: var(--bg-workspace);
    color: var(--text-primary);
    min-height: 100vh;
    
    /* RESTORED: The Technical Dot Grid */
    background-image: radial-gradient(var(--bg-dots) 1px, transparent 1px);
    background-size: 24px 24px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }

.prose a {
    background-color:var(--primary-blue-hover)!important;
    color:#fff!important;
    padding:2px 2px 2px 4px!important;
    margin-right:2px;
}

a.glightbox {
    background-color:inherit!important;
    color:inherit!important;
    padding:inherit!important;
}

/* --- Layout Wrappers --- */
.container-wide {
    width: 100%;
    max-width: 1200px;
    margin-top: 3vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- The Main "System" Panel --- */
.docket-panel {
    background: var(--panel-solid);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-deep);
    padding: 3rem;
    width: 100%;
    position: relative;
}

/* Header inside the container */
.brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

/* --- Homepage Layouts --- */
.home-split {
    gap: 4rem;
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--panel-border);
}

.hero-lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 90%;
}

.hero-visual {
    background: var(--bg-workspace);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-inner);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 250px;
}

.hero-visual img { width: 100%; height: 100%; object-fit: cover; }

/* --- Chapter Grid (The "Cards") --- */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.chapter-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-inner);
    background: transparent;
    transition: all 0.2s ease;
}

.chapter-card:hover {
    border-color: var(--primary-blue);
    background: var(--accent-bg);
    transform: translateY(-2px);
}

.chapter-meta {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.chapter-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.chapter-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Single Page Reading Layout --- */
.read-grid {
    display: grid;
    grid-template-columns: 1fr 240px; /* Content | TOC */
    gap: 4rem;
    align-items: start;
}

@media (max-width: 960px) {
    .read-grid { grid-template-columns: 1fr; }
    .toc-sidebar { display: none; }
}

.prose {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 65ch; /* Optimal reading length */
}

/* Headings within content */
.prose h1 { font-size: 2.5rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1.5rem; letter-spacing: -0.02em; line-height: 1.1; }
.prose h2 { font-size: 1.5rem; font-weight: 500; color: var(--text-primary); margin-top: 2.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--panel-border); padding-bottom: 0.5rem; }
.prose h3 { font-size: 1.2rem; font-weight: 500; color: var(--text-primary); margin-top: 2rem; margin-bottom: 0.75rem; }
.prose p { margin-bottom: 1.25rem; }
.prose ul { padding-left: 1.25rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose code { font-family: var(--font-code); background: var(--bg-workspace); padding: 0.2rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.prose img { max-width: 100%; border-radius: var(--radius-inner); border: 1px solid var(--panel-border); margin: 1.5rem 0; }

ol, li {
    padding-left:20px;
}

/* The Right-Hand TOC */
.toc-sidebar {
    position: sticky;
    top: 2rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--panel-border);
}

.toc-header {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: block;
}

#TableOfContents ul { list-style: none; padding: 0; }
#TableOfContents li { margin-bottom: 0.6rem; }
#TableOfContents a {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1.3;
    display: block;
}
#TableOfContents a:hover { color: var(--primary-blue); }
#TableOfContents ul ul { padding-left: 1rem; margin-top: 0.4rem; border-left: 1px solid var(--panel-border); }

/* --- Utility Components --- */
.btn-sys {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-inner);
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--panel-solid);
}
.btn-sys:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--accent-bg);
    color: var(--primary-blue);
    font-family: var(--font-code);
    font-size: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* --- Case File & Sub-Page Styles --- */
.case-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
    background: rgba(128, 128, 128, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-inner);
    padding: 1.5rem;
}

.case-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.stat-value.highlight {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Sub-page list (e.g. inside Section 4) */
.sub-page-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.case-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-inner);
    background: #fff;
    transition: all 0.2s ease;
}

.case-link-row:hover {
    border-color: var(--primary-blue);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.case-row-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.case-row-meta {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--text-muted);
}
.hover-underline:hover { text-decoration: underline; }

.post-image-wrapper {
  margin: 2rem 0;
  text-align: center;
}

.post-image-wrapper img {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
  border-radius: 8px; /* Optional: for elegance */
}

.post-image-wrapper img:hover {
  opacity: 0.9;
}

.caption {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}


/* --- DESKTOP STYLES (Normal Table) --- */
.clean-table-wrapper {
  width: 100%;
  margin: 2rem 0;
  /* Safety net: ensures the wrapper itself never exceeds screen width */
  max-width: 100%; 
  overflow-x: hidden; 
}

.clean-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Lexend', system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

.clean-table-wrapper th {
  background-color: #f9fafb;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.clean-table-wrapper td {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #4b5563;
  vertical-align: top;
}

/* Force the first column (Dimension) to be 25% on desktop */
.clean-table-wrapper td:first-child {
  font-weight: 600;
  color: #111827;
  width: 25%;
  background-color: #fafafa; 
}

/* --- MOBILE STYLES (The "Card" Transformation) --- */
@media screen and (max-width: 768px) {
  
  /* 1. Hide the table header (Dimension / Description) entirely */
  .clean-table-wrapper thead {
    display: none;
  }

  /* 2. Make rows display as blocks (like cards) */
  .clean-table-wrapper tr {
    display: block;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px; /* Rounded corners for the 'card' */
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }

  /* 3. Make cells display as blocks (stacking them) */
  .clean-table-wrapper td {
    display: block;
    width: 100% !important; /* Force full width */
    border-bottom: none;
    padding: 16px;
  }

  /* 4. Style the first cell (Dimension) to look like a Card Header */
  .clean-table-wrapper td:first-child {
    background-color: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1rem; /* Slightly larger for the header */
    color: #000;
  }
}

