/* Council Documents — Frontend Styles */

.cd-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    width: 100%;
}

/* ── Heading ─────────────────────────────────────────────────────────────── */

.cd-heading {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: #1a1a1a;
}

/* ── Filters ─────────────────────────────────────────────────────────────── */

.cd-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.cd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 200px;
    flex: 1;
}

.cd-filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.cd-filter-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    color: #1a1a1a;
    cursor: pointer;
}

.cd-filter-select:focus {
    outline: 3px solid #005ea2;
    outline-offset: 0;
    border-color: #005ea2;
}

.cd-filter-btn {
    padding: 9px 20px;
    background: #1a1a2e;
    color: #fff;
    border: 2px solid #1a1a2e;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-end;
}

.cd-filter-btn:hover,
.cd-filter-btn:focus {
    background: #2d2d4e;
    outline: 3px solid #005ea2;
    outline-offset: 2px;
}

.cd-filter-clear {
    font-size: 0.875rem;
    color: #005ea2;
    text-decoration: underline;
    align-self: flex-end;
    padding-bottom: 10px;
}

.cd-filter-clear:focus {
    outline: 3px solid #005ea2;
    outline-offset: 2px;
}

.cd-filter-summary {
    font-size: 0.875rem;
    color: #555;
    margin-bottom: 1.5rem;
    padding: 0.6rem 1rem;
    background: #e8f0fe;
    border-left: 4px solid #005ea2;
    border-radius: 0 4px 4px 0;
}

/* ── Year groups ─────────────────────────────────────────────────────────── */

.cd-year-group {
    margin-bottom: 2.5rem;
}

.cd-year-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

/* ── Meeting rows ────────────────────────────────────────────────────────── */

.cd-meetings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cd-meeting {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.cd-meeting__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.cd-meeting__meta {
    flex: 1;
    min-width: 0;
}

.cd-meeting__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: #1a1a1a;
}

.cd-meeting__details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: #555;
}

.cd-meeting__sep { color: #bbb; }

.cd-meeting__committee {
    font-weight: 500;
    color: #005ea2;
}

.cd-meeting__notes {
    font-size: 0.8rem;
    color: #666;
    margin: 0.35rem 0 0;
    font-style: italic;
}

/* Toggle button */
.cd-meeting__toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}

.cd-meeting__toggle:hover {
    background: #e8e8e8;
}

.cd-meeting__toggle:focus {
    outline: 3px solid #005ea2;
    outline-offset: 2px;
}

.cd-meeting__toggle[aria-expanded="true"] .cd-toggle-icon {
    transform: rotate(180deg);
}

.cd-toggle-icon {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

/* ── Documents list ──────────────────────────────────────────────────────── */

.cd-meeting__documents {
    border-top: 1px solid #e0e0e0;
    padding: 1rem 1.25rem;
    background: #fafafa;
}

.cd-documents-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cd-document__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    color: #1a1a1a;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.cd-document__link:hover {
    background: #e8f0fe;
    border-color: #c2d4f0;
    text-decoration: none;
}

.cd-document__link:focus {
    outline: 3px solid #005ea2;
    outline-offset: 2px;
}

/* File type badge */
.cd-document__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #555;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.cd-document__icon--pdf  { background: #c0392b; }
.cd-document__icon--docx,
.cd-document__icon--doc  { background: #2980b9; }
.cd-document__icon--xlsx,
.cd-document__icon--xls  { background: #27ae60; }
.cd-document__icon--pptx,
.cd-document__icon--ppt  { background: #e67e22; }

.cd-document__info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.cd-document__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #005ea2;
}

.cd-document__size {
    font-size: 0.75rem;
    color: #888;
}

.cd-document__external {
    font-size: 0.875rem;
    color: #888;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.cd-empty {
    padding: 2.5rem;
    text-align: center;
    background: #f5f5f5;
    border-radius: 6px;
    border: 2px dashed #ccc;
    color: #666;
}

/* ── Screen reader only ──────────────────────────────────────────────────── */

.cd-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .cd-filters { flex-direction: column; }
    .cd-filter-group { min-width: 0; width: 100%; }
    .cd-filter-btn { width: 100%; text-align: center; }
    .cd-meeting__header { flex-direction: column; align-items: flex-start; }
    .cd-meeting__toggle { align-self: flex-start; }
}

/* ── High contrast / forced colours ─────────────────────────────────────── */

@media (forced-colors: active) {
    .cd-document__icon { forced-color-adjust: none; }
    .cd-meeting__toggle { border: 2px solid ButtonText; }
}
