/* --- Presentations Section --- */

.arn-presentations {
    background-color: #f9fafb;
    padding: 80px 0;
}

.arn-presentations__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 18px;
}

/* Header de Sección */
.arn-presentations__header {
    margin-bottom: 50px;
    max-width: 900px;
}

.arn-presentations__title {
    font-size: 32px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 20px 0;
}

.arn-presentations__divider {
    width: 60px;
    height: 4px;
    background-color: var(--arn-color-primary);
    border-radius: 2px;
}

/* Grid Layout */
.arn-presentations__grid {
    display: grid;
    /* Ajuste automático: mínimo 300px por tarjeta, rellena el espacio */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* --- Presentation Card --- */

.arn-pres-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--arn-color-border);
    display: flex;
    flex-direction: column;
}

.arn-pres-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.arn-pres-card__link-wrapper {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Imagen */
.arn-pres-card__img-box {
    position: relative;
    height: 200px; /* Altura fija para uniformidad */
    width: 100%;
    overflow: hidden;
    background-color: #f3f4f6;
}

.arn-pres-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
}

.arn-pres-card:hover .arn-pres-card__img {
    transform: none;
}

/* Badge "Protegido" */
.arn-pres-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}

.arn-pres-card__badge svg {
    width: 12px;
    height: 12px;
}

/* Cuerpo de la tarjeta */
.arn-pres-card__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.arn-pres-card__meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.arn-pres-card__title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.4;
    /* Limitar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.arn-pres-card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.arn-pres-card__read-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--arn-color-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    transition: gap 0.2s ease;
}

.arn-pres-card:hover .arn-pres-card__read-more {
    gap: 10px; /* Flecha se mueve al hover */
}

.arn-pres-card__read-more svg {
    width: 16px;
    height: 16px;
}

/* --- Pagination --- */
.arn-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--arn-color-border);
}

.arn-pagination__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background-color: #ffffff;
    border: 1px solid var(--arn-color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.arn-pagination__btn:hover:not(:disabled) {
    background-color: var(--arn-color-primary);
    color: #ffffff;
    border-color: var(--arn-color-primary);
}

.arn-pagination__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.arn-pagination__btn svg {
    width: 16px;
    height: 16px;
}

.arn-pagination__info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.arn-pagination__current,
.arn-pagination__total {
    font-weight: 700;
    color: #111827;
}

/* --- Loading State --- */
.arn-presentations__loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.arn-presentations__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--arn-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.arn-presentations__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* Responsividad */
@media (max-width: 600px) {
    .arn-presentations__title {
        font-size: 24px;
    }
    
    .arn-presentations__grid {
        grid-template-columns: 1fr;
    }

    .arn-pagination {
        flex-direction: column;
        gap: 12px;
    }

    .arn-pagination__btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Modal de Contraseña --- */
.arn-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.arn-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.arn-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.arn-modal__container {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.arn-modal.is-open .arn-modal__container {
    transform: scale(1) translateY(0);
}

.arn-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.arn-modal__close:hover {
    background: #e5e7eb;
}

.arn-modal__close svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

.arn-modal__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--arn-color-primary), #1e40af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arn-modal__icon svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

.arn-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.arn-modal__desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.5;
}

.arn-modal__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.arn-modal__input-group {
    position: relative;
}

.arn-modal__input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.arn-modal__toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
}

.arn-modal__toggle:hover {
    background: #f3f4f6;
    color: #111827;
}

.arn-modal__toggle:focus {
    outline: none;
}

.arn-modal__toggle-icon {
    width: 18px;
    height: 18px;
}

.arn-modal__toggle-icon--hide {
    display: none;
}

.arn-modal__toggle.is-on .arn-modal__toggle-icon--show {
    display: none;
}

.arn-modal__toggle.is-on .arn-modal__toggle-icon--hide {
    display: block;
}

.arn-modal__input:focus {
    border-color: var(--arn-color-primary);
    box-shadow: 0 0 0 3px rgba(11, 77, 138, 0.1);
}

.arn-modal__error {
    font-size: 13px;
    color: #dc2626;
    margin: 0;
    min-height: 18px;
}

.arn-modal__submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--arn-color-primary), #1e40af);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arn-modal__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.arn-modal__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.arn-modal__spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

.arn-modal__submit-loading {
    display: inline-flex;
    align-items: center;
}

/* --- Modal de PDF --- */
.arn-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.arn-pdf-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.arn-pdf-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.arn-pdf-modal__container {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.arn-pdf-modal.is-open .arn-pdf-modal__container {
    transform: scale(1);
}

.arn-pdf-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.arn-pdf-modal__title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 16px;
}

.arn-pdf-modal__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.arn-pdf-modal__download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--arn-color-primary), #1e40af);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arn-pdf-modal__download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.arn-pdf-modal__download svg {
    width: 18px;
    height: 18px;
}

.arn-pdf-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    background: #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.arn-pdf-modal__close:hover {
    background: #d1d5db;
}

.arn-pdf-modal__close svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

.arn-pdf-modal__body {
    background: #f3f4f6;
    flex: 1;
    overflow: hidden;
    display: flex;
}

.arn-pdf-modal__viewer {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .arn-pdf-modal__container {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .arn-pdf-modal__header {
        padding: 12px 16px;
    }

    .arn-pdf-modal__title {
        font-size: 14px;
    }

    .arn-pdf-modal__download span {
        display: none;
    }

    .arn-pdf-modal__download {
        padding: 8px 12px;
    }
}