/* ==========================================================================
   Competitions directory — /competitions/ (page-competitions.php), .ct-page
   Design: Figma wS7uze7Ep3azyudK6Bhhmg, frames 32:10126 (1440), 32:20451
   (834), 32:30603 (390). Loaded only on that page (inc/competitions.php),
   after site-chrome.css.

   Breakpoints: >= 1200 desktop, 576–1199 tablet, <= 575 mobile. The DOM is
   in RTL reading order: the first child of a row sits on the right.
   ========================================================================== */

/* Dana on every node of the screen (CLAUDE.md rule). */
.ct-page,
.ct-page
    *:not(i):not(svg):not(use):not(.fa):not(.fas):not(.far):not(.fab):not(
        .fal
    ):not(.fad):not([class*="fa-"]):not([class^="icon-"]):not(
        [class*=" icon-"]
    ):not(.dashicons):not([class^="dashicons-"]):not(.genericon):not(
        .df-icon-custom
    ) {
    font-family: "dana", Tahoma, sans-serif !important;
}

.ct-page {
    display: block;
    margin: 0;
    padding: 0 0 108px;
    background: #070b09;
    color: #fff;
    direction: rtl;
    text-align: start;
    font-feature-settings: "ss02";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    line-height: 1.5;
}

body.ct-screen { background-color: #070b09; }

.ct-page * {
    box-sizing: border-box;
    letter-spacing: 0;
    text-transform: none;
}

.ct-page h1,
.ct-page h2,
.ct-page h3,
.ct-page p,
.ct-page ul {
    margin: 0;
    padding: 0;
}

.ct-page ul { list-style: none; }
.ct-page li { margin: 0; padding: 0; }
.ct-page img { display: block; }
.ct-page a { color: inherit; text-decoration: none; }
.ct-page a:focus-visible,
.ct-page button:focus-visible { outline: 2px solid #97d815; outline-offset: 2px; }

.ct-page [hidden] { display: none !important; }

/* Words only the tablet and mobile frames have («همه لیگ ها», «لیگ انگلیس»). */
.ct-compact { display: none; }

.ct-wrap {
    width: min(1320px, 100% - 120px);
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.ct-hero {
    position: relative;
    display: flex;
    align-items: center;
    height: min(46.32vw, 667px);
    overflow: hidden;
}

/* images/competitions/hero.webp (the owner's banner) has the gradient baked in: no overlay here. */
.ct-page .ct-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

.ct-hero__inner {
    position: relative;
    z-index: 1;
    padding-inline-start: 61.52px;
}

.ct-page .ct-hero__title {
    color: #f4f5f5;
    font-size: 60px;
    font-weight: 900;
    line-height: 72px;
    letter-spacing: -1.2px;
}

.ct-page .ct-hero__sub {
    margin-top: 8px;
    color: #f4f5f5;
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
}

/* --------------------------------------------------------------------------
   Section headings
   -------------------------------------------------------------------------- */
.ct-page .ct-title {
    color: #f1f4ef;
    font-size: 24px;
    font-weight: 700;
    line-height: 32px;
}

/*
 * Dana's web font sits lower in its line box than the frames' DanaFaNum, by
 * more the larger the type. Below 20px it stays within a pixel.
 */
.ct-hero__title,
.ct-hero__sub,
.ct-title,
.ct-group__title { position: relative; }

.ct-hero__title { top: -5px; }
.ct-hero__sub { top: -3px; }
.ct-title,
.ct-group__title { top: -2px; }

/* --------------------------------------------------------------------------
   Popular competitions
   -------------------------------------------------------------------------- */
.ct-popular { padding: 24px 0 56px; }

.ct-page .ct-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.ct-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 8px 0 12px;
    overflow: hidden;
    border-radius: 12px;
    background: #111613;
}

.ct-card__art {
    position: relative;
    display: block;
    flex: none;
    width: 93.548%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #0e0e0e;
}

/* Two green glows, cut off by the square. Offsets are the frame's. */
.ct-card__art::before {
    content: "";
    position: absolute;
    top: -62.98%;
    right: -55.59%;
    bottom: -60.43%;
    left: -48.41%;
    background: url("../images/competitions/card-glow.svg") center / 100% 100% no-repeat;
    opacity: .3;
}

.ct-page .ct-card__logo {
    position: absolute;
    top: calc(50% + .4px);
    left: calc(50% + .4px);
    width: 53.879%;
    max-width: none;
    height: auto;
    transform: translate(-50%, -50%);
}

.ct-card__name {
    align-self: stretch;
    padding-inline: 8px;
    color: #f0f3f5;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Country tabs
   -------------------------------------------------------------------------- */
.ct-filters { padding: 24px 0; }

.ct-tabs {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    border-radius: 24px;
    background: #111613;
}

.ct-page .ct-tab {
    height: 48px;
    margin: 0;
    padding: 0 4px;
    border: 0;
    border-radius: 12px;
    background: #111a14;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, .2), inset 0 1px 1px 0 rgba(255, 255, 255, .04);
    color: #f0f3f4;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    white-space: nowrap;
    appearance: none;
}

.ct-page .ct-tab.is-on {
    background: linear-gradient(180deg, #79ad11 0%, #3a9b0f 100%);
    box-shadow: inset 0 1.033px 1.033px 0 rgba(255, 255, 255, .35), inset 0 3.1px 4.134px 0 rgba(223, 229, 255, .3);
    color: #fff;
    font-weight: 700;
}

@media (scripting: none) {
    .ct-tabs { display: none; }
}

/* --------------------------------------------------------------------------
   Groups and rows
   -------------------------------------------------------------------------- */
.ct-groups {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.ct-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    border-radius: 20px;
    background: #111613;
}

.ct-page .ct-group__title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
}

.ct-page .ct-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ct-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 8px;
    border-radius: 13.983px;
    background: rgba(255, 255, 255, .02);
    transition: filter .15s;
}

/* Row logos are exported on the row's colour, so the whole row brightens. */
a.ct-row:hover { filter: brightness(1.2); }

.ct-page .ct-row__logo {
    flex: none;
    width: 48px;
    height: 48px;
}

.ct-row__name {
    flex: 1 1 0;
    min-width: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.ct-row__arrow {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

/* The drawn icon points down; rotated it points forward in RTL. */
.ct-row__arrow img { transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   Tablet and mobile
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .ct-page { padding-bottom: 64px; }
    .ct-compact { display: inline; }
    .ct-wrap { width: calc(100% - 64px); }

    .ct-hero {
        align-items: flex-start;
        height: 500px;
    }

    .ct-page .ct-hero__img {
        inset: 0 auto auto -4.66%;
        width: 129.43%;
    }

    .ct-hero__inner {
        padding-inline-start: 0;
        padding-top: 231px;
    }

    .ct-hero__title { top: -3px; }
    .ct-hero__sub { top: -1px; }

    .ct-page .ct-hero__title {
        font-size: 48px;
        line-height: 60px;
        letter-spacing: 0;
    }

    .ct-page .ct-hero__sub {
        font-size: 20px;
        line-height: 30px;
    }

    .ct-popular { padding-bottom: 32px; }

    .ct-page .ct-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .ct-card { gap: 12px; }
    .ct-card__art { width: calc(100% - 16px); }

    .ct-page .ct-card__logo {
        top: calc(50% + .5px);
        left: calc(50% + .5px);
        width: 48.387%;
    }

    /* The tablet frame draws this one larger. */
    .ct-page .ct-card-item--bundesliga .ct-card__logo { width: 53.879%; }

    .ct-card__name {
        font-size: 16px;
        line-height: 24px;
    }

    .ct-tabs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        margin-top: 20px;
        padding: 12px;
    }

    .ct-page .ct-tab { height: 44px; }
    .ct-groups { margin-top: 0; }
}

@media (max-width: 575px) {
    .ct-page { padding-bottom: 40px; }
    .ct-wrap { width: calc(100% - 32px); }

    .ct-hero { height: 460px; }

    .ct-page .ct-hero__img {
        inset: 4.05% auto auto -63.72%;
        width: 254.64%;
    }

    /* The image runs 19px past the hero here, so its baked fade would stop short of the page colour. */
    .ct-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(7, 11, 9, 0) 85%, #070b09 100%);
        pointer-events: none;
    }

    .ct-hero__inner {
        padding-top: 226px;
        text-align: center;
    }

    .ct-hero__title { top: -1px; }
    .ct-hero__sub { top: 0; }
    .ct-title { top: -1px; }

    .ct-page .ct-hero__title {
        font-size: 30px;
        font-weight: 700;
        line-height: 38px;
    }

    .ct-page .ct-hero__sub {
        font-size: 16px;
        line-height: 24px;
    }

    .ct-page .ct-title {
        font-size: 20px;
        line-height: 30px;
    }

    .ct-page .ct-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .ct-card__art { border-radius: 5.414px; }

    .ct-page .ct-card__logo,
    .ct-page .ct-card-item--bundesliga .ct-card__logo { width: 57.325%; }

    .ct-card__name {
        font-size: 14px;
        line-height: 20px;
    }

    /* The mobile frame swaps these two. */
    .ct-card-item--ucl { order: 1; }
    .ct-card-item--epl { order: 2; }
    .ct-card-item--serie-a { order: 3; }
    .ct-card-item--laliga { order: 4; }
    .ct-card-item--bundesliga { order: 5; }
    .ct-card-item--ligue-1 { order: 6; }

    .ct-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 8px;
    }

    .ct-page .ct-tab {
        font-size: 14px;
        line-height: 20px;
    }

    .ct-group {
        gap: 16px;
        padding: 12px;
    }

    .ct-page .ct-group__title {
        font-size: 18px;
        line-height: 30px;
    }

    .ct-page .ct-rows {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
}
