/* ===== SHARED STYLES FOR SUB-PAGES ===== */
/* Extracted common styles from main styles.css for multi-page consistency */

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

:root {
    --navy: #0a1628;
    --navy-light: #132240;
    --navy-mid: #1a2d4a;
    --blue: #2563eb;
    --blue-light: #3b82f6;
    --red: #dc2626;
    --red-light: #ef4444;
    --amber: #f59e0b;
    --green: #10b981;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --nav-height: 64px;
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --container-max-width: 1080px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: calc(var(--nav-height) + 12px);
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

p, li, td, th {
    max-width: 80ch;
    overflow-wrap: break-word;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navigation (shared with main page) */
#main-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 40px;
    height: var(--nav-height);
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-brand {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--white);
    background: none; border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--white);
    border-radius: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    overscroll-behavior: contain;
}

.nav-links a {
    color: var(--gray-400);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--white);
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--blue);
    font-weight: 500;
}

.breadcrumbs .separator {
    color: var(--gray-400);
}

.breadcrumbs .current {
    color: var(--gray-700);
    font-weight: 600;
}

/* Page Hero (smaller than main hero) */
.page-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    padding: 110px 0 48px;
    color: var(--white);
}

.page-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.page-hero .subtitle {
    font-size: 1.1rem;
    color: var(--gray-400);
    max-width: 700px;
}

.page-hero .case-ref {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-top: 8px;
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 32px;
}

.narrow-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Section */
.section {
    padding: 64px 0;
}

section[id] {
    scroll-margin-top: calc(var(--nav-height) + 12px);
}

.section:nth-child(even) {
    background: var(--gray-50);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.section-intro {
    font-size: 1.05rem;
    color: var(--gray-600);
    margin-bottom: 32px;
    max-width: 70ch;
}

/* Data Tables */
.data-table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th {
    background: var(--navy);
    color: var(--white);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    vertical-align: top;
}

.data-table tr:hover td { background: var(--gray-50); }

.data-table td.mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.data-table td.red { color: var(--red); font-weight: 600; }
.data-table td.green { color: var(--green); font-weight: 600; }
.data-table td.amber { color: var(--amber); font-weight: 600; }
.data-table td.bold { font-weight: 700; color: var(--gray-900); }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-admit { background: #dcfce7; color: #166534; }
.badge-deny { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-docspeaks { background: #e0e7ff; color: #3730a3; }
.badge-lack { background: #f1f5f9; color: #64748b; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-past { background: #fee2e2; color: #991b1b; }
.badge-sealed { background: var(--gray-800); color: var(--white); }
.badge-ocr { background: #fef3c7; color: #92400e; }
.badge-obtained { background: #dcfce7; color: #166534; }
.badge-missing { background: #fee2e2; color: #991b1b; }

/* Info Cards */
.info-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.info-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.info-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.92rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 8px;
}

/* Highlight Boxes (reused from main) */
.highlight-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 24px;
    margin: 20px 0;
}

.highlight-box h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.highlight-box.alert {
    border-left: 4px solid var(--red);
    background: #fef2f2;
}

.highlight-box.info {
    border-left: 4px solid var(--blue);
    background: #eff6ff;
}

.highlight-box.warning {
    border-left: 4px solid var(--amber);
    background: #fffbeb;
}

/* Deposition Quote Blocks */
.deposition-quote {
    border-left: 4px solid var(--navy-mid);
    padding: 16px 20px;
    margin: 16px 0;
    background: var(--gray-50);
    border-radius: 0 8px 8px 0;
}

.deposition-quote p {
    font-style: italic;
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: 4px;
}

.deposition-quote .quote-source {
    font-style: normal;
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 600;
}

/* Q&A Block */
.qa-block {
    margin: 16px 0;
    padding: 16px 20px;
    background: var(--gray-50);
    border-radius: 8px;
}

.qa-block .question {
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.qa-block .question::before {
    content: "Q: ";
    color: var(--blue);
}

.qa-block .answer {
    color: var(--gray-700);
    font-style: italic;
}

.qa-block .answer::before {
    content: "A: ";
    color: var(--red);
    font-style: normal;
    font-weight: 700;
}

.qa-block .cite {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-style: normal;
    margin-top: 4px;
}

/* Waterfall (reused from main) */
.waterfall-visual { max-width: 700px; margin: 24px auto; }

.waterfall-class {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    transition: transform 0.2s;
}

.waterfall-class:hover { transform: translateX(4px); }
.waterfall-class.priority { border-left: 4px solid var(--red); }
.waterfall-class.cramdown { border-left: 4px solid var(--amber); }
.waterfall-class.wiped { border-left: 4px solid var(--gray-400); opacity: 0.7; }

.waterfall-label {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--gray-900);
}

.waterfall-label small {
    display: block;
    font-weight: 400;
    font-size: 0.82rem;
    color: var(--gray-500);
}

.waterfall-recovery {
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-mono);
    min-width: 100px;
    text-align: right;
}

.waterfall-recovery.paid { color: var(--green); }
.waterfall-recovery.zero { color: var(--red); }
.waterfall-recovery.partial { color: var(--amber); }

.waterfall-arrow {
    text-align: center;
    color: var(--gray-400);
    font-size: 1rem;
    margin: 2px 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-900);
    font-family: var(--font-mono);
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.stat-card.red .stat-value { color: var(--red); }
.stat-card.green .stat-value { color: var(--green); }

/* Timeline (vertical, detailed) */
.detail-timeline {
    position: relative;
    padding-left: 40px;
    margin: 24px 0;
}

.detail-timeline::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-300);
}

.timeline-entry {
    position: relative;
    margin-bottom: 24px;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--navy);
    border: 2px solid var(--white);
}

.timeline-entry.critical::before {
    background: var(--red);
    width: 12px; height: 12px;
    left: -30px;
}

.timeline-entry .time-stamp {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.timeline-entry .time-stamp.red { color: var(--red); }

.timeline-entry h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.timeline-entry p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.filter-tab {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover { border-color: var(--blue); color: var(--blue); }
.filter-tab.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* Grid Layouts */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Footer (shared with main) */
#footer {
    background: var(--navy);
    color: var(--gray-400);
    padding: 64px 0 32px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 12px; }
.footer-col p, .footer-col li { font-size: 0.85rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 4px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-400);
}

.footer-back-link {
    color: var(--gray-400);
}

.footer-back-link:hover {
    color: var(--white);
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-weight: 600;
}

.skip-link:focus { top: 0; }

.noscript-warning {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: #fffbeb;
    color: #92400e;
    border-bottom: 1px solid #fde68a;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 16px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container, .narrow-container { padding: 0 16px; }
    #main-nav { padding: 0 16px; }
    .nav-brand { font-size: 1rem; max-width: calc(100vw - 88px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none; position: absolute; top: var(--nav-height); left: 0; right: 0;
        background: var(--navy); flex-direction: column; padding: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        max-height: calc(100vh - var(--nav-height)); overflow-y: auto;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 14px; font-size: 0.95rem; }
    .page-hero { padding: 100px 0 36px; }
    .page-hero h1 { font-size: 1.8rem; }
    .section { padding: 48px 0; }
    .section-title { font-size: 1.6rem; }
    .two-col, .three-col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .data-table { min-width: 600px; }
    .waterfall-class { padding: 12px 16px; gap: 12px; }
    .detail-timeline { padding-left: 32px; }

    body.nav-open { overflow: hidden; }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .container, .narrow-container { padding: 0 14px; }
    #main-nav { padding: 0 12px; }
    .page-hero h1 { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .waterfall-class { flex-wrap: wrap; }
    .waterfall-recovery { min-width: auto; }
}
