/* =========================================
   MAIN SECTION
========================================= */

.split-gallery {
    width: 100%;
    height: 80vh;
    min-height: 600px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    overflow: hidden;
}


/* =========================================
   CARD
========================================= */

.gallery-card {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    cursor: pointer;

    background: #111;
}


/* =========================================
   MAIN IMAGE
========================================= */

.card-main-image {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;
}

.card-main-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition:
        transform 0.8s cubic-bezier(.22,.61,.36,1),
        filter 0.6s ease;

opacity: 0.5;
}


/* =========================================
   HEADER
========================================= */

.card-title {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 5;

    padding: 40px;

    color: white;

    transition:
        opacity 0.4s ease,
        transform 0.5s ease;
}

.card-title h2 {
    margin: 0;

    font-size: clamp(28px, 4vw, 64px);

    font-weight: 700;

    letter-spacing: -0.03em;

    color: var(--color-primary);
}


/* =========================================
   OVERLAY
========================================= */

.card-overlay {
    position: absolute;

    inset: 0;

    z-index: 10;

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.6s ease,
        visibility 0.6s ease;
}


/* =========================================
   IMAGE GRID
========================================= */

.image-grid {
    position: absolute;

    inset: 0;

    display: grid;

    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}


/* =========================================
   GRID IMAGE
========================================= */

.grid-image {
    position: relative;

    overflow: hidden;

    background: #222;
}

.grid-image::after {
    content: "";

    position: absolute;

    inset: 0;

    background: rgba(0, 0, 0, 0.38);

    transition: background 0.4s ease;
}

.grid-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transform: scale(1.08);

    transition:
        transform 1s cubic-bezier(.22,.61,.36,1);
}


/* =========================================
   TEXT OVER GRID
========================================= */

.grid-text {
    position: absolute;

    z-index: 20;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    width: 75%;

    text-align: center;

    color: white;

    opacity: 0;

    transition:
        opacity 0.7s ease 0.15s,
        transform 0.7s ease 0.15s;
}

.grid-text h3 {
    margin: 0 0 20px;

    font-size: clamp(28px, 4vw, 60px);

    line-height: 1;

    letter-spacing: -0.04em;
}

.grid-text p {
    margin: 0 auto 25px;

    max-width: 600px;

    font-size: clamp(15px, 1.3vw, 20px);

    line-height: 1.5;
}

.grid-link {
    display: inline-block;

    color: white;

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

    letter-spacing: 0.08em;

    border-bottom: 1px solid white;

    padding-bottom: 5px;

    transition: opacity 0.3s ease;
}

.grid-link:hover {
    opacity: 0.6;
}


/* =========================================
   HOVER
========================================= */

.gallery-card:hover .card-overlay {
    opacity: 1;

    visibility: visible;
}

.gallery-card:hover .card-title {
    opacity: 0;

    transform: translateY(20px);
}

.gallery-card:hover .card-main-image img {
    transform: scale(1.08);

    filter: brightness(0.3);
}

.gallery-card:hover .grid-image img {
    transform: scale(1);
}

.gallery-card:hover .grid-text {
    opacity: 1;

    transform: translate(-50%, -50%);
}


/* =========================================
   GRID STAGGER ANIMATION
========================================= */

.grid-image:nth-child(1) img {
    transition-delay: 0.05s;
}

.grid-image:nth-child(2) img {
    transition-delay: 0.1s;
}

.grid-image:nth-child(3) img {
    transition-delay: 0.15s;
}

.grid-image:nth-child(4) img {
    transition-delay: 0.2s;
}

.grid-image:nth-child(5) img {
    transition-delay: 0.25s;
}

.grid-image:nth-child(6) img {
    transition-delay: 0.3s;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 900px) {

    .split-gallery {
        height: 70vh;
        min-height: 500px;
    }

    .card-title {
        padding: 25px;
    }

    .grid-text {
        width: 85%;
    }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    .split-gallery {
        height: auto;
        min-height: 0;

        grid-template-columns: 1fr;

        gap: 8px;
    }

    .gallery-card {
        height: 70vh;
        min-height: 450px;
    }

    /*
       Auf Mobile wird das Grid etwas
       anders angeordnet.
    */

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }

    .card-title {
        padding: 25px;
    }

    .card-title h2 {
        font-size: 34px;
    }

    .grid-text {
        width: 82%;
    }

    .grid-text h3 {
        font-size: 34px;

        margin-bottom: 15px;
    }

    .grid-text p {
        font-size: 15px;

        line-height: 1.4;
    }

}


/* =========================================
   SMALL MOBILE
========================================= */

@media (max-width: 480px) {

    .gallery-card {
        height: 80vh;

        min-height: 420px;
    }

    .grid-text {
        width: 85%;
    }

    .grid-text h3 {
        font-size: 28px;
    }

    .grid-text p {
        font-size: 14px;
    }

}