/* ═══════════════════════════════════════════════════════════════
   Información Pública — Frontend
   Breakpoints Divi:
     desktop  > 980px
     tablet   ≤ 980px
     mobile   ≤ 767px
═══════════════════════════════════════════════════════════════ */

/* ── Layout principal ──────────────────────────────────────── */
.ip-viewer {
    font-family: inherit;
    width: 100%;
}

.ip-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.ip-sidebar {
    flex: 0 0 160px;
    position: sticky;
    top: 80px;
}

/* En desktop: mostrar timeline, ocultar select */
.ip-select-wrap {
    display: none;
}

/* ── Timeline ───────────────────────────────────────────────── */
.ip-timeline-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 20px;
}

/* Línea vertical */
.ip-timeline-wrap::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: #e0e0e0;
}

.ip-timeline-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    position: relative;
}

.ip-timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #c0392b;
    background: #fff;
    flex-shrink: 0;
    margin-left: -20px;
    transition: background .2s, transform .2s;
}

.ip-timeline-item--active .ip-timeline-dot,
.ip-timeline-item:hover .ip-timeline-dot {
    background: #c0392b;
    transform: scale(1.2);
}

.ip-timeline-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2980b9;
    transition: color .2s;
}

.ip-timeline-item--active .ip-timeline-label {
    color: #c0392b;
}

.ip-timeline-item:hover .ip-timeline-label {
    color: #c0392b;
}

/* ── Select (tablet + mobile) ───────────────────────────────── */
.ip-select-anio {
    width: 100%;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #c0392b;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c0392b' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.ip-select-anio:focus {
    outline: 2px solid #c0392b;
    outline-offset: 2px;
}

/* ── Contenido / Acordeones ─────────────────────────────────── */
.ip-content {
    flex: 1;
    min-width: 0;
}

/* ── Barra expandir / colapsar todo ─────────────────────────── */
.ip-controles {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 10px;
}

.ip-controles button {
    background: none;
    border: 1px solid #bbb;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: .72rem;
    color: #777;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1.4;
}

.ip-controles button:hover {
    background: #f0f0f0;
    border-color: #888;
    color: #222;
}

/* ── Item / Acordeón ────────────────────────────────────────── */
.ip-item {
    margin-bottom: 8px;
}

.ip-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 50px;
    cursor: pointer;
    text-align: left;
    font-size: .95rem;
    color: #333;
    transition: background .15s, box-shadow .2s;
}

.ip-item-header:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.ip-item-toggle {
    color: #c0392b;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    line-height: 1;
}

.ip-item-titulo {
    font-weight: 500;
}

.ip-item--vacio .ip-item-titulo {
    color: #888;
}

/* Cuerpo del acordeón */
.ip-item-body {
    padding: 12px 20px 16px 50px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    margin-top: 4px;
}

.ip-item-body[hidden] {
    display: none;
}

/* ── Lista de archivos ──────────────────────────────────────── */
.ip-archivos {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ip-archivos li {
    list-style: none !important;
}

.ip-archivos li::before {
    display: none !important;
    content: none !important;
}

.ip-archivo {
    border-bottom: 1px solid #ececec;
}

.ip-archivo:first-child {
    border-top: 1px solid #ececec;
}

.ip-archivo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #2980b9;
    font-size: .88rem;
    line-height: 1.2;
    padding: 6px 4px;
    transition: color .15s;
}

.ip-archivo a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* ── Icono Font Awesome de archivo ───────────────────────────── */
.ip-file-icon {
    font-size: 16px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    display: block;
    line-height: 1;
}

.ip-archivo-nombre {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.ip-archivo-size {
    flex-shrink: 0;
    color: #999;
    font-size: .78rem;
}

.ip-archivo--empty {
    font-size: .85rem;
    color: #aaa;
}

/* ── Estados ────────────────────────────────────────────────── */
.ip-loading {
    color: #888;
    font-style: italic;
    padding: 16px 0;
}

.ip-empty,
.ip-error {
    padding: 10px 0;
    font-size: .9rem;
}

.ip-error {
    color: #c0392b;
}

/* ═══════════════════════════════════════════════════════════════
   TABLET  ≤ 980px  (breakpoint Divi)
═══════════════════════════════════════════════════════════════ */
@media ( max-width: 980px ) {

    .ip-layout {
        flex-direction: column;
        gap: 20px;
    }

    .ip-sidebar {
        position: static;
        flex: none;
        width: 100%;
    }

    /* Ocultar timeline, mostrar select */
    .ip-timeline-wrap {
        display: none;
    }

    .ip-select-wrap {
        display: block;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE  ≤ 767px  (breakpoint Divi)
═══════════════════════════════════════════════════════════════ */
@media ( max-width: 767px ) {

    .ip-item-header {
        padding: 12px 14px;
        font-size: .88rem;
        border-radius: 30px;
    }

    .ip-item-body {
        padding: 8px 14px 12px 38px;
        border-radius: 12px;
        margin-top: 4px;
    }

    .ip-archivo a {
        font-size: .82rem;
    }

    .ip-archivo-size {
        display: none;
    }
}
