.nmw-termine {
    --nmw-termine-green: #007757;
    --nmw-termine-green-dark: #005b45;
    --nmw-termine-red: #e3000f;
    --nmw-termine-ink: #18231f;
    --nmw-termine-muted: #555f5b;
    --nmw-termine-line: #dfe4e2;

    display: block;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    color: var(--nmw-termine-ink);
    font-family: "Segoe UI", Arial, sans-serif;
}

.nmw-termine,
.nmw-termine * {
    box-sizing: border-box;
}

.nmw-termine-month {
    display: block;
    min-width: 0;
}

.nmw-termine-month + .nmw-termine-month {
    margin-top: 24px;
}

.nmw-termine-month-heading {
    display: flex;
    margin: 0 0 12px;
    align-items: center;
    color: var(--nmw-termine-green-dark);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.nmw-termine-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
}

.nmw-termine-item {
    position: relative;
    display: grid;
    min-width: 0;
    height: auto;
    min-height: 0;
    max-height: none;
    grid-template-columns: minmax(210px, 40%) minmax(0, 1fr);
    overflow: hidden;
    color: var(--nmw-termine-ink);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(15, 38, 31, .11);
    cursor: pointer;
    isolation: isolate;
    transition:
            transform .22s ease,
            box-shadow .22s ease,
            border-color .22s ease;
}

.nmw-termine-item--featured {
    height: auto;
    min-height: 0;
    max-height: none;
    grid-column: 1 / -1;
    grid-template-columns: minmax(300px, 35%) minmax(0, 1fr);
}

.nmw-termine-item:hover {
    border-color: rgba(0, 91, 69, .13);
    box-shadow: 0 10px 27px rgba(15, 38, 31, .16);
    transform: translateY(-2px);
}

.nmw-termine-item:focus-visible {
    border-color: var(--nmw-termine-green);
    outline: 3px solid rgba(0, 119, 87, .2);
    outline-offset: 3px;
}

.nmw-termine-image {
    position: relative;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    overflow: hidden;
    background: var(--nmw-termine-green-dark);
}

.nmw-termine-image img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}

.nmw-termine-item:hover .nmw-termine-image img {
    transform: scale(1.025);
}

.nmw-termine-image-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    place-items: center;
    color: rgba(255, 255, 255, .72);
    font-size: 54px;
}

.nmw-termine-date {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    display: flex;
    width: 66px;
    min-height: 66px;
    padding: 7px 6px 6px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--nmw-termine-red);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .92);
    border-radius: 13px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .18);
    font-family: "Segoe UI", Arial, sans-serif;
    font-style: normal;
    line-height: 1;
    text-align: center;
}

.nmw-termine-date strong {
    font-size: 27px;
    font-weight: 800;
}

.nmw-termine-date span {
    margin-top: 3px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .035em;
}

.nmw-termine-content {
    display: flex;
    min-width: 0;
    padding: 12px 22px 12px;
    justify-content: center;
    flex-direction: column;
}

.nmw-termine-item--featured .nmw-termine-content {
    padding: 12px 30px 12px;
}

.nmw-termine-heading-row {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.nmw-termine-heading-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.nmw-termine-category {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--nmw-termine-green-dark);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .015em;
    text-transform: uppercase;
}

.nmw-termine-title {
    display: -webkit-box;
    margin: -3px 0 0;
    overflow: hidden;
    color: var(--nmw-termine-green-dark);
    font-family: inherit;
    font-size: clamp(27px, 2.2vw, 34px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.025em;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: auto;
    hyphenate-limit-chars: 8 4 4;
    text-wrap: pretty;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nmw-termine-item--featured .nmw-termine-title {
    font-size: clamp(34px, 2.8vw, 44px);
}

.nmw-termine-teaser {
    display: -webkit-box;
    max-width: 720px;
    margin: 8px 0 0;
    overflow: hidden;
    color: var(--nmw-termine-muted);
    font-size: 16px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.nmw-termine-price {
    display: block;
    margin: 5px 0 12px;
    color: var(--nmw-termine-ink);
    font-size: 20px;
    font-weight: 750;
    line-height: 1.2;
}

.nmw-termine-meta {
    display: flex;
    min-width: 0;
    margin-top: 8px;
    padding-top: 0;
    align-items: center;
    gap: 7px;
    color: #414a46;
    font-size: 16px;
    line-height: 1.2;
}

.nmw-termine-meta-item {
    display: inline-flex;
    min-width: 0;
    min-height: 35px;
    padding: 6px 12px;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    background: #dcefe8;
    border: 1px solid rgba(0, 91, 69, .08);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 76, 57, .08);
    color: var(--nmw-termine-green-dark);
    white-space: nowrap;
}

.nmw-termine-meta-item:first-child {
    flex: 0 0 auto;
}

.nmw-termine-meta-item:last-child {
    flex: 0 1 auto;
}

.nmw-termine-meta-item > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nmw-termine-meta-item > .material-symbols-rounded {
    flex: 0 0 auto;
    color: var(--nmw-termine-green-dark);
    font-size: 19px;
    font-variation-settings: "FILL" 0, "wght" 550, "GRAD" 0, "opsz" 20;
}

.nmw-termine-meta-item:last-child > .material-symbols-rounded {
    color: var(--nmw-termine-green-dark);
}

.nmw-termine-arrow {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    padding: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--nmw-termine-green);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 5px 16px rgba(15, 38, 31, .13);
    box-sizing: border-box;
    transition:
            color .2s ease,
            background-color .2s ease,
            box-shadow .2s ease,
            transform .2s ease;
}

.nmw-termine-arrow > .material-symbols-rounded {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 650;
}

.nmw-termine-item:hover .nmw-termine-arrow {
    box-shadow: 0 7px 19px rgba(15, 38, 31, .18);
    transform: translateX(2px);
}


.nmw-termine-empty {
    margin: 0;
    padding: 18px 20px;
    color: var(--nmw-termine-green-dark, #005b45);
    background: #f2f7f5;
    border: 1px solid #dce9e4;
    border-radius: 14px;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Sobald das Desktop-Seitenpopup Platz belegt, darf die verbleibende Seite
   auf ein einspaltiges Terminraster umbrechen. */
@media (min-width: 901px) {
    body.nmw-popup-open .nmw-termine-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.nmw-popup-open .nmw-termine-item {
        grid-column: 1;
    }
}

@media (min-width: 768px) and (max-width: 900px) {
    .nmw-termine-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .nmw-termine-item {
        grid-column: 1;
    }
}

@media (max-width: 767px) {
    /* Elementor kann dem Shortcode-Widget aus einer frueheren Layout-Einstellung
       eine feste bzw. minimale Hoehe geben. Nur die Wrapper dieses konkreten
       Termine-Shortcodes werden deshalb wieder auf ihre Inhaltshoehe gesetzt. */
    .elementor-widget-shortcode:has(.nmw-termine),
    .elementor-widget-shortcode:has(.nmw-termine) > .elementor-widget-container,
    .elementor-widget-shortcode:has(.nmw-termine) .elementor-shortcode {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .nmw-termine {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .nmw-termine-month {
        height: auto;
        min-height: 0;
    }

    .nmw-termine-month + .nmw-termine-month {
        margin-top: 22px;
    }

    .nmw-termine-month:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .nmw-termine-month-heading {
        margin-bottom: 11px;
        font-size: 18px;
    }

    .nmw-termine-grid {
        height: auto;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: max-content;
        align-content: start;
        gap: 12px;
    }

    .nmw-termine-grid > .nmw-termine-item:last-child {
        margin-bottom: 0;
    }

    .nmw-termine-item,
    .nmw-termine-item--featured {
        height: auto;
        min-height: 0;
        max-height: none;
        grid-column: 1;
        grid-template-columns: minmax(105px, 29%) minmax(0, 1fr);
        border-radius: 14px;
    }

    .nmw-termine-image-placeholder {
        min-height: 0;
    }

    .nmw-termine-date {
        top: 7px;
        left: 7px;
        width: 56px;
        min-height: 56px;
        padding: 5px 4px;
        border-radius: 9px;
    }

    .nmw-termine-date strong {
        font-size: 23px;
    }

    .nmw-termine-date span {
        font-size: 10px;
    }

    .nmw-termine-content,
    .nmw-termine-item--featured .nmw-termine-content {
        overflow: hidden;
        padding: 12px 11px;
    }

    .nmw-termine-heading-row {
        gap: 7px;
    }

    .nmw-termine-category {
        gap: 0;
        font-size: 14px;
    }

    .nmw-termine-title,
    .nmw-termine-item--featured .nmw-termine-title {
        margin-top: 2px;
        font-size: clamp(20px, 5.2vw, 25px);
        line-height: 1.05;
        -webkit-line-clamp: 2;
    }

    .nmw-termine-price {
        margin-top: 2px;
        font-size: 19px;
        line-height: 1.05;
    }

    .nmw-termine-meta {
        display: flex;
        margin-top: 5px;
        padding-top: 0;
        gap: 4px;
        font-size: 13px;
    }

    .nmw-termine-meta-item {
        min-height: 30px;
        padding: 4px 9px;
        gap: 3px;
    }

    .nmw-termine-meta-item > .material-symbols-rounded {
        font-size: 17px;
    }

    .nmw-termine-arrow {
        flex-basis: 34px;
        width: 34px;
        min-width: 34px;
        max-width: 34px;
        height: 34px;
    }

    .nmw-termine-arrow > .material-symbols-rounded {
        font-size: 20px;
    }

}

@media (max-width: 430px) {
    .nmw-termine-month-heading {
        font-size: 15px;
    }

    .nmw-termine-item,
    .nmw-termine-item--featured {
        height: auto;
        min-height: 0;
        max-height: none;
        grid-template-columns: minmax(92px, 28%) minmax(0, 1fr);
    }

    .nmw-termine-image-placeholder {
        min-height: 0;
    }

    .nmw-termine-date {
        width: 52px;
        min-height: 52px;
        padding: 4px;
    }

    .nmw-termine-date strong {
        font-size: 21px;
    }

    .nmw-termine-date span {
        font-size: 9px;
    }

    .nmw-termine-content,
    .nmw-termine-item--featured .nmw-termine-content {
        padding: 10px 9px;
    }

    .nmw-termine-category {
        font-size: 13px;
    }

    .nmw-termine-title,
    .nmw-termine-item--featured .nmw-termine-title {
        font-size: clamp(19px, 5vw, 23px);
    }

    .nmw-termine-price {
        font-size: 15px;
    }

    .nmw-termine-meta {
        margin-top: 4px;
        gap: 3px;
        font-size: 12px;
    }

    .nmw-termine-meta-item {
        min-height: 28px;
        padding: 4px 8px;
        gap: 2px;
    }

    .nmw-termine-meta-item > .material-symbols-rounded {
        font-size: 16px;
    }

    .nmw-termine-arrow {
        flex-basis: 32px;
        width: 32px;
        min-width: 32px;
        max-width: 32px;
        height: 32px;
    }

    .nmw-termine-arrow > .material-symbols-rounded {
        font-size: 19px;
    }

}

/* --------------------------------------------------------------
   Optionale kompakte Shortcode-Variante: layout="vorschau"
   -------------------------------------------------------------- */
@media (min-width: 768px) {
    .nmw-termine--vorschau .nmw-termine-month + .nmw-termine-month {
        margin-top: 18px;
    }

    .nmw-termine--vorschau .nmw-termine-month-heading {
        margin-bottom: 8px;
        font-size: 18px;
    }

    .nmw-termine--vorschau .nmw-termine-grid {
        gap: 12px 16px;
    }

    .nmw-termine--vorschau .nmw-termine-item {
        grid-template-columns: minmax(170px, 34%) minmax(0, 1fr);
        border-radius: 14px;
    }

    .nmw-termine--vorschau .nmw-termine-item--featured {
        grid-template-columns: minmax(260px, 30%) minmax(0, 1fr);
    }

    .nmw-termine--vorschau .nmw-termine-date {
        top: 8px;
        left: 8px;
        width: 56px;
        min-height: 56px;
        padding: 5px 4px;
        border-radius: 11px;
    }

    .nmw-termine--vorschau .nmw-termine-date strong {
        font-size: 23px;
    }

    .nmw-termine--vorschau .nmw-termine-date span {
        font-size: 11px;
    }

    .nmw-termine--vorschau .nmw-termine-content,
    .nmw-termine--vorschau .nmw-termine-item--featured .nmw-termine-content {
        padding: 8px 16px;
    }

    .nmw-termine--vorschau .nmw-termine-heading-row {
        gap: 10px;
    }

    .nmw-termine--vorschau .nmw-termine-category {
        gap: 5px;
        font-size: 12px;
    }

    .nmw-termine--vorschau .nmw-termine-title,
    .nmw-termine--vorschau .nmw-termine-item--featured .nmw-termine-title {
        font-size: clamp(23px, 1.8vw, 29px);
    }

    .nmw-termine--vorschau .nmw-termine-item--featured .nmw-termine-title {
        font-size: clamp(29px, 2.2vw, 36px);
    }

    .nmw-termine--vorschau .nmw-termine-teaser {
        margin-top: 6px;
        font-size: 14px;
        line-height: 1.35;
        -webkit-line-clamp: 2;
    }

    .nmw-termine--vorschau .nmw-termine-price {
        margin: 4px 0 7px;
        font-size: 16px;
    }

    .nmw-termine--vorschau .nmw-termine-meta {
        margin-top: 5px;
        gap: 5px;
        font-size: 13px;
    }

    .nmw-termine--vorschau .nmw-termine-meta-item {
        min-height: 29px;
        padding: 4px 9px;
        gap: 4px;
    }

    .nmw-termine--vorschau .nmw-termine-meta-item > .material-symbols-rounded {
        font-size: 16px;
    }

    .nmw-termine--vorschau .nmw-termine-arrow {
        flex-basis: 34px;
        width: 34px;
        min-width: 34px;
        max-width: 34px;
        height: 34px;
    }

    .nmw-termine--vorschau .nmw-termine-arrow > .material-symbols-rounded {
        font-size: 20px;
    }

}

@media (max-width: 767px) {
    .nmw-termine--vorschau .nmw-termine-month-heading,
    .nmw-termine--vorschau .nmw-termine-item--featured .nmw-termine-teaser,
    .nmw-termine--vorschau .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-meta {
        display: none;
    }

    .nmw-termine--vorschau .nmw-termine-month + .nmw-termine-month {
        margin-top: 12px;
    }

    .nmw-termine--vorschau .nmw-termine-grid {
        gap: 10px;
    }

    .nmw-termine--vorschau .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-price {
        margin-bottom: 0;
    }
}

/* layout="kompakt": mobile Vorschau-Vereinfachung auf allen Groessen. */
.nmw-termine--kompakt .nmw-termine-month-heading,
.nmw-termine--kompakt .nmw-termine-item--featured .nmw-termine-teaser,
.nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-meta {
    display: none;
}

.nmw-termine--kompakt .nmw-termine-month + .nmw-termine-month {
    margin-top: 12px;
}

.nmw-termine--kompakt .nmw-termine-grid {
    gap: 10px;
}

.nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-price {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .nmw-termine--kompakt .nmw-termine-item {
        grid-template-columns: minmax(130px, 24%) minmax(0, 1fr);
    }

    .nmw-termine--kompakt .nmw-termine-item--featured {
        grid-template-columns: minmax(220px, 22%) minmax(0, 1fr);
    }

    .nmw-termine--kompakt .nmw-termine-category {
        font-size: 10px;
    }

    .nmw-termine--kompakt .nmw-termine-title,
    .nmw-termine--kompakt .nmw-termine-item--featured .nmw-termine-title {
        font-size: clamp(19px, 1.45vw, 23px);
    }

    .nmw-termine--kompakt .nmw-termine-item--featured .nmw-termine-title {
        font-size: clamp(23px, 1.8vw, 28px);
    }

    .nmw-termine--kompakt .nmw-termine-price {
        font-size: 14px;
    }

    .nmw-termine--kompakt .nmw-termine-meta {
        font-size: 12px;
    }

    .nmw-termine--kompakt .nmw-termine-meta-item > .material-symbols-rounded {
        font-size: 15px;
    }

    .nmw-termine--kompakt .nmw-termine-date strong {
        font-size: 21px;
    }

    .nmw-termine--kompakt .nmw-termine-date span {
        font-size: 10px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-category {
        font-size: 9px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-title {
        font-size: clamp(16px, 1.2vw, 20px);
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-price {
        font-size: 12px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-date strong {
        font-size: 18px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-date span {
        font-size: 8.5px;
    }
}

@media (min-width: 901px) {
    .nmw-termine--kompakt .nmw-termine-item {
        grid-template-columns: minmax(100px, 18%) minmax(0, 1fr);
    }

    .nmw-termine--kompakt .nmw-termine-item--featured {
        grid-template-columns: minmax(170px, 16%) minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-category {
        font-size: 11px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-title {
        font-size: clamp(17px, 4.6vw, 20px);
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-price {
        font-size: 13px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-date strong {
        font-size: 19px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-date span {
        font-size: 8.5px;
    }
}

@media (max-width: 430px) {
    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-category {
        font-size: 10px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-title {
        font-size: clamp(16px, 4.4vw, 19px);
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-price {
        font-size: 12px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-date strong {
        font-size: 18px;
    }

    .nmw-termine--kompakt .nmw-termine-item:not(.nmw-termine-item--featured) .nmw-termine-date span {
        font-size: 8px;
    }
}

/* Einzelne Eingangsanimation aller Termine, unabhaengig vom Layout. */
.nmw-termine-item.nmw-termine-reveal-ready {
    opacity: 0;
    translate: 0 16px;
    scale: .96;
    will-change: opacity, translate, scale;
    transition:
            opacity .5s ease var(--nmw-termine-reveal-delay, 0ms),
            translate .58s cubic-bezier(.22, 1, .36, 1) var(--nmw-termine-reveal-delay, 0ms),
            scale .58s cubic-bezier(.22, 1, .36, 1) var(--nmw-termine-reveal-delay, 0ms),
            transform .22s ease,
            box-shadow .22s ease,
            border-color .22s ease;
}

.nmw-termine-item.nmw-termine-reveal-ready.nmw-termine-revealed {
    opacity: 1;
    translate: 0 0;
    scale: 1;
    will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
    .nmw-termine-item,
    .nmw-termine-image img,
    .nmw-termine-arrow {
        transition-duration: .01ms !important;
    }

    .nmw-termine-item.nmw-termine-reveal-ready {
        opacity: 1;
        translate: none;
        scale: 1;
    }

    .nmw-termine-item:hover,
    .nmw-termine-item:hover .nmw-termine-image img,
    .nmw-termine-item:hover .nmw-termine-arrow {
        transform: none;
    }
}
