/* =================================================================
   DUN Kalender – Frontend
   Schriften und Farben werden vom aktiven Theme geerbt.
   ================================================================= */

.dun-kalender-wrap {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.dun-kalender-wrap *,
.dun-detail-wrap * { box-sizing: border-box; }

/* Toolbar / Sortierung
   --------------------------------------------- */
.dun-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.dun-sort-label {
    font-size: 0.95em;
    opacity: 0.7;
    font-weight: 500;
}
.dun-sort-buttons {
    display: inline-flex;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.dun-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9em;
    text-decoration: none !important;
    color: inherit;
    background: transparent;
    transition: background 0.18s ease, color 0.18s ease;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}
.dun-sort-btn:hover { background: rgba(0,0,0,0.05); }
.dun-sort-btn.is-active {
    background: currentColor;
    color: #fff;
}
.dun-sort-btn.is-active svg { color: #fff; }
.dun-sort-btn svg {
    stroke: currentColor;
    flex-shrink: 0;
}

/* Grid
   --------------------------------------------- */
.dun-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dun-cols-1 { grid-template-columns: 1fr; }
.dun-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dun-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dun-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1100px) {
    .dun-grid, .dun-cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .dun-grid, .dun-cols-4, .dun-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .dun-grid, .dun-cols-4, .dun-cols-3, .dun-cols-2 { grid-template-columns: 1fr; }
}

/* Karte
   --------------------------------------------- */
.dun-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.dun-card:hover {
    background: #f3f3f3;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.dun-card-image {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: #f3f3f3;
}
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.dun-card-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}
.dun-card-title {
    font-weight: 700;
    margin: 0 0 6px;
    font-size: 1.15em;
    line-height: 1.25;
}
.dun-card-meta {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.95em;
    line-height: 1.4;
}
.dun-card-meta .dun-icon {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.7;
    stroke: currentColor;
}
.dun-card-location { align-items: flex-start; }
.dun-card-location strong { font-weight: 600; }
.dun-card-cta {
    margin-top: auto;
    padding-top: 14px;
    font-weight: 600;
    font-size: 0.95em;
    opacity: 0.85;
    transition: opacity 0.18s ease;
}
.dun-card:hover .dun-card-cta { opacity: 1; }

/* Neuer zentrierter Call-to-Action Button auf der Karte */
.dun-card-cta-wrap {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    justify-content: center;
}
.dun-card-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #2c5aa0;
    color: #fff;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92em;
    line-height: 1.2;
    text-align: center;
    box-shadow: 0 1px 3px rgba(44,90,160,0.25);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
    white-space: nowrap;
    max-width: 100%;
}
.dun-card:hover .dun-card-cta-btn { background: #1d4078; box-shadow: 0 4px 12px rgba(44,90,160,0.35); transform: translateY(-1px); }
.dun-card-cta-btn.dun-cta-ticket    { background: #2c5aa0; }
.dun-card-cta-btn.dun-cta-anmeldung { background: #2c5aa0; }
.dun-card-cta-btn.dun-cta-infos     { background: #2c5aa0; }

.dun-empty {
    padding: 30px;
    text-align: center;
    background: #f7f7f7;
    border-radius: 12px;
    color: #666;
}

/* Detailseite
   --------------------------------------------- */
.dun-detail-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}
.dun-detail-eyebrow {
    font-size: 0.95em;
    opacity: 0.7;
    margin: 0 0 16px;
    font-weight: 500;
}
.dun-detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 820px) {
    .dun-detail-grid { grid-template-columns: 1fr; }
}

.dun-contact-box {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.dun-contact-logo {
    margin-bottom: 16px;
}
.dun-contact-logo img {
    max-width: 120px;
    max-height: 80px;
    height: auto;
    display: block;
}
.dun-contact-title {
    font-weight: 700;
    font-size: 1.1em;
    margin: 0 0 12px;
}
.dun-contact-name {
    margin: 0 0 14px;
    font-size: 1em;
}
.dun-contact-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dun-contact-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
    align-items: baseline;
    font-size: 0.95em;
}
.dun-contact-row strong { font-weight: 700; }
.dun-contact-row a { word-break: break-word; }

.dun-detail-main {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.dun-detail-title {
    font-weight: 700;
    margin: 0 0 18px;
    font-size: 1.8em;
    line-height: 1.2;
}
.dun-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #777;
    font-size: 1em;
    margin-bottom: 24px;
}
.dun-detail-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}
.dun-detail-meta-row .dun-icon {
    flex-shrink: 0;
    margin-top: 3px;
    stroke: currentColor;
    opacity: 0.7;
}
.dun-detail-image {
    margin: 24px 0;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #f3f3f3;
    aspect-ratio: 21 / 9;
    max-height: 360px;
}
.dun-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
@media (max-width: 820px) {
    .dun-detail-image { aspect-ratio: 16 / 9; max-height: 280px; }
}
@media (max-width: 540px) {
    .dun-detail-image { aspect-ratio: 16 / 9; max-height: 200px; }
}
.dun-detail-description {
    font-size: 1em;
    line-height: 1.6;
    color: inherit;
}
.dun-detail-description p:first-child { margin-top: 0; }
.dun-detail-pdf { margin-top: 20px; }
.dun-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 999px;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.18s ease;
    font-weight: 500;
}
.dun-pdf-link:hover { background: rgba(0,0,0,0.06); }

/* Anmeldung
   --------------------------------------------- */
.dun-anmeldung { margin-top: 30px; }
.dun-btn-anmelden {
    background: #2c5aa0;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
    font-family: inherit;
}
.dun-btn-anmelden:hover {
    background: #1d4078;
    transform: translateY(-1px);
}

.dun-anmelde-form {
    margin-top: 18px;
    background: #f7f9fc;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 22px;
}
.dun-anmelde-form h3 {
    margin: 0 0 14px;
    font-size: 1.2em;
    font-weight: 700;
}
.dun-field { margin-bottom: 14px; }
.dun-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.95em;
}
.dun-field input[type=text],
.dun-field input[type=email],
.dun-field input[type=tel] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    background: #fff;
}
.dun-field input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44,90,160,0.15);
}
.dun-field-radio {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.dun-field-radio label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}
.dun-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.dun-btn-submit {
    background: #2c5aa0;
    color: #fff;
    border: none;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
}
.dun-btn-submit:hover { background: #1d4078; }
.dun-btn-submit:disabled { opacity: 0.6; cursor: wait; }
.dun-btn-cancel {
    background: transparent;
    color: inherit;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 12px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
}
.dun-btn-cancel:hover { background: rgba(0,0,0,0.05); }

.dun-form-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95em;
}
.dun-form-message.success {
    background: #e6f6ed;
    color: #1f6c3a;
    border: 1px solid #b7e1c5;
}
.dun-form-message.error {
    background: #fdecec;
    color: #8a2222;
    border: 1px solid #f3b7b7;
}

/* Tags / Header-Extras
   --------------------------------------------- */
.dun-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.dun-event-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.05);
    color: rgba(0,0,0,0.65);
    font-size: 0.75em;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    border: 1px solid rgba(0,0,0,0.06);
    transition: background 0.18s ease, color 0.18s ease;
}
.dun-event-tag:hover { background: rgba(0,0,0,0.08); }
.dun-event-tag svg { stroke: currentColor; opacity: 0.8; }
.dun-header-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 22px;
}
a.dun-tag-anmelden {
    cursor: pointer;
}

/* Detail: mehrtägige Anzeige
   --------------------------------------------- */
.dun-detail-tage .dun-tag-line {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.5;
}
.dun-detail-tage .dun-tag-datum { font-weight: 600; }
.dun-detail-tage .dun-tag-zeit { opacity: 0.85; }

/* Erklärtext über dem Anmeldeformular
   --------------------------------------------- */
.dun-anmelde-info {
    background: #f7f9fc;
    border-left: 3px solid #2c5aa0;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.97em;
    line-height: 1.55;
}
.dun-anmelde-info p { margin: 0; }
.dun-anmelde-info p + p { margin-top: 10px; }

/* Nicht-Mitglied: "Jetzt Mitglied werden"-Button
   --------------------------------------------- */
.dun-nichtmitglied-hint {
    background: #fff7e6;
    border: 1px solid #f5d499;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 4px 0 14px;
}
.dun-nichtmitglied-hint p {
    margin: 0 0 10px;
    font-size: 0.95em;
}
.dun-btn-mitglied {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 999px;
    background: #e8a93c;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95em;
    transition: background 0.18s ease;
}
.dun-btn-mitglied:hover { background: #c08820; }

/* Banner: Mitglied erfolgreich angemeldet
   --------------------------------------------- */
.dun-membership-banner {
    margin-top: 18px;
    padding: 14px 18px;
    background: #e6f6ed;
    border: 1px solid #b7e1c5;
    color: #1f6c3a;
    border-radius: 10px;
    font-size: 0.97em;
    line-height: 1.5;
}
.dun-membership-banner strong { display: block; margin-bottom: 4px; }
.dun-countdown {
    display: inline-block;
    min-width: 1.2em;
    text-align: center;
    font-weight: 700;
}

/* Keine Anmeldung erforderlich
   --------------------------------------------- */
.dun-no-anmeldung {
    background: #f3f3f3;
    border-radius: 10px;
    padding: 14px 18px;
    color: #555;
    font-size: 0.97em;
    margin: 0;
}

/* Kalender hinzufügen / abonnieren
   --------------------------------------------- */
.dun-detail-calendar { margin: 14px 0 0; }
.dun-btn-add-calendar {
    /* erbt von .dun-pdf-link bereits Form, hier nur kleine Anpassungen */
}

.dun-subscribe-wrap {
    position: relative;
    margin-right: auto;
}
.dun-btn-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(0,0,0,0.12);
    background: #fff;
    border-radius: 999px;
    font-size: 0.9em;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.18s ease;
    color: inherit;
}
.dun-btn-subscribe:hover { background: rgba(0,0,0,0.05); }
.dun-btn-subscribe svg { stroke: currentColor; }

.dun-subscribe-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    width: 320px;
    max-width: calc(100vw - 30px);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.dun-subscribe-popover[hidden] { display: none; }
.dun-subscribe-headline {
    font-weight: 700;
    margin: 0 0 6px;
    font-size: 1em;
}
.dun-subscribe-text {
    margin: 0 0 12px;
    font-size: 0.92em;
    color: #555;
    line-height: 1.45;
}
.dun-btn-cal-main {
    display: block;
    text-align: center;
    background: #2c5aa0;
    color: #fff !important;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95em;
    transition: background 0.18s ease;
    margin-bottom: 10px;
}
.dun-btn-cal-main:hover { background: #1d4078; }
.dun-subscribe-or {
    text-align: center;
    margin: 6px 0;
    color: #888;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dun-subscribe-copyrow {
    display: flex;
    gap: 6px;
    align-items: stretch;
    margin-bottom: 10px;
}
.dun-subscribe-url {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    font-size: 0.85em;
    background: #f7f9fc;
    color: #333;
    font-family: monospace;
}
.dun-btn-copy {
    padding: 8px 14px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #f7f9fc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.18s ease;
}
.dun-btn-copy:hover  { background: #ecf1f8; }
.dun-btn-copy.is-done {
    background: #e6f6ed;
    color: #1f6c3a;
    border-color: #b7e1c5;
}
.dun-subscribe-hint {
    margin: 8px 0 0;
    font-size: 0.82em;
    color: #888;
    line-height: 1.4;
}
