/*
 * Maliyo Games standalone page styles.
 * Everything is scoped beneath .maliyo-games-page to avoid clashing with WordPress.
 */

:root {
    --mg-red: #ef312f;
    --mg-red-dark: #ca211f;
    --mg-black: #111111;
    --mg-text: #242424;
    --mg-muted: #6b6b6b;
    --mg-soft: #f6f6f3;
    --mg-white: #ffffff;
    --mg-line: #e9e9e5;
    --mg-radius: 30px;
    /* Rounded humanist sans matching the live maliyo.com/games treatment. */
    --mg-game-font: "Nunito", "Nunito Sans", "Poppins", Arial, sans-serif;
}

.maliyo-games-page,
.maliyo-games-page * {
    box-sizing: border-box;
}

/* 100vw counts the scrollbar width, which can add a stray horizontal
   scrollbar on Windows. Only applies on pages containing this section.
   Remove if the parent theme relies on a sticky/position:fixed header.
   The margin reset kills the browser default 8px body margin, which
   otherwise shows as a white band above the full-bleed hero when this
   file is previewed standalone (no theme stylesheet). */
html:has(.maliyo-games-page) body {
    margin: 0;
    overflow-x: hidden;
}

.maliyo-games-page {
    width: 100%;
    margin: 0;
    /* Must stay visible so the hero can break out to full viewport width.
       Nothing here overflows horizontally on its own. */
    overflow: visible;
    background: var(--mg-white);
    color: var(--mg-text);
    font-family: "Poppins", Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.maliyo-games-page img {
    display: block;
    max-width: 100%;
}

.maliyo-games-page a {
    color: inherit;
    text-decoration: none;
}

.mg-container {
    width: min(1180px, calc(100% - 64px));
    margin-inline: auto;
}

/* Hero: illustrated background with copy anchored in the clear left area.
   Breaks out of any parent container so the artwork runs edge to edge. */
.mg-intro {
    position: relative;
    display: flex;
    align-items: center;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: clamp(420px, 46vw, 620px);
    padding: 92px 0 82px;
    overflow: hidden;
    background-color: #2f5a1b;
    background-image: url("images/section-bg.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.mg-intro .mg-container {
    position: relative;
    z-index: 1;
}

.mg-intro h1 {
    width: min(15ch, 100%);
    margin: 0;
    color: #f0dcd6;
    font-family: var(--mg-game-font);
    font-size: clamp(40px, 5.2vw, 74px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.015em;
    text-wrap: balance;
}

.mg-intro-copy {
    width: min(620px, 100%);
    margin: 26px 0 0;
    color: rgba(255,255,255,.88);
    font-family: var(--mg-game-font);
    font-size: clamp(17px, 1.45vw, 21px);
    font-weight: 400;
    line-height: 1.68;
}

/* Dark catalogue: full-bleed black backdrop behind every game row. */
.mg-catalogue {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 40px 0 110px;
    background: #000;
    color: #ffffff;
}

/* Large image + editorial copy presentation, alternating exactly on each row. */
.mg-game {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
    align-items: center;
    gap: clamp(48px, 7vw, 104px);
    padding: 82px 0;
    border-top: 1px solid rgba(255,255,255,.09);
}

.mg-game:first-child {
    border-top: 0;
}

.mg-game--reverse .mg-game-media {
    order: 2;
}

.mg-game--reverse .mg-game-copy {
    order: 1;
}

.mg-game-media {
    position: relative;
}

.mg-game-media > a {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: var(--mg-radius);
    background: #141414;
}

.mg-game-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.2,.72,.2,1), filter .35s ease;
}

.mg-game-media > a::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: inherit;
}

.mg-game-media:hover img {
    transform: scale(1.025);
}

.mg-game-copy h2 {
    margin: 0;
    color: #f0dcd6;
    font-family: var(--mg-game-font);
    font-size: clamp(39px, 4.7vw, 68px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -.015em;
    text-transform: none;
}

.mg-description {
    margin: 25px 0 28px;
    color: rgba(255,255,255,.88);
    font-family: var(--mg-game-font);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.68;
}

.mg-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.mg-store-link {
    display: inline-flex;
    transition: opacity .2s ease, transform .2s ease;
}

.mg-store-link img {
    width: auto;
    height: 47px;
    object-fit: contain;
}

.mg-store-link:hover {
    opacity: .88;
    transform: translateY(-2px);
}

/* Scoped with the page class so it beats `.maliyo-games-page a { color: inherit }`. */
.maliyo-games-page a.mg-view-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-top: 27px;
    padding: 0;
    border: 0;
    color: #e8a13c;
    font-size: 19px;
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: color .2s ease, gap .2s ease;
}

.maliyo-games-page a.mg-view-link span {
    font-size: 1.05em;
    line-height: 1;
}

.maliyo-games-page a.mg-view-link:hover {
    color: #ffbe6b;
    gap: 17px;
}

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .65s ease, transform .65s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 980px) {
    .mg-container {
        width: min(860px, calc(100% - 44px));
    }

    .mg-intro {
        min-height: clamp(360px, 52vw, 460px);
        padding: 72px 0 62px;
        background-position: center center;
    }

    .mg-game,
    .mg-game--reverse {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 62px 0;
    }

    .mg-game--reverse .mg-game-media,
    .mg-game--reverse .mg-game-copy {
        order: initial;
    }

    .mg-game-media > a {
        border-radius: 24px;
    }

    .mg-game-copy {
        max-width: 680px;
    }
}

@media (max-width: 600px) {
    .mg-container {
        width: calc(100% - 30px);
    }

    .mg-intro {
        min-height: 340px;
        padding: 56px 0 48px;
        background-position: center center;
    }

    .mg-intro h1 {
        width: 100%;
        font-size: clamp(30px, 8.6vw, 40px);
        line-height: 1.12;
        letter-spacing: -.025em;
    }

    .mg-intro-copy {
        margin-top: 22px;
        font-size: 15px;
        line-height: 1.7;
    }

    .mg-catalogue {
        padding: 20px 0 70px;
    }

    .mg-game,
    .mg-game--reverse {
        gap: 27px;
        padding: 46px 0;
    }

    .mg-game-media > a {
        border-radius: 19px;
    }

    .mg-game-copy h2 {
        font-size: clamp(34px, 12vw, 50px);
    }

    .mg-description {
        margin: 18px 0 22px;
        font-size: 14px;
        line-height: 1.72;
    }

    .mg-store-link img {
        height: 40px;
    }

    .maliyo-games-page a.mg-view-link {
        margin-top: 22px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .mg-game-media img,
    .mg-store-link,
    .mg-view-link {
        transition: none;
    }
}
