/* ============================================================
   BIO PAGE — CLEAN, STABLE, FULLY NAMESPACED
   ============================================================ */

/* MAIN CONTAINER */
.bio-container {
    width: 95%;
    max-width: 1100px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

/* SECTION HEADER */
.bio-header {
    font-size: 22pt;
    font-weight: bold;
    text-align: center;
    color: white;
    background: red;
    padding: 10px 0;
    margin-bottom: 20px;
}

/* GROUP TITLE */
.bio-section-title {
    font-size: 18pt;
    font-weight: bold;
    margin: 20px 0 10px;
    border-bottom: 2px solid #ccc;
}

/* ============================================================
   GRID LAYOUT
   ============================================================ */
.bio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

/* ============================================================
   ROSTER CARD
   ============================================================ */
.bio-roster {
    background: #7A6F62;
    color: white;
    padding: 10px;
    text-align: center;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
    display: block;
}

.bio-roster:hover {
    transform: scale(1.03);
    box-shadow:
        0 -4px 6px -4px rgba(255, 0, 0, 0.25),
        4px 0 6px -4px rgba(255, 0, 0, 0.25);
}

.bio-roster img {
    width: 75%;
    height: auto;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 8px;
}

/* ============================================================
   DIM BACKGROUND
   ============================================================ */
#bio-dim-layer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 900;
}

/* ============================================================
   FLYOUT PANEL — FIXED + CLEAN
   ============================================================ */
#bio-flyout {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    background: #ffffff;
    padding: 30px;
    border-radius: 6px;
    box-shadow: 0 0 25px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: none;
    z-index: 1000;
    font-size: 13px;
    line-height: 1.4;
    color: #000000;

    max-height: none !important;
    overflow: visible !important;
}

#bio-flyout.open {
    display: block;
    opacity: 1;
}

/* ============================================================
   SCROLLABLE CONTENT AREA — THE ONLY SCROLL CONTAINER
   ============================================================ */
#bio-content {
    max-height: calc(100vh - 160px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* ============================================================
   INNER WRAPPER — NAMESPACED
   ============================================================ */
.bio-flyout-inner {
    overflow: visible !important;
    max-height: none !important;
}

/* ============================================================
   BIO TOP ROW (PHOTO + INFO)
   ============================================================ */
.bio-top-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;               /* 20px Move picture left right*/
    margin-bottom: 20px;
}

.bio-info-block {
    flex: 1;
}

.bio-photo-wrapper {
    width: 180px;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
}

.bio-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   RACE RESULTS HEADER — NAMESPACED
   ============================================================ */
.bio-title,
.bio-location,
.bio-date-line {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.bio-title {
    font-size: 16pt;
    font-weight: bold;
    color: #000080;
    margin-top: 0.75em;
}

.bio-location {
    font-size: 13pt;
    margin-bottom: 2px;
}

.bio-date-line {
    font-size: 11pt;
    margin-bottom: 6px;
}

.bio-rider-name {
    font-size: 13pt;
    text-align: center;
    margin: 10px 0 14px 0;
}

/* ============================================================
   CLOSE BUTTON
   ============================================================ */
#bio-close {
    position: sticky;
    top: 0;
    float: right;
    font-size: 24px;
    font-weight: bold;
    color: #000000;
    background: #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1001;
}

#bio-close:hover {
    color: red;
}

/* ============================================================
   RACE RESULTS TABLE — NAMESPACED
   ============================================================ */
.bio-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 10pt;
    margin: 0.5em auto 1em auto;
    border: 1px solid #999;
    background: white !important;
    color: black !important;
}

.bio-table th,
.bio-table td {
    padding: 4px 8px;
    border: 1px solid #999;
    white-space: nowrap;
    text-align: left;
/*  background: white !important; */
    color: black !important;
}

.bio-table thead tr {
    background-color: #f2f2f2 !important;
    font-weight: bold;
}

.bio-table tbody tr:nth-child(even) {
    background-color: #f9f9f9 !important;
}

.bio-table tbody tr:nth-child(odd) {
    background-color: #e6e6e6 !important;
}

/* ============================================================
   MOBILE — BIO FLYOUT
   ============================================================ */
@media (max-width: 600px) {
    .bio-top-row {
        flex-direction: row;          /* side-by-side layout */
        align-items: flex-start;      /* align photo + text at the top */
        gap: 12px;                    /* tighten spacing */
    }

    .bio-photo-wrapper {
        width: 120px;                 /* optional: mobile-friendly size */
        height: 120px;
    }

    .bio-info-block {
        width: auto;                  /* allow natural width */
        text-align: left;
        flex: 1;                      /* let text fill remaining space */
    }

    #bio-content h2,
    #bio-content p,
    #bio-content h3 {
        text-align: left;
    }
}

/* ============================================================
   MOBILE FIXES FOR BIO TABLE
   ============================================================ */
@media (max-width: 600px) {

    /* Allow horizontal scroll if needed */
    #bio-content {
        overflow-x: auto !important;
    }

    /* Table shrinks properly */
    .bio-table {
        width: 100% !important;
        table-layout: auto !important;
        font-size: 11px !important;
        white-space: normal !important;
    }

    /* Cells wrap instead of forcing overflow */
    .bio-table th,
    .bio-table td {
        padding: 4px 6px !important;
        word-break: break-word !important;
    }

    /* Race column: prevent disappearing + limit width */
    .bio-table th:nth-child(5),
    .bio-table td:nth-child(5) {
        max-width: 90px !important;
    }
}

/* ============================================================
   ZERO RESULTS FIX — KEEP TABLE VISIBLE
   ============================================================ */
.bio-table td[colspan="5"] {
    text-align: center;
    font-style: italic;
    padding: 10px;
}

.bio-race-name-row td {
    background: #FCFCE8;      /* #f2f2f2 light gray shading */
    font-weight: bold;
    padding: 8px 10px;
    border-top: 2px solid #ccc;
    white-space: normal;      /* allows wrapping */
    word-break: break-word;   /* prevents overflow */
}

.bio-race-name {
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.3;
}

.bio-info-block .bio-title {
    text-align: left;
    margin-bottom: 6px;
}