/*
 * Veranstaltungen und Müllkalender (Web).
 *
 * Goldener Schnitt: Schrift 13 / 17 / 21 / 27 / 34 px, Abstände 8 / 13 / 21 /
 * 34 / 55 px, Radien 13 / 21 / 34 px. Akzent ist unser Markenorange – nie
 * Rot oder Rosé (Betreiber 08.10.2026); für kleine Schrift die abgedunkelte
 * Stufe, damit WCAG AA hält (#95531F auf Weiß 5,9:1; #E3A16B auf #111418 8,5:1).
 */

.nj-events {
    --nj-accent: #c97b3d;
    --nj-accent-text: #95531f;
    --nj-accent-soft: rgba(201, 123, 61, 0.12);
    --nj-ev-surface: var(--color-bg-primary);
    --nj-ev-line: var(--color-border);
}

html.dark-mode .nj-events,
body.dark-mode .nj-events {
    --nj-accent: #d38441;
    --nj-accent-text: #e3a16b;
    --nj-accent-soft: rgba(211, 132, 65, 0.16);
}

.nj-events .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nj-events__shell {
    box-sizing: border-box;
    width: 100%;
    /* Als Raster-/Flex-Kind sonst so breit wie die laengste Chipzeile
       (gemessen: 760 px bei 375 px Bildschirm, Seite seitlich abgeschnitten). */
    min-width: 0;
    max-width: 760px;
    margin: 0 auto;
    padding: 21px 21px 55px;
}

/* Brotkrumen */
.nj-events__crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 21px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 17px;
    color: var(--color-text-tertiary);
}

.nj-events__crumbs li + li::before {
    content: "›";
    margin-right: 8px;
    color: var(--color-text-tertiary);
}

.nj-events__crumbs a {
    color: inherit;
    text-decoration: none;
}

.nj-events__crumbs a:hover {
    text-decoration: underline;
}

/* Kopf */
.nj-events__head {
    margin-bottom: 21px;
}

.nj-events__title {
    margin: 0 0 13px;
    font-size: 34px;
    line-height: 43px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    text-wrap: balance;
}

.nj-events__lead {
    margin: 0;
    font-size: 17px;
    line-height: 27px;
    color: var(--color-text-secondary);
}

.nj-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 13px;
    border: 1px solid var(--nj-ev-line);
    font-size: 13px;
    line-height: 13px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--color-text-secondary);
}

/* Suche */
.nj-events__search {
    display: flex;
    gap: 8px;
    margin-bottom: 21px;
}

.nj-events__search input,
.nj-waste__input,
.nj-waste__report textarea {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 8px 13px;
    border-radius: 13px;
    border: 1px solid var(--color-field-border);
    background: var(--nj-ev-surface);
    color: var(--color-text-primary);
    font: inherit;
    font-size: 17px;
    line-height: 21px;
}

.nj-events__search-button,
.nj-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 21px;
    border-radius: 21px;
    border: 1px solid var(--nj-ev-line);
    background: var(--nj-ev-surface);
    color: var(--color-text-primary);
    font: inherit;
    font-size: 17px;
    line-height: 21px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--motion-fast, 180ms) ease, background-color var(--motion-fast, 180ms) ease, transform var(--motion-fast, 180ms) ease;
}

.nj-button:hover,
.nj-events__search-button:hover {
    border-color: var(--color-text-tertiary);
}

.nj-button:active,
.nj-events__search-button:active {
    transform: scale(0.98);
}

.nj-button--primary {
    border-color: transparent;
    background: var(--color-accent-primary);
    color: var(--color-accent-primary-contrast);
}

.nj-events :focus-visible {
    outline: 2px solid var(--color-accent-secondary);
    outline-offset: 2px;
}

/* Chips (Region, Art) */
.nj-events__chips {
    display: flex;
    gap: 8px;
    margin: 0 -21px 13px;
    padding: 0 21px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    /* Ohne diesen Wert rastet der erste Chip an der Bildschirmkante ein und
       ignoriert den seitlichen Rand. */
    scroll-padding-inline: 21px;
}

.nj-events__chips::-webkit-scrollbar {
    display: none;
}

.nj-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 13px;
    border-radius: 21px;
    border: 1px solid var(--nj-ev-line);
    background: var(--nj-ev-surface);
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 17px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color var(--motion-fast, 180ms) ease, color var(--motion-fast, 180ms) ease;
}

.nj-chip:hover {
    color: var(--color-text-primary);
    border-color: var(--color-text-tertiary);
}

.nj-chip.is-active {
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.nj-chip--quiet {
    min-height: 34px;
}

.nj-events__chips--categories {
    margin-bottom: 34px;
}

/* Tagesgruppen */
.nj-events__day {
    margin-bottom: 34px;
}

.nj-events__day-title {
    position: sticky;
    top: var(--site-header-height, 0px);
    z-index: 2;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 8px;
    padding: 8px 0;
    background: var(--color-page-surface);
    font-size: 21px;
    line-height: 27px;
    font-weight: 750;
    color: var(--color-text-primary);
}

.nj-events__day-date {
    font-size: 13px;
    line-height: 17px;
    font-weight: 500;
    color: var(--color-text-tertiary);
}

.nj-events__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nj-events__empty-today {
    margin: 0 0 13px;
    font-size: 17px;
    line-height: 27px;
    color: var(--color-text-secondary);
}

/* Karte: freie Zeile, Haarlinie ab der Textkante (Brand Guide, Listen). */
.nj-event-card {
    animation: nj-event-in var(--motion-standard, 220ms) ease both;
}

.nj-event-card__link {
    display: grid;
    grid-template-columns: 89px 1fr;
    gap: 13px;
    padding: 13px 0;
    color: inherit;
    text-decoration: none;
}

.nj-event-card + .nj-event-card .nj-event-card__body {
    box-shadow: inset 0 1px 0 var(--nj-ev-line);
    margin-top: -13px;
    padding-top: 13px;
}

.nj-event-card__time {
    font-size: 17px;
    line-height: 21px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-primary);
}

.nj-event-card__until {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 17px;
    font-weight: 500;
    color: var(--color-text-tertiary);
}

.nj-event-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.nj-event-card__meta {
    display: flex;
    gap: 8px;
    font-size: 13px;
    line-height: 17px;
    font-weight: 650;
}

.nj-event-card__category {
    color: var(--nj-accent-text);
}

.nj-event-card__status {
    color: var(--color-error);
}

.nj-event-card__title {
    font-size: 17px;
    line-height: 21px;
    font-weight: 650;
    color: var(--color-text-primary);
    overflow-wrap: anywhere;
}

.nj-event-card__link:hover .nj-event-card__title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nj-event-card__place {
    font-size: 13px;
    line-height: 17px;
    color: var(--color-text-tertiary);
}

.nj-event-card.is-cancelled .nj-event-card__title {
    text-decoration: line-through;
    color: var(--color-text-tertiary);
}

@keyframes nj-event-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Weiterladen, Ende, Leerzustand */
.nj-events__more {
    display: flex;
    justify-content: center;
    margin: 21px 0 34px;
}

.nj-events__more-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 21px;
    border-radius: 21px;
    border: 1px solid var(--nj-ev-line);
    color: var(--color-text-primary);
    font-weight: 600;
    text-decoration: none;
}

.nj-events__more.is-loading .nj-events__more-link {
    opacity: 0.55;
    pointer-events: none;
}

.nj-events__end,
.nj-events__note {
    margin: 21px 0;
    font-size: 13px;
    line-height: 21px;
    color: var(--color-text-tertiary);
    text-align: center;
}

/* Leerer Bereich wie in der App: orange Bühne (#B85C1F → #A04B16, weiße
   Schrift ≥ 4,58:1), darunter Zeilen mit Marke 44 und die nächsten Termine. */
.nj-events__empty {
    padding: 21px 0 0;
}

.nj-area-stage {
    position: relative;
    overflow: hidden;
    padding: 21px;
    border-radius: 21px;
    background: linear-gradient(135deg, #b85c1f, #a04b16);
    box-shadow: 0 8px 21px rgba(201, 123, 61, 0.28);
    color: #fff;
}

.nj-events .nj-area-stage__eyebrow,
.nj-events .nj-area-stage__title,
.nj-events .nj-area-stage__text {
    position: relative;
    z-index: 1;
    margin: 0;
    padding-right: 34px;
    /* Der globale Absatzstil färbt sonst dunkel. */
    color: #fff;
}

.nj-area-stage__eyebrow {
    font-size: 13px;
    line-height: 17px;
    font-weight: 650;
}

.nj-events .nj-area-stage__title {
    margin-top: 8px;
    font-size: 21px;
    line-height: 27px;
    font-weight: 750;
}

.nj-events .nj-area-stage__text {
    margin-top: 4px;
    font-size: 17px;
    line-height: 27px;
}

.nj-area-stage__mark {
    position: absolute;
    right: -21px;
    bottom: -21px;
    width: 128px;
    height: 128px;
    color: rgba(255, 255, 255, 0.1);
    transform: rotate(-12deg);
}

.nj-events__section-title {
    margin: 34px 0 8px;
    font-size: 13px;
    line-height: 17px;
    font-weight: 650;
    color: var(--color-text-secondary);
}

.nj-area-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nj-area-row {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    min-height: 44px;
    padding: 13px 0;
    color: inherit;
    text-decoration: none;
}

.nj-area-rows li + li .nj-area-row::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 57px;
    height: 1px;
    background: var(--nj-ev-line);
}

.nj-area-row:focus-visible {
    outline: 2px solid var(--color-accent-secondary);
    outline-offset: 4px;
    border-radius: 13px;
}

.nj-area-row__mark {
    --mark: #1b7a91;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--mark) 84%, #fff), var(--mark));
    color: #fff;
}

.nj-area-row__mark.is-petrol { --mark: #0c5365; }
.nj-area-row__mark.is-blue { --mark: #4a78f6; }
.nj-area-row__mark.is-traffic { --mark: #1b7a91; }

.nj-area-row__mark svg {
    width: 21px;
    height: 21px;
}

.nj-area-row__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.nj-area-row__title {
    font-size: 17px;
    line-height: 21px;
    font-weight: 650;
    color: var(--color-text-primary);
}

.nj-area-row__sub {
    font-size: 13px;
    line-height: 17px;
    color: var(--color-text-secondary);
}

.nj-area-row__chevron {
    width: 17px;
    height: 17px;
    color: var(--color-text-tertiary);
}

@media (hover: hover) {
    .nj-area-row:hover .nj-area-row__title {
        text-decoration: underline;
        text-underline-offset: 4px;
    }
}

.nj-events__app {
    margin: 34px 0 0;
    padding: 21px;
    border-radius: 21px;
    background: var(--nj-accent-soft);
}

.nj-events__app p {
    margin: 0;
    font-size: 17px;
    line-height: 27px;
    color: var(--color-text-secondary);
}

.nj-events__app .nj-events__app-title {
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Einzelseite */
.nj-event__hero {
    position: relative;
    margin: 0 0 21px;
    padding: 34px 21px 21px;
    border-radius: 34px;
    overflow: hidden;
    background: linear-gradient(140deg, rgba(201, 123, 61, 0.26), rgba(211, 132, 65, 0.12) 62%, rgba(12, 74, 88, 0.10));
}

.nj-event__category {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--nj-accent-text);
}

.nj-event__title {
    margin: 0;
    font-size: 34px;
    line-height: 43px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    text-wrap: balance;
}

.nj-event__status {
    display: inline-block;
    margin: 13px 0 0;
    padding: 4px 13px;
    border-radius: 13px;
    background: var(--color-error);
    color: #fff;
    font-size: 13px;
    line-height: 21px;
    font-weight: 700;
}

.nj-event__status--past {
    background: var(--color-text-tertiary);
}

.nj-event__facts {
    display: grid;
    gap: 13px;
    margin: 0 0 21px;
}

.nj-event__fact {
    display: grid;
    grid-template-columns: 55px 1fr;
    gap: 13px;
}

.nj-event__fact dt {
    font-size: 13px;
    line-height: 27px;
    font-weight: 700;
    color: var(--color-text-tertiary);
}

.nj-event__fact dd {
    margin: 0;
    font-size: 17px;
    line-height: 27px;
    color: var(--color-text-primary);
}

.nj-event__muted {
    font-size: 13px;
    line-height: 21px;
    color: var(--color-text-tertiary);
}

.nj-event__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 34px;
}

.nj-event__ai {
    margin: -21px 0 34px;
}

.nj-event__description {
    margin: 0 0 34px;
    font-size: 17px;
    line-height: 27px;
    color: var(--color-text-secondary);
}

.nj-event__dates h2,
.nj-event__more h2,
.nj-waste h2 {
    margin: 0 0 13px;
    font-size: 21px;
    line-height: 27px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.nj-event__dates ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 21px;
    margin: 0 0 34px;
    padding: 0;
    list-style: none;
    font-size: 17px;
    line-height: 27px;
}

.nj-event__more {
    margin-top: 55px;
}

/* Müllkalender */
.nj-waste__finder,
.nj-waste__zone {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 34px;
}

.nj-waste__label {
    font-size: 13px;
    line-height: 17px;
    font-weight: 700;
    color: var(--color-text-secondary);
}

.nj-waste__suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    max-height: 340px;
    overflow-y: auto;
    margin: 4px 0 0;
    padding: 8px 0;
    list-style: none;
    border-radius: 21px;
    border: 1px solid var(--nj-ev-line);
    background: var(--nj-ev-surface);
    box-shadow: 0 13px 34px rgba(16, 19, 26, 0.12);
}

.nj-waste__zone .nj-waste__suggestions {
    top: 76px;
}

.nj-waste__suggestions li {
    padding: 8px 21px;
    font-size: 17px;
    line-height: 21px;
    cursor: pointer;
}

.nj-waste__suggestions li[aria-selected="true"],
.nj-waste__suggestions li:hover {
    background: var(--color-bg-secondary);
}

.nj-waste__suggestions small {
    display: block;
    font-size: 13px;
    line-height: 17px;
    color: var(--color-text-tertiary);
}

.nj-waste__list {
    margin: 0 0 34px;
    padding: 0;
    list-style: none;
}

.nj-waste__list li {
    display: flex;
    justify-content: space-between;
    gap: 13px;
    padding: 13px 0;
    box-shadow: inset 0 -1px 0 var(--nj-ev-line);
    font-size: 17px;
    line-height: 21px;
}

.nj-waste__list a {
    color: var(--color-text-primary);
    font-weight: 600;
    text-decoration: none;
}

.nj-waste__list--columns {
    columns: 2 220px;
    column-gap: 34px;
}

.nj-waste__list--columns li {
    break-inside: avoid;
}

.nj-waste__zones summary,
.nj-waste__report summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 17px;
    line-height: 21px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.nj-waste__zone-name {
    margin: 0 0 13px;
    font-size: 17px;
    line-height: 21px;
    font-weight: 700;
}

.nj-waste__days {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nj-waste__day {
    display: grid;
    grid-template-columns: 144px 1fr;
    gap: 13px;
    padding: 13px 0;
    box-shadow: inset 0 -1px 0 var(--nj-ev-line);
    font-size: 17px;
    line-height: 21px;
}

.nj-waste__day time {
    font-weight: 700;
    color: var(--color-text-primary);
}

.nj-waste__day.is-next {
    padding: 21px;
    margin-bottom: 13px;
    border-radius: 21px;
    box-shadow: none;
    background: var(--color-bg-secondary);
}

.nj-waste__fractions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 13px;
}

.nj-waste__fraction {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
}

.nj-waste__dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--nj-fraction, #888);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.nj-waste__subscribe {
    margin: 21px 0 0;
    font-size: 17px;
    line-height: 21px;
}

.nj-waste__report {
    margin-top: 34px;
}

.nj-waste__report textarea {
    width: 100%;
    margin: 8px 0 13px;
    resize: vertical;
}

.nj-waste__report-status {
    font-size: 13px;
    line-height: 21px;
    color: var(--color-text-tertiary);
}

@media (max-width: 600px) {
    .nj-events__shell {
        padding: 13px 21px 55px;
    }

    .nj-events__title,
    .nj-event__title {
        font-size: 27px;
        line-height: 34px;
    }

    .nj-event-card__link {
        grid-template-columns: 76px 1fr;
    }

    .nj-waste__day {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nj-event-card {
        animation: none;
    }

    .nj-button,
    .nj-events__search-button,
    .nj-chip {
        transition: none;
    }
}
