/* =========================================================
   ZENITH KARATE ACADEMY
   HOMEPAGE GALLERY VISUAL REDESIGN
   Visual-only enhancement layer
========================================================= */

.home-gallery {
    position: relative;
    isolation: isolate;
    padding-top: clamp(6rem, 10vw, 8.5rem);
    padding-bottom: clamp(6rem, 10vw, 8.5rem);
}

.home-gallery::after {
    content: "GALLERY";
    position: absolute;
    right: clamp(-6rem, -2vw, -1rem);
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: center;
    color: rgba(255, 255, 255, 0.025);
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(7rem, 15vw, 13rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    white-space: nowrap;
    pointer-events: none;
    z-index: -1;
}

.home-gallery-header {
    align-items: flex-end;
    justify-content: flex-end;
    gap: clamp(2rem, 6vw, 6rem);
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.home-gallery-heading {
    position: relative;
    gap: 0.65rem;
    text-align: right;
    align-items: flex-end;
}

.home-gallery-heading::after {
    content: "";
    width: clamp(4rem, 9vw, 7rem);
    height: 3px;
    margin-top: 0.4rem;
    background: linear-gradient(90deg, transparent, #fdb203, #e60f32);
}

.home-gallery-heading .eyebrow {
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.home-gallery-heading h2 {
    font-size: clamp(3.5rem, 7vw, 6.2rem);
    letter-spacing: 0.02em;
    line-height: 0.84;
}

.home-gallery-header p {
    width: min(100%, 27rem);
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.86rem;
    line-height: 1.8;
    text-align: right;
}

.home-gallery-grid {
    width: min(100%, 82rem);
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(13rem, 19rem));
    gap: 0.9rem;
}

.home-gallery-card {
    border-radius: 0;
    border-color: rgba(255,255,255,0.11);
    background: rgba(10,10,10,0.5);
    box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.22);
}

.home-gallery-card:first-child {
    grid-column: span 6;
    grid-row: 1 / 3;
}

.home-gallery-card:nth-child(2),
.home-gallery-card:nth-child(3),
.home-gallery-card:nth-child(4),
.home-gallery-card:nth-child(5) {
    grid-column: span 3;
}

.home-gallery-card:nth-child(3) {
    grid-column: span 6;
}

.home-gallery-card a::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(253,178,3,0);
    transition: border-color 260ms ease;
    z-index: 2;
    pointer-events: none;
}

.home-gallery-card a::after {
    background:
        linear-gradient(180deg, rgba(0,0,0,0.02) 30%, rgba(0,0,0,0.72) 100%),
        linear-gradient(90deg, rgba(230,15,50,0.1), transparent 55%);
}

.home-gallery-card:hover {
    border-color: rgba(253,178,3,0.38);
    box-shadow: 0 1.8rem 3.5rem rgba(0,0,0,0.4);
}

.home-gallery-card:hover a::before {
    border-color: rgba(253,178,3,0.28);
}

.home-gallery-card img {
    transition: transform 0.7s cubic-bezier(0.2,0.7,0.2,1), filter 0.4s ease;
    filter: saturate(0.92) contrast(1.03);
}

.home-gallery-card:hover img {
    transform: scale(1.07);
    filter: saturate(1.08) contrast(1.06);
}

.home-gallery-card-info {
    left: 1.15rem;
    right: 1.15rem;
    bottom: 1.05rem;
    gap: 0.35rem;
}

.home-gallery-card-category {
    width: fit-content;
    padding: 0.22rem 0.45rem;
    border-left: 2px solid #e60f32;
    background: rgba(8,8,8,0.6);
    color: #fdb203;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
}

.home-gallery-card-caption {
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.home-gallery-actions {
    justify-content: flex-end;
    width: min(100%, 82rem);
    margin: 0 auto;
}

.home-gallery-button {
    position: relative;
    min-width: 13rem;
    border: 1px solid rgba(253,178,3,0.75);
    background: transparent;
    color: #fdb203;
    overflow: hidden;
}

.home-gallery-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fdb203;
    transform: translateX(-101%);
    transition: transform 260ms ease;
    z-index: -1;
}

.home-gallery-button:hover::before {
    transform: translateX(0);
}

.home-gallery-button:hover {
    color: #080808;
    background: transparent;
}

@media (max-width: 850px) {
    .home-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(13rem, 18rem));
    }

    .home-gallery-header {
        align-items: flex-end;
    }

    .home-gallery-heading,
    .home-gallery-header p {
        text-align: right;
    }

    .home-gallery-card:first-child {
        grid-column: span 2;
        grid-row: span 1;
    }

    .home-gallery-card:nth-child(2),
    .home-gallery-card:nth-child(3),
    .home-gallery-card:nth-child(4),
    .home-gallery-card:nth-child(5) {
        grid-column: span 1;
    }

    .home-gallery-card:nth-child(3) {
        grid-column: span 1;
    }

    .home-gallery-actions {
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .home-gallery::after {
        right: -5.5rem;
        font-size: 7rem;
    }

    .home-gallery-header {
        align-items: flex-end;
        gap: 1.25rem;
    }

    .home-gallery-header p {
        max-width: 100%;
    }

    .home-gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, minmax(14rem, 18rem));
    }

    .home-gallery-card:first-child,
    .home-gallery-card:nth-child(2),
    .home-gallery-card:nth-child(3),
    .home-gallery-card:nth-child(4),
    .home-gallery-card:nth-child(5) {
        grid-column: auto;
        grid-row: auto;
    }

    .home-gallery-button {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-gallery-card img,
    .home-gallery-card,
    .home-gallery-card a::before,
    .home-gallery-button::before {
        transition: none !important;
    }
}
