.gallery-page {
    min-height: 100vh;
    color: #17243d;
    font-family: Quicksand, sans-serif;
    background: #eef3f9;
}

.gallery-page-hero {
    padding: 74px 0 58px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(7, 25, 55, .92), rgba(16, 52, 105, .72)),
        url("https://mediastore.cc.bogazici.edu.tr/web/template/takvim/images/header.jpeg") center/cover;
}

.gallery-container {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
}

.gallery-page-hero h1 {
    margin: 0 0 10px;
    color: #fff;
    font-family: Poppins, sans-serif;
    font-size: clamp(34px, 4vw, 58px);
    font-weight: 900;
}

.gallery-page-hero p {
    max-width: 700px;
    margin: 0;
    color: rgba(255, 255, 255, .84);
    font-size: 17px;
    line-height: 1.65;
}

.gallery-tabs {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.gallery-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.gallery-tabs a.is-active {
    border-color: #fff;
    color: #1c458b;
    background: #fff;
}

.gallery-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 26px;
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 38, 76, .06);
}

.gallery-category-filter a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid rgba(28, 69, 139, .16);
    border-radius: 999px;
    color: #1c458b;
    background: #fff;
    font-weight: 800;
    text-decoration: none;
}

.gallery-category-filter a.is-active {
    color: #fff;
    border-color: var(--cat-color, #1c458b);
    background: var(--cat-color, #1c458b);
}

.gallery-page-body {
    padding: 42px 0 80px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.gallery-list-card {
    overflow: hidden;
    border-radius: 18px;
    color: #1c458b;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 22px 48px rgba(15, 38, 76, .08);
}

.gallery-grid--masonry .gallery-list-card:nth-child(3n+2) .gallery-list-card__image {
    height: 310px;
}

.gallery-grid--masonry .gallery-list-card:nth-child(3n) .gallery-list-card__image {
    height: 230px;
}

.gallery-list-card__image {
    position: relative;
    height: 260px;
    overflow: hidden;
    background: #dfe8f2;
}

.gallery-list-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.gallery-list-card:hover img {
    transform: scale(1.04);
}

.gallery-list-card__type {
    position: absolute;
    right: 16px;
    top: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: #1c458b;
}

.gallery-list-card__body {
    padding: 20px 22px 24px;
}

.gallery-list-card__category {
    display: block;
    margin-bottom: 10px;
    color: #f27d24;
    font-size: 12px;
    font-weight: 900;
}

.gallery-list-card h2 {
    margin: 0 0 14px;
    color: #1c458b;
    font-family: Poppins, sans-serif;
    font-size: 20px;
    line-height: 1.25;
}

.gallery-list-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #697990;
    font-size: 13px;
    font-weight: 700;
}

.gallery-detail-card {
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 26px 58px rgba(15, 38, 76, .1);
}

.gallery-detail-media {
    background: #08162a;
}

.gallery-detail-media img,
.gallery-detail-media video {
    display: block;
    width: 100%;
    max-height: 680px;
    object-fit: contain;
}

.gallery-detail-content {
    padding: 30px 34px;
}

.gallery-detail-content h2 {
    margin: 0 0 12px;
    color: #1c458b;
    font-family: Poppins, sans-serif;
    font-size: 30px;
}

.gallery-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.gallery-detail-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    color: #fff;
    background: #1c458b;
    font-weight: 800;
    text-decoration: none;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.gallery-modal.is-open {
    display: flex;
}

.gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 16, 36, .76);
    backdrop-filter: blur(8px);
}

.gallery-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(1120px, 100%);
    max-height: min(820px, calc(100vh - 44px));
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(0, 0, 0, .36);
}

.gallery-modal__close {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .42);
    cursor: pointer;
}

.gallery-ajax-detail__media {
    background: #08162a;
}

.gallery-ajax-detail__media img,
.gallery-ajax-detail__media video {
    display: block;
    width: 100%;
    max-height: 650px;
    object-fit: contain;
}

.gallery-ajax-detail__body {
    padding: 24px 30px 28px;
}

.gallery-ajax-detail__body span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 900;
}

.gallery-ajax-detail__body h2 {
    margin: 0 0 8px;
    color: #1c458b;
    font-family: Poppins, sans-serif;
    font-size: 28px;
}

.gallery-ajax-detail__body p,
.gallery-loading {
    color: #697990;
    font-size: 15px;
    font-weight: 700;
}

.gallery-loading {
    padding: 46px;
}

@media (max-width: 980px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-detail-content {
        padding: 24px 18px;
    }
}
