/* ═══════════════════════════════════════════════════════════════════════════
   JCI Davao — Senators frontend styles
   Matches the design in the provided mockup.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.jcid-senators-wrap {
    --jcid-cols: 3;
    --jcid-orange: #f97316;
    --jcid-border: #e5e7eb;
    --jcid-radius: 12px;
    --jcid-gap: 16px;
    --jcid-text: #111827;
    --jcid-muted: #6b7280;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 8px;
    color: var(--jcid-text);
}

/* ── Search row ──────────────────────────────────────────────────────────── */
.jcid-search-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Search box */
.jcid-search-box {
    position: relative;
    flex: 1;
    max-width: 460px;
}

.jcid-search-box input[type="search"] {
    width: 100%;
    padding: 11px 48px 11px 22px;
    border: 1.5px solid var(--jcid-border);
    border-radius: 50px;
    font-size: 14px;
    color: var(--jcid-text);
    background: #ffffff;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    transition: border-color 0.18s;
    box-shadow: none;
}

.jcid-search-box input[type="search"]:focus {
    border-color: #9ca3af;
}

/* Clear button that browsers add */
.jcid-search-box input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.jcid-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--jcid-muted);
    pointer-events: none;
    flex-shrink: 0;
}

/* Legend */
.jcid-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--jcid-muted);
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Orange pill used in legend and on cards */
.jcid-dagger-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--jcid-orange);
    color: #ffffff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Senator grid ────────────────────────────────────────────────────────── */
.jcid-senators-grid {
    display: grid;
    grid-template-columns: repeat( var(--jcid-cols), 1fr );
    gap: var(--jcid-gap);
}

@media (max-width: 760px) {
    .jcid-senators-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .jcid-senators-grid { grid-template-columns: 1fr; }
    .jcid-search-row { flex-direction: column; align-items: flex-start; }
    .jcid-search-box { max-width: 100%; width: 100%; }
}

/* ── Senator card ────────────────────────────────────────────────────────── */
.jcid-senator-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1.5px solid var(--jcid-border);
    border-radius: var(--jcid-radius);
    transition: box-shadow 0.18s, transform 0.18s;
    text-decoration: none;
    color: inherit;
}

.jcid-senator-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Deceased dagger badge — top-right corner of card */
.jcid-senator-card .jcid-dagger {
    position: absolute;
    top: -9px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--jcid-orange);
    color: #ffffff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    z-index: 1;
    box-shadow: 0 1px 4px rgba(249, 115, 22, 0.4);
}

/* ── Photo ───────────────────────────────────────────────────────────────── */
.jcid-senator-photo {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    background: #e5e7eb;
}

.jcid-senator-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Info block ──────────────────────────────────────────────────────────── */
.jcid-senator-info {
    flex: 1;
    min-width: 0;
}

.jcid-senator-info p {
    margin: 0 0 2px;
    line-height: 1.35;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.jcid-senator-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--jcid-text);
    margin-top: 0;
    margin-bottom: 2px;
}

.jcid-senator-number,
.jcid-senator-year {
    font-size: 12px;
    color: var(--jcid-muted);
}

/* ── Hidden state (search filtering) ────────────────────────────────────── */
.jcid-senator-card[hidden] {
    display: none;
}

/* ── No-results message ──────────────────────────────────────────────────── */
.jcid-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--jcid-muted);
    padding: 40px 16px;
    font-size: 15px;
    margin: 0;
}

.jcid-no-senators {
    grid-column: 1 / -1;
    color: var(--jcid-muted);
    font-size: 14px;
    margin: 0;
    padding: 24px 0;
    text-align: center;
}

/* ── Total count in legend ───────────────────────────────────────────────── */
.jcid-total-count {
    font-size: 12px;
    color: var(--jcid-muted);
    font-weight: 600;
}

.jcid-legend-sep {
    margin: 0 6px;
    color: #d1d5db;
    font-size: 14px;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.jcid-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.jcid-pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid var(--jcid-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--jcid-text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}

.jcid-pg-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.jcid-pg-btn.jcid-pg-active {
    background: #1B3A8A;
    border-color: #1B3A8A;
    color: #ffffff;
    font-weight: 700;
    cursor: default;
}

.jcid-pg-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.jcid-pg-prev,
.jcid-pg-next {
    font-size: 18px;
    font-weight: 400;
    min-width: 36px;
}

.jcid-pg-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    color: var(--jcid-muted);
    font-size: 14px;
    letter-spacing: 1px;
}
