/* LTB Plugin – Public Stylesheet */

/* ── Global font ─────────────────────────────────────────────────────────── */
[class*="ltb-"] {
    font-family: Avenir, sans-serif;
}

/* Year navigation */
.ltb-year-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    /* column-gap / row-gap split: more row gap prevents border overlap between rows */
    gap: 0.45em 0.25em !important;
    margin: 1em 0 !important;
    padding: 0 !important;
    list-style: none !important;
    background-color: transparent;
    line-height: 1 !important;
    height: auto !important;
    overflow: visible !important;
}
.ltb-year-nav a {
    display: inline-flex !important;
    align-items: center !important;
    float: none !important;
    position: static !important;
    margin: 0 !important;
    /* fixed height so the bold active button cannot make its row taller */
    height: 2em !important;
    padding: 0 0.5em !important;
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    font-family: Avenir, sans-serif !important;
    font-size: 0.9em !important;
    /* all buttons use bold so the active one doesn't change the button size */
    font-weight: bold !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    vertical-align: top !important;
}
.ltb-year-nav a.ltb-active {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

.ltb-year-nav > code {
    background-color: transparent;
}

/* Code block that follows the year-nav (shortcode pages rendered in a <code> wrapper) */
.ltb-year-nav + code {
    display: block;
    width: 100%;
    background-color: transparent;
}

/* Code block that follows the AK filter bar */
.ltb-bak-filters + code {
    display: block;
    width: 100%;
    background: transparent;
}

.ltb-bak-filters > code {
    background-color: transparent;
}

/* Direct <code> children inside ltb wrappers: transparent background */
.ltb-mitgliederliste-wrap > code {
    background: transparent;
    width: 100%;
}

/* When a <code> block wraps ltb shortcode output: remove gray background and reset font */
code:has(.ltb-meine-ergebnisse-wrap),
code:has(.ltb-mitgliederliste-wrap),
code:has(.ltb-bak-filters) {
    display: block !important;
    background: transparent !important;
    font-family: Avenir, sans-serif !important;
}
.ltb-meine-ergebnisse-wrap h2 {
    font-family: Avenir, sans-serif;
}
.ltb-meine-ergebnisse-wrap h2 code {
    background-color: transparent;
    font-family: Avenir, sans-serif;
}

/* Member list search input spacing */
.ltb-ml-filter {
    margin-bottom: 0.75em;
}

/* Race/course headings used outside [ltb_ergebnisse] */
.ltb-lauf-header {
    margin-top: 2em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 0.2em;
}
.ltb-course-header {
    margin-top: 1em;
}

/* ── [ltb_ergebnisse] responsive layout toggle ───────────────────────────── */

/* Mobile-first: show narrow, hide wide */
.ltb-results-wide   { display: none; }
.ltb-results-narrow { display: block; }

@media (min-width: 1025px) {
    .ltb-results-wide   { display: block; }
    .ltb-results-narrow { display: none; }
}

/* ── [ltb_ergebnisse] table ──────────────────────────────────────────────── */

/* Slightly smaller than the default 0.9 em used by other tables */
.ltb-results-table {
    font-size: 0.85em;
    margin-top: 1em;
    margin-bottom: 2em;
    border: none;
    border-spacing: 0;
}

/* No borders on any cell – overrides the shared border-bottom rule */
.ltb-results-table th,
.ltb-results-table td {
    border: none;
}

/* Race title row – spans all columns, dark banner */
.ltb-race-header-row th {
    background: #003d6e;
    color: #fff;
    font-size: 1.1em;
    white-space: nowrap;
    padding: 0.45em 0.8em;
}
.ltb-race-header-row .ltb-race-date {
    margin-right: 0.6em;
    opacity: 0.85;
}
.ltb-race-header-row .ltb-race-link {
    color: #fff;
    margin-left: 0.5em;
    opacity: 0.75;
    text-decoration: none;
}
.ltb-race-header-row .ltb-race-link:hover { opacity: 1; }

/* Per-distance column-header row */
.ltb-course-header-row th {
    background: #0073aa;
    color: #fff;
    white-space: nowrap;
}
.ltb-course-header-row th a {
    color: #fff;
    text-decoration: none;
}
.ltb-course-header-row th a:hover { text-decoration: underline; }

/* Spacer row between consecutive courses inside one table */
.ltb-course-spacer td {
    padding: 0.25em 0;
    border: none !important;
    background: transparent !important;
}

/* Larger spacer between races inside the wide single-table */
.ltb-race-spacer td {
    padding: 0.7em 0;
    border: none !important;
    background: transparent !important;
}

/* Distance label row in the narrow layout (replaces first-column header) */
.ltb-distance-label-row td {
    background: #dbeef7;
    color: #003d6e;
    font-weight: 600;
    padding: 0.3em 0.7em;
    border-bottom: none;
    white-space: nowrap;
}

/* Rank column – right-aligned, muted */
.ltb-results-table .ltb-rank-cell {
    text-align: right;
    color: #888;
    padding-right: 0.5em;
    min-width: 1.8em;
}

/* Name / Lauf cells – never wrap (applies to all LTB tables) */
.ltb-name-cell,
.ltb-lauf-cell {
    white-space: nowrap;
}

/* Right-aligned columns (Platz AK, Platz Ges.) */
.ltb-results-table .ltb-col-right {
    text-align: right;
}

/* Extra spacing after statistik tables (separates sections like Bestzeiten) */
.ltb-statistik-table {
    margin-bottom: 3em;
}

/* All tables */
.ltb-results-table,
.ltb-statistik-table,
.ltb-laufkalender-table,
.ltb-mitgliederliste-table,
.ltb-mitglied-info,
.ltb-bestzeiten-table,
.ltb-vm-table,
.ltb-ergebnisse-table,
.ltb-wk-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
    font-size: 0.9em;
}
.ltb-results-table th,
.ltb-statistik-table th,
.ltb-laufkalender-table th,
.ltb-mitgliederliste-table th,
.ltb-mitglied-info th,
.ltb-bestzeiten-table th,
.ltb-vm-table th,
.ltb-ergebnisse-table th,
.ltb-wk-table th {
    background: #0073aa;
    color: #fff;
    padding: 0.4em 0.6em;
    text-align: left;
}
.ltb-results-table td,
.ltb-statistik-table td,
.ltb-laufkalender-table td,
.ltb-mitgliederliste-table td,
.ltb-mitglied-info td,
.ltb-bestzeiten-table td,
.ltb-vm-table td,
.ltb-ergebnisse-table td,
.ltb-wk-table td {
    padding: 0.3em 0.6em;
    border-bottom: 1px solid #eee;
}
.ltb-results-table tr:nth-child(even),
.ltb-statistik-table tr:nth-child(even),
.ltb-laufkalender-table tr:nth-child(even),
.ltb-mitgliederliste-table tr:nth-child(even),
.ltb-ergebnisse-table tr:nth-child(even),
.ltb-wk-table tr:nth-child(even) {
    background: #f8f8f8;
}

/* Widget table: transparent header */
.ltb-wk-table th {
    background: transparent;
    color: #2d4a7a;
    border-bottom: 1px solid #dce1e9;
}

/* Overflow wrapper for responsive tables */
.ltb-results-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Personal best indicator */
.ltb-pb {
    color: gold;
    margin-left: 0.3em;
    font-size: 1.1em;
}

/* Member photo */
.ltb-mitglied-photo img {
    max-width: 150px;
    float: right;
    margin: 0 0 1em 1em;
    border-radius: 4px;
}

/* Info/error messages */
.ltb-info,
.ltb-error {
    padding: 0.8em 1em;
    border-radius: 4px;
    margin: 1em 0;
}
.ltb-info { background: #e7f3fe; border-left: 4px solid #0073aa; }
.ltb-error { background: #fde8e8; border-left: 4px solid #cc0000; }

/* ── Responsive column hiding (bestenliste-ak / bestzeiten) ─────────────── */
/* Mobile-first: hide secondary columns */
.ltb-col-narrow-hide { display: none; }

@media (min-width: 1025px) {
    .ltb-col-narrow-hide { display: table-cell; }
}

/* ── Bestenliste AK filter bar ──────────────────────────────────────────── */
.ltb-bak-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1.5em;
}

.ltb-bak-select {
    display: inline-block !important;
    width: auto !important;
    min-width: 180px;
    padding: 0.3em 0.5em;
    font-size: 1rem;
}

/* ── Wettkampf-Widgets [ltb_anstehende_wettkampfe] / [ltb_letzte_ergebnisse] */
.ltb-wk-widget {
    display: inline-block;
    vertical-align: top;
    border: 1px solid #dce1e9;
    border-radius: 8px;
    padding: 16px 20px 12px;
    min-width: 280px;
    box-sizing: border-box;
}

.ltb-wk-heading {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
}

.ltb-wk-date {
    white-space: nowrap;
}

.ltb-wk-table a {
    color: inherit;
    text-decoration: none;
}

.ltb-wk-table a:hover {
    text-decoration: underline;
}

.ltb-wk-empty {
    color: #666;
    font-style: italic;
    margin: 0;
}
