/* ===== СТРАНИЦА ПУБЛИКАЦИЙ ===== */
.publications-page {
    min-height: 100vh;
    background: #eef2f7;
}

.page-header {
    background: #ffffff;
    padding: 30px 0;
    margin: 20px 20px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
}

/* ===== ПРЕМИАЛЬНАЯ КНОПКА НАЗАД ===== */
.back-btn {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e94560;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 24px 12px 20px;
    border-radius: 12px;
    background: transparent;
    border: 2px solid #e94560;
    z-index: 1;
    overflow: hidden;
    transition: all 0.3s ease;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: #e94560;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: -1;
}

.back-btn:hover::before {
    width: 100%;
}

.back-btn:hover {
    color: #fff;
    border-color: #e94560;
    transform: translateY(-50%) translateX(-4px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.3);
}

.back-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.page-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0;
}

.page-subtitle {
    font-size: 16px;
    color: #636e72;
    margin-top: 8px;
    font-weight: 500;
}

/* ===== ФИЛЬТРЫ ===== */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 20px 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 22px;
    border-radius: 30px;
    border: 2px solid #1a1a2e;
    background: #fff;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1a1a2e;
}

.filter-btn:hover,
.filter-btn.active {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.3);
}

/* ===== ПОИСК ===== */
.search-bar {
    max-width: 600px;
    margin: 0 auto 25px;
    padding: 0 20px;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fff;
}

.search-bar input:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.search-bar input::placeholder {
    color: #999;
}

/* ===== СЕТКА ПУБЛИКАЦИЙ ===== */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 0 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.pub-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.pub-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.pub-image-wrap {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.pub-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pub-card:hover .pub-image-wrap img {
    transform: scale(1.08);
}

.pub-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e94560;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
    z-index: 2;
}

.pub-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.pub-card:hover .pub-overlay {
    opacity: 1;
}

.pub-zoom-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.pub-card:hover .pub-zoom-icon {
    transform: scale(1);
}

.pub-info {
    padding: 20px;
}

.pub-info h3 {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.pub-info p {
    font-size: 14px;
    color: #636e72;
    line-height: 1.5;
    margin-bottom: 12px;
}

.pub-date {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

/* ===== ЛАЙТБОКС ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    color: #fff;
    text-align: center;
    margin-top: 15px;
    font-size: 18px;
    font-weight: 500;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.lightbox-close:hover {
    background: #e94560;
    border-color: #e94560;
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.lightbox-nav:hover {
    background: #e94560;
    border-color: #e94560;
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 992px) {
    .publications-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-header {
        padding: 25px 20px;
    }
    .back-btn {
        position: static;
        transform: none;
        margin-bottom: 15px;
        justify-content: center;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    .back-btn:hover {
        transform: translateX(-4px) !important;
    }
    .back-btn:active {
        transform: scale(0.95) !important;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 600px) {
    .publications-grid {
        grid-template-columns: 1fr;
    }
    .page-header h1 {
        font-size: 28px;
    }
    .pub-image-wrap {
        height: 220px;
    }
    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    .search-bar input {
        padding: 12px 16px;
        font-size: 14px;
    }
}