.gallery-section {
    min-height: auto;

    padding: 20px 8%;
    width: 100%;
    color: var(--light-text);
    background: var(--alt-bg);

    text-align: center;
}

.gallery-section h2 {
    font-size: var(--section-header-size);
    font-weight: 300;

    margin-bottom: 15px;
    color: var(--light-text);
}

.gallery-section h2 span {
    color: var(--dark-accent-text);
}

.gallery-section p {
    max-width: 700px;
    margin: auto;

    font-size: var(--section-par-size);
    line-height: 1.8;
}

.gallery {
    position: relative;

    width: 80%;
    max-width: 1200px;

    margin: 0 auto;

    overflow: hidden;

    border-radius: 20px;

    user-select: none;

    touch-action: pan-y;
}

.gallery-image {
    width: 100%;

    height: min(70vh, 700px);

    object-fit: cover;

    display: block;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

    opacity: 1;
}

.gallery-image.changing {
    opacity: 0;
    transform: scale(1.02);
}

.gallery::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 35%;

    background:
        linear-gradient(to top,
            rgba(0, 0, 0, 0.65),
            transparent);

    pointer-events: none;
}

.arrowGal {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    width: 64px;
    height: 64px;

    border: none;

    border-radius: 50%;

    background: rgba(20, 20, 20, 0.75);

    color: var(--light-text);

    font-size: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 5;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.arrowGal:hover {
    background: rgba(20, 20, 20, 0.95);

    transform:
        translateY(-50%) scale(1.08);
}

.arrowGal:active {
    transform:
        translateY(-50%) scale(0.95);
}

.arrowGal-left {
    left: 25px;
}

.arrowGal-right {
    right: 25px;
}

.before-after-button {
    position: absolute;

    bottom: 25px;

    left: 50%;

    transform: translateX(-50%);

    z-index: 10;

    border: none;

    border-radius: 10px;

    padding: 16px 28px;

    background: var(--main-button);

    color: var(--dark-text);

    font-size: var(--button-text-size);

    font-weight: 700;

    letter-spacing: 0.5px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.before-after-button:hover {
    background: var(--main-hover);

    transform:
        translateX(-50%) scale(1.05);
}

.before-after-button:active {
    transform:
        translateX(-50%) scale(0.96);
}

.project-info {
    position: relative;
    padding-top: 15px;

    z-index: 10;

    pointer-events: none;
}

.project-title {
    font-size: var(--card-header-size);

    font-weight: 700;

    margin-bottom: 5px;
}

.project-description {
    font-size: var(--card-par-size);

    opacity: 0.85;
}

.image-counter {
    position: absolute;

    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    z-index: 10;

    padding: 8px 14px;

    border-radius: 20px;

    background: rgba(0, 0, 0, 0.65);
    color: var(--light-text);

    font-size: 14px;

    backdrop-filter: blur(5px);
}

.dots {
    display: flex;

    justify-content: center;

    gap: 8px;

    margin-top: 18px;
}

.dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    border: none;

    background: #666;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.dot.active {
    background: rgb(0, 0, 0);
    transform: scale(1.4);
}

@media (max-width: 768px) {
    .gallery {
        border-radius: 14px;
        width: 90%;
    }

    .gallery-image {
        height: 65vh;
        min-height: 420px;
    }

    .image-counter {
    top: 10px;

    padding: 4px 7px;

    font-size: 12px;
}

    .arrowGal {
        width: 46px;
        height: 46px;
        font-size: 30px;
    }

    .arrowGal-left {
        left: 12px;
    }

    .arrowGal-right {
        right: 12px;
    }

    .before-after-button {
        bottom: 18px;
        padding: 13px 20px;
    }
}

@media (max-width: 400px) {
    .gallery-image {
        height: 60vh;
    }

    .gallery {
        width: 100%;
    }

    .arrowGal {
        width: 35px;
        height: 35px;
        font-size: 25px;
    }

    .arrowGal-left {
        left: 9px;
    }

    .arrowGal-right {
        right: 9px;
    }
}