/* ============================================================
   PrestoSports Monospace Print Styles
   Shared across all statcrew *xml-monospace-template files.
   https://theme-assets.prestosports.com/theme-assets/generic/assets/css/xml-monospace.css
   ============================================================ */

/* ---- Reset / Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: monospace;
    font-size: 11px;
    color: #000;
    background: #fff;
    margin: 0;
    padding: 0;
    text-align: left;
}

/* ---- Pre-header label (above H1) ---- */
.mono-pre-header {
    font-size: inherit;
    letter-spacing: 0.08em;
    color: #666;
    margin-bottom: 0.2em;
}

/* ---- Page header ---- */
.mono-print-header {
    margin-bottom: 1em;
    border-bottom: 2px solid #000;
}

.mono-print-header h1 {
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 0.25em 0;
    text-transform: uppercase;
}

.mono-print-header .game-info {
    font-size: 11px;
    margin: 0.2em 0;
}

.mono-print-header .game-info-item {
    white-space: nowrap;
}

.mono-header-inner {
    display: flex;
    align-items: center;
}

.mono-header-center {
    flex: 1;
    text-align: center;
    padding: 0.75em 0;
}

.mono-header-logo {
    flex: 0 0 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mono-team-logo {
    width: 64px;
    height: 64px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ---- Section headings ---- */
.mono-section-label {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    margin: 1em 0 0.25em 0;
    padding-bottom: 2px;
    border-bottom: 1px solid #333;
    break-after: avoid;
    page-break-after: avoid;
}

.mono-stat-subsection {
    font-size: 11px;
    font-weight: bold;
    border-bottom: 1px solid #999;
    margin: 0.75em 0 0.2em 0;
    padding-bottom: 2px;
    break-after: avoid;
    page-break-after: avoid;
}

.mono-team-label {
    font-size: 12px;
    font-weight: bold;
    margin: 0.5em 0 0.2em 0;
}

/* ---- Tables ---- */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: monospace;
    font-size: 11px;
}

th {
    font-weight: bold;
    text-align: right;
    padding: 3px 5px;
    border-bottom: 1px solid #000;
    white-space: nowrap;
}

th.align-left {
    text-align: left;
}

td {
    text-align: right;
    padding: 3px 5px;
    vertical-align: top;
}

td:first-child,
td.align-left {
    text-align: left;
}

.col-num {
    width: 2em;
    white-space: nowrap;
}

.period-stat-table {
    table-layout: fixed;
}

.period-stat-table th:first-child,
.period-stat-table td:first-child {
    width: 40%;
    text-align: left;
}

tr.even td,
tr.even th {
    background-color: #f5f5f5;
}

tr.totals td,
tr.totals th {
    font-weight: bold;
    border-top: 1px solid #000;
}

tr.title th {
    text-align: left;
    font-size: 12px;
    background-color: #eee;
}

tr.hr td {
    border-top: 1px dashed #444;
    line-height: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
}

table.no-borders td {
    border: none;
}

table.no-borders th {
    border-width: 0 0 1px 0;
}

/* ---- Summary text blocks ---- */
.mono-summary {
    margin: 0.5em 0;
    font-size: 11px;
    line-height: 1.5;
}

/* ---- Layout utilities ---- */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.clear        { clear: both; }
.align-left   { text-align: left; }
.align-right  { text-align: right; }
.align-center { text-align: center; }
.bold         { font-weight: bold; }
.nowrap       { white-space: nowrap; }

/* ---- Half-box layout ---- */
.mono-halfbox-left {
    width: 49%;
    float: left;
    margin-bottom: 1em;
}

.mono-halfbox-right {
    width: 49%;
    float: right;
    margin-bottom: 1em;
}

.mono-halfbox-center {
    width: 49%;
    margin: 0 auto 1em;
}

/* ---- Full-width box ---- */
.mono-fullbox {
    width: 100%;
    margin-bottom: 1em;
}

.mono-fullbox table {
    width: 100%;
}

/* ---- Quarter-width stat tables ---- */
.mono-quarterbox-left {
    width: 24%;
    float: left;
    margin-bottom: 1em;
    margin-right: 1%;
}

/* ---- Recessed score section ---- */
.mono-score-wrap {
    width: 75%;
    margin: 0 auto 1em auto;
}

.mono-score-wrap table {
    width: 100%;
}

/* ---- Centered comparison table ---- */
.mono-comparison-wrap {
    margin: 0 0 1em 0;
}

.mono-comparison-wrap table {
    width: 100%;
}

/* ---- Centered headings in recessed sections ---- */
.mono-score-wrap .mono-section-label,
.mono-comparison-wrap .mono-section-label {
    text-align: center;
}

/* ---- Team statistics comparison table ---- */
.team-stat th {
    text-align: left;
    font-weight: normal;
    color: #000;
}

.team-stat th.team-stat-data {
    text-align: right;
    font-weight: bold;
}

.team-stat td.stat-label {
    text-align: left;
    font-weight: normal;
}

.team-stat td.stat-category {
    text-align: center;
    font-weight: normal;
}

.team-stat td.stat-sublabel {
    text-align: center;
    font-weight: normal;
    font-style: italic;
}

.team-stat td.team-stat-data {
    text-align: right;
}

.team-stat tr.stat-total-row td.team-stat-data {
    font-weight: bold;
}

.mono-comparison-wrap .team-stat td.stat-label,
.mono-comparison-wrap .team-stat td.stat-category,
.mono-comparison-wrap .team-stat td.stat-sublabel {
    text-align: center;
}

.mono-comparison-wrap .team-stat th.team-stat-data,
.mono-comparison-wrap .team-stat td.team-stat-data {
    text-align: center;
}

.scoring-summary td {
    vertical-align: top;
}

/* ---- Page footer ---- */
.presto-print-footer {
    text-align: center;
    padding: 0.75em 10%;
    margin-top: 2em;
    border-top: 1px solid #ccc;
    font-size: 10px;
    color: #666;
}

.presto-print-footer p {
    margin: 0 0 0.5em 0;
    font-style: italic;
}

.presto-print-footer img {
    height: 18px;
    width: auto;
    opacity: 0.7;
    display: block;
    margin: 0 auto;
}

/* ---- Legacy (cms/generic) styles ---- */
.stats-halfbox-left,
.stats-halfbox-right { border: 0; }

.stats-fullbox { border: 0; }

.stats-wrapper { font-size: 10px; }

.stats-wrapper th {
    background: #ffffff;
    color: #444444;
}

.stats-wrapper th,
.stats-wrapper td {
    text-align: left;
    border: 1px solid #444;
}

.stats-wrapper table.no-borders td { border: 0; }
.stats-wrapper table.no-borders th { border-width: 0 0 1px 0; }

.game-title {
    font-weight: 100;
    text-align: center;
}

.game-title strong { font-weight: 700; }

/* ---- Page breaks ---- */
.page-break-before {
    page-break-before: always;
    break-before: page;
}

/* ---- Print media ---- */
@media print {
    @page {
        margin: 0.75in 0.5in;
        size: letter portrait;
    }

    table {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    .presto-print-footer {
        margin-top: 2em;
        page-break-inside: avoid;
        break-inside: avoid;
    }
}
