/* ── Base ───────────────────────────────────────────────────── */

body {
    font-family: sans-serif;
    font-size: 0.9rem;
    padding: 1rem 2rem;
    color: #111;
}

/* ── Site navigation ─────────────────────────────────────────── */

.site-nav {
    background: #2c4a7c;
    padding: 0.55rem 2rem;
    margin: -1rem -2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-brand {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    text-decoration: none;
    margin-right: auto;
}

.nav-link {
    color: #c8d4e8;
    text-decoration: none;
    font-size: 0.85rem;
}

.nav-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* ── Home page ───────────────────────────────────────────────── */

.site-description {
    font-size: 0.9rem;
    color: #444;
    max-width: 52rem;
    margin: 0.3rem 0 1.5rem;
}

.home-section {
    margin-bottom: 2rem;
    max-width: 52rem;
}

h1 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

a {
    color: #1a4a8a;
}

/* ── Navigation tables (index, year, month) ─────────────────── */

table.nav-table,
table.session-table {
    border-collapse: collapse;
    margin-top: 1rem;
    min-width: 20rem;
}

table.nav-table th,
table.session-table th {
    background: #2c4a7c;
    color: #fff;
    text-align: left;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table.nav-table td,
table.session-table td {
    padding: 0.35rem 0.8rem;
    border-bottom: 1px solid #ddd;
}

table.nav-table tr:nth-child(even) td,
table.session-table tr:nth-child(even) td {
    background: #f0f4fb;
}

td.count {
    text-align: right;
    color: #555;
}

/* ── Judge profile ──────────────────────────────────────────── */

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.judge-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #1e3560;
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.judge-badge {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #4a6ea8;
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.judge-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin: 0 0 0.4rem;
}

.judge-meta-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active        { background: #1e7a3a; color: #fff; }
.status-senior-status { background: #9a7020; color: #fff; }
.status-retired       { background: #666;    color: #fff; }
.status-visiting      { background: #2c4a7c; color: #fff; }

.meta-item { font-size: 0.9rem; color: #c8d4e8; }

.judge-dates {
    font-size: 0.8rem;
    color: #a0b4cc;
}

.date-sep { margin: 0 0.3rem; }

/* ── Stat cards grid ─────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border: 1px solid #dde4f0;
    border-radius: 6px;
    padding: 1.1rem 1.3rem;
    border-left: 4px solid #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.accent-blue   { border-left-color: #2c4a7c; }
.accent-green  { border-left-color: #1e7a3a; }
.accent-red    { border-left-color: #b8331a; }
.accent-amber  { border-left-color: #9a7020; }
.accent-rate   { border-left-color: #555; }
.accent-purple { border-left-color: #5a2d82; }

.stat-value {
    font-size: 2.2rem;
    font-weight: bold;
    line-height: 1;
    color: #1a1a2e;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin-bottom: 0.3rem;
}

.stat-sub {
    font-size: 0.78rem;
    color: #888;
}

/* Rate bar */
.rate-bar-wrap { margin: 0.5rem 0 0.3rem; }

.rate-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.rate-fill-affirmed {
    height: 100%;
    background: #1e7a3a;
}

.rate-fill-reversed {
    height: 100%;
    background: #b8331a;
}

/* ── Visiting judge summary line ─────────────────────────────── */

.visiting-summary {
    margin: 0 0 1.5rem;
    font-size: 1rem;
    color: #444;
}

.visiting-sep { margin: 0 0.5rem; color: #bbb; }

/* ── Single judge section ────────────────────────────────────── */

.judge-sections {
    display: block;
}

.section-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2c4a7c;
    border-bottom: 2px solid #2c4a7c;
    padding-bottom: 0.3rem;
    margin: 0 0 0.75rem;
}

.col-right { text-align: right; }

.empty-note {
    color: #888;
    font-style: italic;
    font-size: 0.85rem;
}

/* Judge name links inside calendar table headers */
a.judge-link {
    color: #c8d4e8;
    text-decoration: none;
}

a.judge-link:hover {
    text-decoration: underline;
    color: #fff;
}

/* ── Argument-day table ─────────────────────────────────────── */

table.cal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    border: 1px solid #999;
}

/* Header rows (date/time/loc, judges, column labels) */
tr.header-row th {
    background: #2c4a7c;
    color: #fff;
    text-align: left;
    padding: 0.4rem 0.6rem;
    font-weight: normal;
    border-bottom: 1px solid #1a3060;
}

tr.col-headers th {
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #3a5a9a;
}

/* Data rows */
tr.row-even td { background: #fff; }
tr.row-odd  td { background: #f0f4fb; }

td {
    padding: 0.35rem 0.6rem;
    vertical-align: top;
    border-bottom: 1px solid #ddd;
}

/* Column widths */
td.col-case-num { width: 8%;  white-space: nowrap; font-family: monospace; }
td.col-caption  { width: 35%; }
td.col-time     { width: 5%;  white-space: nowrap; text-align: right; }
td.col-status   { width: 10%; white-space: nowrap; }
td.col-opinion  { width: 15%; font-size: 0.85rem; }

/* Status / outcome */
span.pending  { color: #888; font-style: italic; }
span.outcome  { font-weight: bold; }

/* Opinion writings */
span.writ-type { font-weight: bold; }
span.joining   { color: #555; font-size: 0.8rem; }

/* Empty-cases fallback */
td.no-cases {
    color: #888;
    font-style: italic;
    padding: 0.5rem 0.6rem;
}

/* ── Judges listing page ─────────────────────────────────────── */

.judges-group-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2c4a7c;
    border-bottom: 2px solid #2c4a7c;
    padding-bottom: 0.3rem;
    margin: 1.5rem 0 0.6rem;
}

table.judges-table {
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    min-width: 32rem;
    width: 100%;
    max-width: 52rem;
}

table.judges-table th {
    background: #2c4a7c;
    color: #fff;
    text-align: left;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table.judges-table td {
    padding: 0.35rem 0.8rem;
    border-bottom: 1px solid #ddd;
}

table.judges-table tr:nth-child(even) td {
    background: #f0f4fb;
}

table.judges-table .col-center {
    text-align: center;
}

/* ── Statistics page ─────────────────────────────────────────── */

.overview-grid {
    max-width: 48rem;
    margin-bottom: 2rem;
}

.stat-section {
    margin-bottom: 2.5rem;
    max-width: 56rem;
}

.section-note {
    font-size: 0.82rem;
    color: #777;
    margin: -0.4rem 0 0.8rem;
}

/* Bar chart legend */
.bar-legend {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
}

.legend-affirmed { background: #1e7a3a; }
.legend-reversed { background: #b8331a; }

/* Bar chart table */
table.bar-table {
    border-collapse: collapse;
    width: 100%;
}

table.bar-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
    font-weight: normal;
}

th.bar-pct-th,
th.bar-n-th,
th.bar-extra-th { text-align: right; }

table.bar-table tr.bar-row:nth-child(even) { background: #f7f9fc; }

td.bar-label {
    width: 22%;
    padding: 0.45rem 0.5rem 0.45rem 0;
    font-size: 0.85rem;
    vertical-align: middle;
    white-space: nowrap;
}

td.bar-cell {
    width: auto;
    padding: 0.45rem 0.75rem;
    vertical-align: middle;
}

.bar-track {
    height: 14px;
    background: #e8edf5;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}

.bar-fill-affirmed {
    height: 100%;
    background: #1e7a3a;
    flex-shrink: 0;
}

.bar-fill-reversed {
    height: 100%;
    background: #b8331a;
    flex-shrink: 0;
}

td.bar-pct {
    width: 4.5rem;
    text-align: right;
    font-size: 0.88rem;
    font-weight: bold;
    color: #222;
    white-space: nowrap;
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

td.bar-n {
    width: 5rem;
    text-align: right;
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

td.bar-extra {
    width: 7rem;
    text-align: right;
    font-size: 0.8rem;
    color: #555;
    white-space: nowrap;
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

/* Timing comparison grid */
.timing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 34rem;
}
