/* ==================================================== */
/* ============ PUBLICATION GRID ====================== */
/* ==================================================== */

.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.pub-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.pub-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.pub-cover {
    height: 320px;
    background: var(--gray-100);
    overflow: hidden;
    position: relative;
}

.pub-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.pub-card:hover .pub-cover img {
    transform: scale(1.05);
}

.pub-cover-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    color: rgba(255, 255, 255, 0.5);
    font-size: 4rem;
}

.pub-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.pub-body h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
    margin: 0;
    
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pub-date {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin-top: auto;
}

.pub-btn:hover {
    background: var(--gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(50, 155, 214, 0.35);
}

.pub-btn i {
    color: var(--gold);
}

@media (max-width: 576px) {
    .pub-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .pub-cover {
        height: 240px;
    }
    
    .pub-body h4 {
        font-size: 0.85rem;
    }
    
    .pub-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}
/* ==================================================== */
/* ============ PDF MODAL ============================= */
/* ==================================================== */

.pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.pdf-modal.active {
    display: flex;
    opacity: 1;
}

.pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
}

.pdf-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    z-index: 1;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.pdf-modal.active .pdf-modal-content {
    transform: translateY(0);
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--gradient);
    color: var(--white);
    flex-shrink: 0;
}

.pdf-modal-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.pdf-modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pdf-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: inherit;
}

.pdf-modal-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--gold);
    color: var(--gold);
}

.pdf-modal-btn-close {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.pdf-modal-btn-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    transform: rotate(90deg);
}

.pdf-modal-body {
    flex: 1;
    background: var(--gray-100);
    overflow: hidden;
}

.pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ==================================================== */
/* ============ RESPONSIVE ============================ */
/* ==================================================== */

@media (max-width: 768px) {
    .law-category-grid {
        grid-template-columns: 1fr;
    }
    
    .law-item-header {
        padding: 16px;
    }
    
    .law-item-content h4 {
        font-size: 0.9rem;
    }
    
    .law-documents {
        padding: 0 16px 16px;
    }
    
    .law-doc-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pdf-modal {
        padding: 0;
    }
    
    .pdf-modal-content {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .pdf-modal-header h3 {
        font-size: 0.85rem;
        max-width: 50%;
    }
}