/* ============================================================
   Tennis Data Hub — Tournament page styling
   Genbruger CSS-tokens fra hovedplugin'et (tdh_shared_css i tennis-data-hub.php).
   Denne fil indeholder kun turnerings-specifik styling.

   Loaded via: Tennis_Data_Hub_Tournaments::enqueue_assets()
   Scope: kun indlæg i kategori 103 (turneringer)
   ============================================================ */

/* ── HERO ──────────────────────────────────────────────────
   Full-width som spillerne — bagfarven løber til kanten.
   Divi-sektionen sørger for fuld bredde og padding; .tdh-hero
   tilføjer kun bagfarve og base-styles, intet eget padding.
   Matches spiller-hero i tennis-data-hub.php linje 1022-1032.
   ────────────────────────────────────────────────────────── */
.tdh-hero {
    position: relative;
    padding: 0;
    overflow: hidden;
    background: var(--primary);
    color: #fff;
}
.tdh-hero-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 36px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}
.tdh-hero-info { flex: 1; }

.tdh-hero-info h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0 0 6px 0;
    padding: 0;
    color: #fff;
}

/* Officielt navn-linjen direkte under H1 */
.tdh-hero-official-name {
    font-size: 17px;
    color: rgba(255,255,255,0.7);
    margin: 0 0 14px 0;
    line-height: 1.4;
}
.tdh-hero-official-label {
    color: rgba(255,255,255,0.45);
    font-weight: 600;
    margin-right: 4px;
}

.tdh-wrap .tdh-hero-subtitle {
    font-size: 17px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 22px;
    line-height: 1.5;
}
.tdh-hero-subtitle img {
    vertical-align: middle;
    margin-right: 4px;
}
.tdh-hero-sub-group { display: inline; }
.tdh-hero-sub-line { display: inline; }
.tdh-hero-sub-sep { display: inline; }

/* Spillested-ikon (fa-stadium) — kun synligt på desktop, gemmes på mobil
   hvor "Spillested:"-label vises i stedet. */
.tdh-hero-sub-icon-venue {
    margin-right: 6px;
    color: rgba(255,255,255,0.55);
    width: 18px;
    text-align: center;
}

/* Mobile labels ("By:", "Underlag:", "Spillested:", "Hjemmeside:") — kun
   synlige på mobil hvor hver linje står for sig selv og labels gør det
   tydeligt hvad værdien er. Skjules på desktop hvor inline-flow er nok. */
.tdh-hero-sub-mobile-label {
    display: none;
}

/* Surface-pille i hero — tre farver (matcher .tdh-surface-tag i hovedplugin'et,
   men i hero-versionen er baggrunden kraftigere så den læses oven på den
   grønne hero-baggrund) */
.tdh-surface-pill {
    display: inline-block;
    border-radius: 4px;
    padding: 2px 10px;
    border: 1px solid;
}
.tdh-surface-pill.hard {
    background: rgba(37,99,235,0.25);
    border-color: rgba(37,99,235,0.4);
    color: #93c5fd;
}
.tdh-surface-pill.clay {
    background: rgba(194,65,12,0.25);
    border-color: rgba(194,65,12,0.4);
    color: #fdba74;
}
.tdh-surface-pill.grass {
    background: rgba(34,197,94,0.25);
    border-color: rgba(34,197,94,0.4);
    color: #86efac;
}

/* Officiel hjemmeside — inline i subtitle */
.tdh-wrap .tdh-hero-subtitle .tdh-hero-website-link {
    color: rgba(255,255,255,0.65);
    border-bottom: none;
    transition: color 0.2s;
}
.tdh-wrap .tdh-hero-subtitle .tdh-hero-website-link:hover {
    color: #fff;
    border-bottom: none;
}
.tdh-hero-website-icon {
    display: inline-block;
    margin-right: 6px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.tdh-wrap .tdh-hero-subtitle .tdh-hero-website-link:hover .tdh-hero-website-icon {
    opacity: 1;
}

/* ── HERO TOUR ROWS — desktop layout ──────────────────────
   Bruges både til ATP-only (én row) og kombinerede ATP+WTA (to rows).
   Tag yderst venstre, stats i grid til højre.
   ────────────────────────────────────────────────────────── */
.tdh-tour-stats-desktop {
    display: block;
}
.tdh-tour-stats-mobile {
    display: none;
    width: 100%;
}

.tdh-tour-row {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 18px 0;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.tdh-tour-row:first-child {
    border-top: none;
    padding-top: 0;
}
.tdh-tour-row:last-child {
    padding-bottom: 0;
}

.tdh-tour-tag {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 14px;
    border-radius: 4px;
    line-height: 1.2;
    text-align: center;
    flex-shrink: 0;
    min-width: 110px;
}
.tdh-tour-tag-level {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.tdh-tour-tag-gender {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.8px;
    opacity: 0.8;
    margin-top: 3px;
    text-transform: uppercase;
}

.tdh-tour-stats-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 24px;
}
.tdh-tour-stat {
    display: flex;
    flex-direction: column;
}
.tdh-tour-stat-value {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}
.tdh-tour-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

/* ── HERO STATS — legacy, bevares for bagudkompatibilitet ── */
.tdh-hero-stats {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}
.tdh-hero-stat {
    display: flex;
    flex-direction: column;
}
.tdh-hero-stat-value {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}
.tdh-hero-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

/* ── PRÆMIEPENGE & POINT ──────────────────────────── */
.tdh-prize-table th:nth-child(2),
.tdh-prize-table th:nth-child(3),
.tdh-prize-table td:nth-child(2),
.tdh-prize-table td:nth-child(3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.tdh-prize-table .tdh-prize-winner td {
    background: rgba(251,191,36,0.08);
}
.tdh-prize-table .tdh-prize-winner td:first-child {
    color: var(--gold);
    font-weight: 700;
}
.tdh-prize-table .tdh-prize-winner td.tdh-prize-amount {
    color: var(--gold);
    font-weight: 700;
}

/* ── TIDLIGERE VINDERE ──────────────────────────────
   Tab-skift: byyear / mostwins
   ────────────────────────────────────────────────── */
.tdh-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.tdh-tab-btn {
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s ease;
}
.tdh-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.tdh-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.tdh-tab-panel { display: none; }
.tdh-tab-panel.active { display: block; }

.tdh-champ-flag {
    width: 20px;
    height: 14px;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}
.tdh-champ-table .tdh-year-col {
    width: 70px;
    font-weight: 600;
    color: var(--text);
}
.tdh-champ-table .tdh-score-col {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

/* Most wins layout */
.tdh-mostwins-table .tdh-count-col {
    width: 90px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}
.tdh-mostwins-years {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── ONE-TIMERS — kort-grid for vindere med 1 titel ─── */
.tdh-onetimers-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-top: 18px;
}
.tdh-onetimers-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}
.tdh-onetimers-count {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 14px;
    border-radius: 6px;
    line-height: 1;
}
.tdh-onetimers-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--text-muted);
    font-weight: 600;
}
.tdh-onetimers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.tdh-onetimer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card-alt);
    border-radius: 8px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}
.tdh-onetimer:hover {
    border-color: var(--primary);
    background: #fff;
    transform: translateY(-1px);
}
.tdh-onetimer .tdh-champ-flag {
    margin-right: 0;
    flex-shrink: 0;
}
.tdh-onetimer-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    flex: 1;
    line-height: 1.2;
    border-bottom: none !important;
}
a.tdh-onetimer-name:hover { color: var(--primary); }
.tdh-onetimer-year {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ── KØNS-PILLE-KNAPPER (i sektionsoverskriften, kombinerede turneringer) ──
   Lille, kompakte pille-knapper der sidder mellem H3 og periode-badgen.
   Bruger pille-stilen som .tdh-tag for at matche resten af sitet, men
   med tydelig active-state for den valgte køn.
   ────────────────────────────────────────────────────────── */
.tdh-champ-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.tdh-champ-section-header h3 {
    margin: 0;
}
.tdh-champ-section-header .tdh-champ-period-tag {
}

.tdh-champ-gender-pills {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px;
}
.tdh-champ-gender-pill {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
    white-space: nowrap;
}
.tdh-champ-gender-pill:hover {
    color: var(--primary);
    background: var(--bg-card);
}
.tdh-champ-gender-pill.active {
    background: var(--primary);
    color: #fff;
}
.tdh-champ-gender-pill.active:hover {
    color: #fff;
    background: var(--primary);
}

/* Periode-tabs (indre) — placeret inde i et tdh-champ-group panel.
   Lidt mindre end ydre kønstabs for at vise hierarki. */
.tdh-champ-period-tabs {
    align-items: center;
    margin-top: 6px;
}

/* Ikke spillet-rækker — dæmpet visuelt så rigtige finaler er primære.
   Står stadig synligt så brugeren kan se kontinuiteten i historikken. */
.tdh-champ-not-played td {
    color: var(--text-muted);
    background: rgba(0,0,0,0.015);
}
.tdh-champ-not-played td em {
    font-style: italic;
    font-weight: 600;
}

/* ── HERO MOBILE: sammenligningstabel for kombinerede turneringer ───── */
.tdh-tour-table-mobile {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    table-layout: fixed;
}
.tdh-tour-table-mobile th,
.tdh-tour-table-mobile td {
    padding: 11px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    width: 35%;
}
.tdh-tour-table-mobile thead th {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 10px 6px 14px;
}
.tdh-tour-table-mobile thead th.tdh-tour-label-col {
    width: 30%;
}
.tdh-tour-table-mobile tbody td {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.tdh-tour-table-mobile tbody td.tdh-tour-label-cell {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: rgba(255,255,255,0.5);
}

/* ── HERO MOBILE: vertikal liste for ATP-only turneringer ───── */
.tdh-single-tour-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 12px;
    margin-top: 12px;
}
.tdh-single-tour-stat {
    display: flex;
    flex-direction: column;
}
.tdh-single-tour-stat-value {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}
.tdh-single-tour-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

/* ── MOBIL ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .tdh-hero-inner {
        flex-direction: column;
        gap: 18px;
    }
    .tdh-hero-info h1 { font-size: 32px; }
    .tdh-hero-subtitle { font-size: 15px; margin-bottom: 18px; }

    /* Mobil: hver subtitle-linje står for sig selv, vist i en flex-kolonne
       så data-order kan styre rækkefølgen (Spillested → By → Underlag → Hjemmeside) */
    .tdh-wrap .tdh-hero-subtitle {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .tdh-hero-sub-line { display: block; }
    .tdh-hero-sub-line[data-order="1"] { order: 1; }
    .tdh-hero-sub-line[data-order="2"] { order: 2; }
    .tdh-hero-sub-line[data-order="3"] { order: 3; }
    .tdh-hero-sub-line[data-order="4"] { order: 4; }
    .tdh-hero-sub-sep { display: none; }
    .tdh-hero-sub-group { display: block; margin-bottom: 4px; }
    .tdh-hero-subtitle .tdh-surface-pill { display: inline-block; }

    /* Mobile labels: vis "Spillested:", "By:" osv. for at gøre layoutet selvforklarende
       når hver linje står for sig. */
    .tdh-hero-sub-mobile-label {
        display: inline;
        color: rgba(255,255,255,0.45);
        font-weight: 600;
        margin-right: 6px;
    }

    /* Spillested-ikon skjules på mobil — vi har "Spillested:"-label i stedet */
    .tdh-hero-sub-icon-venue { display: none; }

    /* Skift mellem desktop tour-rows og mobil-layout */
    .tdh-tour-stats-desktop { display: none; }
    .tdh-tour-stats-mobile { display: block; }

    /* Legacy hero-stats (bruges hvis nogen siden bruger den gamle struktur) */
    .tdh-hero-stats { gap: 14px 40px; }
    .tdh-hero-stat-value { font-size: 22px; }
    .tdh-hero-stat-label { font-size: 11px; letter-spacing: 1.2px; }

    /* Sektionsoverskrift på mobil:
       Kombineret: H3 på én linje, gender pills på næste (fuld bredde).
       Solo: H3 + periode-badge inline (samme som desktop). */
    .tdh-champ-section-header {
        gap: 8px;
    }

    /* Gender pills: fuld bredde på mobil, pills fylder plads ligeligt */
    .tdh-champ-gender-pills {
        width: 100%;
        display: flex;
    }
    .tdh-champ-gender-pill {
        flex: 1;
        text-align: center;
        font-size: 14px;
        padding: 9px 10px;
    }

    /* Efter år / Flest titler tabs: centrerede og samme bredde på mobil */
    .tdh-champ-period-tabs {
        display: flex;
        justify-content: center;
    }
    .tdh-champ-period-tabs .tdh-tab-btn {
        min-width: 130px;
        text-align: center;
    }

    .tdh-prize-table th,
    .tdh-prize-table td {
        padding: 8px 6px;
        font-size: 14px;
    }

    .tdh-onetimers-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 6px;
    }
    .tdh-onetimer { padding: 8px 10px; }
    .tdh-onetimer-name { font-size: 13px; }
    .tdh-onetimer-year { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════
   MASTER-SHORTCODE-LAYOUT
   ═══════════════════════════════════════════════════════════
   Tilføjet 15. maj 2026 som del af migrationen fra ACF+Divi Theme
   Builder til master-shortcoden [tennis_tournament_profile].

   Værdierne her matcher 1:1 den gamle Divi-template på
   Indian Wells-siden (verificeret via page source, 15. maj 2026).
   Samme mønster som players.css — se decisions § for begrundelse.
   ═══════════════════════════════════════════════════════════ */

/* CSS-VARIABLER (module-specifikke) — scoped til turneringsside */
.tdh-tournament-profile {
    --tdh-primary:        #0f5c5c;
    --tdh-hero-bg:        #0f5c5c;  /* hero-grøn (lidt mørkere end primary) */
    --tdh-menu-bar:       #1c9090;  /* menu-grøn (lysere — den "grønne stribe") */
    --tdh-section-alt:    #f4f4f4;  /* prize/champions baggrund */
}


/* ── SEKTION-BASE ───────────────────────────────────────────
   Hele master-shortcoden er én container med sektion-børn. */

.tdh-tournament-profile {
    position: relative;
    width: 100%;
}

.tdh-tournament-profile .tdh-section {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Indre container — 1200px matcher Divi's globale .container.
   Sikrer at hero og alle sektioner flugter med headeren ovenfor. */
.tdh-tournament-profile .tdh-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}


/* ── SEKTION-VARIANTER (baggrunde + padding) ───────────────
   Matcher den gamle Divi-template på turneringssider 1:1. */

/* 1. Hero — mørkegrøn, 55px top / 40px bund */
.tdh-tournament-profile .tdh-section--hero {
    background-color: var(--tdh-hero-bg);
    padding-top: 55px;
    padding-bottom: 40px;
}

/* 2. Menu — lysere grøn "stribe", 5/5 padding.
   Den oprindelige Divi-tekstmodul brugte font-size 16px, line-height
   1.7em, font-weight 400, hvid tekst og centrering. Replikeres her. */
.tdh-tournament-profile .tdh-section--menu {
    background-color: var(--tdh-menu-bar);
    padding-top: 5px;
    padding-bottom: 5px;
}

/* 3. Kampe og resultater — placeholder (sektionen filtreres væk
   indtil tdh_t_render_section_kampe() får indhold; CSS-reglen
   gemmes her klar til den dag kampe-shortcoden implementeres).

   padding-bottom er bevidst lavere end de øvrige sektioner (16 vs 40).
   Hver under-sektion (Live / Udsatte / Kommende / Resultater) har sit
   eget margin-bottom: 32px, og næste hovedsektion (typisk Præmiepenge)
   bidrager med 40px padding-top. Total afstand fra sidste tabel/kort
   til næste hovedsektions H3 = 0 (last-child nuller margin) + 16 + 40
   = 56px, hvilket matcher afstanden mellem to under-sektioner
   (32 margin-bottom + 24 header margin-top = 56). Tidligere var det 80px
   hvilket gav et synligt "tomrum" specielt på fallback-tilfælde hvor
   sektionen kun indeholder en kort tekstblok (21. maj 2026). */
.tdh-tournament-profile .tdh-section--kampe {
    background-color: var(--tdh-section-alt);
    padding-top: 40px;
    padding-bottom: 16px;
}

/* 4. Præmiepenge og point — lysegrå, 40/40 */
.tdh-tournament-profile .tdh-section--prize {
    background-color: var(--tdh-section-alt);
    padding-top: 40px;
    padding-bottom: 40px;
}

/* 5. Tidligere vindere — transparent (arver body/wrapper), 40/40 */
.tdh-tournament-profile .tdh-section--champions {
    background-color: transparent;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* 6. Følg [Turnering] — baggrundsbillede med 65% sort overlay, 35/35.
   Samme baggrund som spiller-sidens follow-sektion (decisions §). */
.tdh-tournament-profile .tdh-section--follow {
    background-image: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.65) 100%),
                      url('https://www.tennissporten.dk/wp-content/uploads/2026/02/tennis-header.webp');
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    padding-top: 35px;
    padding-bottom: 35px;
}


/* ── INDLEJREDE TDH-WRAPS — fjern indre padding/margin ─────
   Hero, prize, champions har internt .tdh-wrap > .tdh-section som
   stammer fra dengang shortcoderne kørte standalone i Divi-tekstmoduler.
   Inde i master-shortcoden styrer .tdh-section--*-padding alt det
   ydre, så vi nulstiller wrapper-padding for at undgå dobbelt-padding.
   Samme mønster som players.css. */

.tdh-tournament-profile .tdh-section--hero .tdh-wrap,
.tdh-tournament-profile .tdh-section--prize .tdh-wrap,
.tdh-tournament-profile .tdh-section--champions .tdh-wrap {
    padding: 0;
    margin: 0;
    background: transparent;
}

.tdh-tournament-profile .tdh-section--hero .tdh-section,
.tdh-tournament-profile .tdh-section--prize .tdh-section,
.tdh-tournament-profile .tdh-section--champions .tdh-section {
    padding: 0;
    margin: 0;
    background: transparent;
}

/* Hero-sektionens .tdh-hero har egen padding: 0 og overflow: hidden —
   den skal beholde sin grønne baggrund inde i section-wrapperen.
   Indre .tdh-hero-inner styrer 1200px-bredden via section-inner ovenfor. */
.tdh-tournament-profile .tdh-section--hero .tdh-hero {
    background: transparent; /* sektion-wrapper holder selv baggrunden */
    padding: 0;
}


/* ═══════════════════════════════════════════════════════════
   INTERN MENU (.tdh-tournament-menu)
   ═══════════════════════════════════════════════════════════
   Den grønne stribe under hero med ankerlinks til siden-sektionerne.
   Værdier matcher den gamle Divi tekstmodul-styling (h2 font-size 16px,
   font-weight 400, line-height 1.7em, hvid, centreret). */

.tdh-tournament-profile .tdh-tournament-menu {
    color: #ffffff;
    font-family: 'Roboto Condensed', Helvetica, Arial, Lucida, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7em;
    text-align: center;
    margin: 0;
    padding: 0;
}

.tdh-tournament-profile .tdh-tournament-menu a {
    color: #ffffff;
    text-decoration: none;
}

.tdh-tournament-profile .tdh-tournament-menu a:hover {
    text-decoration: underline;
}

.tdh-tournament-profile .tdh-menu-sep {
    color: #ffffff;
}


/* ═══════════════════════════════════════════════════════════
   SOCIAL BAR (.tdh-follow-*)
   ═══════════════════════════════════════════════════════════
   Matcher spiller-sidens follow-sektion 1:1 — hvide cirkulære
   ikoner med grøn ikon-farve. Font Awesome 7 brand-ikoner. */

.tdh-tournament-profile .tdh-follow-title {
    color: #ffffff;
    font-family: 'Roboto Condensed', Helvetica, Arial, Lucida, sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.2em;
    text-align: center;
    margin: 0 0 20px 0;
    padding: 0;
}

.tdh-tournament-profile .tdh-follow-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tdh-tournament-profile .tdh-follow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--tdh-primary);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tdh-tournament-profile .tdh-follow-icon i {
    font-size: 28px;
    line-height: 1;
}

.tdh-tournament-profile .tdh-follow-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* To-bjælker-tilfælde: når der følger endnu en .tdh-follow-title efter
   et sæt ikoner (asymmetriske kombinerede turneringer som Canadian Open
   hvor ATP og WTA har separate social-konti), giv mellemrum mellem de
   to bjælker. Reglen påvirker IKKE almindelige én-bjælke-tilfælde, fordi
   den kun matcher når der er en title-søsker bagefter. */
.tdh-tournament-profile .tdh-follow-icons:has(+ .tdh-follow-title) {
    margin-bottom: 40px;
}

/* Fallback for browsere uden :has()-understøttelse (Firefox <121).
   Bruger samme tilgang som hero — alle .tdh-follow-title efter den
   første får ekstra top-margin. */
.tdh-tournament-profile .tdh-follow-title + .tdh-follow-icons + .tdh-follow-title {
    margin-top: 40px;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤767px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    .tdh-tournament-profile .tdh-section-inner {
        padding: 0 20px;
    }

    /* Hero får mere padding-top på mobil — matcher den gamle Divi-template
       der gik fra 55px → 30px på phone. Vi bruger 30px her. */
    .tdh-tournament-profile .tdh-section--hero {
        padding-top: 30px;
        padding-bottom: 25px;
    }

    /* Menu får lidt mere luft på mobil (matcher Divi's 8px på phone) */
    .tdh-tournament-profile .tdh-section--menu {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* Follow-sektion: mindre h3 og tættere ikoner */
    .tdh-tournament-profile .tdh-follow-title {
        font-size: 28px;
        margin-bottom: 16px;
    }
    .tdh-tournament-profile .tdh-follow-icons {
        gap: 14px;
    }
    .tdh-tournament-profile .tdh-follow-icon {
        width: 48px;
        height: 48px;
    }
    .tdh-tournament-profile .tdh-follow-icon i {
        font-size: 24px;
    }
}

/* ═══════════════════════════════════════════════════════════
   KAMPE OG RESULTATER — sektion-styling
   ═══════════════════════════════════════════════════════════
   Tilføjet 17. maj 2026. Bruges af tournaments-matches.php's
   sektion-renderere (Live / Udsatte / Kommende / Resultater).

   Hver af de 4 under-sektioner får sin egen <div class="tdh-section">
   med eget anker-id, så menupunkterne kan pege direkte på dem.

   Selve sektionsoverskrifterne (H3 + tdh-tag eller pille-knapper) genbruger
   det eksisterende mønster fra prize/champions via .tdh-section-header. */

/* Stack af kampe-sub-sektioner: lidt luft mellem dem så de er
   visuelt adskilt på en længere side */
.tdh-tournament-profile .tdh-section--kampe .tdh-t-matches-section {
    margin-bottom: 32px;
}
.tdh-tournament-profile .tdh-section--kampe .tdh-t-matches-section:last-child {
    margin-bottom: 0;
}

/* Luft over H3-titlen i hver kampe-sub-sektion (Live / Kommende / Resultater)
   så headeren ikke klistrer op af sektionens øvre kant. */
.tdh-tournament-profile .tdh-section--kampe .tdh-t-matches-section .tdh-section-header {
    margin-top: 24px;
}
/* Den FØRSTE sub-sektion sidder direkte under .tdh-section--kampe's
   padding-top på 40px — så her ville 24px ekstra blive for meget. Nulstil.
   Gælder uanset hvilken sektion der står øverst: typisk Live når en kamp
   er i gang, men kan også være Udsatte / Kommende / Resultater / fallback-
   blokken hvis tidligere sektioner er tomme.

   Tidligere targetede vi kun [data-section="live"], men det gav synligt
   mere top-padding på fx French Open hvor "Kommende kampe" står øverst
   (21. maj 2026). DOM-struktur: hver sektion har sin egen .tdh-wrap +
   .tdh-container — derfor matcher vi #tdh-t-matches-container > .tdh-wrap
   :first-child og nuller margin på dens nested header. */
.tdh-tournament-profile #tdh-t-matches-container > .tdh-wrap:first-child .tdh-t-matches-section .tdh-section-header {
    margin-top: 0;
}

/* Resultater samlet i én tabel — runder vises som sektion-rækker
   inde i tabellen ("Finale", "Semifinaler", "Kvartfinaler" osv.). */
.tdh-tournament-profile .tdh-results-table .tdh-t-round-row td {
    text-align: center;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #0f5c5c;
    background: #f7faf6;
    border-top: 1px solid var(--tdh-border, #e5e5e5);
    border-bottom: 1px solid var(--tdh-border, #e5e5e5);
    letter-spacing: 0.4px;
}

/* Første runde-række skal ikke have top-border (tabellens thead står lige over) */
.tdh-tournament-profile .tdh-results-table tbody tr.tdh-t-round-row:first-child td {
    border-top: none;
}

/* Mobile tilpasninger */
@media (max-width: 640px) {
    .tdh-tournament-profile .tdh-results-table .tdh-t-round-row td {
        font-size: 14px;
        padding: 10px 14px;
    }
    .tdh-tournament-profile .tdh-section--kampe .tdh-t-matches-section {
        margin-bottom: 24px;
    }
}

/* ═══════════════════════════════════════════════════════════
   KOMMENDE KAMPE — mobil-kort (parallel til tabellen)
   ═══════════════════════════════════════════════════════════
   tdh_t_render_upcoming_table() outputter to parallelle blokke:
   en .tdh-matches-table (desktop) og en .tdh-matches-cards
   (mobil). Default skjuler vi kortene; ved 768px toggler vi.
   Samme mønster som spillersidens [tennis_kampe].

   Card-stylingen er duplikeret fra players.css fordi CSS-filerne
   loades separat per side-type (players.css kun på kategori 56,
   tournaments.css kun på kategori 103). Hvis kortmønsteret senere
   bliver brugt på en tredje side-type, kan reglerne flyttes til
   tdh-shared.css. Tilføjet 25. maj 2026. */
.tdh-tournament-profile .tdh-matches-cards { display: none; }

.tdh-tournament-profile .tdh-match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tdh-tournament-profile .tdh-mc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: var(--text-muted);
}
.tdh-tournament-profile .tdh-mc-top .tdh-mc-date,
.tdh-tournament-profile .tdh-mc-top .tdh-mc-round {
    font-size: 16px;
}

/* Main-rækken: Spiller 1 vs. Spiller 2 side om side.
   flex-wrap så lange navne (fx "Francisco Cerundolo" + "Botic Van De Zandschulp")
   kan ombryde uden at sprænge layoutet, mens korte navne står på én linje. */
.tdh-tournament-profile .tdh-mc-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.tdh-tournament-profile .tdh-mc-player {
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tdh-tournament-profile .tdh-mc-vs {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Mobile toggle: scopet til .tdh-upcoming-table (ikke .tdh-matches-table
   generelt), fordi Resultater-tabellen også bruger .tdh-matches-table-klassen
   uden at have et tilsvarende .tdh-matches-cards-fallback — så en bred
   .tdh-matches-table { display: none } ville få Resultater til at forsvinde
   på mobil (sket 25. maj 2026). Samme præcision for .tdh-matches-cards: vi
   matcher kun det .tdh-matches-cards-blok der følger umiddelbart efter en
   .tdh-upcoming-table (deres parallelle output fra tdh_t_render_upcoming_table). */
@media (max-width: 768px) {
    .tdh-tournament-profile .tdh-upcoming-table { display: none; }
    .tdh-tournament-profile .tdh-upcoming-table + .tdh-matches-cards { display: block; }
}

/* ═══════════════════════════════════════════════════════════
   FALLBACK — ingen kampe i nogen state
   ═══════════════════════════════════════════════════════════
   Vises på kommende 2026-turneringer hvor lodtrækningen endnu
   ikke har fundet sted. Tilføjet 21. maj 2026.

   Renderes inde i en .tdh-t-matches-section med H3 "Kommende kampe"
   (uden tag/pille-knapper), samme wrapper-struktur som rigtige sektioner
   så menu-linket #kommende-kampe har et anker at hoppe til.
   Lidt større tekst end normal brødtekst (18px vs 16px) for at
   gøre beskeden mere synlig på en ellers tom sektion.

   Tekst er centreret (text-align + margin:0 auto på p) fordi blokken
   står alene i sektionen — venstrejustering ville se mere "tomt" ud
   end centreret tekst med begrænset linjelængde.

   Ingen padding på selve .tdh-t-matches-empty — afstanden over teksten
   håndteres af .tdh-section-header's margin-bottom (22px), og afstanden
   under håndteres af .tdh-section--kampe's padding-bottom (16px). Det
   matcher hvordan en normal kommende-kampe-tabel ville positionere sig. */
.tdh-tournament-profile .tdh-t-matches-empty {
    text-align: center;
}
.tdh-tournament-profile .tdh-t-matches-empty p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text);
    max-width: 640px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .tdh-tournament-profile .tdh-t-matches-empty p {
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════
   LIVE-SCOREBOARD — kopieret fra players.css 18. maj 2026
   ═══════════════════════════════════════════════════════════
   Bruges på turneringssidens "Live kampe"-sektion. Samme
   markup-struktur som spillersidens live-kort:

       <div class="tdh-card tdh-live-container">
         <table class="tdh-live-scoreboard">
           <thead><tr>
             <th class="tdh-sb-meta">LIVE · 1. SÆT · X server</th>
             <th class="tdh-sb-set">1. sæt</th>
             <th class="tdh-sb-game">Parti</th>
           </tr></thead>
           <tbody><tr>
             <td class="tdh-sb-player">...</td>
             <td class="tdh-sb-set tdh-sb-current">3</td>
             <td class="tdh-sb-game">40</td>
           </tr></tbody>
         </table>
       </div>

   .tdh-card-scopingen på scoreboard td/th er nødvendig for at
   slå .tdh-wrap td/th fra tdh-shared.css (samme specificitet
   ellers, og shared loader før modul-CSS i kaskaden).

   NB: holdes synkron med players.css. Hvis denne blok ændres,
   skal samme ændring også laves i players.css. ═══════════ */

/* Kort-container */
.tdh-card.tdh-live-container { padding: 10px 14px; }
.tdh-live-container + .tdh-live-container { margin-top: 12px; }

/* Hver live/suspended kamp wrappes i tournaments-matches.php i sin egen
   <div class="tdh-section">, så .tdh-live-container + .tdh-live-container
   ovenfor matcher aldrig (kortene er ikke adjacent siblings). Den gamle
   regel beholdes som sikkerhedsnet hvis markup'en senere ændres tilbage.

   Mellemrum mellem live/suspended-kort scopes til selve matches-sektionen.
   To selector-varianter:
     - Single-gender case: .tdh-section direkte børn af .tdh-t-matches-section
     - Combined case (M+F tabs): .tdh-section inde i .tdh-tab-panel
   .tdh-tournament-profile-præfikset hæver specificiteten så reglen ikke
   tabes til generiske .tdh-section-regler i samme stylesheet. */
.tdh-tournament-profile .tdh-t-matches-section[data-section="live"] > .tdh-section + .tdh-section,
.tdh-tournament-profile .tdh-t-matches-section[data-section="live"] .tdh-tab-panel > .tdh-section + .tdh-section,
.tdh-tournament-profile .tdh-t-matches-section[data-section="suspended"] > .tdh-section + .tdh-section,
.tdh-tournament-profile .tdh-t-matches-section[data-section="suspended"] .tdh-tab-panel > .tdh-section + .tdh-section {
    margin-top: 15px;
}

/* LIVE-chip */
.tdh-live-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.8px; font-weight: 700; color: var(--red); white-space: nowrap; }
.tdh-live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: tdh-pulse 1.6s ease-in-out infinite; }
@keyframes tdh-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Scoreboard */
.tdh-live-scoreboard { width: 100%; border-collapse: collapse; margin: 0 0 4px; }
.tdh-card .tdh-live-scoreboard th { padding: 2px 8px; text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-light); }
.tdh-card .tdh-live-scoreboard td { padding: 3px 10px; border: none; border-bottom: 1px solid var(--border-light); font-size: 15px; }
.tdh-card .tdh-live-scoreboard tr:last-child td { border-bottom: none; }
.tdh-card .tdh-live-scoreboard tr:hover td { background: transparent; }
.tdh-sb-player { font-weight: 600; color: var(--text); }
.tdh-sb-player img { height: 16px; width: auto; margin-right: 6px; vertical-align: middle; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); }
.tdh-sb-set { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-dim); font-weight: 500; white-space: nowrap; }
.tdh-sb-set.tdh-sb-current { background: var(--red-light); color: var(--red); font-weight: 700; }
.tdh-sb-set sup { font-size: 0.7em; }
.tdh-sb-game { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; }

/* Long/short-varianter af sæt- og parti-headers. Default (desktop): vis lang
   tekst ("1. sæt", "Parti"), skjul kort tekst. Mobil-blokken nedenfor skifter
   til kort tekst — for parti altid, for sæt-headers kun ved 4+ sæt. */
.tdh-sb-set-short,
.tdh-sb-game-short { display: none; }

/* Meta-cell i thead */
.tdh-card .tdh-live-scoreboard th.tdh-sb-meta { text-align: left; padding: 2px 10px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 12px; }
.tdh-live-meta-wrap { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tdh-live-meta-sep { color: var(--text-muted); font-weight: 400; }

/* Server-tekst */
.tdh-live-server-text { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); font-weight: 500; }

/* Runde-tekst i live/suspended-kortets meta-cell (kun turneringssider).
   Samme styling som .tdh-live-chip men i primary-grøn og uden dot/blink. */
.tdh-live-round-text { font-size: 13px; text-transform: uppercase; letter-spacing: 1.8px; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* Opdateret-timestamp (skjult — beslutning 18. maj 2026) */
.tdh-live-updated { display: none; }

/* Suspended (Udsat kamp) — gul/amber variant af live */
.tdh-tag.tdh-tag--suspended { background: #f59e0b; color: #1f2937; }
.tdh-live-chip.tdh-live-chip--suspended { color: #b45309; }
.tdh-live-dot.tdh-live-dot--suspended { background: #f59e0b; animation: none; }
.tdh-suspended-resume {
    margin-top: 12px;
    padding: 8px 12px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #78350f;
}

/* Desktop: faste kolonnebredder så sæt/parti-kolonnerne står lodret
   på linje på tværs af alle live-kort på turneringssiden. Hver live-kamp
   renderes som sin egen <table>, så uden table-layout: fixed beregnes
   kolonnebredderne uafhængigt baseret på indholdet (spillernavn-længde
   m.v.) — og kolonnerne forskubbes mellem kortene. Scopes til
   .tdh-tournament-profile så spillersidens live-kort ikke påvirkes. */
@media (min-width: 769px) {
    .tdh-tournament-profile .tdh-live-scoreboard { table-layout: fixed; }
    .tdh-tournament-profile .tdh-sb-player { width: auto; }
    .tdh-tournament-profile .tdh-sb-set { width: 80px; min-width: 80px; }
    .tdh-tournament-profile .tdh-sb-game { width: 64px; min-width: 64px; }
}

/* Mobil */
@media (max-width: 768px) {
    /* Container-padding: 16px top/bottom, 5px sider (fra default 14px) for at
       frigøre plads til scoreboardet.
       Selector matcher specificitet med desktop-reglen .tdh-card.tdh-live-container
       (0,2,0) — uden .tdh-card-præfikset taber denne regel i specificitet. */
    .tdh-card.tdh-live-container { padding: 16px 5px; }
    /* Meta-celle venstrejusteres så den flugter med spillernavnene under
       (default text-align: left fra desktop-reglen arves). */
    .tdh-live-meta-wrap { flex-direction: column; gap: 4px; align-items: flex-start; }
    .tdh-live-meta-sep { display: none; }
    /* td-padding: matcher desktop-specificitet (0,3,1) ved at scope under .tdh-card
       og .tdh-live-scoreboard. Tidligere bare ".tdh-live-scoreboard td" (0,1,1)
       tabte til desktop-reglen ".tdh-card .tdh-live-scoreboard td { padding: 3px 10px }"
       og blev aldrig anvendt — det er derfor "Parti" ved 3 sæt overflowede, da
       cellen ikke havde 6px 6px padding (som ville passe inden i 38px width) men
       i stedet 3px 10px (som krævede >58px bredde for "Parti"-teksten). */
    .tdh-card .tdh-live-scoreboard td { padding: 6px 6px; font-size: 15px; }
    /* Header-celler (th): halver venstre/højre padding på mobil (8px → 4px) for at
       frigøre plads. Specificitet 0,3,1 matcher desktop-reglen, vinder pga senere
       placering i kaskaden. */
    .tdh-card .tdh-live-scoreboard th { padding: 2px 4px; }
    /* Spillernavn-celle: smallere padding + lidt mindre font for at frigøre plads. */
    .tdh-card .tdh-live-scoreboard td.tdh-sb-player { padding: 6px 4px; font-size: 14px; }
    /* width-værdier kræver min-width: 0 for at faktisk virke. Default desktop-reglerne
       har min-width 56px (sb-set) og 48px (sb-game) som ellers vinder over min width-regler. */
    .tdh-sb-set { width: 30px; min-width: 0; }
    /* sb-game er 50px så "Parti"-teksten (~42px ved 11px font + uppercase + letter-spacing)
       passer indenfor cellen med 4px padding på hver side. 38px var for snæver. */
    .tdh-sb-game { width: 50px; min-width: 0; }
    .tdh-suspended-resume { text-align: center; font-size: 12px; }

    /* Ved 4-5 sæt: krymp sæt- og parti-kolonnerne yderligere, da indholdet kun
       er ét tal i header og max 2 tegn i body (fx "6²" eller "40"). min-width: 0
       nuller default min-width (56px på sb-set, 48px på sb-game) så width-værdier
       under disse faktisk virker. */
    .tdh-live-scoreboard[data-sets="4"] .tdh-sb-set,
    .tdh-live-scoreboard[data-sets="5"] .tdh-sb-set { width: 22px; min-width: 0; }
    .tdh-live-scoreboard[data-sets="4"] .tdh-sb-game,
    .tdh-live-scoreboard[data-sets="5"] .tdh-sb-game { width: 28px; min-width: 0; }

    /* Parti-header: skift til "P" KUN ved 4-5 sæt. Ved ≤3 sæt er der plads
       til "Parti" og det fulde ord bevares. */
    .tdh-live-scoreboard[data-sets="4"] .tdh-sb-game-long,
    .tdh-live-scoreboard[data-sets="5"] .tdh-sb-game-long { display: none; }
    .tdh-live-scoreboard[data-sets="4"] .tdh-sb-game-short,
    .tdh-live-scoreboard[data-sets="5"] .tdh-sb-game-short { display: inline; }

    /* Sæt-headers: skift til kompakt ("1", "2"…) kun ved 4 eller 5 sæt,
       hvor "1. SÆT" ellers klippes på 375px-viewport. Ved ≤3 sæt bevares
       den fulde "1. SÆT"-tekst. */
    .tdh-live-scoreboard[data-sets="4"] .tdh-sb-set-long,
    .tdh-live-scoreboard[data-sets="5"] .tdh-sb-set-long { display: none; }
    .tdh-live-scoreboard[data-sets="4"] .tdh-sb-set-short,
    .tdh-live-scoreboard[data-sets="5"] .tdh-sb-set-short { display: inline; }
}