/* =========================================================
   ZENITH KARATE ACADEMY
   HOMEPAGE GALLERY
========================================================= */

.home-gallery {
    position: relative;
    width: 100%;
    padding: 5.5rem clamp(1rem, 6vw, 5rem) 6.5rem;
    overflow: hidden;
}

.home-gallery::before {
    content: "";
    position: absolute;
    width: 28rem;
    height: 28rem;
    left: -18rem;
    top: 10rem;
    border-radius: 50%;
    background: rgba(230, 15, 50, 0.08);
    filter: blur(5rem);
    pointer-events: none;
}

.home-gallery-header {
    position: relative;
    z-index: 1;
    width: min(100%, 80rem);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 auto 2.5rem;
}

.home-gallery-heading {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.home-gallery-heading .eyebrow {
    color: #fdb203;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16rem;
}

.home-gallery-heading h2 {
    margin: 0;
    color: white;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0.08rem;
}

.home-gallery-heading h2 span {
    display: block;
}

.home-gallery-header p {
    width: min(100%, 31rem);
    margin: 0;
    color: #aaa;
    font-size: 0.92rem;
    line-height: 1.7;
}

.home-gallery-grid {
    position: relative;
    z-index: 1;
    width: min(100%, 80rem);
    margin: 0 auto 2.5rem;
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    grid-template-rows: repeat(2, minmax(12rem, 17rem));
    gap: 1rem;
}

.home-gallery-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.9rem;
    background: #111;
    opacity: 0;
    transform: translateY(1.5rem);
    animation: homeGalleryReveal 0.65s ease forwards;
}

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

.home-gallery-card:nth-child(2) { animation-delay: 0.08s; }
.home-gallery-card:nth-child(3) { animation-delay: 0.16s; }
.home-gallery-card:nth-child(4) { animation-delay: 0.24s; }
.home-gallery-card:nth-child(5) { animation-delay: 0.32s; }

@keyframes homeGalleryReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-gallery-card a,
.home-gallery-card img {
    width: 100%;
    height: 100%;
}

.home-gallery-card a {
    display: block;
    position: relative;
}

.home-gallery-card img {
    display: block;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.home-gallery-card a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 55%);
    pointer-events: none;
}

.home-gallery-card:hover img {
    transform: scale(1.055);
}

.home-gallery-card-info {
    position: absolute;
    z-index: 2;
    left: 1rem;
    right: 1rem;
    bottom: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    pointer-events: none;
}

.home-gallery-card-category {
    color: #fdb203;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.13rem;
    text-transform: uppercase;
}

.home-gallery-card-caption {
    overflow: hidden;
    color: white;
    font-size: 0.8rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-gallery-empty {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    min-height: 15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 0.9rem;
    color: #777;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12rem;
}

.home-gallery-actions {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.home-gallery-button {
    min-width: 12.5rem;
    min-height: 3.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.4rem;
    border: 2px solid #fdb203;
    background: rgba(253, 178, 3, 0.08);
    color: #fdb203;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1rem;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.home-gallery-button:hover {
    color: #080808;
    background: #fdb203;
    transform: translateY(-2px);
}

@media (max-width: 850px) {
    .home-gallery {
        padding: 4.5rem 1.5rem 5.5rem;
    }

    .home-gallery-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
    }

    .home-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(12rem, 18rem));
    }

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

@media (max-width: 560px) {
    .home-gallery {
        padding: 3.75rem 1rem 4.5rem;
    }

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

    .home-gallery-card:first-child {
        grid-row: auto;
    }

    .home-gallery-card-caption {
        font-size: 0.75rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .home-gallery-card:hover img,
    .home-gallery-button:hover {
        transform: none;
    }
}

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

    .home-gallery-card {
        opacity: 1;
        transform: none;
    }
}


/* =========================================================
   HOMEPAGE HERO VISUAL UPGRADE
========================================================= */

.home {
    isolation: isolate;
    background-position: center 42%;
    box-shadow: inset 0 -8rem 8rem -7rem rgba(8, 8, 8, 0.95);
}

.home::before {
    z-index: 0;
    background:
        linear-gradient(
            90deg,
            rgba(4, 4, 4, 0.9) 0%,
            rgba(4, 4, 4, 0.68) 38%,
            rgba(4, 4, 4, 0.28) 72%,
            rgba(4, 4, 4, 0.5) 100%
        ),
        linear-gradient(
            180deg,
            rgba(4, 4, 4, 0.42) 0%,
            rgba(4, 4, 4, 0) 34%,
            rgba(4, 4, 4, 0.45) 100%
        );
}

.home::after {
    content: "";
    position: absolute;
    inset: 1rem;
    border: 1px solid rgba(253, 178, 3, 0.16);
    pointer-events: none;
    z-index: 1;
}

.home > * {
    position: relative;
    z-index: 2;
}

.home .tertiaryText {
    position: relative;
    width: fit-content;
    margin-bottom: 1.25rem;
    padding: 0.25rem 0.95rem 0.25rem 0.8rem;
    border: 1px solid rgba(253, 178, 3, 0.46);
    border-left: 3px solid #fdb203;
    border-radius: 0.2rem;
    background: rgba(9, 9, 9, 0.72);
    box-shadow: 0 0 28px rgba(253, 178, 3, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.home .secondaryTitleText {
    position: relative;
    margin-bottom: 0.55rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(0.72rem, 1.35vw, 0.95rem);
    font-weight: 800;
    letter-spacing: 0.28rem;
    text-transform: uppercase;
}

.home .secondaryTitleText::before {
    content: "";
    display: inline-block;
    width: 2.75rem;
    height: 2px;
    margin: 0 0.7rem 0.2rem 0;
    background: #e60f32;
    box-shadow: 0 0 10px rgba(230, 15, 50, 0.45);
}

.home .primaryTitleText1 {
    font-size: clamp(3.6rem, 8.4vw, 7rem);
    letter-spacing: 0.05rem;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.42);
}

.home .primaryTitleText2 {
    position: relative;
    width: fit-content;
    margin-bottom: 1.15rem;
    font-size: clamp(5rem, 12vw, 10.5rem);
    letter-spacing: 0.02rem;
    line-height: 0.8;
    text-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
}

.home .primaryTitleText2::after {
    content: "";
    position: absolute;
    left: 0.15rem;
    right: 0;
    bottom: -0.7rem;
    height: 3px;
    background: linear-gradient(90deg, #e60f32, rgba(230, 15, 50, 0));
    box-shadow: 0 0 14px rgba(230, 15, 50, 0.32);
}

.home .descriptionText {
    max-width: 34rem;
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(0.92rem, 1.5vw, 1.08rem);
    letter-spacing: 0.035rem;
    line-height: 1.75;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}

.home .button-group {
    gap: 0.85rem;
    margin-top: 1.7rem;
}

.home .homeAboutButton,
.home .homeTimetableButton {
    min-height: 3.2rem;
    height: auto;
    padding: 0.85rem 1.2rem;
    border-radius: 0.18rem;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.095rem;
    text-transform: uppercase;
    transition:
        transform 0.25s ease,
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.home .homeAboutButton {
    width: min(17rem, 100%);
    background: linear-gradient(135deg, rgba(230, 22, 22, 0.88), rgba(163, 12, 38, 0.82));
    border: 1px solid rgba(255, 110, 120, 0.45);
    box-shadow: 0 12px 34px rgba(178, 11, 31, 0.2);
}

.home .homeTimetableButton {
    width: 11.5rem;
    background: rgba(10, 10, 10, 0.42);
    border: 1px solid rgba(253, 178, 3, 0.7);
    box-shadow: 0 12px 34px rgba(253, 178, 3, 0.08);
}

.home .homeAboutButton:hover,
.home .homeTimetableButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.home .homeAboutButton:hover {
    color: white;
    background: linear-gradient(135deg, #f03343, #bd1230);
    border-color: rgba(255, 150, 160, 0.7);
}

.home .homeTimetableButton:hover {
    color: #080808;
    background: #fdb203;
    border-color: #fdb203;
}

@media (max-width: 850px) {
    .home {
        background-position: 58% center;
        padding-top: clamp(7rem, 17vh, 9rem);
        padding-bottom: 4rem;
    }

    .home::after {
        inset: 0.75rem;
    }

    .home::before {
        z-index: 0;
        background:
            linear-gradient(
                180deg,
                rgba(4, 4, 4, 0.5) 0%,
                rgba(4, 4, 4, 0.68) 42%,
                rgba(4, 4, 4, 0.82) 100%
            ),
            linear-gradient(
                90deg,
                rgba(4, 4, 4, 0.75) 0%,
                rgba(4, 4, 4, 0.34) 100%
            );
    }

    .home .secondaryTitleText {
        letter-spacing: 0.18rem;
    }

    .home .primaryTitleText1 {
        font-size: clamp(3.2rem, 12vw, 5.5rem);
    }

    .home .primaryTitleText2 {
        font-size: clamp(4.7rem, 17vw, 8rem);
    }

    .home .descriptionText {
        max-width: 30rem;
    }
}

@media (max-width: 560px) {
    .home {
        min-height: 100svh;
        justify-content: center;
        padding: 7.5rem 1.15rem 3.25rem;
        background-position: 63% center;
    }

    .home::after {
        inset: 0.55rem;
        border-color: rgba(253, 178, 3, 0.11);
    }

    .home .tertiaryText {
        margin-bottom: 1rem;
        padding-inline: 0.7rem;
        font-size: 0.57rem;
        letter-spacing: 0.13rem;
        line-height: 1.9rem;
    }

    .home .secondaryTitleText {
        font-size: 0.63rem;
        letter-spacing: 0.13rem;
        line-height: 1.5;
    }

    .home .secondaryTitleText::before {
        width: 1.5rem;
        margin-right: 0.45rem;
    }

    .home .primaryTitleText1 {
        font-size: clamp(2.85rem, 13.5vw, 4.3rem);
    }

    .home .primaryTitleText2 {
        margin-bottom: 1rem;
        font-size: clamp(4.45rem, 20vw, 6.3rem);
    }

    .home .primaryTitleText2::after {
        bottom: -0.5rem;
    }

    .home .descriptionText {
        max-width: 22rem;
        margin-top: 0.2rem;
        font-size: 0.85rem;
        line-height: 1.65;
    }

    .home .button-group {
        width: 100%;
        flex-direction: column;
        gap: 0.7rem;
        margin-top: 1.35rem;
    }

    .home .homeAboutButton,
    .home .homeTimetableButton {
        width: min(100%, 20rem);
        min-height: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home .homeAboutButton,
    .home .homeTimetableButton {
        transition: none;
    }

    .home .homeAboutButton:hover,
    .home .homeTimetableButton:hover {
        transform: none;
    }
}
