/*
 * Filters sheet for tablets and phones (native <dialog> rising from the bottom) and the
 * "about" dialog.
 */

@keyframes home-sheet-up {
    from {
        transform: translate3d(0, 100%, 0);
    }

    to {
        transform: none;
    }
}

@keyframes home-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.home-sheet {
    width: 100%;
    max-width: 560px;
    height: fit-content;
    max-height: 90dvh;
    margin: auto auto 0;
    padding: 0;
    border: 0;
    border-radius: 28px 28px 0 0;
    background: var(--home-page);
    color: var(--rg-color-ink);
}

.home-sheet[open] {
    display: flex;
    animation: home-sheet-up 0.42s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.home-sheet::backdrop,
.home-about::backdrop {
    background: var(--home-backdrop);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: home-backdrop-in 0.25s ease;
}

.home-sheet__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.home-sheet__header {
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-2);
    padding: 10px var(--rg-space-4) var(--rg-space-2);
}

.home-sheet__handle {
    align-self: center;
    width: 40px;
    height: 4px;
    border-radius: var(--rg-radius-pill);
    background: var(--home-hero-text-soft);
}

.home-sheet__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-sheet__title {
    margin: 0;
    padding-left: var(--rg-space-1);
    font-size: 22px;
    font-weight: var(--rg-font-weight-regular);
    letter-spacing: -0.5px;
}

.home-sheet__body {
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-6);
    padding: var(--rg-space-1) var(--rg-space-4) var(--rg-space-4);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.home-sheet__footer {
    display: flex;
    align-items: center;
    gap: var(--rg-space-2);
    padding: var(--rg-space-3) var(--rg-space-4) var(--rg-space-5);
    border-top: 1px solid #ecece9;
    background: var(--rg-color-surface);
}

.home-sheet__clear {
    padding: 0 18px;
    font-size: var(--rg-font-size-lg);
    text-decoration: underline;
}

.home-sheet__apply {
    flex: 1;
    height: 52px;
    font-size: var(--rg-font-size-lg);
}

/* About dialog */
.home-about {
    width: min(520px, calc(100% - 32px));
    padding: 40px var(--rg-space-8) var(--rg-space-8);
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: var(--rg-radius-lg);
    background: var(--home-ink);
    color: var(--rg-color-inverse-text);
    text-align: center;
}

.home-about[open] {
    animation: home-backdrop-in 0.25s ease;
}

.home-about__close {
    position: absolute;
    top: var(--rg-space-4);
    right: var(--rg-space-4);
    background: rgb(255 255 255 / 10%);
    color: var(--rg-color-inverse-text);
}

.home-about__logo {
    width: auto;
    height: 40px;
    margin: 0 auto var(--rg-space-6);
}

.home-about__title {
    margin: 0 0 var(--rg-space-3);
    font-size: var(--rg-font-size-xl);
    font-weight: var(--rg-font-weight-medium);
}

.home-about__text {
    margin: 0;
    color: rgb(255 255 255 / 85%);
    font-size: var(--rg-font-size-lg);
    line-height: 1.7;
}

.home-about__facts {
    display: flex;
    justify-content: center;
    gap: var(--rg-space-10);
    margin: var(--rg-space-8) 0 0;
    padding-top: var(--rg-space-6);
    border-top: 1px solid rgb(255 255 255 / 10%);
}

.home-about__facts dt {
    color: rgb(255 255 255 / 60%);
    font-size: var(--rg-font-size-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.home-about__facts dd {
    margin: var(--rg-space-1) 0 0;
    font-size: 16px;
}

.home-sheet .home-filters {
    gap: 22px;
}

.home-sheet .home-segment {
    border-radius: var(--rg-radius-pill);
    box-shadow: none;
}

.home-sheet .home-segment__option {
    height: 40px;
    border-radius: var(--rg-radius-pill);
    font-size: var(--rg-font-size-md);
}

/* Two columns: four sports in view (two rows), the rest scroll */
.home-sheet .home-sports {
    --home-sport-row: 52px;
    --home-sports-visible: 2;

    display: grid;
    grid-template-columns: 1fr 1fr;
}

.home-sheet .home-sport {
    padding-right: var(--rg-space-3);
    border-radius: var(--rg-radius-lg);
    background: var(--rg-color-surface);
}

.home-sheet .home-sport__icon {
    width: 38px;
    height: 38px;
    background: var(--rg-color-surface-sunken);
}

.home-sheet .home-select {
    height: 48px;
    box-shadow: none;
}
