/* Gallery Page Specific Styles */
:root {
    --gallery-gap: 24px;
    --card-radius: 12px;
    --transition-speed: 0.4s;
}

.gallery__hero {
    height: 60vh;
    min-height: 400px;
    background: url('../../images/gallery_outside002.webp');
    background-color: #000F3C;
    /* Fallback color matching gradient */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    padding: 0 20px;
}

/* Gradient Overlay - Fixed to container */
.gallery__hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 15, 60, 0.7), rgba(0, 15, 60, 0.6));
    z-index: 1;
    pointer-events: none;
}

/* Ensure content sits above the overlay */
.gallery__hero .text {
    position: relative;
    z-index: 3;
}

.gallery__hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, rgba(255, 255, 255, 1), transparent);
    z-index: 2;
}

.gallery__hero h2 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.gallery__hero h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color1);
    margin: 20px auto 0;
    border-radius: 2px;
}

.gallery__hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 500;
    max-width: 600px;
    line-height: 1.6;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery__main {
    padding: 60px 4%;
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    /* Create a responsive grid with a minimum item width */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--gallery-gap);
    margin-top: -60px;
    /* Pull up into the hero fade */
    position: relative;
    z-index: 2;
}


/* Izmir Customizations for a Premium Look */
.c4-izmir {
    width: 100%;
    /* Let height be determined by aspect ratio or content, but fixed helps grid alignment */
    height: 320px;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 0;
    background-color: #f0f0f0;
    /* placeholder color */
    position: relative;
}

.c4-izmir:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.c4-izmir img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Subtle zoom on hover, handled by Izmir class but we can enhance */
.c4-izmir:hover img {
    transform: scale(1.05);
    /* Slightly smoother than default */
}


/* Caption Styling */
.c4-izmir figcaption {
    background: linear-gradient(to top, rgba(0, 23, 97, 0.95), rgba(0, 23, 97, 0.7));
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.c4-izmir:hover figcaption {
    opacity: 1;
}

.c4-izmir h4 {
    font-family: 'Montserrat', sans-serif;
    /* More professional than Comic Neue */
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color1);
    margin-bottom: 8px;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.c4-izmir p {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s;
    /* delay */
}

/* Animate text up on hover */
.c4-izmir:hover h4,
.c4-izmir:hover p {
    transform: translateY(0);
}

/* Ensure h4 and p stack vertically explicitly */
.c4-izmir figcaption div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.c4-izmir h4,
.c4-izmir p {
    display: block;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    .gallery__hero {
        height: 50vh;
        min-height: 300px;
    }

    .gallery__main {
        padding: 40px 20px;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        margin-top: -40px;
        gap: 16px;
    }

    .gallery__hero h2 {
        border-bottom: none;
        /* Remove border on mobile if it wraps awkwardly */
    }

    .c4-izmir {
        height: 280px;
    }
}