/* =============================================================================
   Transylvania Liga — Public Styles
   Brand: #CC0000 (primary), #1a1a1a (secondary)
   ============================================================================= */

/* --- CSS custom properties ------------------------------------------------- */
:root {
    --tsv-primary:  #CC0000;
    --tsv-dark:     #1a1a1a;
    --tsv-positive: #2E8B57;
    --tsv-muted:    #999999;
    --tsv-border:   #e0e0e0;
}

/* --- Reset / base ---------------------------------------------------------- */
.tsv-schedule-wrapper *,
.tsv-league-info *,
.tsv-locations-grid *,
.tsv-faq-accordion * {
    box-sizing: border-box;
}

/* --- Buttons --------------------------------------------------------------- */
.tsv-btn {
    display: inline-block;
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 2px;
    font-family: sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    border: none;
    line-height: 1;
    text-align: center;
    transition: background 0.15s;
}
.tsv-btn-primary {
    background: #CC0000;
    color: #fff;
}
.tsv-btn-primary:hover,
.tsv-btn-primary:focus {
    background: #aa0000;
    color: #fff;
    text-decoration: none;
}
.tsv-btn-secondary {
    background: #1a1a1a;
    color: #fff;
}
.tsv-btn-secondary:hover,
.tsv-btn-secondary:focus {
    background: #333;
    color: #fff;
}
.tsv-btn-block {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

/* --- 3-column wrapper ------------------------------------------------------ */
.tsv-schedule-wrapper {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    grid-template-rows: auto;
    gap: 24px;
    font-family: sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
    align-items: start;
}

/* --- Section / sidebar headings ------------------------------------------- */
.tsv-section-title,
.tsv-sidebar-heading {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 6px;
    margin: 0 0 12px;
    color: #1a1a1a;
}

/* --- League Info Card ------------------------------------------------------ */
.tsv-league-info {
    font-family: sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    max-width: 720px;
}
.tsv-league-hero { margin-bottom: 16px; }
.tsv-league-hero-img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}
.tsv-league-title {
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.2;
}
.tsv-league-dates  { color: #555; margin: 0 0 4px; }
.tsv-league-format { color: #555; margin: 0 0 12px; }
.tsv-league-age-groups {
    padding-left: 20px;
    margin: 0 0 16px;
}
.tsv-league-age-groups li { margin-bottom: 3px; }
.tsv-league-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.tsv-league-locations-text p { margin: 0 0 6px; }

/* --- Location Grid --------------------------------------------------------- */
.tsv-locations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    font-family: sans-serif;
    font-size: 13px;
}
.tsv-location-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tsv-location-card .dashicons {
    color: #CC0000;
    font-size: 20px;
    width: 20px;
    height: 20px;
}
.tsv-location-name { font-weight: 700; }
.tsv-maps-link { color: #CC0000; font-size: 12px; text-decoration: none; }
.tsv-maps-link:hover { text-decoration: underline; }

/* --- FAQ Accordion (pure CSS checkbox hack) -------------------------------- */
.tsv-faq-accordion { font-family: sans-serif; font-size: 13px; }
.tsv-faq-item { border-bottom: 1px solid #eee; }
.tsv-faq-toggle { display: none; }

.tsv-faq-question {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    color: #1a1a1a;
}
.tsv-faq-icon {
    flex-shrink: 0;
    width: 18px;
    font-size: 18px;
    line-height: 1;
    color: #CC0000;
    font-weight: 300;
    transition: transform 0.2s;
    margin-top: 1px;
}
.tsv-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    color: #444;
    line-height: 1.6;
}
.tsv-faq-toggle:checked + .tsv-faq-question .tsv-faq-icon {
    transform: rotate(45deg);
}
.tsv-faq-toggle:checked ~ .tsv-faq-answer {
    max-height: 600px;
    padding-bottom: 12px;
}

/* --- Left sidebar ---------------------------------------------------------- */
.tsv-sidebar-left { min-width: 0; }
.tsv-league-nav ul { list-style: none; margin: 0; padding: 0; }
.tsv-league-nav li { border-bottom: 1px solid #eee; }
.tsv-league-nav a {
    display: block;
    padding: 7px 0;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 13px;
}
.tsv-league-nav li.active a { color: #CC0000; font-weight: 700; }
.tsv-league-nav a:hover { color: #CC0000; }
.tsv-promo-card { margin-top: 20px; }
.tsv-promo-img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 8px;
    display: block;
}

/* --- Standings Table ------------------------------------------------------- */
.tsv-standings-wrapper { overflow-x: auto; margin-bottom: 28px; }
.tsv-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 380px;
}
.tsv-standings-table thead th {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.tsv-standings-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.tsv-standings-row:hover td { background: #fafafa; }
.tsv-first-place td:first-child {
    border-left: 3px solid #CC0000;
    padding-left: 7px;
}
.tsv-col-pts { color: #CC0000; font-weight: 700; }
.tsv-gd-positive { color: #2E8B57; font-weight: 600; }
.tsv-gd-negative { color: #CC0000; }
.tsv-col-rank { width: 32px; font-weight: 700; }
.tsv-team-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 6px;
}

/* --- Schedule filters ------------------------------------------------------ */
.tsv-schedule-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.tsv-filter {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    background: #fff;
    min-width: 120px;
}

/* --- Schedule matches ------------------------------------------------------ */
.tsv-day-group { margin-bottom: 22px; }
.tsv-day-header {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 5px;
    margin: 0 0 6px;
    color: #1a1a1a;
}
.tsv-match-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 13px;
}
.tsv-match-home,
.tsv-match-away {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.tsv-match-away { justify-content: flex-end; flex-direction: row-reverse; }
.tsv-match-score {
    min-width: 52px;
    text-align: center;
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 3px;
    flex-shrink: 0;
}
.tsv-score-future { color: #999; }
.tsv-score-played { color: #1a1a1a; font-weight: 700; }
.tsv-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tsv-match-field {
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}
.tsv-match-field .dashicons { font-size: 14px; width: 14px; height: 14px; }

/* --- Right sidebar --------------------------------------------------------- */
.tsv-sidebar-right { min-width: 0; }
.tsv-league-info-card,
.tsv-locations-sidebar,
.tsv-faq-sidebar { margin-bottom: 20px; }
.tsv-league-info-card p { margin: 4px 0; font-size: 13px; }
.tsv-location-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    margin-bottom: 4px;
}
.tsv-location-item .dashicons { color: #CC0000; font-size: 16px; width: 16px; height: 16px; }

/* --- Utility --------------------------------------------------------------- */
.tsv-no-data { color: #888; font-style: italic; font-size: 13px; margin: 8px 0; }
.tsv-error   { color: #CC0000; font-size: 13px; }

/* =============================================================================
   Mobile — single column, sidebars become pure-CSS accordions
   ============================================================================= */
@media (max-width: 767px) {

    /* Stack columns vertically: sidebar-left, main, sidebar-right */
    .tsv-schedule-wrapper {
        grid-template-columns: 1fr;
    }

    /* Hide mobile-hidden standings columns */
    .tsv-hide-mobile { display: none !important; }

    .tsv-sidebar-left,
    .tsv-sidebar-right { width: 100%; }

    /* Accordion toggle: hidden checkbox drives the collapsible */
    .tsv-sidebar-toggle { display: none; }

    .tsv-sidebar-left  .tsv-sidebar-heading,
    .tsv-sidebar-right .tsv-sidebar-heading {
        cursor: pointer;
        border-bottom-color: #CC0000;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .tsv-toggle-icon {
        display: inline-block;
        font-size: 11px;
        transition: transform 0.2s;
    }

    .tsv-sidebar-content { display: none; padding-top: 8px; }

    .tsv-sidebar-toggle:checked ~ .tsv-sidebar-heading .tsv-toggle-icon {
        transform: rotate(180deg);
    }
    .tsv-sidebar-toggle:checked ~ .tsv-sidebar-content { display: block; }

    /* Locations: single column */
    .tsv-locations-grid { grid-template-columns: 1fr; }

    /* Hide field location on small screens to keep rows clean */
    .tsv-match-field { display: none; }

    /* Schedule filters: wrap nicely */
    .tsv-filter { min-width: 100px; flex: 1 1 auto; }
}

/* Desktop: hide sidebar accordion controls */
@media (min-width: 768px) {
    .tsv-sidebar-toggle { display: none; }
    .tsv-sidebar-content { display: block !important; }
    .tsv-toggle-icon { display: none; }
}
