/**
 * Öffnungszeiten Frontend Styles
 *
 * Primäre Textfarbe und Schrift werden vom Theme geerbt.
 * Alle konfigurierbaren Farben laufen über CSS Custom Properties,
 * die im Backend überschrieben werden können.
 */

:root {
    --oz-text-muted:       #666666; /* gedämpfte Textfarbe (Zeiten, Zusatzinfos) */
    --oz-text-faint:       #999999; /* sehr gedämpft (Bemerkungen) */
    --oz-geschlossen:      #c62828; /* "Geschlossen"-Farbe */
    --oz-offen-bg:         #e8f5e9; /* Badge "Jetzt geöffnet" Hintergrund */
    --oz-offen-text:       #2e7d32; /* Badge "Jetzt geöffnet" Textfarbe */
    --oz-offen-dot:        #4caf50; /* Badge "Jetzt geöffnet" Punkt */
    --oz-zu-bg:            #ffebee; /* Badge "Aktuell geschlossen" Hintergrund */
    --oz-zu-text:          #c62828; /* Badge "Aktuell geschlossen" Textfarbe */
    --oz-zu-dot:           #f44336; /* Badge "Aktuell geschlossen" Punkt */
    --oz-heute-badge-bg:   #000000; /* "Heute"-Marker Hintergrund */
    --oz-heute-badge-text: #ffffff; /* "Heute"-Marker Textfarbe */
    --oz-zebra-farbe:      #f9f9f9; /* Zebra-Streifen Hintergrundfarbe */
}

/* Leere P-Tags vor/nach Shortcodes ausblenden */
.oz-oeffnungszeiten + p:empty,
.oz-oeffnungszeiten-heute + p:empty,
.oz-oeffnungszeiten-spezial + p:empty {
    display: none;
    margin: 0;
    padding: 0;
    height: 0;
    line-height: 0;
}

p:has(+ .oz-oeffnungszeiten),
p:has(+ .oz-oeffnungszeiten-heute),
p:has(+ .oz-oeffnungszeiten-spezial) {
    margin: 0;
    padding: 0;
    height: 0;
    line-height: 0;
    font-size: 0;
}

/* Wochenübersicht */
.oz-oeffnungszeiten {
    margin: 0 0 20px 0;
}

.oz-shortcode-title {
    margin: 0 0 15px 0;
    padding: 0;
    line-height: 1.3;
}

.oz-oeffnungszeiten-tabelle {
    width: 100%;
    border-collapse: collapse;
    border: none !important;
}

.oz-oeffnungszeiten-tabelle tbody {
    border: none !important;
}

.oz-oeffnungszeiten-tabelle tr {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

.oz-oeffnungszeiten-tabelle td {
    padding: 12px 15px;
    vertical-align: middle;
    border: none !important;
}

/* Tagname erbt Textfarbe vom Theme */
.oz-tag-name {
    font-weight: 500;
    width: 40%;
    font-size: 1em;
    white-space: nowrap;
}

/* Zeiten in gedämpfter Farbe */
.oz-tag-zeiten {
    text-align: right;
    font-size: 0.95em;
    color: var(--oz-text-muted);
}

/* Heute: stärker gewichtet, Farbe erbt vom Theme */
.oz-oeffnungszeiten-tabelle tr.oz-heute .oz-tag-name {
    font-weight: 600;
}

.oz-oeffnungszeiten-tabelle tr.oz-heute .oz-tag-zeiten {
    font-weight: 500;
    color: inherit;
}

.oz-heute-marker {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--oz-heute-badge-bg);
    color: var(--oz-heute-badge-text);
}

.oz-info-icon {
    font-size: 0.75em;
    opacity: 0.6;
    margin-right: 4px;
}

.oz-oeffnungszeiten-tabelle tr.oz-hat-spezial {
    position: relative;
}

.oz-zeiten-wrapper {
    position: relative;
}

.oz-spezial-zeiten {
    display: block;
}

.oz-regulaere-zeiten {
    display: block;
    font-size: 0.85em;
    color: var(--oz-text-muted);
    margin-top: 4px;
}

.oz-bemerkung-inline {
    display: inline-block;
    font-size: 0.85em;
    color: var(--oz-text-faint);
    font-style: italic;
    margin-left: 6px;
}

/* Geschlossen */
.oz-geschlossen {
    color: var(--oz-geschlossen);
    font-weight: 500;
}

/* Heute Shortcode */
.oz-oeffnungszeiten-heute {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
}

/* Tagname erbt vom Theme */
.oz-heute-tag {
    font-weight: 600;
    font-size: 1em;
}

.oz-heute-zeiten {
    font-weight: 400;
    color: var(--oz-text-muted);
}

.oz-heute-bemerkung {
    color: var(--oz-text-faint);
    font-size: 0.9em;
}

/* Status-Badge */
.oz-status {
    display: inline-flex;
    align-items: center;
    font-size: 0.8em;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 3px;
    margin-left: 8px;
}

.oz-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.oz-status.oz-offen {
    background: var(--oz-offen-bg);
    color: var(--oz-offen-text);
}

.oz-status.oz-offen::before {
    background: var(--oz-offen-dot);
}

.oz-status.oz-zu {
    background: var(--oz-zu-bg);
    color: var(--oz-zu-text);
}

.oz-status.oz-zu::before {
    background: var(--oz-zu-dot);
}

/* Spezielle Öffnungszeiten */
.oz-oeffnungszeiten-spezial {
    margin: 0 0 20px 0;
}

.oz-spezial-tabelle {
    width: 100%;
    border-collapse: collapse;
    border: none !important;
}

.oz-spezial-tabelle tbody {
    border: none !important;
}

.oz-spezial-tabelle tr {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

.oz-spezial-tabelle td {
    padding: 12px 15px;
    vertical-align: middle;
    border: none !important;
}

/* Datum erbt vom Theme */
.oz-spezial-datum {
    font-weight: 500;
    font-size: 0.95em;
    width: 50%;
}

.oz-spezial-info {
    text-align: right;
    color: var(--oz-text-muted);
    font-size: 0.95em;
}

.oz-spezial-bemerkung {
    color: var(--oz-text-faint);
    font-size: 0.85em;
    margin-left: 8px;
}

/* Zebra-Streifen (werden per Inline-CSS aktiviert, wenn konfiguriert) */
.oz-oeffnungszeiten-tabelle tr:nth-child(odd),
.oz-spezial-tabelle tr:nth-child(odd) {
    background-color: transparent; /* Standard: kein Zebra */
}

/* Kompakte Variante (Footer/Sidebar) */
.oz-oeffnungszeiten-kompakt {
    margin: 0 0 20px 0;
}

.oz-oeffnungszeiten-kompakt .oz-shortcode-title {
    margin: 0 0 10px 0;
    padding: 0;
}

.oz-kompakt-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.oz-kompakt-status .oz-status {
    margin-left: 0;
}

.oz-kompakt-liste {
    list-style: none;
    margin: 0;
    padding: 0;
}

.oz-kompakt-zeile {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 3px 0;
    font-size: 0.9em;
    line-height: 1.5;
}

.oz-kompakt-tag {
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.oz-kompakt-zeiten {
    color: var(--oz-text-muted);
    text-align: right;
}

/* Responsive */
@media (max-width: 480px) {
    .oz-oeffnungszeiten-tabelle td,
    .oz-tag-name,
    .oz-tag-zeiten {
        font-size: 0.9em;
    }

    .oz-heute-marker {
        font-size: 0.65em;
        padding: 2px 5px;
        margin-left: 5px;
    }

    .oz-regulaere-zeiten {
        font-size: 0.8em;
        padding: 5px 8px;
    }

    .oz-oeffnungszeiten-heute {
        flex-direction: column;
        align-items: flex-start;
    }

    .oz-status {
        margin-left: 0;
        margin-top: 5px;
    }

    .oz-spezial-tabelle td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 8px 15px;
    }

    .oz-spezial-tabelle tr td:first-child {
        padding-bottom: 4px;
        padding-top: 12px;
    }

    .oz-spezial-tabelle tr td:last-child {
        padding-top: 0;
        padding-bottom: 12px;
    }

    .oz-spezial-datum {
        width: 100%;
        font-weight: 600;
    }

    .oz-spezial-info {
        text-align: left;
    }

    .oz-spezial-bemerkung {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}
