/**
 * Publications Page - Modern Corporate Design
 * Designed for financial services, consulting, and investment advisory firms
 * Big 4 consulting aesthetic with professional, trustworthy appearance
 * Uses brand colors from style.css
 */

/* ============================================
   TYPOGRAPHY & BASE STYLES
   ============================================ */
.publications-page {
    font-family: 'Inter', 'Poppins', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--dark, #15233C);
    line-height: 1.6;
}

/* ============================================
   HERO SECTION
   ============================================ */
.publications-hero {
    background: linear-gradient(135deg, rgba(57, 47, 133, 0.95) 0%, rgba(21, 35, 60, 0.98) 100%);
    /* Using primary and dark colors: primary = #392F85 (57, 47, 133), dark = #15233C (21, 35, 60) */
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.publications-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/blog.jpg') center/cover;
    opacity: 0.15;
    z-index: 0;
}

.publications-hero .container {
    position: relative;
    z-index: 1;
}

.publications-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.publications-hero__subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    font-weight: 400;
    line-height: 1.6;
    max-width: 600px;
}

.publications-hero .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.publications-hero .breadcrumb-item {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.publications-hero .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.95);
}

.publications-hero .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.publications-hero .breadcrumb-item a:hover {
    color: #ffffff;
}


/* ============================================
   PUBLICATIONS GRID
   ============================================ */
.publications-section {
    padding: 0 0 80px;
    background: var(--light, #F6F7FC);
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Publication Card */
.publication-card {
    background: #ffffff;
    border: 1px solid rgba(21, 35, 60, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.publication-card:hover {
    box-shadow: 0 10px 25px rgba(57, 47, 133, 0.15);
    border-color: var(--primary, #392F85);
    transform: translateY(-4px);
}

/* Card Image */
.publication-card__image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, var(--light, #F6F7FC) 0%, rgba(246, 247, 252, 0.8) 100%);
}

.publication-card__image-placeholder {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, var(--light, #F6F7FC) 0%, rgba(246, 247, 252, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(21, 35, 60, 0.4);
    font-size: 3rem;
}

/* Card Body */
.publication-card__body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.publication-card__title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--dark, #15233C);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.85rem; /* 2 lines * 1.4 line-height * 1.375rem */
}

.publication-card__description {
    font-size: 0.9375rem;
    color: rgba(21, 35, 60, 0.7);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-card__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(21, 35, 60, 0.5);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light, #F6F7FC);
}

.publication-card__meta-icon {
    font-size: 0.875rem;
}

/* Card Actions */
.publication-card__actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: auto;
}

.publication-card__btn-download {
    flex: 1;
    background: var(--primary, #392F85);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.publication-card__btn-download:hover {
    background: rgba(57, 47, 133, 0.9);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(57, 47, 133, 0.4);
}

.publication-card__btn-download:active {
    transform: translateY(0);
}

.publication-card__btn-read-more {
    background: transparent;
    color: var(--primary, #392F85);
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.publication-card__btn-read-more:hover {
    color: var(--secondary, #0DD3F1);
    text-decoration: underline;
}

.publication-card__btn-read-more .read-more-text,
.publication-card__btn-read-more .read-less-text {
    display: inline;
}

/* ============================================
   DOWNLOAD MODAL
   ============================================ */
#downloadModal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

#downloadModal .modal-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(21, 35, 60, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 12px 12px 0 0;
}

#downloadModal .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark, #15233C);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#downloadModal .modal-body {
    padding: 2rem;
    background: #ffffff;
}

#downloadModal .modal-body > p {
    color: rgba(21, 35, 60, 0.7);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

#downloadModal .form-label {
    font-weight: 500;
    color: var(--dark, #15233C);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

#downloadModal .form-control {
    border: 1px solid rgba(21, 35, 60, 0.2);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

#downloadModal .form-control:focus {
    border-color: var(--primary, #392F85);
    box-shadow: 0 0 0 3px rgba(57, 47, 133, 0.1);
    outline: none;
}

#downloadModal .form-control.is-invalid {
    border-color: #dc3545;
}

#downloadModal .invalid-feedback {
    font-size: 0.875rem;
    color: #dc3545;
    margin-top: 0.25rem;
}

#downloadModal .modal-footer {
    background: var(--light, #F6F7FC);
    border-top: 1px solid rgba(21, 35, 60, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 0 0 12px 12px;
}

#downloadModal .btn-secondary {
    background: #ffffff;
    color: var(--dark, #15233C);
    border: 1px solid rgba(21, 35, 60, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#downloadModal .btn-secondary:hover {
    background: var(--light, #F6F7FC);
    border-color: rgba(21, 35, 60, 0.3);
}

#downloadModal #downloadSubmitBtn {
    background: var(--primary, #392F85);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#downloadModal #downloadSubmitBtn:hover:not(:disabled) {
    background: rgba(57, 47, 133, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(57, 47, 133, 0.4);
}

#downloadModal #downloadSubmitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#downloadFormError {
    border-radius: 6px;
    border: 1px solid #fee2e2;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.9375rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.publications-pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
}

.publications-pagination .pagination {
    margin: 0;
    gap: 0.5rem;
}

.publications-pagination .page-link {
    color: var(--dark, #15233C);
    border: 1px solid rgba(21, 35, 60, 0.1);
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 42px;
    text-align: center;
}

.publications-pagination .page-link:hover {
    background: var(--light, #F6F7FC);
    border-color: var(--primary, #392F85);
    color: var(--primary, #392F85);
}

.publications-pagination .page-item.active .page-link {
    background: var(--primary, #392F85);
    border-color: var(--primary, #392F85);
    color: #ffffff;
}

.publications-pagination .page-item.disabled .page-link {
    color: rgba(21, 35, 60, 0.4);
    background: var(--light, #F6F7FC);
    border-color: rgba(21, 35, 60, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.publications-empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(21, 35, 60, 0.1);
}

.publications-empty-state__icon {
    font-size: 4rem;
    color: rgba(21, 35, 60, 0.3);
    margin-bottom: 1.5rem;
}

.publications-empty-state__message {
    font-size: 1.125rem;
    color: rgba(21, 35, 60, 0.7);
    margin: 0;
}

/* ============================================
   SUCCESS TOAST
   ============================================ */
.publications-toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

#successToast .toast {
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: none;
}

#successToast .toast-header {
    background: var(--secondary, #0DD3F1);
    color: var(--dark, #15233C);
    border-bottom: none;
    padding: 0.875rem 1rem;
    border-radius: 8px 8px 0 0;
}

#successToast .toast-body {
    background: #ffffff;
    color: var(--dark, #15233C);
    padding: 1rem;
    font-size: 0.9375rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 992px) {
    .publications-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .publications-hero h1 {
        font-size: 2.75rem;
    }
}

@media (max-width: 768px) {
    .publications-hero {
        padding: 60px 0 40px;
    }
    
    .publications-hero h1 {
        font-size: 2.25rem;
    }
    
    .publications-hero__subtitle {
        font-size: 1rem;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .publication-card__image,
    .publication-card__image-placeholder {
        height: 200px;
    }
    
    .publication-card__title {
        font-size: 1.25rem;
        min-height: auto;
    }
    
    .publication-card__actions {
        flex-direction: column;
    }
    
    .publication-card__btn-download,
    .publication-card__btn-read-more {
        width: 100%;
        justify-content: center;
    }
    
    #downloadModal .modal-header,
    #downloadModal .modal-body,
    #downloadModal .modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .publications-toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 576px) {
    .publications-hero h1 {
        font-size: 2rem;
    }
    
    .publication-card__body {
        padding: 1.25rem;
    }
    
    .publications-pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 38px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.publication-card {
    animation: fadeInUp 0.4s ease-out;
}

.publication-card:nth-child(1) { animation-delay: 0.05s; }
.publication-card:nth-child(2) { animation-delay: 0.1s; }
.publication-card:nth-child(3) { animation-delay: 0.15s; }
.publication-card:nth-child(4) { animation-delay: 0.2s; }
.publication-card:nth-child(5) { animation-delay: 0.25s; }
.publication-card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .publication-card,
    .publication-card:hover {
        animation: none;
        transition: none;
    }
}

.publication-card:focus-within {
    outline: 2px solid var(--primary, #392F85);
    outline-offset: 2px;
}
