/* ============================================================
   The Daily Digest — Shared Design System
   Included on every page. Tailwind CDN handles utilities;
   this file owns branded tokens + reusable component classes.
   ============================================================ */

:root {
    /* Brand palette — single source of truth */
    --gold: #C9A961;
    --gold-text: #A6853F;
    --gold-dark: #8a6508;
    --gold-light: #f4e8c1;
    --ink: #1A1A1A;
    --bg: #FBFBF9;
    --card: #FFFFFF;

    /* Semantic */
    --text-main: #1A1A1A;
    --text-muted: #6B7280;
    --border: #E5E7EB;

    /* Court accents (for pills / chart legend) */
    --court-sc: #E11D48;
    --court-sc-bg: #FFF1F2;
    --court-dhc: #2563EB;
    --court-dhc-bg: #EFF6FF;
    --court-atfp: #D97706;
    --court-atfp-bg: #FEF3C7;
}

/* ---------- Base ---------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-serif {
    font-family: Georgia, "Times New Roman", "Noto Serif", serif;
    font-weight: normal;
}

/* ---------- Gold helpers ---------- */
.gold-text { color: var(--gold-text); }
.gold-border { border-color: var(--gold); }
.gold-bg { background-color: var(--gold); }

/* ---------- Navigation bar (shared across all pages) ---------- */
.nav-bar {
    background: #ffffff;
    padding: 15px 20px;
    border-bottom: 2px solid var(--gold);
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-link {
    text-decoration: none;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.2s ease;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--gold-text); }
.nav-link.active {
    color: var(--gold-text);
    border-bottom-color: var(--gold);
}

/* ---------- Branding header (shared) ---------- */
.brand-header {
    text-align: center;
    padding: 40px 20px 30px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.brand-header h1 {
    margin: 0;
    font-size: 2.75em;
    letter-spacing: -0.5px;
    color: var(--gold-text);
    font-weight: normal;
}
.brand-header p {
    margin: 10px 0 0;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ---------- Card ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.card-header {
    font-size: 1.05em;
    color: var(--text-main);
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    font-family: Georgia, serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 24px; }

/* ---------- KPI tile (dashboard) ---------- */
.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 4px solid var(--gold);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.07);
}
.kpi-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 10px;
}
.kpi-number {
    font-family: Georgia, serif;
    font-size: 2.75em;
    line-height: 1;
    color: var(--text-main);
    margin: 0;
}
.kpi-sub {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 0.85em;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}
.btn-primary:hover { background: var(--gold); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--text-muted);
    font-size: 0.8em;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-text); }
.btn-ghost.active {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}

/* ---------- Court pill ---------- */
.court-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.court-pill.sc { background: var(--court-sc-bg); color: var(--court-sc); border: 1px solid #FFE4E6; }
.court-pill.dhc { background: var(--court-dhc-bg); color: var(--court-dhc); border: 1px solid #DBEAFE; }
.court-pill.atfp { background: var(--court-atfp-bg); color: var(--court-atfp); border: 1px solid #FDE68A; }

/* ---------- Filter select ---------- */
.filter-select {
    padding: 10px 18px;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.filter-select:hover {
    border-color: var(--gold);
    box-shadow: 0 2px 6px rgba(201,169,97,0.15);
}
.filter-select:focus { outline: none; border-color: var(--gold); }

/* ---------- Footer (shared) ---------- */
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.75em;
    border-top: 1px solid var(--border);
    background: #fff;
}

/* ---------- Rank list (judges / lawyers / precedents) ---------- */
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 0.875em;
}
.rank-list li:last-child { border-bottom: none; }
.rank-list .rank-name {
    color: var(--text-main);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.rank-list .rank-num {
    color: var(--gold-text);
    font-family: Georgia, serif;
    font-weight: 600;
    min-width: 18px;
}
.rank-list .rank-count {
    color: var(--text-muted);
    font-size: 0.85em;
    background: #F9FAFB;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* ---------- Compact judgment row (dashboard latest) ---------- */
.judgment-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #F3F4F6;
}
.judgment-row:last-child { border-bottom: none; }
.judgment-row .j-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0 0 4px;
}
.judgment-row .j-meta {
    font-size: 0.75em;
    color: var(--text-muted);
}

/* ---------- Loading / empty states ---------- */
.state-msg {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.state-msg .state-icon {
    width: 40px; height: 40px;
    margin: 0 auto 12px;
    color: #D1D5DB;
}

/* ---------- Chart canvas container ---------- */
.chart-wrap {
    position: relative;
    width: 100%;
}
.chart-wrap.h-300 { height: 300px; }
.chart-wrap.h-350 { height: 350px; }
.chart-wrap.h-250 { height: 250px; }

/* ---------- Scrollbar polish ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
