/* ============================
   PDF MODE GLOBAL
============================ */

.pdf-mode body > * {
    display: none !important;
}

.pdf-mode .pdf-print-block {
    display: block !important;
    position: relative;
    padding: 20px;
    font-family: Arial, sans-serif;
}

/* ============================
   HEADER LABEL SWITCHING
============================ */

/* Default website: show real text */
th {
    color: inherit;
    position: relative;
}

/* Default website: do NOT use ::after unless needed */
th::after {
    content: none;
}

/* Website: events with >8 games use SHORT labels */
.games-9 th,
.games-10 th,
.games-11 th,
.games-12 th,
.games-13 th,
.games-14 th,
.games-15 th,
.games-16 th {
    color: transparent;
}

.games-9 th::after,
.games-10 th::after,
.games-11 th::after,
.games-12 th::after,
.games-13 th::after,
.games-14 th::after,
.games-15 th::after,
.games-16 th::after {
    content: attr(data-short);
    color: #000;
    position: absolute;
    left: 0;
    top: 0;
}

/* PDF MODE: always hide real text */
.pdf-mode th {
    color: transparent !important;
    position: relative;
}

/* PDF MODE: default to long labels */
.pdf-mode th::after {
    content: attr(data-long);
    color: #000 !important;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 11px !important;
    white-space: nowrap;
}

/* PDF MODE: events with >8 games use SHORT labels */
.pdf-mode .games-9 th::after,
.pdf-mode .games-10 th::after,
.pdf-mode .games-11 th::after,
.pdf-mode .games-12 th::after,
.pdf-mode .games-13 th::after,
.pdf-mode .games-14 th::after,
.pdf-mode .games-15 th::after,
.pdf-mode .games-16 th::after {
    content: attr(data-short);
}

/* Center header labels (long + short) */
th {
    text-align: center;
    position: relative;
}

th::after {
  
    text-align: center;
}


/* ============================
   PDF HEADER
============================ */

.pdf-header {
    text-align: center;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

.pdf-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pdf-logo {
    width: 45px;
}

.pdf-header-title {
    font-size: 18px;
    font-weight: bold;
}

.pdf-header-sub {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
}

.pdf-header-divider {
    height: 2px;
    background-color: #002395;
    margin-top: 6px;
}

/* ============================
   PAGE BREAKS
============================ */

.pdf-print-block {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.pdf-print-block .division-container.open[data-division*="Women"] {
    page-break-after: always;
    break-after: page;
}

.pdf-print-block .division-container.open[data-division*="Women"]:last-of-type {
    page-break-after: avoid !important;
    break-after: avoid !important;
}

.pdf-print-block * {
    page-break-inside: avoid !important;
}

/* ============================
   PDF TABLE FIXES
============================ */

.pdf-print-block table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

.pdf-print-block caption {
    display: none !important;
}

.pdf-print-block th,
.pdf-print-block td {
    padding: 2px 3px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

/* ============================
   PDF BUTTON (screen only)
============================ */

.pdf-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background-color: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.pdf-btn i {
    font-size: 16px;
}

.pdf-btn:hover {
    background-color: #d32f2f;
}

.pdf-btn:active {
    transform: scale(0.96);
}

/* Hide PDF button in PDF mode */
.pdf-mode .pdf-btn {
    display: none !important;
}

/* Show PDF button only when a division is open */
.event-block.has-open .pdf-btn {
    display: inline-flex;
}

/* Never shorten Last Name or First Name */
.games-9 th:nth-child(2)::after,
.games-9 th:nth-child(3)::after,
.games-10 th:nth-child(2)::after,
.games-10 th:nth-child(3)::after,
.games-11 th:nth-child(2)::after,
.games-11 th:nth-child(3)::after,
.games-12 th:nth-child(2)::after,
.games-12 th:nth-child(3)::after,
.games-13 th:nth-child(2)::after,
.games-13 th:nth-child(3)::after,
.games-14 th:nth-child(2)::after,
.games-14 th:nth-child(3)::after,
.games-15 th:nth-child(2)::after,
.games-15 th:nth-child(3)::after,
.games-16 th:nth-child(2)::after,
.games-16 th:nth-child(3)::after {
    content: attr(data-long) !important;
}

.pdf-mode .games-9 th:nth-child(2)::after,
.pdf-mode .games-9 th:nth-child(3)::after,
.pdf-mode .games-16 th:nth-child(2)::after,
.pdf-mode .games-16 th:nth-child(3)::after {
    content: attr(data-long) !important;
}
