/*
 * Home page: the hero (centre-mode carousel), the news block and the rankings preview. Loaded by Pages/Index.cshtml
 * through the layout's Head section; it builds on the components of site.css. The carousel's behaviour is in
 * site.js (positions are classes: .is-active, .is-prev, .is-next, .is-far-prev, .is-far-next).
 * No inline styles anywhere: the CSP forbids them.
 */

/* ---- hero --------------------------------------------------------------------------------------------------------- */

.hero {
    background: var(--c-bg);
}

.hero__stage {
    position: relative;
    overflow: hidden;
    background: var(--c-bar);
}

/* The stage is as tall as the centre slide: 64% of the width at the 1010:435 banner ratio. */
.hero__stage::before {
    content: "";
    display: block;
    padding-top: calc(64% * 435 / 1010);
}

.hero__track {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
}

.hero__slide {
    position: absolute;
    top: 0;
    left: 18%;
    width: 64%;
    height: 100%;
    overflow: hidden;
    background: #26292f;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.hero__slide.is-active {
    z-index: 2;
    opacity: 1;
    visibility: visible;
}

.hero__slide.is-prev,
.hero__slide.is-next {
    opacity: 1;
    visibility: visible;
}

.hero__slide.is-prev { transform: translateX(-100%); }
.hero__slide.is-next { transform: translateX(100%); }
.hero__slide.is-far-prev { transform: translateX(-200%); }
.hero__slide.is-far-next { transform: translateX(200%); }

.hero__slide.is-repositioning {
    transition: none;
}

.hero__link {
    position: absolute;
    inset: 0;
    display: block;
    color: #fff;
}

.hero__link:hover {
    color: #fff;
}

.hero__img,
.hero__blur {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__img {
    z-index: 0;
}

/*
 * The key visual's right ~30% fades to white (login-panel space): the art is scaled 1.25x from its top-left corner so
 * the five faces fill the slide and the fade is out of frame, in the sharp slide and in its blurred side copy.
 */
.hero__img--key,
.hero__slide--key .hero__blur {
    object-position: 0 0;
    transform: scale(1.25);
    transform-origin: 0 0;
}

/* A neighbouring slide shows a blurred, veiled copy of its art; the centre slide fades both out. */
.hero__blur {
    inset: -24px;
    z-index: 2;
    width: calc(100% + 48px);
    height: calc(100% + 48px);
    filter: blur(12px) brightness(0.75) saturate(0.95);
    transition: opacity 0.3s;
}

.hero__veil {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(0, 0, 0, 0.45);
    transition: opacity 0.3s;
}

.hero__slide.is-active .hero__blur,
.hero__slide.is-active .hero__veil {
    opacity: 0;
    pointer-events: none;
}

.hero__slide--notice { background: linear-gradient(120deg, #2b1118 0%, #7a3a4b 60%, #ff81a0 190%); }
.hero__slide--event { background: linear-gradient(120deg, #0f2529 0%, #2c6671 60%, #59b7c8 190%); }
.hero__slide--update { background: linear-gradient(120deg, #1a1430 0%, #4a3b80 60%, #7560bc 190%); }
.hero__slide--maintenance { background: linear-gradient(120deg, #0c1c30 0%, #1d4f84 60%, #2e8dde 190%); }

.hero__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.5) 45%, rgba(0, 0, 0, 0.05) 100%);
}

.hero__figure {
    position: absolute;
    right: 3%;
    bottom: 0;
    z-index: 1;
    width: auto;
    height: 100%;
    max-width: 52%;
    object-fit: contain;
    object-position: bottom right;
}

.hero__caption {
    position: absolute;
    top: 50%;
    left: 5%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 52%;
    transform: translateY(-50%);
}

.hero__title {
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: clamp(20px, 2.4vw, 40px);
    font-weight: 900;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.hero__summary {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(12px, 1.1vw, 16px);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* A lone slide has no neighbours to show at the sides: its blurred copy fills the stage instead. */
.hero__backdrop {
    object-position: 0 0;
    transform: scale(1.25);
    transform-origin: 0 0;
    position: absolute;
    inset: -24px;
    width: calc(100% + 48px);
    height: calc(100% + 48px);
    object-fit: cover;
    filter: blur(12px) brightness(0.75) saturate(0.95);
}

.hero--single .hero__stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.hero--single .hero__slide {
    z-index: 2;
}

.hero__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3.5rem;
    height: 43px;
    padding: 0.35rem 0;
    background: var(--c-bg);
}

.hero__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d3d6db;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}

.hero__arrow::before {
    content: "";
    width: 16px;
    height: 16px;
    background: var(--c-accent);
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}

.hero__arrow--prev::before {
    -webkit-mask-image: url("../img/ui/chevron-left.svg");
    mask-image: url("../img/ui/chevron-left.svg");
}

.hero__arrow--next::before {
    -webkit-mask-image: url("../img/ui/chevron-right.svg");
    mask-image: url("../img/ui/chevron-right.svg");
}

.hero__arrow--prev:hover { transform: translateX(-2px); }
.hero__arrow--next:hover { transform: translateX(2px); }

.hero__dots {
    display: flex;
    gap: 10px;
}

.hero__dots li {
    width: 20px;
    height: 20px;
}

.hero__dot {
    display: block;
    width: 14px;
    height: 14px;
    margin: 3px;
    padding: 0;
    border: 0;
    background: #c9cdd4;
    transform: rotate(45deg);
    cursor: pointer;
    transition: background-color 0.2s;
}

.hero__dot:hover {
    background: #b3b8c1;
}

.hero__dot[aria-current="true"] {
    background: var(--c-accent);
}

/* Without JS the controls do nothing. */
html:not(.js) .hero__controls {
    display: none;
}

@media (max-width: 767.98px) {
    .hero__stage::before {
        padding-top: calc(100% * 435 / 1010);
    }

    .hero__slide {
        left: 0;
        width: 100%;
    }

    .hero__caption {
        left: 4%;
        gap: 6px;
        width: 62%;
    }

    .hero__title {
        font-size: 18px;
        -webkit-line-clamp: 2;
    }

    .hero__summary {
        display: none;
    }

    .hero__controls {
        gap: 2rem;
    }
}

/* ---- news block --------------------------------------------------------------------------------------------------- */

.home-news .tabs {
    margin-bottom: 15px;
}

.news-empty {
    padding: 36px 0;
    color: var(--c-muted);
    text-align: center;
}

/* ---- rankings preview (RankingTop view component): two boards on the white page ------------------------------ */

.home-news {
    padding-bottom: 60px;
}

.home-rank {
    padding-top: 0;
}

.ranking-top__boards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    align-items: start;
}

.board__head {
    display: flex;
    align-items: baseline;
    gap: 6px 14px;
    padding: 12px 18px;
    background: var(--c-bar);
    color: #fff;
}

.board__title {
    flex: 0 0 auto;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}

.board__sub {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board__more {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--c-accent);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.board__more:hover {
    color: #fff;
}

.board__empty {
    padding: 16px 18px;
    border-bottom: 1px solid var(--c-rule);
    color: var(--c-muted);
    font-size: 14px;
}

.rank-rows__item {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 64px;
    padding: 0 18px;
    border-bottom: 1px solid var(--c-rule);
}

.rank-rows__rank {
    flex: 0 0 36px;
    color: var(--c-muted);
    font-size: 16px;
    font-weight: 900;
    text-align: center;
}

.rank-rows__rank img {
    display: block;
    width: 36px;
    height: auto;
}

.rank-rows__bust {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    object-fit: cover;
    object-position: 25% 30%;
}

.rank-rows__bust--empty {
    background: #ececec;
}

.rank-rows__who {
    flex: 1 1 0;
    min-width: 0;
}

.rank-rows__name {
    display: block;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The class line is shown on the lead row only: name, class, then the account link. */
.rank-rows__class {
    display: block;
    color: var(--c-muted);
    font-size: 14px;
}

/* The account nickname (the account code without one) under the character name: the profile link when it has a code. */
.rank-rows__account {
    display: block;
    overflow: hidden;
    color: var(--c-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.rank-rows__account {
    color: var(--c-link);
}

a.rank-rows__account:hover {
    text-decoration: underline;
}

.rank-rows__value {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 700;
}

/* Rank 1 is the feature row: a large head-and-shoulders portrait, the medal and the number. */
.rank-rows__item--lead {
    height: 132px;
    gap: 18px;
}

.rank-rows__item--lead .rank-rows__rank {
    flex-basis: 52px;
}

.rank-rows__item--lead .rank-rows__rank img {
    width: 52px;
}

.rank-rows__item--lead .rank-rows__bust {
    flex-basis: 120px;
    width: 120px;
    height: 120px;
    /* Bottom-aligned but lifted, so the portrait does not touch the row's separator line. */
    align-self: flex-end;
    margin-bottom: 8px;
}

.rank-rows__item--lead .rank-rows__name {
    font-size: 18px;
}

.rank-rows__item--lead .rank-rows__account {
    font-size: 14px;
}

.rank-rows__item--lead .rank-rows__value {
    font-size: 26px;
    font-weight: 900;
}

@media (max-width: 899.98px) {
    .ranking-top__boards {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
}

@media (max-width: 575.98px) {
    .rank-rows__item {
        gap: 10px;
        padding: 0 12px;
    }

    .rank-rows__item--lead {
        height: 112px;
    }

    .rank-rows__item--lead .rank-rows__bust {
        flex-basis: 80px;
        width: 80px;
        height: 80px;
    }

    .rank-rows__item--lead .rank-rows__rank {
        flex-basis: 36px;
    }

    .rank-rows__item--lead .rank-rows__rank img {
        width: 36px;
    }

    .rank-rows__item--lead .rank-rows__value {
        font-size: 17px;
    }
}
