/* RepoDocs — Document List Block */

:root {
    --rd-header-bg: #1e3a5f;
    --rd-row-even-bg: #f8f9fa;
    --rd-row-odd-bg: #ffffff;
    --rd-row-hover-bg: #e3eaf3;
    --rd-accent: #1e3a5f;
    --rd-font-size: 14px;
}

/* Size variants */
.rd-size-small { --rd-font-size: 12px; }
.rd-size-large { --rd-font-size: 16px; }

/* Wrapper */
.repodocs-block-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--rd-font-size);
    max-width: 100%;
}

/* Search and year filter bar */
.rd-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.rd-search {
    flex: 1;
    min-width: 150px;
    max-width: 400px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    box-sizing: border-box;
}

.rd-search:focus {
    outline: none;
    border-color: var(--rd-accent);
}

.rd-year-select {
    width: 100px;
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.rd-year-select:focus {
    outline: none;
    border-color: var(--rd-accent);
}

.rd-year-select:focus {
    outline: none;
    border-color: var(--rd-accent);
}

/* Table */
.rd-table-wrap {
    overflow-x: auto;
    border-radius: 6px;
}

.rd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--rd-font-size);
    background: var(--rd-row-odd-bg);
}

/* Border styles */
.rd-border-none .rd-table { border: none; }
.rd-border-subtle .rd-table { border: 1px solid #e0e0e0; }
.rd-border-subtle .rd-table th,
.rd-border-subtle .rd-table td { border-left: 1px solid #e0e0e0; border-top: 1px solid #e0e0e0; }
.rd-border-subtle .rd-table th:last-child,
.rd-border-subtle .rd-table td:last-child { border-right: 1px solid #e0e0e0; }
.rd-border-subtle .rd-table tbody tr:last-child td { border-bottom: 1px solid #e0e0e0; }

.rd-border-strong .rd-table { border: 2px solid #333; }
.rd-border-strong .rd-table th,
.rd-border-strong .rd-table td { border: 1px solid #333; }

/* Header */
.rd-table thead th {
    background: var(--rd-header-bg) !important;
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: calc(var(--rd-font-size) - 1px);
}

.rd-table thead th a {
    color: #ffffff;
    text-decoration: none;
}

/* Body */
.rd-table tbody tr:nth-child(even) { background: var(--rd-row-even-bg); }
.rd-table tbody tr:nth-child(odd) { background: var(--rd-row-odd-bg); }

.rd-table tbody tr:hover { background: var(--rd-row-hover-bg) !important; }

.rd-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Links in rows */
.rd-table tbody td a {
    color: var(--rd-accent);
    text-decoration: none;
    font-weight: 500;
}

.rd-table tbody td a:hover {
    text-decoration: underline;
}

/* Year badge */
.rd-year {
    display: inline-block;
    background: var(--rd-accent);
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: calc(var(--rd-font-size) - 2px);
    font-weight: 600;
    vertical-align: middle;
}

/* File size & date — secondary text */
.rd-meta {
    color: #777;
    font-size: calc(var(--rd-font-size) - 1px);
    white-space: nowrap;
}

/* Loading */
.rd-loading {
    text-align: center;
    padding: 40px;
    color: #777;
    font-size: var(--rd-font-size);
}

/* Error */
.rd-error {
    color: #c00;
    padding: 20px;
    text-align: center;
    font-size: var(--rd-font-size);
}

/* Show all link */
.rd-show-all {
    display: inline-block;
    margin-top: 10px;
    color: var(--rd-accent);
    font-size: var(--rd-font-size);
    cursor: pointer;
    text-decoration: underline;
}

/* No documents */
.rd-empty {
    color: #888;
    padding: 20px;
    text-align: center;
    font-style: italic;
}

/* Year group header row */
.rd-year-group td {
    background: var(--rd-header-bg) !important;
    color: #ffffff;
    padding: 6px 14px !important;
    font-weight: 600;
    font-size: calc(var(--rd-font-size) - 1px);
    letter-spacing: 0.03em;
}

/* Block editor wrapper */
.repodocs-block-wrap .repodocs-block-inner {
    min-height: 60px;
}
