#publicaciones-documentos .pd-titulo {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    opacity: .85;
    margin: 0 0 14px;
}

#publicaciones-documentos .pd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
    max-width: 460px;
}

#publicaciones-documentos .pd-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

#publicaciones-documentos .pd-miniatura {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border: 1px solid rgba(255,255,255,.15);
    transition: transform .2s ease, border-color .2s ease;
}

#publicaciones-documentos .pd-item:hover .pd-miniatura {
    transform: translateY(-3px);
    border-color: #3dbff3;
}

#publicaciones-documentos .pd-miniatura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#publicaciones-documentos .pd-icono-pdf {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #3dbff3;
    border: 2px solid #3dbff3;
    border-radius: 6px;
    padding: 6px 8px;
}

#publicaciones-documentos .pd-item span.pd-nombre {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
}

#publicaciones-documentos .pd-item span.pd-descripcion {
    font-size: 11px;
    line-height: 1.3;
    color: #cfd6e6;
    font-style: italic;
    margin-top: 1px;
}

/* Botón "Cargar más" */
#publicaciones-documentos .pd-cargar-mas {
    margin-top: 16px;
    padding: 9px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,.4);
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

#publicaciones-documentos .pd-cargar-mas:hover {
    background: rgba(255,255,255,.1);
    border-color: #3dbff3;
}

/* ---- Galería / carrusel a pantalla completa ---- */
.pd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 9, 24, .93);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.pd-overlay.pd-abierto {
    display: flex;
}

.pd-visor {
    max-width: min(900px, 90vw);
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.pd-visor img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

.pd-pdf {
    width: min(900px, 90vw);
    height: 75vh;
    border: none;
    border-radius: 6px;
    background: #fff;
}

/* ---- Zoom dentro del visor ---- */
.pd-visor .pd-img,
.pd-visor .pd-pdf {
    transform-origin: center center;
    transition: transform .15s ease-out;
    touch-action: none;
    -webkit-user-drag: none;
    user-select: none;
    cursor: zoom-in;
}

.pd-visor .pd-img.pd-zoomed,
.pd-visor .pd-pdf.pd-zoomed {
    cursor: grab;
}

.pd-visor .pd-img.pd-arrastrando,
.pd-visor .pd-pdf.pd-arrastrando {
    cursor: grabbing;
    transition: none;
}

.pd-zoom-controles {
    position: absolute;
    top: 18px;
    left: 22px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 30px;
    padding: 4px;
}

.pd-zoom-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 19px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .2s ease;
}

.pd-zoom-btn:hover:not(:disabled) {
    background: #3dbff3;
}

.pd-zoom-btn:disabled {
    opacity: .35;
    cursor: default;
}

.pd-zoom-nivel {
    min-width: 46px;
    text-align: center;
    color: #fff;
    font-size: 12px;
    opacity: .85;
    cursor: pointer;
    user-select: none;
}

.pd-abrir-pdf {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #3dbff3;
    font-size: 13px;
    text-decoration: underline;
}

.pd-cerrar {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.pd-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: 30px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-flecha:hover {
    background: #3dbff3;
    border-color: #3dbff3;
}

.pd-flecha-izq { left: 16px; }
.pd-flecha-der { right: 16px; }

.pd-pie {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 13px;
}

.pd-pie-titulo {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.pd-pie-contador {
    opacity: .6;
}

@media (max-width: 600px) {
    .pd-flecha { width: 38px; height: 38px; font-size: 24px; }
    .pd-cerrar { top: 10px; right: 14px; font-size: 28px; }
    .pd-zoom-controles { top: 10px; left: 12px; }
    .pd-zoom-btn { width: 30px; height: 30px; font-size: 17px; }
    .pd-zoom-nivel { min-width: 38px; font-size: 11px; }
}
