/* ----------------------------------------------------
   GLOBAL LAYOUT (1100px max)
---------------------------------------------------- */

.race-banner,
.race-title,
.race-location,
.race-date-line,
#race-archive {
    max-width: 1100px;
    margin: 0 auto;
}

.race-banner {
    margin-bottom: 15px;
}

.race_title1 {
    font-family: Arial, sans-serif;
    font-size: 22pt;
    font-weight: bold;
    text-align: center;
    color: black;
    background: white;
    padding: 6px 0;
}

.race-title {
    font-size: 16pt;
    font-weight: bold;
    color: #000080;
    margin-top: 0.75em;
    text-align: center;
}

.race-location {
    font-size: 13pt;
    margin-bottom: 2px;
    text-align: center;
}

.race-date-line {
    font-size: 11pt;
    margin-bottom: 6px;
    text-align: center;
}

.race-camera {
    font-size: 26pt;
    cursor: pointer;
}

.race-camera:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------
   TABLE WRAPPER
---------------------------------------------------- */

.race_table_wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    color: black;
    overflow-x: hidden; /* desktop default */
}

/* Tablet: allow scroll */
@media (max-width: 1100px) {
    .race_table_wrapper {
        overflow-x: auto;
    }
}

/* ----------------------------------------------------
   TABLE (DESKTOP/TABLET)
---------------------------------------------------- */

.race_table {
    width: 1100px;
    table-layout: fixed;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 10pt;
    line-height: 1.4;
    margin: 0.5em auto 1em auto;
    border: 1px solid #999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-sizing: border-box;
}

.race_table.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.race_table thead tr {
    background-color: #f2f2f2;
    color: #000;
    font-weight: bold;
}

.race_table th,
.race_table td {
    padding: 4px 8px;
    border: 1px solid #999;
    white-space: nowrap;
    text-align: left;
}

.race_table th {
    font-weight: 800 !important;
}

.race_table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.race_table tbody tr:nth-child(odd) {
    background-color: #e6e6e6;
}

/* Tablet shrink */
@media (max-width: 1100px) {
    .race_table {
        width: 100%;
    }

    .race_table th,
    .race_table td {
        white-space: normal;
        padding: 4px 6px;
    }
}

/* ----------------------------------------------------
   MOBILE (MODERN COMPRESSED TABLE)
---------------------------------------------------- */

@media (max-width: 600px) {

    /* Hide Rider column */
    .race_table th:nth-child(1),
    .race_table td:nth-child(1) {
        display: none;
    }

    /* Keep table intact */
    .race_table {
        width: 100%;
        table-layout: fixed;
    }

    .race_table th,
    .race_table td {
        font-size: 11px;
        padding: 4px 6px;
        white-space: normal;
        word-break: break-word;
    }

    /* Prevent Race column from stretching */
    .race_table td:nth-child(5) {
        max-width: 120px;
    }
}

/* ----------------------------------------------------
   PHOTO BLOCKS
---------------------------------------------------- */

.race-block {
    display: none;
    margin: 8px auto 18px auto;
    max-width: 1100px;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    position: relative;
}

.race-block.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.race-photo-grid-wide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 20px auto;
}

.race-photo-item-wide img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.race-photo-caption {
    font-family: Arial, sans-serif;
    font-size: 12pt;
    text-align: center;
    color: black;
    background: white;
    padding-top: 4px;
}

.race-photo-item-wide {
    position: relative;
}

.race-photo-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.85);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18pt;
    font-weight: bold;
    color: #000080;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* ----------------------------------------------------
   YEAR ACCORDION
---------------------------------------------------- */

.race-year {
    margin-bottom: 6px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
}

.race-year-summary {
    font-weight: bold;
    cursor: pointer;
    color: black;
    background: white;
}

/* ----------------------------------------------------
   FLOATING BUTTONS
---------------------------------------------------- */

#back-to-top,
#back-to-year {
    position: fixed;
    right: 20px;
    background: #000080;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 10pt;
    cursor: pointer;
    display: none;
    z-index: 9999;
    opacity: 0.75;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: opacity 0.2s ease;
}

#back-to-top:hover,
#back-to-year:hover {
    opacity: 1;
}

#back-to-top { bottom: 20px; }
#back-to-year { bottom: 60px; }

/* ----------------------------------------------------
   FLOATING YEAR TAG + PRINT BUTTON
---------------------------------------------------- */

#floating-year-tag,
#floating-print-wrapper {
    position: fixed;
    top: 360px;
    z-index: 99999;
}

#floating-year-tag {
    left: 20px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.8);
    color: #000080;
    font-weight: bold;
    font-size: 11pt;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#floating-print-wrapper {
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#floating-print-button {
    width: 34px;
    height: 34px;
    border-radius: 20px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#floating-print-button svg {
    width: 18px;
    height: 18px;
    stroke: #000080;
    fill: none;
    stroke-width: 1.6;
}

#floating-print-wrapper:hover #floating-print-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#floating-print-dropdown {
    margin-top: 6px;
    min-width: 190px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-size: 10pt;
    overflow: hidden;
}

.print-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    color: #000080;
}

.print-dropdown-item:hover {
    background: rgba(0,0,128,0.08);
}

/* ----------------------------------------------------
   PRINT MODE
---------------------------------------------------- */

@media print {
    #back-to-top,
    #back-to-year,
    #floating-year-tag,
    #floating-print-wrapper,
    summary,
    .race-block {
        display: none !important;
    }

    .race_table {
        width: 100% !important;
        border: 1px solid #000;
    }
}

/* Safety: ensure header is not hidden by theme */
thead {
    display: table-header-group !important;
}

/* --- Team News cleanup --- */
.team-news,
.team-news p {
    font-family: inherit !important;
}

blockquote::before,
blockquote::after,
blockquote p::before,
blockquote p::after {
    content: none !important;
}

/* Optional: match Race Results look */
.team-news p {
    margin: 0.4em 0;
    font-style: italic;
    color: #444;
}

/* --- Fix diamonds with question marks --- */
.team-news p {
    font-family: Arial, Helvetica, sans-serif !important; /* universal fallback */
    font-style: italic;
    color: #444;
    margin: 0.4em 0;
}

/* Disable WordPress smart quotes and theme pseudo-elements */
blockquote::before,
blockquote::after,
blockquote p::before,
blockquote p::after {
    content: none !important;
}

/* Prevent Mesmerize theme from inserting decorative glyphs */
.team-news::before,
.team-news::after {
    content: none !important;
}

.team-news p {
  word-spacing: 0.05em;
  letter-spacing: 0.01em;
}

