/**
 * EventHub Base Styles
 *
 * Wrapper, Grid-Layout und Utility-Klassen.
 *
 * @package EventHub
 * @since 1.0.0
 */

/* ==========================================================================
   GLOBAL MOBILE FIXES
   ========================================================================== */

/* Tap-Highlight auf interaktiven Elementen global entfernen */
.eventhub-wrapper button,
.eventhub-wrapper summary,
.eventhub-wrapper [role='button'],
.eventhub-wrapper details > summary {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* ==========================================================================
   WRAPPER
   ========================================================================== */

.eventhub-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--eventhub-spacing-md);
    font-family: var(--eventhub-font-family);
    line-height: var(--eventhub-line-height);
    color: var(--eventhub-color-text);
}

/* Shortcode-Wrapper: Erbt vom Theme-Container, daher keine eigene max-width */
.eventhub-wrapper--shortcode {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */

.eventhub-grid {
    display: grid;
    grid-template-columns: repeat(var(--eventhub-grid-columns), 1fr);
    gap: var(--eventhub-grid-gap);
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.eventhub-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eventhub-clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ==========================================================================
   ARCHIVE HEADER (Legacy-Klassen für Abwärtskompatibilität)
   ========================================================================== */

.eventhub-archive-header {
    margin-bottom: var(--eventhub-spacing-xl);
}

.eventhub-archive-header__image {
    margin-bottom: var(--eventhub-spacing-lg);
    overflow: hidden;
    border-radius: var(--eventhub-border-radius);
}

.eventhub-archive-header__image img {
    width: 100%;
    height: var(--eventhub-header-image-height);
    object-fit: cover;
    object-position: center;
    display: block;
}

.eventhub-archive-header__content {
    /* Erbt Typografie vom Theme */
}

.eventhub-archive-header__title {
    margin: 0 0 var(--eventhub-spacing-sm);
    /* Font-Size erbt vom Theme (h1) */
}

.eventhub-archive-header__description {
    margin-bottom: var(--eventhub-spacing-md);
    color: var(--eventhub-color-text);
}

.eventhub-archive-header__description p:last-child {
    margin-bottom: 0;
}

.eventhub-archive-header__count {
    font-size: var(--eventhub-font-size-sm);
    color: var(--eventhub-color-text-muted);
    margin: 0;
}

.eventhub-archive-header__count-link {
    display: inline-flex;
    align-items: center;
    gap: var(--eventhub-spacing-xs);
    color: var(--eventhub-color-primary);
    text-decoration: none;
    transition: color var(--eventhub-transition);
}

.eventhub-archive-header__count-link:hover {
    color: var(--eventhub-color-primary-dark);
    text-decoration: underline;
}

.eventhub-archive-header__count-arrow {
    font-size: 0.9em;
    transition: transform var(--eventhub-transition);
}

.eventhub-archive-header__count-link:hover
    .eventhub-archive-header__count-arrow {
    transform: translateY(2px);
}

/* ==========================================================================
   HERO EDITORIAL (Konsistente Header für CPTs, Archive, Timeframe)
   ========================================================================== */

.eventhub-hero-editorial {
    margin-bottom: var(--eventhub-spacing-xl, 2rem);
}

.eventhub-hero-editorial__image-wrapper {
    position: relative;
    margin-bottom: var(--eventhub-spacing-lg, 1.5rem);
    overflow: hidden;
    border-radius: var(--eventhub-border-radius, 4px);
}

.eventhub-hero-editorial__image {
    width: 100%;
    height: var(--eventhub-header-image-height, 280px);
    object-fit: cover;
    object-position: center;
    display: block;
}

.eventhub-hero-editorial__content {
    /* Container für Inhalt */
}

.eventhub-hero-editorial__content--no-image {
    /* Keine spezielle Behandlung ohne Bild */
}

.eventhub-hero-editorial__main-column {
    /* Hauptspalte */
}

.eventhub-hero-editorial__main-column--full {
    /* Volle Breite wenn kein Bild */
}

.eventhub-hero-editorial__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eventhub-spacing-sm, 0.5rem);
    margin-bottom: var(--eventhub-spacing-sm, 0.5rem);
    color: var(--eventhub-color-text-muted, #666);
    font-size: var(--eventhub-font-size-sm, 0.875rem);
}

/* Kicker/Dachzeile (z.B. "Veranstaltungsort", "Kategorie") */
.eventhub-hero-editorial__kicker {
    margin: 0 0 var(--eventhub-spacing-xs, 0.25rem);
    padding: 0;
    color: var(--eventhub-color-text-muted, #666);
    font-family: var(--eventhub-font-family, inherit);
    font-size: var(--eventhub-font-size-sm, 0.875rem);
    font-weight: var(--eventhub-font-weight-medium, 500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.eventhub-hero-editorial__title {
    margin: 0 0 var(--eventhub-spacing-md, 1rem);
    /* Font erbt vom Theme (h1) */
}

.eventhub-hero-editorial__description {
    margin-bottom: var(--eventhub-spacing-md, 1rem);
}

.eventhub-hero-editorial__description p:last-child {
    margin-bottom: 0;
}

/* Event-Teaser (Anzahl kommender Veranstaltungen) */
.eventhub-hero-editorial__event-teaser {
    display: inline-flex;
    align-items: center;
    gap: var(--eventhub-spacing-xs, 0.25rem);
    margin-bottom: var(--eventhub-spacing-md, 1rem);
    color: var(--eventhub-color-primary, #0073aa);
    font-size: var(--eventhub-font-size-base, 1rem);
    text-decoration: none;
}

.eventhub-hero-editorial__event-teaser-count {
    font-weight: 600;
}

.eventhub-hero-editorial__event-teaser-text {
    /* Text nach der Zahl */
}

.eventhub-hero-editorial__event-teaser--static {
    cursor: default;
}

/* Section-Zähler (neben Section-Überschriften) */
.eventhub-section-count {
    font-weight: var(--eventhub-font-weight-medium);
    color: var(--eventhub-color-text-muted);
    margin-left: var(--eventhub-spacing-xs);
}

/* ==========================================================================
   OCCURRENCE LIST (Termin-Liste für Serien-Events)
   ========================================================================== */

.eventhub-occurrence-list {
    margin-bottom: var(--eventhub-spacing-xl);
}

.eventhub-occurrence-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.eventhub-occurrence-list li {
    padding: var(--eventhub-spacing-sm) 0;
    border-bottom: 1px solid var(--eventhub-color-border);
}

.eventhub-occurrence-list li:last-child {
    border-bottom: none;
}

.eventhub-occurrence-list a {
    text-decoration: none;
}

.eventhub-occurrence-list a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   SHORTCODE WRAPPER
   ========================================================================== */

.eventhub-shortcode {
    margin: var(--eventhub-spacing-lg) 0;
}

/* Grid-Layout für Cards (Shortcode-spezifisch mit Spalten-Klassen) */
.eventhub-grid--cols-1 {
    --eventhub-grid-columns: 1;
}
.eventhub-grid--cols-2 {
    --eventhub-grid-columns: 2;
}
.eventhub-grid--cols-3 {
    --eventhub-grid-columns: 3;
}
.eventhub-grid--cols-4 {
    --eventhub-grid-columns: 4;
}

/* Responsive Breakpoints für Shortcode-Grid */
@media (max-width: 575.98px) {
    .eventhub-shortcode .eventhub-grid--cols-2,
    .eventhub-shortcode .eventhub-grid--cols-3,
    .eventhub-shortcode .eventhub-grid--cols-4 {
        --eventhub-grid-columns: 1;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .eventhub-shortcode .eventhub-grid--cols-3,
    .eventhub-shortcode .eventhub-grid--cols-4 {
        --eventhub-grid-columns: 2;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .eventhub-shortcode .eventhub-grid--cols-4 {
        --eventhub-grid-columns: 3;
    }
}

/* List-Layout für Shortcode */
.eventhub-shortcode--list {
    display: flex;
    flex-direction: column;
    gap: var(--eventhub-spacing-sm);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.eventhub-empty-state {
    padding: var(--eventhub-spacing-xl);
    text-align: center;
    color: var(--eventhub-color-text-muted);
    font-style: italic;
}

/* ==========================================================================
   SECTION TITEL (einheitliches H2-Styling für alle Abschnitte)
   ========================================================================== */

.eventhub-section-title,
.eventhub-faq__title,
.eventhub-event-dates__title,
.eventhub-child-events__title,
.eventhub-visibility-section__title,
.eventhub-events-section > h2,
.eventhub-opening-hours h2,
.eventhub-event-list__heading,
.eventhub-running-events__heading {
    margin: 0 0 var(--eventhub-spacing-md);
    padding: 0;
    font-family: inherit;
    font-size: var(--eventhub-section-title-size);
    font-weight: var(--eventhub-section-title-weight);
    text-transform: var(--eventhub-section-title-transform);
    letter-spacing: var(--eventhub-section-title-spacing);
    color: inherit;
    border: none;
    background: transparent;
}

/* ==========================================================================
   EVENTS SECTION (Container für Überschrift + Filter + Grid)
   ========================================================================== */

.eventhub-events-section {
    margin-top: var(--eventhub-spacing-xl);
}

/* Header mit Titel und Kalender-Button nebeneinander */
.eventhub-events-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--eventhub-spacing-md);
    margin-bottom: var(--eventhub-spacing-md);
}

.eventhub-events-section__header .eventhub-section-title {
    margin: 0;
}

/* Grid-Überschrift - DEPRECATED: Nutze .eventhub-event-list__heading aus eventhub-sections.css
.eventhub-section-title--grid {
    margin-top: var(--eventhub-spacing-lg);
    margin-bottom: var(--eventhub-spacing-md);
}
*/

/* ==========================================================================
   FAQ KOMPONENTE (partials/faq-list.php)
   ========================================================================== */

.eventhub-faq {
    margin-bottom: var(--eventhub-spacing-xl);
}

/* .eventhub-faq__title - Styling in Section-Titel-Block oben */

.eventhub-faq__list {
    display: flex;
    flex-direction: column;
    gap: var(--eventhub-spacing-xs);
}

.eventhub-faq__item {
    border: 1px solid var(--eventhub-color-border);
    border-radius: var(--eventhub-border-radius);
    background: var(--eventhub-color-bg-alt);
}

.eventhub-faq__question {
    display: flex;
    align-items: center;
    gap: var(--eventhub-spacing-sm);
    padding: var(--eventhub-spacing-sm) var(--eventhub-spacing-md);
    font-weight: var(--eventhub-font-weight-medium);
    cursor: pointer;
    list-style: none;
    transition: background-color var(--eventhub-transition);
    /* Mobile: Tap-Highlight entfernen */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.eventhub-faq__question::-webkit-details-marker {
    display: none;
}

.eventhub-faq__question::before {
    content: '▸';
    flex-shrink: 0;
    color: var(--eventhub-color-primary);
    transition: transform var(--eventhub-transition);
}

.eventhub-faq__item[open] .eventhub-faq__question::before {
    transform: rotate(90deg);
}

.eventhub-faq__question:hover {
    background: var(--eventhub-color-surface-hover);
}

.eventhub-faq__question:focus-visible {
    outline: 2px solid var(--eventhub-color-primary);
    outline-offset: -2px;
}

.eventhub-faq__answer {
    padding: 0 var(--eventhub-spacing-md) var(--eventhub-spacing-md);
    padding-left: calc(
        var(--eventhub-spacing-md) + 1em + var(--eventhub-spacing-sm)
    );
    color: var(--eventhub-color-text);
    line-height: 1.6;
}

.eventhub-faq__answer p {
    margin: 0;
}

/* ==========================================================================
   BACK NAVIGATION
   ========================================================================== */

.eventhub-back-navigation {
    margin-top: var(--eventhub-spacing-xl, 2rem);
}

.eventhub-back-button {
    display: inline-flex;
    align-items: center;
    gap: var(--eventhub-spacing-xs, 0.25rem);
    /* Padding für Hover-Hintergrund, aber negatives Margin links für optische Bündigkeit */
    padding: var(--eventhub-spacing-sm, 0.5rem) var(--eventhub-spacing-md, 1rem);
    margin-left: calc(-1 * var(--eventhub-spacing-md, 1rem));
    color: var(--eventhub-color-text-muted, #666);
    text-decoration: none;
    font-size: var(--eventhub-font-size-base, 1rem);
    font-weight: 500;
    border-radius: var(--eventhub-border-radius, 4px);
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.eventhub-back-button:hover {
    color: var(--eventhub-color-primary, #0073aa);
    background-color: var(--eventhub-color-surface-hover, rgba(0, 0, 0, 0.03));
    text-decoration: none;
}

.eventhub-back-button__icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

.eventhub-back-button__text {
    /* Text bleibt auf einer Zeile */
}

/* ==========================================================================
   BUTTONS (globale Basisklassen)
   ========================================================================== */

.eventhub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--eventhub-spacing-sm, 0.5rem);
    padding: var(--eventhub-spacing-sm, 0.5rem)
        var(--eventhub-spacing-lg, 1.5rem);
    border: none;
    border-radius: var(--eventhub-border-radius, 4px);
    font-size: var(--eventhub-font-size-base, 1rem);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--eventhub-transition, 0.2s ease);
}

.eventhub-btn:hover {
    text-decoration: none;
}

.eventhub-btn--primary {
    background: var(--eventhub-color-primary, #0073aa);
    color: #fff;
}

.eventhub-btn--primary:hover {
    background: #005a87;
    color: #fff;
}

.eventhub-btn--secondary {
    background: var(--eventhub-color-bg-alt, #f9f9f9);
    color: var(--eventhub-color-text, inherit);
    border: 1px solid var(--eventhub-color-border, #ddd);
}

.eventhub-btn--secondary:hover {
    background: var(--eventhub-color-bg, #eee);
}

.eventhub-btn--small {
    padding: var(--eventhub-spacing-xs, 0.25rem)
        var(--eventhub-spacing-md, 1rem);
    font-size: var(--eventhub-font-size-sm, 0.875rem);
}

.eventhub-btn--large {
    padding: var(--eventhub-spacing-md, 1rem) var(--eventhub-spacing-xl, 2rem);
    font-size: var(--eventhub-font-size-lg, 1.25rem);
}

.eventhub-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
