/* Homepage tournament cards: category colours follow the tournament, not its position. */
.bi-events {
    background: #f6f9fc;
}

.bi-events .bi-section-heading h2 {
    width: fit-content;
    max-width: 100%;
    padding-bottom: 0.08em;
    color: var(--bi-navy);
    font-weight: 700;
    line-height: 1.18;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .bi-events .bi-section-heading h2 {
        background: linear-gradient(112deg, #063e70 0%, #0a315f 45%, #43164d 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.bi-events .bi-section-heading p {
    color: #687b90;
}

.bi-events .bi-event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.bi-events .bi-event-item {
    --bi-event-card-inset: 16px;
    --bi-event-color: #46607c;
    --bi-event-gradient: linear-gradient(115deg, #435e79, #34455c);
    --bi-link-background: var(--bi-event-gradient);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bi-events .bi-event-card {
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 17px calc(var(--bi-event-card-inset) - 1px) 12px;
    border: 1px solid #dce6ef;
    border-radius: 12px;
    box-shadow: 0 4px 14px #10355205;
    color: #173354;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bi-events .bi-event-card:hover,
.bi-events .bi-event-card:focus-within {
    border-color: var(--bi-blue);
    box-shadow: 0 5px 18px #0866c616;
}

.bi-events .bi-event-card:focus-within {
    outline: 2px solid var(--bi-blue);
    outline-offset: 3px;
}

.bi-events .bi-event-item.is-regional {
    --bi-event-color: #1b65a5;
    --bi-event-gradient: linear-gradient(115deg, #245d92, #174875 55%, #263e73);
}

.bi-events .bi-event-item.is-sectional {
    --bi-event-color: #07796f;
    --bi-event-gradient: linear-gradient(115deg, #167c76, #12645f 55%, #175466);
}

.bi-events .bi-event-item.is-nabc {
    --bi-event-color: #794078;
    --bi-event-gradient: linear-gradient(115deg, #765084, #5b376d 55%, #492554);
}

.bi-events .bi-event-info {
    position: relative;
    display: flex;
    flex: 1;
    align-self: stretch;
    flex-direction: column;
    min-width: 0;
    padding: 0;
}

.bi-events .bi-event-info h3 {
    margin: 0 0 3px;
    color: var(--bi-blue);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.5px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.bi-events .bi-event-info p {
    display: block;
    min-width: 0;
    margin: 0;
    color: #536b80;
    font-size: 14px;
    line-height: 1.4;
}

.bi-events .bi-event-info p > i {
    margin-right: 5px;
    color: var(--bi-event-color);
}

.bi-events .bi-event-period {
    margin-top: auto;
    padding: 11px 14px 13px;
    border-radius: 8px;
    color: #fff;
    background: var(--bi-event-gradient);
}

.bi-events .bi-event-card .bi-event-type {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0;
    padding: 0;
    color: #fff;
    background: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.bi-events .bi-event-type::before,
.bi-events .bi-event-type::after {
    content: "";
    flex: 1;
    max-width: 32px;
    height: 1px;
    background: #ffffff42;
}
.bi-events .bi-event-dates {
    display: grid;
    width: 100%;
    max-width: 260px;
    margin-inline: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bi-events .bi-event-endpoint {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bi-events .bi-event-endpoint + .bi-event-endpoint {
    align-items: flex-end;
    text-align: right;
}

.bi-events .bi-event-date-label {
    color: #e2ecf5;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.bi-events .bi-event-date {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    color: #fff;
    background: none;
    line-height: 1.1;
    white-space: nowrap;
}

.bi-events .bi-event-date strong {
    font-size: 29px;
    font-weight: 600;
    letter-spacing: -1px;
}

.bi-events .bi-event-date span {
    font-size: 29px;
    font-weight: 500;
}

.bi-events .bi-event-year {
    color: #e7eef8;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
}

.bi-events .bi-events-all {
    justify-self: end;
    text-align: right;
}

@media (max-width: 991.98px) {
    .bi-events .bi-event-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639.98px) {
    .bi-events .bi-event-grid {
        grid-template-columns: 1fr;
    }
}

/* The tournament's information is clickable; booking stays in its own footer. */
.bi-events .bi-event-info .bi-event-details-link {
    color: inherit;
    text-decoration: none;
}

.bi-events .bi-event-details-link::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: -6px;
    border-radius: 8px;
}

.bi-events .bi-event-details-link:focus-visible {
    outline: none;
}

.bi-events .bi-event-details-link:focus-visible::after {
    outline: 2px solid var(--bi-blue);
    outline-offset: 2px;
}

.bi-events .bi-event-location {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 13px;
}

.bi-events .bi-event-distance {
    white-space: nowrap;
}

.bi-events .bi-event-info :is(.bi-event-more, .bi-tmark, .bi-event-partners) {
    position: relative;
    z-index: 2;
}

.bi-events .bi-event-info .bi-event-more {
    --bi-link-background: currentColor;
    justify-self: end;
    margin-right: 0;
    color: var(--bi-blue);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    text-decoration: none;
}

/* A shared footer connects the choice of partner to the tournament above. */
.bi-events .bi-event-pro-picker {
    --bi-link-background: currentColor;
    position: relative;
    margin: 15px calc(1px - var(--bi-event-card-inset)) -12px;
    padding: 13px calc(var(--bi-event-card-inset) - 1px) 10px;
    border-top: 1px solid #e2eaf2;
    border-radius: 0 0 11px 11px;
    background: linear-gradient(115deg, #f0f6fb, #f7f5fa);
}

.bi-events .bi-event-pro-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bi-events .bi-event-pro-intro {
    min-width: 0;
}

.bi-events .bi-event-pro-heading {
    display: block;
    color: var(--bi-navy);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.bi-events .bi-event-pro-hint {
    display: block;
    margin-top: 3px;
    color: #657b90;
    font-size: 11px;
    line-height: 1.3;
}

.bi-events .bi-event-pro-choices {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 5px;
}

.bi-events .bi-event-pro-face {
    position: relative;
    z-index: 1;
    display: block;
    width: 44px;
    height: 52px;
    padding: 2px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: linear-gradient(#fff, #fff) padding-box,
        linear-gradient(140deg, #c5e1f5, #d7c7e3) border-box;
    box-shadow: 0 2px 6px #17335410;
    font: inherit;
    cursor: pointer;
    transform-origin: top right;
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease;
}

.bi-events .bi-event-pro-portrait {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(145deg, #e8f4ff, #eee7f5);
}

.bi-events .bi-event-pro-portrait::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border: 1px solid #ffffff70;
    border-radius: inherit;
    pointer-events: none;
}

.bi-events .bi-event-pro-portrait img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    background: linear-gradient(145deg, #e8f4ff, #eee7f5);
}

.bi-events .bi-event-pro-portrait img[hidden] {
    display: none;
}

.bi-events .bi-event-pro-default-avatar {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #879fbb;
}

.bi-events .bi-event-pro-default-avatar svg {
    width: 85%;
    height: 85%;
}

.bi-events .bi-event-pro-picker.is-previewing .bi-event-pro-face.is-active {
    z-index: 6;
    border-color: #fff;
    transform: scale(1.75);
}

.bi-events .bi-event-pro-face:hover,
.bi-events .bi-event-pro-face:focus-visible {
    border-color: var(--bi-blue);
}

.bi-events .bi-event-pro-face:focus-visible {
    outline: 2px solid var(--bi-blue);
    outline-offset: 3px;
}

/* One card grows left from the selected portrait, outside the grid's flow. */
.bi-events .bi-event-pro-current {
    box-sizing: border-box;
    position: absolute;
    z-index: 5;
    top: var(--bi-pro-popup-top, 0px);
    right: 12px;
    left: var(--bi-pro-popup-left, auto);
    width: var(--bi-pro-popup-width, 280px);
    max-width: calc(100% - 24px);
    min-height: 105px;
    padding: 10px;
    border-radius: 14px;
    filter: drop-shadow(0 10px 22px #17335420);
    text-align: right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0s 0.3s;
}

.bi-events .bi-event-pro-current::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    background: linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, #beddf3, #d2ddef 55%, #d7c4df) border-box;
    clip-path: inset(var(--bi-pro-start-top, 7px) var(--bi-pro-start-right, 7px)
        var(--bi-pro-start-bottom, 80px) var(--bi-pro-start-left, 14px) round 9px);
    pointer-events: none;
    transition: clip-path 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bi-events .bi-event-pro-current-book {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
}

.bi-events .bi-event-pro-current-book:focus-visible {
    outline: 2px solid var(--bi-blue);
    outline-offset: 3px;
}

.bi-events .bi-event-pro-reveal-inner,
.bi-events .bi-event-pro-current-actions {
    position: relative;
    z-index: 2;
    min-width: 0;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.2s ease;
}

.bi-events .bi-event-pro-reveal-inner {
    padding-right: 88px;
}

.bi-events .bi-event-pro-current-header {
    display: block;
}

.bi-events .bi-event-pro-current-actions {
    display: flex;
    justify-content: flex-end;
    margin: 4px 0 -3px;
    max-width: calc(100% - 88px);
}

.bi-events .bi-event-pro-current-actions .bi-event-pro-profile {
    flex-shrink: 1;
    white-space: normal;
    overflow-wrap: anywhere;
    pointer-events: auto;
}

.bi-events .bi-event-pro-picker.is-previewing .bi-event-pro-current {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.bi-events .bi-event-pro-picker.is-previewing .bi-event-pro-current::before {
    clip-path: inset(0 round 14px);
}

.bi-events .bi-event-pro-picker.is-previewing .bi-event-pro-reveal-inner,
.bi-events .bi-event-pro-picker.is-previewing .bi-event-pro-current-actions {
    opacity: 1;
    transform: none;
    transition-delay: 0.08s;
}

/* Touch keeps its compact, always reachable profile details. */
@media (hover: none) {
    .bi-events .bi-event-pro-picker.is-previewing .bi-event-pro-face.is-active {
        transform: none;
        border-color: var(--bi-blue);
    }

    .bi-events .bi-event-pro-current {
        position: static;
        width: auto;
        max-width: none;
        min-height: 0;
        margin-top: 10px;
        padding: 10px;
        filter: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .bi-events .bi-event-pro-current::before {
        clip-path: inset(0 round 14px);
    }

    .bi-events .bi-event-pro-reveal-inner {
        padding-right: 0;
    }

    .bi-events .bi-event-pro-current-actions {
        max-width: none;
    }

    .bi-events .bi-event-pro-reveal-inner,
    .bi-events .bi-event-pro-current-actions {
        opacity: 1;
        transform: none;
    }
}

.bi-events .bi-event-pro-achievement {
    display: block;
    margin: 6px 0 0;
    color: #657b90;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bi-events .bi-event-pro-achievement[hidden] {
    display: none;
}

.bi-events .bi-event-pro-achievement i {
    display: inline-block;
    margin-right: 4px;
    color: #aa824c;
}

.bi-events .bi-event-pro-name {
    display: block;
    min-width: 0;
    color: var(--bi-navy);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.bi-events .bi-event-pro-profile,
.bi-events .bi-event-pro-browse {
    flex-shrink: 0;
    margin-right: 0;
    color: var(--bi-blue);
    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .bi-events .bi-event-card,
    .bi-events .bi-event-pro-face,
    .bi-events .bi-event-pro-current,
    .bi-events .bi-event-pro-current::before,
    .bi-events .bi-event-pro-reveal-inner,
    .bi-events .bi-event-pro-current-actions {
        transition: none;
    }
}

/* A quieter distance filter; its native select remains the no-JS fallback. */
.bi-events .bi-event-radius-label {
    flex-shrink: 0;
}

.bi-events .bi-event-radius-label .bi-radius-select,
.bi-events .bi-event-radius-trigger {
    min-height: 40px;
    border: 1px solid var(--bi-border);
    border-radius: 6px;
    background-color: #ffffffb3;
    color: #536b80;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.bi-events .bi-event-radius-label .bi-radius-select {
    appearance: none;
    padding: 9px 38px 9px 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%238393a4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.bi-events .bi-event-radius-dropdown {
    position: relative;
}

.bi-events .bi-event-radius-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 166px;
    padding: 9px 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bi-events .bi-event-radius-trigger:hover,
.bi-events .bi-event-radius-dropdown.is-open .bi-event-radius-trigger {
    border-color: #a6bdd1;
    background-color: #fff;
}

.bi-events .bi-event-radius-trigger:focus-visible {
    outline: 2px solid #0870de80;
    outline-offset: 3px;
}

.bi-events .bi-event-radius-chevron {
    flex-shrink: 0;
    color: #8393a4;
    transition: transform 0.2s ease;
}

.bi-events .bi-event-radius-dropdown.is-open .bi-event-radius-chevron {
    transform: rotate(180deg);
}

.bi-events .bi-event-radius-menu {
    position: absolute;
    z-index: 6;
    top: calc(100% + 7px);
    right: 0;
    min-width: 100%;
    margin: 0;
    padding: 5px;
    border: 1px solid #dce6ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px #17335414;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s 0.18s;
}

.bi-events .bi-event-radius-dropdown.is-open .bi-event-radius-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition-delay: 0s;
}

.bi-events .bi-event-radius-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #536b80;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.bi-events .bi-event-radius-option[aria-selected="true"] {
    color: var(--bi-navy);
    background: linear-gradient(115deg, #edf5fc, #f4f1f8);
}

.bi-events .bi-event-radius-option svg {
    flex-shrink: 0;
    color: var(--bi-blue);
    opacity: 0;
}

.bi-events .bi-event-radius-option[aria-selected="true"] svg {
    opacity: 1;
}

.bi-events .bi-event-radius-option:hover,
.bi-events .bi-event-radius-option:focus {
    background-color: #f0f5f9;
    outline: 1px solid #a6bdd1;
    outline-offset: -1px;
}

@media (pointer: coarse) {
    .bi-events .bi-event-radius-trigger,
    .bi-events .bi-event-radius-option {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bi-events .bi-event-radius-trigger,
    .bi-events .bi-event-radius-chevron,
    .bi-events .bi-event-radius-menu,
    .bi-events .bi-event-radius-option {
        transition: none;
    }

    .bi-events .bi-event-radius-menu {
        transform: none;
    }
}
