/*
 * eGov-Kalender NEGZ Styling
 *
 * Diese Datei ist bewusst lesbar und kann unter
 * Plugins -> Plugin-Datei-Editor manuell angepasst werden.
 * Die Markenwerte lassen sich zusätzlich im WordPress-Customizer ändern.
 */

/* ============================================================
   01. NEGZ Design-Tokens (Design Manual, Juli 2025)
   ============================================================ */

:root {
  --egov-blue: #3090b0;
  --egov-blue-light: #5ba1d6;
  --egov-sage: #8bb59b;
  --egov-green: #8ab122;
  --egov-lime: #bbd034;
  --egov-ink: #123651;
  --egov-rust: #b05030;
  --egov-accent: #d6905b;
  --egov-lavender: #b58ba5;
  --egov-purple: #4934d0;
  --egov-bronze: #512d12;
  --egov-border: #bcbec0;
  --egov-border-soft: #e2e5e7;
  --egov-surface: #fff;
  --egov-surface-muted: #f7f8f9;
  --egov-surface-blue: #edf6fa;
  --egov-surface-green: #edf4ef;
  --egov-surface-peach: #faf0e8;
  --egov-text-muted: #4e5f6b;
  --egov-primary: var(--egov-accent);
  --egov-primary-hover: var(--egov-accent-hover, var(--egov-rust));
  --egov-advertising: var(--egov-rust);
  --egov-soft-green: var(--egov-surface-green);
  --egov-calendar-max-width: 1290px;
  --egov-calendar-content-width: min(
    var(--egov-calendar-max-width),
    var(--global-content-width, var(--egov-calendar-max-width))
  );
  --egov-edge-space: var(
    --global-content-edge-padding,
    clamp(1rem, 4vw, 3.5rem)
  );
  --egov-radius: 14px;
  --egov-radius-small: 8px;
  --egov-shadow: 0 10px 30px rgba(18, 54, 81, 0.09);
  --egov-shadow-hover: 0 14px 36px rgba(18, 54, 81, 0.14);
  --egov-motion-duration: 180ms;
  --egov-sans:
    "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --egov-serif: "IBM Plex Serif", Georgia, serif;
}

/* ============================================================
   02. Scope, Typografie und barrierearme Interaktionen
   ============================================================ */

body.egov-calendar-negz-styling
  :where(
    .tribe-events,
    .tribe-events-single,
    #tribe-community-events,
    .egov-calendar-template-shell,
    .egov-directory-shell,
    .egov-event-details,
    .egov-submitter-card
  ) {
  font-family: var(--egov-sans);
  color: var(--egov-ink);
}

body.egov-calendar-negz-styling
  :where(
    .tribe-events,
    .tribe-events-single,
    #tribe-community-events,
    .egov-calendar-template-shell,
    .egov-directory-shell,
    .egov-event-details,
    .egov-submitter-card
  )
  *,
body.egov-calendar-negz-styling
  :where(
    .tribe-events,
    .tribe-events-single,
    #tribe-community-events,
    .egov-calendar-template-shell,
    .egov-directory-shell,
    .egov-event-details,
    .egov-submitter-card
  )
  *::before,
body.egov-calendar-negz-styling
  :where(
    .tribe-events,
    .tribe-events-single,
    #tribe-community-events,
    .egov-calendar-template-shell,
    .egov-directory-shell,
    .egov-event-details,
    .egov-submitter-card
  )
  *::after {
  box-sizing: border-box;
}

body.egov-calendar-negz-styling .tribe-common {
  --tec-font-family-sans-serif: var(--egov-sans);
  --tec-color-text-primary: var(--egov-ink);
  --tec-color-text-event-title: var(--egov-ink);
  --tec-color-text-events-title: var(--egov-ink);
  --tec-color-link-primary: var(--egov-ink);
  --tec-color-accent-primary: var(--egov-accent);
  --tec-color-icon-active: var(--egov-rust);
  --tec-color-border-default: var(--egov-border-soft);
  --tec-color-background-events: var(--egov-surface);
  --tec-color-background-secondary: var(--egov-surface-muted);
  --tec-color-background-view-selector-list-item-hover: var(
    --egov-surface-peach
  );
}

body.egov-calendar-negz-styling
  :where(
    .tribe-common,
    .tribe-events-single,
    #tribe-community-events,
    .egov-event-details,
    .egov-submitter-card,
    .egov-directory-shell
  )
  :where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--egov-blue) !important;
  outline-offset: 3px;
}

body.egov-calendar-negz-styling :where(.tribe-common, .tribe-events-single) a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.1em;
}

body.egov-calendar-negz-styling
  :where(.tribe-common, .tribe-events-single)
  a:hover {
  color: var(--egov-rust);
}

/* ============================================================
   03. Veranstaltungsvorlage und seitenweite Innenabstände
   ============================================================ */

/*
 * TEC paints its archive and page-template wrappers with an opaque white
 * events background. On themes with a light-grey page canvas this produces a
 * second, oversized white sheet behind otherwise intentional cards. Keep all
 * plugin-controlled outer canvases transparent; component cards, fields,
 * tooltips and bars retain their own surface backgrounds below.
 */
body.egov-calendar-negz-styling
  :where(
    .tribe-events-view,
    #tribe-events,
    #tribe-events-pg-template,
    .tribe-events-pg-template,
    #tribe-community-events,
    .egov-calendar-template-shell,
    .egov-calendar-template-main,
    .egov-calendar-template-inner,
    .egov-directory-shell,
    .egov-directory-archive
  ) {
  background-color: transparent !important;
  box-shadow: none !important;
}

/*
 * Public submitter singles use the theme's normal post template instead of a
 * TEC template. Kadence adds its opaque content-bg article there, so clear
 * only that post-type-specific shell while preserving ordinary site pages.
 */
body.egov-calendar-negz-styling.single-egov_submitter
  :where(.content-bg, article.type-egov_submitter) {
  background-color: transparent !important;
  box-shadow: none !important;
}

/*
 * TEC can expose its archive as a native post-type archive or as a virtual
 * view. The shared .tribe-events-view wrapper exists in both paths, so the
 * visible calendar width is constrained here instead of on a route-specific
 * theme container. !important deliberately wins over TEC's full-width view
 * utilities and inline view refreshes.
 */
body.egov-calendar-negz-styling .tribe-events-view {
  box-sizing: border-box;
  width: calc(100% - (2 * var(--egov-edge-space))) !important;
  max-width: calc(
    var(--egov-calendar-max-width) - (2 * var(--egov-edge-space))
  ) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

body.egov-calendar-negz-styling .tribe-events .tribe-events-l-container {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-right: 0;
  padding-left: 0;
}

.egov-calendar-template-shell {
  width: 100%;
  margin: 0;
}

.egov-calendar-template-main {
  width: 100%;
  margin: 0;
}

body.egov-calendar-negz-template:not(.single-tribe_events)
  #tribe-events-pg-template.egov-calendar-template-inner {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}

/*
 * Single events do not contain TEC's .tribe-events-view archive wrapper.
 * Constrain their canonical page wrapper directly and without relying on the
 * optional template body class, which is not present in every TEC render path.
 * These values deliberately mirror the archive frame above.
 */
body.egov-calendar-negz-styling.single-tribe_events #tribe-events-pg-template {
  box-sizing: border-box;
  width: calc(100% - (2 * var(--egov-edge-space))) !important;
  max-width: calc(
    var(--egov-calendar-max-width) - (2 * var(--egov-edge-space))
  ) !important;
  margin: clamp(2rem, 5vw, 4.5rem) auto !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

body.egov-calendar-negz-styling.tribe_community_edit #tribe-events-pg-template,
body.egov-calendar-negz-styling.tribe_community_list #tribe-events-pg-template {
  width: 100%;
  max-width: var(--egov-calendar-content-width);
  margin: clamp(2rem, 5vw, 4.5rem) auto;
  padding-inline: var(--egov-edge-space);
}

/* ============================================================
   04. Suchleiste, Ansichtsumschalter und Navigation
   ============================================================ */

body.egov-calendar-negz-styling .tribe-events .tribe-events-c-events-bar {
  border: 1px solid var(--egov-border-soft);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: 0 4px 18px rgba(18, 54, 81, 0.06);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-search__input-control {
  border-bottom-color: var(--egov-border);
}

body.egov-calendar-negz-styling .tribe-events .tribe-events-c-search__input {
  color: var(--egov-ink);
  font-family: var(--egov-sans);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-search__input::placeholder {
  color: var(--egov-text-muted);
  opacity: 1;
}

body.egov-calendar-negz-styling .tribe-events .tribe-events-c-search__button,
body.egov-calendar-negz-styling
  .tribe-events
  button.tribe-events-c-search__button {
  min-height: 2.75rem;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--egov-accent) !important;
  border-radius: 999px !important;
  background: var(--egov-accent) !important;
  box-shadow: none !important;
  color: var(--egov-ink) !important;
  font-family: var(--egov-sans);
  font-weight: 700;
  transition:
    background-color var(--egov-motion-duration) ease,
    border-color var(--egov-motion-duration) ease,
    color var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-search__button:hover,
body.egov-calendar-negz-styling
  .tribe-events
  button.tribe-events-c-search__button:hover {
  border-color: var(--egov-accent-hover) !important;
  background: var(--egov-accent-hover) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-view-selector__list-item-link {
  position: relative;
  color: var(--egov-ink);
  font-weight: 500;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-view-selector__list-item--active
  .tribe-events-c-view-selector__list-item-link::after {
  position: absolute;
  right: 0;
  bottom: -0.45rem;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--egov-accent);
  content: "";
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-c-top-bar__nav-link,
    .tribe-events-c-top-bar__datepicker-button,
    .tribe-events-c-view-selector__button
  ) {
  border-radius: var(--egov-radius-small) !important;
  transition:
    background-color var(--egov-motion-duration) ease,
    color var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-c-top-bar__nav-link,
    .tribe-events-c-top-bar__datepicker-button,
    .tribe-events-c-view-selector__button
  ):hover {
  background: var(--egov-surface-peach) !important;
  color: var(--egov-rust) !important;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-top-bar__datepicker-button {
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-weight: 600;
}

body.egov-calendar-negz-styling .tribe-events .tribe-events-c-messages__message,
body.egov-calendar-negz-styling .tribe-events-notices {
  padding: 1rem 1.25rem;
  border: 1px solid var(--egov-border-soft);
  border-left: 4px solid var(--egov-blue);
  border-radius: 0 var(--egov-radius-small) var(--egov-radius-small) 0;
  background: var(--egov-surface-blue);
  color: var(--egov-ink);
}

/* ============================================================
   05. Filter Bar
   ============================================================ */

body.egov-calendar-negz-styling .tribe-filter-bar {
  border: 1px solid var(--egov-border-soft);
  border-radius: var(--egov-radius);
  background: var(--egov-surface-muted);
  color: var(--egov-ink);
}

body.egov-calendar-negz-styling
  .tribe-events--filter-bar-vertical
  .tribe-filter-bar {
  padding: 1rem;
}

body.egov-calendar-negz-styling .tribe-filter-bar .tribe-filter-bar-c-filter {
  border-bottom-color: var(--egov-border-soft);
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-filter__toggle {
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-weight: 600;
  transition: color var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-filter__toggle:hover,
body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-filter--has-selections
  .tribe-filter-bar-c-filter__toggle {
  color: var(--egov-rust);
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-filter__toggle-icon,
body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-filter__toggle-plus-icon,
body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-filter__toggle-minus-icon {
  color: var(--egov-blue);
  stroke: var(--egov-blue);
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-pill__pill {
  border: 1px solid var(--egov-ink) !important;
  border-radius: 999px;
  background: var(--egov-ink) !important;
  color: #fff !important;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/*
 * Filter Bar versieht den Pill-Container zusaetzlich mit tribe-common-b*- und
 * Hover-Regeln. Diese Regeln setzen die Textfarbe nachtraeglich wieder auf
 * TECs dunkle Standardfarbe. Die sichtbaren Texte erhalten deshalb den
 * kontrastreichen Zustand ausdruecklich auf allen Interaktionsstufen.
 */
body.egov-calendar-negz-styling
  .tribe-events
  .tribe-filter-bar
  .tribe-filter-bar-c-pill__pill:is(:hover, :focus, :active),
body.egov-calendar-negz-styling
  .tribe-events
  .tribe-filter-bar
  .tribe-filter-bar-c-pill__pill
  :where(
    .tribe-filter-bar-c-pill__pill-label,
    .tribe-filter-bar-c-pill__pill-label-colon,
    .tribe-filter-bar-c-pill__pill-selections
  ) {
  color: #fff !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-pill__remove-button {
  color: var(--egov-accent) !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-pill__remove-button-icon
  path {
  stroke: currentColor !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-pill__remove-button:is(:hover, :focus-visible) {
  color: #fff !important;
}

/* Keep selected values inside an opened multi-select equally legible. */
body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-multiselect
  .select2-selection__choice {
  border-color: var(--egov-ink) !important;
  background: var(--egov-ink) !important;
  color: #fff !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  .tribe-filter-bar-c-multiselect
  :where(.select2-selection__choice__text, .select2-selection__choice__remove) {
  color: #fff !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :where(
    .select2-selection--single,
    .select2-selection--multiple,
    .tribe-filter-bar-c-dropdown__select
  ) {
  border-color: var(--egov-border) !important;
  border-radius: var(--egov-radius-small) !important;
  background: var(--egov-surface) !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :where(.select2-container--focus, .select2-container--open)
  :where(.select2-selection--single, .select2-selection--multiple) {
  border-color: var(--egov-blue) !important;
  box-shadow: 0 0 0 3px rgba(48, 144, 176, 0.14);
}


/*
 * Teilnahme steht direkt unter "Filter": kein eigener aufklappbarer Titel.
 *
 * Filter Bar 5.6.x kann je nach gespeicherter Konfiguration entweder den
 * Context-Slug `filterbar_egov_format`, den Legacy-Slug `egov_format` oder nur
 * den Feldnamen im Markup ausgeben. Die ID-Selektoren sind der schnelle,
 * breite Fallback; :has() fängt aktuelle V2.1-Markupvarianten ab.
 */
body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  ) {
  padding-top: 0.35rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--egov-border-soft);
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  .tribe-filter-bar-c-filter__toggle {
  display: none !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  .tribe-filter-bar-c-filter__filter-fields {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.6rem;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  overflow: visible !important;
}

/*
 * Online und Vor Ort treten als schnelle, klickbare Chips auf. Die native
 * Checkbox bleibt für Assistive Technologien erhalten, visuell übernimmt die
 * Beschriftung die Rolle einer kleinen Toggle-Fläche.
 */
body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox) {
  position: relative;
  flex: 1 1 calc(50% - 0.3rem);
  min-width: 0;
  width: calc(50% - 0.3rem);
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  .tribe-common-form-control-checkbox__input,
body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  input[type="checkbox"] {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}


body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  .tribe-common-form-control-checkbox__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  inline-size: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.6rem 1rem;
  border: 1px solid var(--egov-border-soft);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(18, 54, 81, 0.05);
  color: var(--egov-ink);
  font-weight: 650;
  font-size: 0.8rem;
  line-height: 1;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  cursor: pointer;
  transition:
    border-color var(--egov-motion-duration) ease,
    background-color var(--egov-motion-duration) ease,
    box-shadow var(--egov-motion-duration) ease,
    color var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  .tribe-common-form-control-checkbox__label-text {
  display: inline-block;
  padding-inline-end: 0.14rem;
  font-size: 0.8rem;
  letter-spacing: -0.01em;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  .tribe-common-form-control-checkbox__label::before {
  content: "";
  display: inline-block;
  inline-size: 1.44rem;
  block-size: 1.44rem;
  flex: 0 0 1.44rem;
  border-radius: 999px;
  background-color: var(--egov-surface-muted);
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%233090B0%27%20stroke-width%3D%271.9%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%278%27%2F%3E%3Cpath%20d%3D%27M4.8%209h14.4M4.8%2015h14.4%27%2F%3E%3Cpath%20d%3D%27M12%204a13%2013%200%200%201%200%2016M12%204a13%2013%200%200%200%200%2016%27%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.82rem 0.82rem;
  transition:
    background-color var(--egov-motion-duration) ease,
    background-image var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox):nth-child(2)
  .tribe-common-form-control-checkbox__label::before {
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%238AB122%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4.5%2010.5%2012%204l7.5%206.5%27%2F%3E%3Cpath%20d%3D%27M6.5%209.5V20h11V9.5%27%2F%3E%3C%2Fsvg%3E");
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  .tribe-common-form-control-checkbox__label:hover {
  border-color: rgba(48, 144, 176, 0.24);
  background: #fbfcfd;
  box-shadow: 0 7px 16px rgba(18, 54, 81, 0.08);
  transform: translateY(-1px);
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox):has(input:focus-visible)
  .tribe-common-form-control-checkbox__label {
  outline: 3px solid rgba(48, 144, 176, 0.3);
  outline-offset: 2px;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox):has(input:checked)
  .tribe-common-form-control-checkbox__label {
  border-color: rgba(48, 144, 176, 0.34);
  background: #f8fcff;
  box-shadow: 0 8px 18px rgba(48, 144, 176, 0.1);
  color: var(--egov-ink);
  font-weight: 700;
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox):has(input:checked)
  .tribe-common-form-control-checkbox__label::before {
  background-color: var(--egov-blue);
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23FFFFFF%27%20stroke-width%3D%271.9%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%278%27%2F%3E%3Cpath%20d%3D%27M4.8%209h14.4M4.8%2015h14.4%27%2F%3E%3Cpath%20d%3D%27M12%204a13%2013%200%200%201%200%2016M12%204a13%2013%200%200%200%200%2016%27%2F%3E%3C%2Fsvg%3E");
  transform: scale(1.02);
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox):nth-child(2):has(input:checked)
  .tribe-common-form-control-checkbox__label {
  border-color: rgba(138, 177, 34, 0.34);
  background: #fafcf4;
  box-shadow: 0 8px 18px rgba(138, 177, 34, 0.1);
}

body.egov-calendar-negz-styling
  .tribe-filter-bar
  :is(
    [id^="filterbar_egov_format-container"],
    [id^="egov_format-container"],
    .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
    .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
  )
  :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox):nth-child(2):has(input:checked)
  .tribe-common-form-control-checkbox__label::before {
  background-color: var(--egov-green);
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23FFFFFF%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4.5%2010.5%2012%204l7.5%206.5%27%2F%3E%3Cpath%20d%3D%27M6.5%209.5V20h11V9.5%27%2F%3E%3C%2Fsvg%3E");
}

@media (max-width: 380px) {
  body.egov-calendar-negz-styling
    .tribe-filter-bar
    :is(
      [id^="filterbar_egov_format-container"],
      [id^="egov_format-container"],
      .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
      .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
    )
    :is(.tribe-filter-bar-c-checkbox, .tribe-common-form-control-checkbox) {
    flex-basis: 100%;
    width: 100%;
  }

  body.egov-calendar-negz-styling
    .tribe-filter-bar
    :is(
      [id^="filterbar_egov_format-container"],
      [id^="egov_format-container"],
      .tribe-filter-bar-c-filter:has(input[name^="tribe_egov_format"]),
      .tribe-filter-bar-c-filter:has(input[name^="tribe_filterbar_egov_format"])
    )
    .tribe-common-form-control-checkbox__label {
    justify-content: center;
  }
}

/* ============================================================
   06. Listenansicht
   ============================================================ */

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-list__month-separator::after,
body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-latest-past__heading::after {
  background-color: var(--egov-border-soft);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-list__month-separator-text,
body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-latest-past__heading {
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-weight: 700;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-wrapper,
    .tribe-events-calendar-latest-past__event-wrapper
  ) {
  min-width: 0;
  border: 1px solid var(--egov-border-soft);
  border-left: 5px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: var(--egov-shadow);
  overflow: hidden;
  transition:
    border-color var(--egov-motion-duration) ease,
    box-shadow var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-row,
    .tribe-events-calendar-latest-past__event-row
  ):hover
  :where(
    .tribe-events-calendar-list__event-wrapper,
    .tribe-events-calendar-latest-past__event-wrapper
  ) {
  border-left-color: var(--egov-accent-hover);
  box-shadow: var(--egov-shadow-hover);
  transform: translateY(-2px);
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event,
    .tribe-events-calendar-latest-past__event
  ) {
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 1.5rem);
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-title-link,
    .tribe-events-calendar-latest-past__event-title-link
  ) {
  color: var(--egov-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

body.egov-calendar-negz-styling .tribe-events .egov-card-formats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  margin: 0 0 0.55rem;
  font-family: var(--egov-sans);
  line-height: 1.2;
}

body.egov-calendar-negz-styling
  .tribe-events
  .egov-card-formats__label {
  color: var(--egov-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

body.egov-calendar-negz-styling
  .tribe-events
.egov-card-formats__chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.23rem 0.58rem;
  border: 1px solid rgba(176, 80, 48, 0.2);
  border-radius: 999px;
  background: var(--egov-surface-peach);
  color: var(--egov-rust);
  font-size: 0.75rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Field-local AI transparency and image-rights attribution. */
.egov-ai-disclosure {
	display: flex;
	gap: .42rem;
	align-items: baseline;
	margin: .4rem 0 1rem;
	color: var(--egov-muted, #5d6870);
	font-size: .78rem;
	font-style: italic;
	line-height: 1.45;
}

.egov-ai-disclosure__icon {
	color: var(--egov-accent, #b05030);
	font-style: normal;
}

.egov-image-credit {
	margin: .45rem 0 1.2rem;
	color: var(--egov-muted, #5d6870);
	font-size: .76rem;
	line-height: 1.45;
}

.egov-image-credit__label {
	font-weight: 650;
}

.egov-image-credit a {
	text-decoration-thickness: 1px;
	text-underline-offset: .14em;
}

.egov-submitter-prefill {
	margin: -.25rem 0 1.2rem;
	padding: .9rem 1rem;
	border-left: 4px solid var(--egov-blue, #3090b0);
	border-radius: 0 .35rem .35rem 0;
	background: #edf6fb;
}

.egov-submitter-prefill p {
	margin: .45rem 0 0;
}

.egov-submitter-prefill__ready {
	color: #17643a;
	font-weight: 650;
}

.egov-submitter-prefill__status:not(:empty) {
	font-weight: 600;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-title-link,
    .tribe-events-calendar-latest-past__event-title-link
  ):hover {
  color: var(--egov-rust);
  text-decoration: underline;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-datetime,
    .tribe-events-calendar-latest-past__event-datetime
  ) {
  color: var(--egov-rust);
  font-weight: 600;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-venue,
    .tribe-events-calendar-latest-past__event-venue,
    .tribe-events-calendar-list__event-description,
    .tribe-events-calendar-latest-past__event-description
  ) {
  color: var(--egov-text-muted);
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-featured-image,
    .tribe-events-calendar-latest-past__event-featured-image
  ) {
  border-radius: calc(var(--egov-radius) - 4px);
  object-fit: cover;
  transition: transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-list__event-row,
    .tribe-events-calendar-latest-past__event-row
  ):hover
  :where(
    .tribe-events-calendar-list__event-featured-image,
    .tribe-events-calendar-latest-past__event-featured-image
  ) {
  transform: scale(1.015);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-list__event-date-tag-weekday {
  color: var(--egov-rust);
  font-weight: 700;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-list__event-date-tag-daynum {
  color: var(--egov-ink);
  font-weight: 700;
}

/* ============================================================
   07. Monatsansicht: Ganztag, Mehrtag und lange Titel
   ============================================================ */

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__header-column-title {
  color: var(--egov-text-muted);
  font-family: var(--egov-sans);
  font-weight: 700;
  letter-spacing: 0.04em;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__body {
  border-color: var(--egov-border-soft);
  border-radius: var(--egov-radius);
  overflow: hidden;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__day {
  min-width: 0;
  border-color: var(--egov-border-soft);
  background: var(--egov-surface);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__day--past {
  background: #fbfcfc;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__day-date-daynum {
  color: var(--egov-ink);
  font-weight: 700;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__day--current
  .tribe-events-calendar-month__day-date-daynum {
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding-inline: 0.25rem;
  border-radius: 999px;
  background: var(--egov-accent);
  color: var(--egov-ink);
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-month__calendar-event,
    .tribe-events-calendar-month__calendar-event-title,
    .tribe-events-calendar-month__multiday-event,
    .tribe-events-calendar-month__multiday-event-wrapper,
    .tribe-events-calendar-month__multiday-event-bar,
    .tribe-events-calendar-month__multiday-event-bar-inner
  ) {
  min-width: 0;
  max-width: 100%;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event {
  padding-left: 0.35rem;
  border-left: 2px solid var(--egov-accent);
  overflow: hidden;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-datetime {
  color: var(--egov-text-muted);
  font-size: 0.69rem;
  line-height: 1.3;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-title-link {
  color: var(--egov-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: none;
}

/*
 * TEC behandelt Ganztagstermine wie Mehrtagstermine. Der bisher graue Balken
 * wird deshalb bewusst als orangefarbene, aber ruhige Ereignisfläche gestaltet.
 */
body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__multiday-event-bar-inner {
  border: 1px solid rgba(176, 80, 48, 0.22);
  border-left: 3px solid var(--egov-accent);
  border-radius: 6px;
  background: var(--egov-surface-peach) !important;
  background: color-mix(in srgb, var(--egov-accent) 17%, #fff) !important;
  color: var(--egov-ink);
  transition:
    background-color var(--egov-motion-duration) ease,
    border-color var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-events
  :where(
    .tribe-events-calendar-month__multiday-event-bar-inner--hover,
    .tribe-events-calendar-month__multiday-event-bar-inner--focus,
    .tribe-events-calendar-month__multiday-event-bar:hover
      .tribe-events-calendar-month__multiday-event-bar-inner
  ) {
  border-color: var(--egov-accent-hover);
  background: var(--egov-accent) !important;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__multiday-event-bar-title {
  color: var(--egov-ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__more-events-link {
  color: var(--egov-rust);
  font-weight: 700;
}

/*
 * TEC legt um den eigentlichen Vorschauinhalt standardmaessig einen grossen
 * Aussenabstand. Rahmen und Innenabstand werden hier zu einer einzigen ruhigen
 * Karte zusammengefuehrt, damit der Text weder am Innenrahmen klebt noch auf
 * einer unnoetig schmalen Spalte umbricht.
 */
body.egov-calendar-negz-styling .tooltipster-base.tribe-events-tooltip-theme {
  box-sizing: border-box;
  width: min(22.5rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--egov-border-soft);
  border-top: 4px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: var(--egov-shadow-hover);
}

body.egov-calendar-negz-styling
  .tooltipster-base.tribe-events-tooltip-theme
  .tooltipster-box {
  border-radius: inherit;
}

body.egov-calendar-negz-styling
  .tooltipster-base.tribe-events-tooltip-theme
  .tooltipster-content {
  padding: 0;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip {
  box-sizing: border-box;
  width: 100%;
  padding: 1rem 1.125rem 1.125rem;
  border: 0;
  border-radius: 0;
  background: var(--egov-surface);
  box-shadow: none;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-featured-image-wrapper {
  width: 100%;
  margin-bottom: 0.875rem;
  overflow: hidden;
  border-radius: var(--egov-radius-small);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-featured-image {
  width: 100%;
  height: auto;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-datetime {
  margin: 0 0 0.4rem;
  line-height: 1.45;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-title {
  margin: 0 0 0.55rem;
  line-height: 1.35;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-title-link {
  display: block;
  color: var(--egov-ink);
  font-weight: 700;
  line-height: inherit;
  overflow-wrap: anywhere;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-description {
  margin: 0;
  line-height: 1.55;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-description
  > :first-child {
  margin-top: 0;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__calendar-event-tooltip-description
  > :last-child {
  margin-bottom: 0;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__mobile-events-icon--event,
body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month__mobile-events-icon--featured {
  background-color: var(--egov-accent);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month-mobile-events__mobile-event {
  padding: 1rem;
  border: 1px solid var(--egov-border-soft);
  border-left: 4px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: 0 6px 20px rgba(18, 54, 81, 0.07);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-calendar-month-mobile-events__mobile-event-title-link {
  color: var(--egov-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ============================================================
   08. Einzelveranstaltung und TEC-Metadaten
   ============================================================ */

body.egov-calendar-negz-styling.single-tribe_events .tribe-events-single,
body.egov-calendar-negz-styling.single-tribe_events .tribe-events-event-meta,
body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single-event-description {
  min-width: 0;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single-event-title {
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.13;
  overflow-wrap: anywhere;
}

body.egov-calendar-negz-styling.single-tribe_events .tribe-events-schedule {
  padding: 0.85rem 1rem;
  border: 0 !important;
  border-left: 4px solid var(--egov-accent) !important;
  border-radius: 0 var(--egov-radius-small) var(--egov-radius-small) 0;
  background: var(--egov-surface-peach) !important;
  color: var(--egov-ink);
}

body.egov-calendar-negz-styling.single-tribe_events .tribe-events-event-meta {
  border: 1px solid var(--egov-border-soft);
  border-radius: var(--egov-radius);
  background: var(--egov-surface-muted);
}

/*
 * TEC 6.17.2 draws a full-width separator with an absolutely positioned
 * ::before element. Once the metadata becomes a padded card, that separator
 * crosses the Details heading instead of sitting between content sections.
 * The card already has its own border, so the redundant pseudo element is
 * removed for both TEC metadata blocks.
 */
body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-event-meta.primary::before,
body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-event-meta.secondary::before {
  display: none !important;
  border: 0 !important;
  content: none !important;
}

/*
 * TECs Standard-Stile setzen die Metagruppen in Spalten, lassen dem aeusseren
 * Primaerblock je nach Theme aber keinen verlaesslichen Innenabstand. Padding
 * und Gap liegen deshalb am gemeinsamen Container; die Gruppen selbst bleiben
 * flexibel und stapeln sich auf kleinen Displays ohne horizontales Scrollen.
 */
body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-event-meta.primary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3rem);
  width: 100%;
  padding: clamp(1.25rem, 3vw, 2rem);
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-event-meta.primary
  .tribe-events-meta-group {
  float: none;
  flex: 1 1 17rem;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-event-meta.primary
  .tribe-events-single-section-title {
  margin: 0 0 0.9rem;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-event-meta.primary
  :where(dl, dd) {
  margin-right: 0;
  margin-left: 0;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-event-meta.primary
  :where(dd, a) {
  overflow-wrap: anywhere;
}

body.egov-calendar-negz-styling.single-tribe_events .tribe-events-meta-group {
  color: var(--egov-ink);
}

body.egov-calendar-negz-styling.single-tribe_events .tribe-events-meta-group a {
  color: var(--egov-ink);
  font-weight: 600;
}

/*
 * TEC Pro renders related events as a flexible row. If there is only one
 * result, its `flex: 1` card stretches across the complete event container.
 * The legacy thumbnail rule also enlarges the image with scale(2), which is
 * why a single recommendation can look like a second full-width hero image.
 * A real grid keeps one to three recommendations compact and predictable.
 */
body.egov-calendar-negz-styling.single-tribe_events
  :where(
    .tribe-events-related-events-title,
    .tribe-block__related-events__title
  ) {
  margin: clamp(2rem, 4vw, 3rem) 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--egov-border-soft);
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.5rem);
  align-items: stretch;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  > li {
  display: flex;
  float: none !important;
  flex: none !important;
  flex-direction: column;
  min-width: 0;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--egov-border-soft);
  border-top: 4px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: var(--egov-shadow);
  overflow: hidden;
  transition:
    border-color var(--egov-motion-duration) ease,
    box-shadow var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  > li:hover {
  border-top-color: var(--egov-accent-hover);
  box-shadow: var(--egov-shadow-hover);
  transform: translateY(-2px);
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-events-thumbnail {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  margin: 0 !important;
  background: var(--egov-surface-muted);
  overflow: hidden;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-events-thumbnail
  > a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding-top: 0 !important;
  overflow: hidden;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-events-thumbnail
  :where(img, picture) {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-events-thumbnail
  img {
  position: absolute !important;
  inset: 0 !important;
  object-fit: cover;
  object-position: center;
  transform: none !important;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-event-info {
  display: flex;
  flex: 1;
  align-content: flex-start;
  align-items: baseline;
  width: 100%;
  padding: 1rem 1.125rem 1.125rem;
  color: var(--egov-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-event-info
  .tribe-related-events-title {
  margin: 0 0 0.55rem;
  color: var(--egov-ink);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-event-info
  .tribe-related-events-title
  a {
  color: var(--egov-ink);
  text-decoration-color: currentColor;
}

body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-single
  ul.tribe-related-events
  .tribe-related-event-info
  .tribe-related-events-title
  a:hover {
  color: var(--egov-rust);
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-subscribe-dropdown__button,
body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-c-subscribe-dropdown__button {
  border-color: var(--egov-ink) !important;
  border-radius: 999px !important;
  background: var(--egov-ink) !important;
  color: #fff !important;
  font-weight: 700;
  transition:
    background-color var(--egov-motion-duration) ease,
    border-color var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  .tribe-events
  .tribe-events-c-subscribe-dropdown__button:hover,
body.egov-calendar-negz-styling.single-tribe_events
  .tribe-events-c-subscribe-dropdown__button:hover {
  border-color: var(--egov-accent-hover) !important;
  background: var(--egov-accent-hover) !important;
  transform: translateY(-1px);
}

/* ============================================================
   09. eGov Calendar Core: Terminangaben, Badges und CTA
   ============================================================ */

.egov-event-subtitle {
  margin-block: -0.35em 1.25em;
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.35;
}

.egov-event-details {
  margin-block: 2.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--egov-border-soft);
  border-left: 5px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: var(--egov-shadow);
  color: var(--egov-ink);
  font-family: var(--egov-sans);
}

.egov-event-details > h2,
.egov-submitter-card h2 {
  margin-block: 0 1rem;
  color: var(--egov-ink);
  font-family: var(--egov-sans);
}

.egov-event-taxonomies,
.egov-event-relations {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.egov-event-taxonomy,
.egov-event-relation {
  display: grid;
  grid-template-columns: minmax(9rem, 0.35fr) 1fr;
  gap: 0.5rem 1rem;
  align-items: start;
}

.egov-event-taxonomy dt,
.egov-event-relation dt {
  font-weight: 700;
}

.egov-event-taxonomy dd,
.egov-event-relation dd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.egov-event-relations {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--egov-border-soft);
}

.egov-event-relation dd a {
  color: var(--egov-ink);
  font-weight: 700;
}

.egov-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid rgba(48, 144, 176, 0.18);
  border-radius: 999px;
  background: var(--egov-surface-blue);
  color: var(--egov-ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.egov-badge--link {
  text-decoration: none;
  transition:
    background-color var(--egov-motion-duration) ease,
    border-color var(--egov-motion-duration) ease,
    box-shadow var(--egov-motion-duration) ease;
}

.egov-badge--link:hover {
  border-color: var(--egov-accent);
  background: var(--egov-surface-peach);
  color: var(--egov-ink);
  box-shadow: 0 0 0 2px rgba(214, 144, 91, 0.12);
}

.egov-badge--advertising {
  border-color: var(--egov-advertising);
  background: var(--egov-advertising);
  color: #fff;
  font-weight: 700;
}

.egov-badge--live {
  border-color: var(--egov-accent);
  background: var(--egov-accent);
  color: var(--egov-ink);
}

.egov-event-ticket {
  margin-block: 1.5rem 0;
}

.egov-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: var(--egov-accent);
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color var(--egov-motion-duration) ease,
    color var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

.egov-button:hover {
  background: var(--egov-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.egov-button:focus-visible,
.egov-event-details a:focus-visible,
.egov-submitter-card a:focus-visible {
  outline: 3px solid var(--egov-blue);
  outline-offset: 3px;
}

/* ============================================================
   10. Einreichenden- und Objektprofile
   ============================================================ */

.egov-submitter-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  margin-block: 2.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--egov-border-soft);
  border-top: 4px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: 0 6px 22px rgba(18, 54, 81, 0.07);
  color: var(--egov-ink);
  font-family: var(--egov-sans);
}

.egov-submitter-card__image img {
  width: 96px;
  height: 96px;
  border: 3px solid var(--egov-surface-peach);
  border-radius: 50%;
  object-fit: cover;
}

.egov-submitter-card__eyebrow {
  margin: 0 0 0.35rem;
  color: var(--egov-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.egov-submitter-card__role {
  margin-top: -0.5rem;
  font-weight: 500;
}

.egov-submitter-card__links,
.egov-profile-links,
.egov-object-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/*
 * Links remain Space Cadet including their underline. Dark Peach/Brown Rust
 * is reserved for the card accent and the interactive hover state, avoiding
 * the previous blue-label/orange-underline combination inherited from the
 * theme.
 */
.egov-submitter-card :where(h2 a, .egov-submitter-card__links a),
.egov-object-meta a,
.egov-object-events a,
.egov-directory-card__title a {
  color: var(--egov-ink) !important;
  text-decoration-color: currentColor !important;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.18em;
}

.egov-submitter-card :where(h2 a, .egov-submitter-card__links a):hover,
.egov-object-meta a:hover,
.egov-object-events a:hover,
.egov-directory-card__title a:hover {
  color: var(--egov-rust) !important;
  text-decoration-color: currentColor !important;
}

.egov-directory-shell {
  width: min(calc(100% - (2 * var(--egov-edge-space))), 76rem);
  margin-inline: auto;
}

/*
 * TEC Pro renders native venue and organizer singles through a separate
 * linked-post template. Core details appended to the_content can therefore
 * sit outside TEC's own centered wrapper. Constrain both the native wrapper
 * and the appended cards to the same frame used by calendar views. A plain
 * 100% width below the maximum deliberately keeps small screens spacious.
 */
body.egov-calendar-negz-styling:is(.single-tribe_venue, .single-tribe_organizer)
  #tribe-events-pg-template {
  box-sizing: border-box;
  width: calc(100% - (2 * var(--egov-edge-space))) !important;
  max-width: calc(
    var(--egov-calendar-max-width) - (2 * var(--egov-edge-space))
  ) !important;
  margin: clamp(2rem, 5vw, 4.5rem) auto !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

body.egov-calendar-negz-styling:is(
    .single-tribe_venue,
    .single-tribe_organizer,
    .single-egov_submitter
  )
  :where(.egov-object-meta, .egov-object-events) {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(
    var(--egov-calendar-max-width) - (2 * var(--egov-edge-space))
  );
  margin-right: auto;
  margin-left: auto;
}

body.egov-calendar-negz-styling:is(.single-tribe_venue, .single-tribe_organizer)
  :where(#tribe-events-pg-template, .egov-object-meta, .egov-object-events)
  a {
  color: var(--egov-ink) !important;
  text-decoration-color: currentColor !important;
}

body.egov-calendar-negz-styling:is(.single-tribe_venue, .single-tribe_organizer)
  :where(#tribe-events-pg-template, .egov-object-meta, .egov-object-events)
  a:hover {
  color: var(--egov-rust) !important;
  text-decoration-color: currentColor !important;
}

.egov-directory-archive .page-header {
  margin-block: 2rem;
}

.egov-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
  margin-block: 1.5rem 2.5rem;
}

.egov-directory-card {
  display: flex;
  gap: 1rem;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--egov-border-soft);
  border-top: 4px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: var(--egov-shadow);
  color: var(--egov-ink);
  transition:
    box-shadow var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

.egov-directory-card:hover {
  box-shadow: var(--egov-shadow-hover);
  transform: translateY(-2px);
}

.egov-directory-card__image {
  flex: 0 0 72px;
}

.egov-directory-card__image img,
.egov-person-placeholder {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--egov-surface-peach);
  object-fit: cover;
  font-size: 1.15rem;
  font-weight: 700;
}

.egov-directory-card__body {
  min-width: 0;
}

.egov-directory-card__title {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.egov-directory-card__meta,
.egov-directory-card__count {
  color: var(--egov-text-muted);
  font-size: 0.8rem;
}

.egov-directory-card__count {
  margin-bottom: 0;
  font-weight: 600;
}

.egov-object-meta,
.egov-object-events {
  margin-block: 2rem;
  padding: clamp(1.15rem, 2.5vw, 1.6rem);
  border: 1px solid var(--egov-border-soft);
  border-left: 4px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: 0 3px 14px rgba(18, 54, 81, 0.06);
  color: var(--egov-ink);
}

.egov-object-meta > :first-child,
.egov-object-events > :first-child {
  margin-top: 0;
}

.egov-object-meta > :last-child,
.egov-object-events > :last-child {
  margin-bottom: 0;
}

.egov-object-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.egov-object-links li {
  margin: 0;
  padding: 0;
}

.egov-object-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--egov-border);
  border-radius: 999px;
  background: var(--egov-surface-muted);
  color: var(--egov-ink);
  font-weight: 600;
  text-decoration: none;
}

.egov-object-links a:hover {
  border-color: var(--egov-accent);
  background: var(--egov-surface-peach);
  color: var(--egov-ink);
}

.egov-object-events__list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.egov-object-events__list li {
  display: grid;
  grid-template-columns: minmax(9.5rem, auto) 1fr;
  gap: 0.75rem 1rem;
}

.egov-object-events__list time {
  color: var(--egov-text-muted);
}

/* ============================================================
   11. Community Events und eGov-Zusatzfelder
   ============================================================ */

body.egov-calendar-negz-styling #tribe-community-events {
  color: var(--egov-ink);
  font-family: var(--egov-sans);
}

body.egov-calendar-negz-styling
  #tribe-community-events
  :where(.tribe-section, .tribe-section.tribe-section-egov) {
  border-color: var(--egov-border-soft);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: 0 5px 20px rgba(18, 54, 81, 0.05);
  overflow: hidden;
}

body.egov-calendar-negz-styling #tribe-community-events .tribe-section-header {
  border-bottom: 1px solid var(--egov-border-soft);
  background: var(--egov-surface-muted);
}

body.egov-calendar-negz-styling
  #tribe-community-events
  .tribe-section-header
  h3 {
  color: var(--egov-ink);
  font-family: var(--egov-sans);
  font-weight: 700;
  text-align: left;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  :where(
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea
  ) {
  border: 1px solid var(--egov-border);
  border-radius: var(--egov-radius-small);
  background: var(--egov-surface);
  color: var(--egov-ink);
  font-family: var(--egov-sans);
}

body.egov-calendar-negz-styling #tribe-community-events input[type="file"] {
  max-width: 100%;
  color: var(--egov-text-muted);
  font-family: var(--egov-sans);
}

body.egov-calendar-negz-styling
  #tribe-community-events
  input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--egov-border);
  border-radius: 999px;
  background: var(--egov-surface-muted);
  color: var(--egov-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--egov-motion-duration) ease,
    border-color var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  input[type="file"]::file-selector-button:hover {
  border-color: var(--egov-accent);
  background: var(--egov-surface-peach);
}

body.egov-calendar-negz-styling
  #tribe-community-events
  :where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--egov-accent-hover);
}

body.egov-calendar-negz-styling
  #tribe-community-events
  :where(
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea
  ):focus {
  border-color: var(--egov-blue);
  box-shadow: 0 0 0 3px rgba(48, 144, 176, 0.14);
  outline: 0;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  :where(button, .button, input[type="button"], input[type="submit"]) {
  border: 2px solid var(--egov-accent) !important;
  border-radius: 999px !important;
  background: var(--egov-accent) !important;
  box-shadow: none !important;
  color: var(--egov-ink) !important;
  font-family: var(--egov-sans);
  font-weight: 700;
  transition:
    background-color var(--egov-motion-duration) ease,
    border-color var(--egov-motion-duration) ease,
    color var(--egov-motion-duration) ease,
    transform var(--egov-motion-duration) ease;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  :where(button, .button, input[type="button"], input[type="submit"]):hover {
  border-color: var(--egov-accent-hover) !important;
  background: var(--egov-accent-hover) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.egov-community-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.5rem 1rem;
}

.tribe-section.tribe-section-egov .tribe-section-content {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.tribe-section.tribe-section-egov .tribe-section-content-row {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: 0.75rem 1.5rem;
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0;
  text-align: left;
}

.tribe-section.tribe-section-egov .tribe-section-content-label,
.tribe-section.tribe-section-egov .tribe-section-content-field {
  float: none;
  width: auto;
  max-width: none;
  margin: 0;
  text-align: left;
}

.tribe-section.tribe-section-egov .tribe-section-content-label {
  padding-top: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
}

.tribe-section.tribe-section-egov
  .tribe-section-content-field
  > input[type="text"],
.tribe-section.tribe-section-egov
  .tribe-section-content-field
  > input[type="email"],
.tribe-section.tribe-section-egov
  .tribe-section-content-field
  > input[type="url"],
.tribe-section.tribe-section-egov .tribe-section-content-field > select,
.tribe-section.tribe-section-egov .tribe-section-content-field > textarea {
  display: block;
  width: 100%;
  max-width: 42rem;
  margin: 0;
}

.tribe-section.tribe-section-egov .tribe-section-content-field > select {
  max-width: 32rem;
}

.tribe-section.tribe-section-egov .egov-community-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.65rem 1.25rem;
  padding-top: 0.55rem;
}

.tribe-section.tribe-section-egov
  .egov-community-checkboxes
  > input[type="hidden"] {
  display: none;
}

.tribe-section.tribe-section-egov .egov-community-checkboxes label,
.tribe-section.tribe-section-egov .egov-community-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
}

.tribe-section.tribe-section-egov
  .egov-community-checkboxes
  input[type="checkbox"],
.tribe-section.tribe-section-egov .egov-community-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  margin: 0.2em 0 0;
}

.tribe-section.tribe-section-egov .tribe-community-events-info {
  max-width: 42rem;
  margin: 0.6rem 0 0;
  color: var(--egov-text-muted);
}

.egov-community-existing-object {
  display: grid;
  grid-template-columns: minmax(11rem, 13rem) minmax(0, 1fr);
  gap: 0.45rem 1.5rem;
  align-items: center;
  margin: 0 0 1.25rem;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.egov-community-existing-object label {
  grid-column: 1;
  margin: 0;
  text-align: right;
}

.egov-community-existing-object select {
  grid-column: 2;
  width: 100%;
  max-width: 42rem;
  margin: 0;
}

.egov-community-existing-object .select2-container {
  grid-column: 2;
  width: 100% !important;
  max-width: 42rem;
  margin: 0;
}

.egov-community-existing-object
  .select2-container
  .select2-selection--single {
  min-height: 2.85rem;
  border: 1px solid var(--egov-border) !important;
  border-radius: var(--egov-radius-small) !important;
  background: var(--egov-surface) !important;
}

.egov-community-existing-object
  .select2-container
  .select2-selection--single
  .select2-selection__rendered {
  padding: 0.65rem 2.5rem 0.65rem 0.85rem;
  color: var(--egov-ink);
  line-height: 1.45;
}

.egov-community-existing-object .tribe-community-events-info {
  grid-column: 2;
  margin: 0.1rem 0 0;
  text-align: left;
}

.tribe-section.tribe-section-egov .egov-required {
  display: inline;
  margin-left: 0.2rem;
  color: #8f2f1f;
  font-size: 0.85em;
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
}

/*
 * The five links are an in-page overview, not a client-side wizard. Every
 * field remains in the same TEC form and native validation can still focus a
 * field in any section.
 */
body.egov-calendar-negz-styling
  #tribe-community-events
  .egov-community-progress {
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  padding: 0.75rem;
  border: 1px solid var(--egov-border-soft);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: 0 4px 18px rgba(18, 54, 81, 0.06);
}

body.egov-calendar-negz-styling
  #tribe-community-events
  .egov-community-progress
  ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  .egov-community-progress
  li {
  min-width: 0;
  margin: 0;
  padding: 0;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  .egov-community-progress
  a {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--egov-radius-small);
  color: var(--egov-ink);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  .egov-community-progress
  a:hover {
  border-color: var(--egov-accent);
  background: var(--egov-surface-peach);
  color: var(--egov-ink);
}

body.egov-calendar-negz-styling
  #tribe-community-events
  .egov-community-progress
  a[aria-current="step"] {
  border-color: var(--egov-accent);
  background: var(--egov-surface-peach);
  color: var(--egov-ink);
}

.egov-community-progress__number {
  display: inline-grid;
  flex: 0 0 1.75rem;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--egov-ink);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.egov-community-step-target {
  scroll-margin-top: 2rem;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  button.egov-community-disclosure {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.5rem;
  margin: 0.5rem 0;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--egov-border) !important;
  border-radius: var(--egov-radius-small) !important;
  background: var(--egov-surface-muted) !important;
  color: var(--egov-ink) !important;
  font-weight: 650;
  text-align: left;
  transform: none;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  button.egov-community-disclosure::after {
  margin-left: 0.65rem;
  content: "+";
  font-size: 1.2em;
  line-height: 1;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  button.egov-community-disclosure[aria-expanded="true"]::after {
  content: "−";
}

body.egov-calendar-negz-styling
  #tribe-community-events
  button.egov-community-disclosure:hover {
  border-color: var(--egov-accent) !important;
  background: var(--egov-surface-peach) !important;
  color: var(--egov-ink) !important;
  transform: none;
}

#tribe-community-events
  :where(.egov-community-timezone-panel, .recurrence, .recurrence-row)[hidden] {
  display: none !important;
}

#tribe-community-events .egov-community-timezone-panel {
  margin: 0.25rem 0 1rem;
}

#tribe-community-events .egov-community-timezone-panel .select2-container {
  width: 100% !important;
}

.tribe-section.tribe-section-egov.egov-community-privacy
  .tribe-section-content {
  border-left: 4px solid var(--egov-blue);
  background: var(--egov-surface-blue);
}

.egov-community-privacy__missing {
  padding: 0.75rem 0.9rem;
  border-left: 4px solid var(--egov-rust);
  background: var(--egov-surface-peach);
  color: var(--egov-ink) !important;
  font-weight: 650;
}

body.egov-calendar-negz-styling
  #tribe-community-events
  :where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--egov-rust) !important;
  box-shadow: 0 0 0 3px rgba(176, 80, 48, 0.14);
}

#tribe-community-events .egov-community-native-hidden,
#tribe-community-events .tribe-section-taxonomy,
#tribe-community-events .tribe-section-virtual,
#tribe-community-events .tribe-section-cost,
#tribe-community-events .tribe-section-event-status,
#tribe-community-events .tribe-section-status {
  display: none !important;
}

/* ============================================================
   12. Responsive Feinabstimmung
   ============================================================ */

@media (min-width: 768px) {
  body.egov-calendar-negz-styling
    .tribe-events
    .tribe-events-calendar-month__calendar-event-title-link {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.25;
  }
}

@media (max-width: 959px) {
  body.egov-calendar-negz-styling
    .tribe-events--filter-bar-vertical
    .tribe-filter-bar {
    padding: 0.8rem;
  }

  body.egov-calendar-negz-styling.single-tribe_events
    .tribe-events-single
    ul.tribe-related-events {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  :root {
    --egov-edge-space: 1rem;
    --egov-radius: 12px;
  }

  body.egov-calendar-negz-styling .tribe-events .tribe-events-c-events-bar {
    border-radius: var(--egov-radius-small);
  }

  body.egov-calendar-negz-styling
    .tribe-events
    :where(
      .tribe-events-calendar-list__event,
      .tribe-events-calendar-latest-past__event
    ) {
    padding: 1rem;
  }

  body.egov-calendar-negz-styling
    .tribe-events
    :where(
      .tribe-events-calendar-list__event-row,
      .tribe-events-calendar-latest-past__event-row
    ):hover
    :where(
      .tribe-events-calendar-list__event-wrapper,
      .tribe-events-calendar-latest-past__event-wrapper
    ) {
    transform: none;
  }

  body.egov-calendar-negz-styling.single-tribe_events
    .tribe-events-single-event-title {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  body.egov-calendar-negz-styling.single-tribe_events
    .tribe-events-event-meta.primary {
    gap: 1.25rem;
    padding: 1rem;
  }

  body.egov-calendar-negz-styling.single-tribe_events
    .tribe-events-event-meta.primary
    .tribe-events-meta-group {
    flex-basis: 100%;
  }

  body.egov-calendar-negz-styling.single-tribe_events
    .tribe-events-single
    ul.tribe-related-events {
    grid-template-columns: minmax(0, 1fr);
  }

  body.egov-calendar-negz-styling.single-tribe_events
    .tribe-events-single
    ul.tribe-related-events
    > li:hover {
    transform: none;
  }

  .egov-community-existing-object {
    grid-template-columns: 1fr;
    padding-right: 0;
    padding-left: 0;
  }

  .egov-community-existing-object label,
  .egov-community-existing-object select,
  .egov-community-existing-object .select2-container,
  .egov-community-existing-object .tribe-community-events-info {
    grid-column: 1;
    text-align: left;
  }

  .egov-event-taxonomy,
  .egov-event-relation,
  .egov-object-events__list li {
    grid-template-columns: 1fr;
  }

  .egov-submitter-card {
    grid-template-columns: 1fr;
  }

  .tribe-section.tribe-section-egov .tribe-section-content-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .tribe-section.tribe-section-egov .tribe-section-content-label {
    padding-top: 0;
  }

  .tribe-section.tribe-section-egov .egov-community-checkboxes {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  body.egov-calendar-negz-styling
    #tribe-community-events
    .egov-community-progress {
    overflow-x: auto;
  }

  body.egov-calendar-negz-styling
    #tribe-community-events
    .egov-community-progress
    ol {
    grid-template-columns: repeat(5, minmax(10.5rem, 1fr));
  }
}

@media (max-width: 480px) {
  body.egov-calendar-negz-styling .tribe-events .tribe-events-c-search__button,
  body.egov-calendar-negz-styling
    #tribe-community-events
    :where(button, .button, input[type="button"], input[type="submit"]) {
    width: 100%;
  }

  .egov-directory-card {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.egov-calendar-negz-styling *,
  body.egov-calendar-negz-styling *::before,
  body.egov-calendar-negz-styling *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  body.egov-calendar-negz-styling
    :where(
      .tribe-events-calendar-list__event-wrapper,
      .tribe-events-calendar-latest-past__event-wrapper,
      .tribe-events-calendar-list__event-featured-image,
      .tribe-events-calendar-latest-past__event-featured-image,
      .tribe-related-events > li,
      .egov-directory-card,
      .egov-button
    ) {
    transform: none !important;
  }
}


/* -------------------------------------------------------------------------
 * Startseite: The Events Calendar Shortcode & Block
 * -------------------------------------------------------------------------
 * Das Fremd-Plugin liefert eine einfache ul.ecs-event-list mit li.ecs-event.
 * Auf der Startseite übersetzen wir diese Ausgabe in die visuelle Sprache der
 * eGov-Kalender-Listenansicht, ohne Markup oder Pluginlogik zu verändern.
 */
body.home.egov-calendar-negz-styling .ecs-event-list {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(1rem, 2vw, 1.35rem);
  width: 100%;
  margin: 1.35rem 0 1rem !important;
  padding: 0 !important;
  list-style: none !important;
}

body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  margin: 0 !important;
  padding: 1.05rem 1.1rem 1.15rem !important;
  overflow: hidden;
  border: 1px solid var(--egov-border-soft);
  border-left: 5px solid var(--egov-accent);
  border-radius: var(--egov-radius);
  background: var(--egov-surface);
  box-shadow: var(--egov-shadow-card);
  list-style: none !important;
  transition:
    transform var(--egov-motion-duration) ease,
    box-shadow var(--egov-motion-duration) ease,
    border-color var(--egov-motion-duration) ease;
}

body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event::marker {
  content: "";
}

body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 144, 91, 0.38);
  box-shadow: 0 14px 30px rgba(18, 54, 81, 0.12);
}

/* Vorhandene Eventbilder bilden einen kompakten 16:9-Kopf. Bei Events ohne
 * Bild entsteht bewusst kein Platzhalter und damit auch kein leerer Raum. */
body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event > a:first-child {
  display: block;
  margin: -1.05rem -1.1rem 1rem;
  overflow: hidden;
  border-radius: calc(var(--egov-radius) - 1px) calc(var(--egov-radius) - 1px) 0 0;
}

body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event > a:first-child img {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  margin: 0 !important;
  object-fit: cover;
  transition: transform 220ms ease;
}

body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event:hover > a:first-child img {
  transform: scale(1.025);
}

body.home.egov-calendar-negz-styling .ecs-event-list .entry-title.summary {
  margin: 0 0 0.65rem !important;
  color: var(--egov-ink);
  font-family: inherit;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  font-weight: 700;
  line-height: 1.25;
}

body.home.egov-calendar-negz-styling .ecs-event-list .entry-title.summary a {
  color: var(--egov-ink) !important;
  text-decoration: none !important;
  text-underline-offset: 0.16em;
}

body.home.egov-calendar-negz-styling .ecs-event-list .entry-title.summary a:hover,
body.home.egov-calendar-negz-styling .ecs-event-list .entry-title.summary a:focus-visible {
  color: var(--egov-accent-hover) !important;
  text-decoration: underline !important;
}

body.home.egov-calendar-negz-styling .ecs-event-list .duration {
  display: block;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

body.home.egov-calendar-negz-styling .ecs-event-list .duration.time {
  margin-bottom: 0.35rem;
  color: var(--egov-accent-hover);
  font-weight: 700;
}

body.home.egov-calendar-negz-styling .ecs-event-list .duration.venue {
  color: var(--egov-ink);
  font-weight: 600;
}

body.home.egov-calendar-negz-styling .ecs-event-list .duration.venue > em {
  display: none;
}

body.home.egov-calendar-negz-styling .ecs-event-list .ecs-excerpt {
  display: -webkit-box;
  flex: 1 1 auto;
  margin: 0.8rem 0 0 !important;
  overflow: hidden;
  color: var(--egov-ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@media (max-width: 1024px) {
  body.home.egov-calendar-negz-styling .ecs-event-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body.home.egov-calendar-negz-styling .ecs-event-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event {
    padding: 1rem !important;
  }

  body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event > a:first-child {
    margin: -1rem -1rem 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event,
  body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event > a:first-child img {
    transition: none !important;
  }

  body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event:hover,
  body.home.egov-calendar-negz-styling .ecs-event-list > .ecs-event:hover > a:first-child img {
    transform: none !important;
  }
}
