/* ================================================================
   STM Event Manager – Main Stylesheet
   Version: 1.2.0
   (c) Swen Braunreuter – www.bluWORX.de
   ================================================================ */

/* --- BASIS & SCHRIFT --- */
#stm-event-root, 
#stm-event-detail-root {
    font-family: 'Open Sans', sans-serif;
    width: 100%;
    color: #333;
    line-height: 1.6;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ----------------------------------------------------------------
   1. EVENT GRID (Übersichtsseite)
----------------------------------------------------------------
*/

.stm-event-filter-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

body.admin-bar .stm-event-filter-container {
    top: 32px; 
}

/* Mobile Header - Auf Desktop unsichtbar */
.stm-filter-mobile-header {
    display: none;
}

.stm-event-search-wrapper { margin-bottom: 20px; }
.stm-event-search-wrapper input {
    width: 100%; padding: 12px 15px; border: 1px solid #ccc; border-radius: 6px; font-size: 16px; background: #fff;
}

.stm-event-selectors-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stm-event-year-select select {
    padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; font-weight: 700; background: #fff;
}

.stm-event-month-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.stm-event-month-btn {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s;
    color: #999;
}

.stm-event-month-btn.has-events { color: #333; border-color: #bbb; }
.stm-event-month-btn.has-events:hover { background: #eee; }

.stm-event-month-btn.active {
    background: #ffcc00 !important;
    border-color: #ffcc00 !important;
    color: #000 !important;
}

.stm-event-month-btn.disabled {
    opacity: 0.4;
    cursor: default;
    background: #f0f0f1;
}

.stm-event-stats { font-size: 13px; color: #777; margin-bottom: 25px; padding-left: 5px; }
#stm-evt-count { font-weight: bold; color: #000; }

.stm-event-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stm-event-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border: 1px solid #ffcc00;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stm-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.stm-event-image {
    padding: 20px;
    width: 280px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.stm-event-image img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 8px; aspect-ratio: 1 / 1;
}

.stm-event-content {
    padding: 30px 20px 30px 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stm-event-content h3 { 
    margin: 0 0 5px 0; 
    font-size: clamp(1.2rem, 2vw + 0.8rem, 1.6rem) !important; 
    font-weight: 700; 
    color: #111; 
}

.stm-event-content .stm-event-slogan { 
    font-size: 14px !important; 
    color: #666666 !important; 
    margin: 0 0 20px 0 !important;
    font-weight: 400 !important;
}

/* Bestehende Icon-Zeilen (bleiben drin für Kompatibilität) */
.stm-event-icon-row { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.stm-event-icon {
    width: 36px; height: 36px; background: #ffcc00; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #000;
}

/* ==========================================================
   NEU: Kompakte Meta-Anzeige für Start / Ende / Ort
   (für die neue PHP-Ausgabe mit .stm-event-meta-*)
   ========================================================== */

.stm-event-meta-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.stm-event-meta-row {
    display: grid;
    grid-template-columns: 18px 42px 1fr;
    align-items: center;
    column-gap: 10px;
    line-height: 1.3;
    margin: 0;
}

.stm-event-meta-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d4aa00; /* dezentes Gold passend zum Brand */
    opacity: 0.95;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.stm-event-meta-ico svg {
    display: block;
    width: 15px;
    height: 15px;
}

.stm-event-meta-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #7a7a7a;
    line-height: 1.2;
}

.stm-event-meta-value {
    font-size: 14px;
    color: #2b2b2b;
    line-height: 1.3;
    word-break: break-word;
}

/* Ende-Zeile dezent */
.stm-event-meta-row-end .stm-event-meta-value {
    color: #3a3a3a;
}

/* Optional minimal mehr Abstand unter der gesamten Detailliste */
.stm-event-details {
    margin-top: 2px;
}

.stm-event-action {
    border-left: 1px solid #eee;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
}

.stm-event-btn {
    display: block; width: 100%; text-align: center; background: #ffcc00; color: #000; padding: 14px 20px; text-decoration: none !important; font-weight: 700; border-radius: 4px; font-size: 14px;
    cursor: pointer; border: none; transition: background 0.2s;
}

.stm-event-btn:hover { 
    background: #e6b800 !important; 
    color: #000 !important; 
}

/* ----------------------------------------------------------------
   2. BADGE RIBBONS
----------------------------------------------------------------
*/

.stm-badge-ribbon {
    position: absolute;
    z-index: 10;
    padding: 5px 0;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    line-height: 1; 
    text-transform: uppercase;
}

.stm-event-image .stm-badge-ribbon {
    top: 22px;
    left: -33px;
    right: auto;
    width: 140px;
    transform: rotate(-45deg);
    font-size: 10px;
}

.stm-event-detail-header-img .stm-badge-ribbon {
    top: 30px !important;
    right: -45px !important;
    left: auto !important; 
    width: 180px !important; 
    transform: rotate(45deg) !important;
    font-size: 13px !important;
    padding: 8px 0 !important;
}

.stm-badge-ribbon.stm { background: #ffcc00; color: #000; }
.stm-badge-ribbon.featured { background: #d11218; color: #fff; }

/* ----------------------------------------------------------------
   3. DETAILSEITE
----------------------------------------------------------------
*/

#stm-event-detail-root {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.stm-event-detail-header {
    display: flex;
    background: #ffcc00;
    border-radius: 20px;
    overflow: hidden;
    min-height: 400px;
    margin-bottom: 50px;
}

.stm-event-detail-header-info {
    flex: 1.2;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stm-event-detail-back { text-decoration: none; color: #333; font-size: 14px; margin-bottom: 25px; display: block; font-weight: 600; }

.stm-event-detail-header-info h1 { 
    font-size: clamp(1.5rem, 5vw + 1rem, 2.75rem) !important; 
    font-weight: 800 !important; 
    margin: 0 0 5px 0 !important; 
    line-height: 1.1 !important; 
    color: #000 !important;
}

.stm-event-detail-header-info h2 { 
    font-size: 16px !important; 
    font-weight: 400 !important; 
    margin: 0 0 40px 0 !important; 
    color: #666666 !important; 
    line-height: 1.4 !important; 
    text-transform: none !important;
    border: none !important;
}

.stm-event-detail-header-meta { display: flex; flex-direction: column; gap: 12px; }
.stm-event-detail-header-meta p { 
    font-weight: 700; margin: 0; font-size: 18px; display: flex; align-items: center; gap: 10px; 
}

.stm-event-detail-header-img { 
    flex: 1; 
    position: relative; 
    overflow: hidden;
}
.stm-event-detail-header-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.stm-event-detail-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

.stm-event-detail-content { min-width: 0; }
.stm-event-detail-title-large { 
    text-transform: uppercase; font-weight: 800; font-size: 26px; border-bottom: 3px solid #333; padding-bottom: 15px; margin-bottom: 35px; 
}

.stm-event-detail-sidebar { display: flex; flex-direction: column; }

.stm-event-detail-price {
    background: #ffcc00;
    padding: 18px;
    font-weight: 800;
    font-size: 18px;
    text-align: center;
    border-radius: 6px 6px 0 0;
}

.stm-event-detail-box {
    background: #fffbe6;
    padding: 30px 25px;
    margin-top: 2px;
}

.stm-event-detail-box:last-child { border-radius: 0 0 6px 6px; }

.stm-event-detail-box-title { font-weight: 800; font-size: 22px; margin-bottom: 15px; }
.stm-event-detail-box p { margin: 8px 0; font-size: 15px; }

.stm-event-osm-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #ffcc00;
    color: #000;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s;
}

.stm-event-osm-btn:hover { background: #e6b800 !important; color: #000 !important; }

/* ----------------------------------------------------------------
   4. RESPONSIVE ANPASSUNGEN (KORRIGIERT)
----------------------------------------------------------------
*/
@media (max-width: 900px) {
    #stm-event-root, #stm-event-detail-root { padding: 0 15px; }
    
    .stm-event-card, .stm-event-detail-header { flex-direction: column; }
    .stm-event-image, .stm-event-detail-header-info { width: 100%; padding: 25px; }
    
    /* Padding-Fix für Grid-Texte auf Mobile */
    .stm-event-card .stm-event-content { padding: 10px 25px 30px 25px; }
    
    .stm-event-detail-main { grid-template-columns: 1fr; gap: 30px; }
    .stm-event-action { border-left: none; border-top: 1px solid #eee; width: 100%; padding: 25px; }

    /* NEU: Meta-Zeilen auf Mobile etwas kompakter */
    .stm-event-meta-row {
        grid-template-columns: 18px 38px 1fr;
        column-gap: 8px;
    }

    .stm-event-meta-label {
        font-size: 11px;
    }

    .stm-event-meta-value {
        font-size: 13px;
    }
    
    /* Mobile Toggle Mechanik (Match mit PHP Klassen) */
    .stm-event-filter-container { 
        padding: 0; 
        overflow: hidden; 
        transition: background 0.3s ease;
        top: 0px; 
    }

    .stm-filter-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        background: #fff;
        cursor: pointer;
        border-bottom: 1px solid #eee;
    }

    .stm-m-label { font-size: 10px; text-transform: uppercase; font-weight: 800; color: #999; letter-spacing: 0.5px; }
    .stm-m-active-state { display: block; font-size: 14px; font-weight: 700; color: #000; }
    .stm-filter-m-icon { transition: transform 0.3s ease; }

    /* Fix: Selektor hieß in PHP "body", im CSS "content" -> korrigiert auf "body" */
    .stm-filter-collapsible-body {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0 20px;
    }

    /* Status: OFFEN */
    .stm-event-filter-container.is-open { background: #f9f9f9; }
    .stm-event-filter-container.is-open .stm-filter-collapsible-body {
        max-height: 800px; 
        opacity: 1;
        visibility: visible;
        padding: 20px;
    }
    .stm-event-filter-container.is-open .stm-filter-m-icon { transform: rotate(180deg); }
    .stm-event-filter-container.is-open .stm-filter-mobile-header { background: #f9f9f9; }
}

/* ----------------------------------------------------------------
   1b. VERTIKALER SHORTCODE (Sidebar / News-Spalte)
   Shortcode: [stm-event-vertical]
----------------------------------------------------------------
*/

.stm-vertical-list-wrap {
    width: 100%;
}

.stm-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Kompakte vertikale Karte */
.stm-vertical-card {
    background: #fff;
    border: 1px solid #ffcc00;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stm-vertical-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.stm-vertical-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f5f5f5;
}

.stm-vertical-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Kleine Badges im Stil deiner Ribbon-Farben */
.stm-vertical-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
    letter-spacing: .03em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.stm-vertical-badge.stm {
    background: #ffcc00;
    color: #000;
}

.stm-vertical-badge.featured {
    background: #d11218;
    color: #fff;
}

.stm-vertical-body {
    padding: 14px 14px 14px 14px;
}

.stm-vertical-title {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 700;
    color: #111;
}

.stm-vertical-title a {
    color: inherit;
    text-decoration: none;
}

.stm-vertical-title a:hover {
    text-decoration: underline;
}

.stm-vertical-slogan {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Meta-Liste kompakt (ähnlich deinem neuen Grid-Meta-Look) */
.stm-vertical-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stm-vertical-meta-row {
    display: grid;
    grid-template-columns: 16px 40px 1fr;
    align-items: start;
    column-gap: 8px;
    line-height: 1.25;
}

.stm-vertical-meta-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d4aa00;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.stm-vertical-meta-ico svg {
    width: 14px;
    height: 14px;
    display: block;
}

.stm-vertical-meta-label {
    font-size: 10px;
    font-weight: 800;
    color: #777;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.35;
    padding-top: 1px;
}

.stm-vertical-meta-value {
    font-size: 13px;
    color: #2b2b2b;
    line-height: 1.35;
    word-break: break-word;
}

.stm-vertical-meta-row-end .stm-vertical-meta-value {
    color: #333;
}

/* Buttonbereich */
.stm-vertical-actions {
    margin-top: 14px;
}

.stm-vertical-btn {
    padding: 11px 14px;
    font-size: 13px;
    border-radius: 6px;
}

/* Wenn der Shortcode in sehr schmalen Sidebars sitzt */
@media (max-width: 480px) {
    .stm-vertical-body {
        padding: 12px;
    }

    .stm-vertical-title {
        font-size: 1rem;
    }

    .stm-vertical-meta-row {
        grid-template-columns: 16px 36px 1fr;
        column-gap: 7px;
    }

    .stm-vertical-meta-label {
        font-size: 9px;
    }

    .stm-vertical-meta-value {
        font-size: 12px;
    }
}

/* ==========================================================
   NEU: Detailseite Sidebar-Box "Wann?" im kompakten Meta-Stil
   ========================================================== */

.stm-event-detail-when-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.stm-event-detail-when-row {
    display: grid;
    grid-template-columns: 18px 42px 1fr;
    align-items: start;
    column-gap: 10px;
    line-height: 1.3;
}

.stm-event-detail-when-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #d4aa00;
    margin-top: 1px;
}

.stm-event-detail-when-ico svg {
    display: block;
    width: 15px;
    height: 15px;
}

.stm-event-detail-when-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #7a7a7a;
    line-height: 1.25;
    padding-top: 1px;
}

.stm-event-detail-when-value {
    font-size: 14px;
    color: #2b2b2b;
    line-height: 1.35;
    word-break: break-word;
}

.stm-event-detail-when-row-end .stm-event-detail-when-value {
    color: #3a3a3a;
}