/*
 * Vista ACORDEÓN para la página de inicio.
 * Mes vigente abierto; los demás colapsados (un solo tap los abre).
 * Filas compactas tipo lista ejecutiva. Mobile-first.
 *
 * No interfiere con .cmp-home ni .cmp-hub. Usa namespace .cmp-acc__*.
 */

.cmp-acc {
    --acc-blue: var(--cmp-blue, #15267e);
    --acc-bg: var(--cmp-bg, #f3f6fb);
    --acc-line: var(--cmp-line, #dbe4f0);
    --acc-text: var(--cmp-text, #163057);
    --acc-muted: var(--cmp-muted, #64748b);
    --acc-white: #ffffff;

    max-width: 880px;
    margin: 0 auto;
    padding: 12px 12px 28px;
    color: var(--acc-text);
}

/* ── Encabezado ──────────────────────────────────────────────────────────── */

.cmp-acc__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.cmp-acc__title {
    margin: 4px 0 0;
    font-size: clamp(22px, 4vw, 30px);
    color: var(--acc-blue);
    font-weight: 800;
    line-height: 1.1;
}

.cmp-acc__more-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--acc-blue);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    transition: transform 0.15s ease, background 0.15s ease;
}

.cmp-acc__more-link:hover {
    background: #0f1b57;
    transform: translateX(2px);
}

/* ── Controles (buscador + filtro año) ───────────────────────────────────── */

.cmp-acc__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.cmp-acc__search {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.cmp-acc__search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    display: block;
    width: 18px;
    height: 18px;
    color: var(--acc-muted);
    pointer-events: none;
    z-index: 1;
}

.cmp-acc__search-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    line-height: 1.2;
    padding: 8px 14px 8px 42px;
    border: 1px solid var(--acc-line);
    border-radius: 12px;
    background: var(--acc-white);
    color: var(--acc-text);
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cmp-acc__search-input:focus {
    outline: none;
    border-color: rgba(21, 38, 126, 0.4);
    box-shadow: 0 0 0 4px rgba(21, 38, 126, 0.08);
}

.cmp-acc__years {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cmp-acc__year {
    padding: 8px 14px;
    border: 1px solid var(--acc-line);
    border-radius: 999px;
    background: var(--acc-white);
    color: var(--acc-blue);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cmp-acc__year:hover {
    background: var(--acc-bg);
}

.cmp-acc__year.is-active {
    background: var(--acc-blue);
    color: #fff;
    border-color: var(--acc-blue);
}

/* ── Lista de meses (acordeón) ───────────────────────────────────────────── */

.cmp-acc__months {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cmp-acc__month {
    border: 1px solid var(--acc-line);
    border-radius: 14px;
    background: var(--acc-white);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cmp-acc__month[open] {
    border-color: rgba(21, 38, 126, 0.25);
    box-shadow: 0 8px 24px rgba(21, 38, 126, 0.07);
}

.cmp-acc__month-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none; /* quita el triángulo por defecto del <summary> */
    user-select: none;
}

.cmp-acc__month-head::-webkit-details-marker {
    display: none;
}

.cmp-acc__chevron {
    flex: 0 0 auto;
    color: var(--acc-blue);
    transition: transform 0.2s ease;
}

.cmp-acc__month[open] .cmp-acc__chevron {
    transform: rotate(90deg);
}

.cmp-acc__month-title {
    flex: 1 1 auto;
    margin: 0;
    font-size: clamp(15px, 3.8vw, 17px);
    font-weight: 800;
    color: var(--acc-blue);
    text-transform: capitalize;
    line-height: 1.2;
}

.cmp-acc__month-count {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--acc-bg);
    color: var(--acc-blue);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Filas compactas dentro de cada mes ──────────────────────────────────── */

.cmp-acc__rows {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--acc-line);
}

.cmp-acc__row + .cmp-acc__row {
    border-top: 1px solid var(--acc-line);
}

.cmp-acc__row[hidden] {
    display: none !important;
}

.cmp-acc__row-link {
    display: grid;
    grid-template-columns: 60px 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: inherit !important;
    transition: background 0.15s ease;
}

.cmp-acc__row-link:hover {
    background: var(--acc-bg);
}

.cmp-acc__row-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 10px;
    background: var(--acc-bg);
    color: var(--acc-blue);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    padding: 0 8px;
    white-space: nowrap;
}

.cmp-acc__row-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--acc-white);
    border: 1px solid var(--acc-line);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmp-acc__row-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cmp-acc__row-logo.no-image {
    background: var(--acc-bg);
    color: var(--acc-muted);
    font-size: 9px;
    font-weight: 700;
}

.cmp-acc__row-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cmp-acc__row-title {
    color: var(--acc-blue);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmp-acc__row-meta {
    color: var(--acc-muted);
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmp-acc__row-sep {
    margin: 0 4px;
    opacity: 0.6;
}

.cmp-acc__row-pill {
    flex: 0 0 auto;
    font-size: 11px;
    padding: 4px 8px;
}

/* Mes oculto durante búsqueda/filtro. */
.cmp-acc__month[hidden] {
    display: none !important;
}

.cmp-acc__empty {
    padding: 22px;
    border-radius: 14px;
    background: var(--acc-bg);
    border: 1px dashed var(--acc-line);
    color: var(--acc-muted);
    text-align: center;
    font-weight: 600;
}

/* ── Móvil pequeño: ajustes finos ────────────────────────────────────────── */

@media (max-width: 540px) {
    .cmp-acc {
        padding: 8px 8px 24px;
    }

    .cmp-acc__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cmp-acc__more-link {
        align-self: flex-start;
    }

    .cmp-acc__row-link {
        grid-template-columns: 52px 36px minmax(0, 1fr);
        padding: 10px 12px;
    }

    /* El pill se pasa a su propia fila debajo de la info para no chocar. */
    .cmp-acc__row-pill {
        grid-column: 3 / -1;
        justify-self: start;
        margin-top: 4px;
    }

    .cmp-acc__row-day {
        height: 34px;
    }

    .cmp-acc__row-logo {
        width: 36px;
        height: 36px;
    }

    .cmp-acc__row-title {
        font-size: 13.5px;
    }

    .cmp-acc__row-meta {
        font-size: 11.5px;
    }
}
