/* ========================================================================== WP Events Plugin Theme Integration - 1SCP Design Basierend auf 1scp.de/terminkalender/ ========================================================================== */
/* CSS Icon Variables */
:root {
    --icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    --icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    --icon-location: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
    --icon-category: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E");
}

/* Icon Base Styles */
.em-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 8px !important;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Leerzeichen nach Icon (falls HTML keins hat) */
.em-icon::after {
    content: ' ';
    white-space: pre;
}

.em-icon-calendar {
    background-image: var(--icon-calendar);
}

.em-icon-clock {
    background-image: var(--icon-clock);
}

.em-icon-location {
    background-image: var(--icon-location);
}

.em-icon-category {
    background-image: var(--icon-category);
}

/* Events Grid Container */
.em-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: var(--scp-space-6, 1.5rem);
}

/* Events als Liste (Startseite) */
.home-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.home-events-list .em-event.em-item {
    width: 100%;
}

@media (max-width:480px) {
    .em-events-grid {
        grid-template-columns: 1fr;
    }
}

/* Event Card */
.em-event.em-item {
    display: flex;
    background: #fff;
    border-radius: var(--scp-radius-lg, 12px);
    box-shadow: var(--scp-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
    overflow: hidden;
    border-left: 4px solid var(--default-border, #b78d38);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

/* Letztes Event ohne margin */
.em-events-list .em-event.em-item:last-child {
    margin-bottom: 0;
}

.em-event.em-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Date Placeholder Image */
.em-item-image {
    flex-shrink: 0;
    width: 100px;
    min-height: 120px;
    display: flex;
    align-items: stretch;
}

.em-item-image.has-placeholder .em-item-image-placeholder {
    width: 100%;
    background: linear-gradient(135deg, var(--scp-navy-700, #003d5c) 0%, #002d4a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--scp-space-4, 1rem);
}

.em-item-image-placeholder .date {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.em-item-image-placeholder .date .day {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.em-item-image-placeholder .date .month {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--scp-gold, #d4a574);
    text-transform: uppercase;
    margin-top: 4px;
}

/* Event Info Section */
.em-item-info {
    flex: 1;
    padding: var(--scp-space-4, 1rem) var(--scp-space-5, 1.25rem);
    display: flex;
    flex-direction: column;
    gap: var(--scp-space-2, 0.5rem);
}

/* Event Title */
.em-item-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--scp-navy-700, #003d5c);
    margin: 0 0 var(--scp-space-2, 0.5rem) 0;
    margin-top: 0 !important;
    padding-top: 0 !important;
    line-height: 1.3;
}

h3.em-item-title {
    margin-top: 0 !important;
    margin-bottom: 0.5rem;
}

.em-item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.em-item-title a:hover {
    color: var(--scp-gold, #d4a574);
}

/* Meta Information - 2 Spalten Grid */
.em-event-meta.em-item-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    padding-left: 1.5rem;
}

.em-item-meta-line {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
}

/* Mobile:1 Spalte */
@media (max-width:576px) {
    .em-event-meta.em-item-meta {
        grid-template-columns: 1fr;
    }
}

.em-item-meta-line.em-event-date {
    color: #333;
    font-weight: 500;
}

.em-item-meta-line.em-event-time {
    color: #666;
    margin-bottom: 1rem;
}

.em-item-meta-line.em-event-location {
    color: #666;
}

.em-item-meta-line.em-event-categories {
    color: var(--scp-gold, #d4a574);
    font-weight: 500;
}

/* Location Links aktivieren */
.em-event-location a {
    color: var(--scp-navy-700, #003d5c) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    pointer-events: auto;
    cursor: pointer;
}

.em-event-location a:hover {
    color: var(--scp-gold, #b78d38) !important;
}

/* Kategorie Links deaktivieren */
.em-event-categories a {
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: none;
    cursor: default;
}

/* Kategorie ohne Bullet und inline */
.em-event-categories ul,
.em-event-categories ul.event-categories {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline;
}

.em-event-categories li {
    display: inline;
    margin: 0;
    padding: 0;
}

.em-event-categories>div {
    display: inline;
}

/* Read More Button - klein und grau */
.em-item-read-more.button,
.em-item-read-more {
    font-size: 0.85rem !important;
    color: #666 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-decoration: none;
}

.em-item-read-more:hover {
    color: #333 !important;
    text-decoration: underline;
}

/* Event Description */
.em-item-desc {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
    margin-top: var(--scp-space-2, 0.5rem);
    padding-top: var(--scp-space-2, 0.5rem);
    border-top: 1px solid #eee;
}

/* Responsive Adjustments */
@media (max-width:600px) {
    .em-event.em-item {
        flex-direction: column;
    }

    .em-item-image {
        width: 100%;
        min-height: 80px;
    }

    .em-item-image-placeholder .date {
        flex-direction: row;
        gap: var(--scp-space-2, 0.5rem);
    }

    .em-item-image-placeholder .date .day {
        font-size: 2rem;
    }

    .em-item-image-placeholder .date .month {
        font-size: 1rem;
        margin-top: 0;
    }
}

/* ========================================================================== Legacy Event Item Styles (Fallback) ========================================================================== */
.event-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-date-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    background: #1e3a5f;
    border-radius: 8px;
    overflow: hidden;
}

.event-date-icon .event-month {
    background: #c41e3a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 12px;
    width: 100%;
    text-align: center;
}

.event-date-icon .event-day {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    padding: 8px 12px;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.event-details .event-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e3a5f;
}

.event-details .event-category {
    font-size: 0.85rem;
    color: #666;
}

.event-details .event-excerpt {
    font-size: 0.9rem;
    color: #444;
}

/* ========================================================================== Event Detail Page Styles ========================================================================== */
/* Sections Abstände - einheitlich */
.em-item-header {
    padding: 1.5rem !important;
}

.em-item-meta-column {
    padding: 0.5rem !important;
}

/* Alle Meta-Sections mit gleichem Abstand */
.em-event-when,
.em-event-where,
.em-item-taxonomies,
.em-event-info {
    padding: 1rem !important;
    margin: 0 0 1rem 0 !important;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Letztes Element ohne margin-bottom */
.em-item-taxonomies:last-child,
.em-event-info:last-child {
    margin-bottom: 0 !important;
}

/* Info Block Styling */
.em-event-info h3,
.em-event-when h3,
.em-event-where h3,
.em-item-taxonomies h3 {
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a5f;
}

.em-event-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #444;
    line-height: 1.5;
}

/* Zurück-Button (unten links) */
.em-event-back-button {
    margin-top: 1.5rem;
    text-align: left;
}

.em-event-back-button .btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--scp-navy-700, #003d5c);
    background: #f5f5f5;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.em-event-back-button .btn-back:hover {
    background: #e8e8e8;
    color: #002d4a;
}

/* Content */
.em-event-content {
    font-size: 0.875rem;
    padding: 1.5rem !important;
    margin-top: 1rem;
}

/* "Zum Kalender hinzufügen" Button - Theme Design */
.em-event-when {
    position: relative;
}

.em-event-add-to-calendar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(135deg, var(--scp-navy-700, #003d5c) 0%, #002d4a 100%) !important;
    border: none !important;
    border-radius: var(--scp-radius-md, 8px) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.em-event-add-to-calendar:hover {
    background: linear-gradient(135deg, #004a6e 0%, #003d5c 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.em-event-add-to-calendar:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dropdown Content - Adjacent Sibling Selector */
.em-event-add-to-calendar-content,
.em-tooltip-ddm-content {
    display: none !important;
    position: absolute !important;
    top: auto !important;
    left: 0 !important;
    z-index: 1000 !important;
    min-width: 200px;
    margin-top: 4px;
    background: #fff !important;
    border-radius: var(--scp-radius-md, 8px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

/* Dropdown bei Hover über Button anzeigen */
.em-event-add-to-calendar:hover+.em-event-add-to-calendar-content,
.em-event-add-to-calendar:hover+.em-tooltip-ddm-content,
.em-event-add-to-calendar-content:hover,
.em-tooltip-ddm-content:hover {
    display: block !important;
}

/* Dropdown Links */
.em-event-add-to-calendar-content a,
.em-tooltip-ddm-content a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.em-event-add-to-calendar-content a:hover,
.em-tooltip-ddm-content a:hover {
    background: #f5f5f5 !important;
    color: var(--scp-navy-700, #003d5c) !important;
}

.em-event-add-to-calendar-content a+a,
.em-tooltip-ddm-content a+a {
    border-top: 1px solid #eee;
}