/* =========================================================
   Tonspion Tourdaten – Frontend-Styles
   ========================================================= */

/* ── Wrapper ── */
.ton-tourdaten {
    margin: 2em 0;
    font-size: 0.95em;
}
.ton-tourdaten__title {
    font-size: 1.4em;
    margin-bottom: 0.6em;
}

/* ── Suchfeld ── */
.ton-td-search-wrap {
    margin-bottom: 1em;
}
.ton-td-search {
    width: 100%;
    max-width: 320px;
    padding: 0.35em 0.7em;
    font-size: 0.9em;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
}
.ton-td-search:focus {
    border-color: #555;
}
.ton-td-search:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}
.ton-td-no-results {
    display: none;
    margin-top: 0.4em;
    font-size: 0.88em;
    color: #6b6b6b;
    font-style: italic;
}
.ton-td-no-results.visible {
    display: block;
}

/* ── Monats-Gruppe (details/summary) ── */
.ton-tourdaten__month-group {
    margin-top: 1.4em;
}
.ton-tourdaten__month-group + .ton-tourdaten__month-group {
    margin-top: 1em;
}

.ton-tourdaten__month {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    font-size: 1em;
    font-weight: 700;
    padding-bottom: 0.25em;
    border-bottom: 2px solid #222;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    gap: 0.5em;
}
/* Pfeil-Indikator */
.ton-tourdaten__month::after {
    content: '▸';
    font-size: 0.75em;
    font-weight: 400;
    color: #767676;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.ton-tourdaten__month-group[open] > .ton-tourdaten__month::after {
    transform: rotate(90deg);
}
/* Browsernormalisierung summary-Marker entfernen */
.ton-tourdaten__month::-webkit-details-marker { display: none; }

.ton-td-count {
    font-size: 0.75em;
    font-weight: 400;
    color: #6b6b6b;
    margin-left: auto;
    margin-right: 0.3em;
}

/* ── Event-Liste (seit 2.1.2 als <ul>/<li>) ── */
.ton-tourdaten ul.ton-tourdaten__list {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0.2em 0 0;
}
.ton-tourdaten ul.ton-tourdaten__list > li {
    list-style: none;
    margin: 0;
}
.ton-tourdaten ul.ton-tourdaten__list > li::before,
.ton-tourdaten ul.ton-tourdaten__list > li::marker {
    content: none;
}

/* ── Einzelne Zeile – 4-Spalten-Grid (city) / 3-Spalten (artist) ── */
.ton-tourdaten__event {
    display: grid;
    grid-template-columns: 82px 1fr 1fr auto;
    column-gap: 0.9em;
    align-items: baseline;
    padding: 0.38em 0;
    border-bottom: 1px solid #ebebeb;
    line-height: 1.45;
}
.ton-tourdaten--no-artist .ton-tourdaten__event {
    grid-template-columns: 82px 1fr auto;
}
.ton-tourdaten__event:last-child {
    border-bottom: none;
}

/* ── Spalten ── */
.ton-td-date {
    color: #6b6b6b;
    font-size: 0.88em;
    white-space: nowrap;
}
.ton-td-location {
    color: #666;
    font-size: 0.88em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}
.ton-td-links {
    white-space: nowrap;
    font-size: 0.88em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Links ── */
.ton-td-tickets {
    display: inline-block;
    padding: 0.15em 0.55em;
    border: 1px solid currentColor;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.85em;
    line-height: 1.5;
}
.ton-td-tickets:hover {
    background: #222;
    color: #fff;
    border-color: #222;
}
.ton-td-cal {
    text-decoration: none;
    font-size: 1em;
    opacity: 0.7;
}
.ton-td-cal:hover,
.ton-td-cal:focus-visible {
    opacity: 1;
}

/* ── Fokus sichtbar (Tastatur) ── */
.ton-tourdaten__month:focus-visible,
.ton-td-tickets:focus-visible,
.ton-td-cal:focus-visible,
.ton-td-retry:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}

/* ── Nur für Screenreader ── */
.ton-td-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Lazy Loading / Suche (seit 2.1.0) ── */
.ton-td-loading,
.ton-td-error {
    padding: 0.6em 0;
    font-size: 0.88em;
    color: #6b6b6b;
}
.ton-td-error { color: #a33; }
.ton-td-retry {
    margin-left: 0.4em;
    padding: 0.1em 0.5em;
    font: inherit;
    font-size: 0.95em;
    border: 1px solid currentColor;
    border-radius: 3px;
    background: none;
    color: inherit;
    cursor: pointer;
}
.ton-td-search-results[aria-busy="true"] { opacity: 0.5; }
.ton-td-search-month {
    margin-top: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 0.25em;
    border-bottom: 2px solid #222;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .ton-tourdaten {
        font-size: 0.88em;
    }
    .ton-td-search {
        max-width: 100%;
    }
    .ton-tourdaten__event {
        grid-template-columns: 72px 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 0.05em;
        padding: 0.45em 0;
    }
    .ton-td-date     { grid-column: 1; grid-row: 1; font-size: 0.82em; }
    .ton-td-artist   { grid-column: 2; grid-row: 1; font-size: 0.88em; }
    .ton-td-links    { grid-column: 3; grid-row: 1 / 3; align-self: center; }
    .ton-td-location { grid-column: 2; grid-row: 2; max-width: none; font-size: 0.82em; }
}

/* ── Touch-Ziele mind. 44 × 44 px (WCAG 2.5.5) auf Mobilgeräten ── */
@media (max-width: 600px), (pointer: coarse) {
    .ton-td-links {
        gap: 8px;
    }
    .ton-td-tickets,
    .ton-td-cal {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: 44px;
        min-height: 44px;
    }
    .ton-td-tickets {
        padding: 0 0.75em;
        font-size: 0.85em;
        line-height: 1;
    }
    .ton-td-cal {
        font-size: 1.15em;
        opacity: 0.85;
    }
    .ton-td-retry {
        min-height: 44px;
        padding: 0 0.9em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ton-tourdaten__month::after { transition: none; }
}
