/* WS Events – Ticker, Karten-Layout, Countdown, Einreichen.
   Farben, Radius, Schrift: CSS-Variablen aus den Plugin-Einstellungen (inline ausgegeben). */

/* ---------- Countdown ---------- */
.wsef-k-cd {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 0.25rem 0.65rem;
  margin-bottom: 0.6rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--wsef-k-font-head, inherit);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--wsef-k-text, #111827);
  background: var(--wsef-cd-soft, #f1f2f4);
}
.wsef-k-cd.is-hot {
  color: var(--wsef-cd-text, #fff);
  background: var(--wsef-cd-bg, #374151);
}

/* ---------- Karten-Layout (Spalten nach verfügbarer Breite) ---------- */
.wsef-k-wrap { container: wsefk / inline-size; }
.wsef-k-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  font-family: var(--wsef-k-font, inherit);
}
@container wsefk (min-width: 520px) {
  .wsef-k-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container wsefk (min-width: 960px) {
  .wsef-k-grid { grid-template-columns: repeat(var(--wsef-k-cols, 4), minmax(0, 1fr)); }
}
.wsef-k-card {
  background: var(--wsef-k-bg, #fff);
  color: var(--wsef-k-text, #1a1a1a);
  border: 1px solid var(--wsef-k-border, #e5e5e5);
  border-radius: var(--wsef-k-radius, 12px);
  overflow: hidden;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .wsef-k-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
}
.wsef-k-link {
  display: flex;
  gap: 14px;
  box-sizing: border-box;
  height: 100%;
  padding: 14px;
  color: inherit !important;
  text-decoration: none !important;
}
.wsef-k-link:focus-visible {
  outline: 2px solid var(--wsef-k-accent, #374151);
  outline-offset: -2px;
}
.wsef-k-date {
  font-family: var(--wsef-k-font-head, inherit);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  min-height: 68px;
  padding: 6px 4px;
  border-radius: calc(var(--wsef-k-radius, 12px) * 0.7);
  background: var(--wsef-k-date-bg, #111827);
  color: var(--wsef-k-date, #fff);
  line-height: 1;
  text-align: center;
}
.wsef-k-mon { color: var(--wsef-k-date-month, #d1d5db); }
.wsef-k-wd,
.wsef-k-mon {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wsef-k-day {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 3px 0;
  font-variant-numeric: tabular-nums;
}
.wsef-k-body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.wsef-k-cd {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
}
.wsef-k-cat {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wsef-k-accent, #374151);
  margin: 2px 0 4px;
  padding-right: 96px;
}
.wsef-k-title {
  margin: 0 0 6px !important;
  font-family: var(--wsef-k-font-head, inherit) !important;
  font-size: 1.02rem !important;
  line-height: 1.3 !important;
  font-weight: 700;
  color: inherit !important;
  overflow-wrap: anywhere;
}
.wsef-k-meta {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--wsef-k-muted, #666);
}
.wsef-k-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--wsef-k-muted, #666);
}

/* ---------- Live-Ticker ---------- */
.wsef-ticker {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: var(--wsef-t-height, 44px);
  overflow: hidden;
  background: var(--wsef-t-bg, #111);
  color: var(--wsef-t-text, #fff);
  font-family: var(--wsef-t-font, inherit);
  font-size: var(--wsef-t-size, 15px);
  line-height: 1.2;
}
.wsef-ticker__label {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--wsef-t-label-bg, #374151);
  color: var(--wsef-t-label, #fff);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wsef-ticker__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: wsef-ticker-pulse 1.6s ease-in-out infinite;
}
@keyframes wsef-ticker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.wsef-ticker__viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.wsef-ticker__track {
  display: flex;
  width: max-content;
  animation: wsef-ticker-run 40s linear infinite;
  will-change: transform;
}
.wsef-ticker:hover .wsef-ticker__track,
.wsef-ticker:focus-within .wsef-ticker__track,
.wsef-ticker.is-paused .wsef-ticker__track {
  animation-play-state: paused;
}
@keyframes wsef-ticker-run {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.wsef-ticker__group {
  display: flex;
  align-items: center;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.wsef-ticker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 0 0 0 18px !important;
  white-space: nowrap;
  list-style: none !important;
}
.wsef-ticker__item::before { content: none !important; }
.wsef-ticker__tag {
  padding: 3px 7px;
  border-radius: var(--wsef-t-radius, 4px);
  background: var(--wsef-t-tag-bg, #333);
  color: var(--wsef-t-tag, #fff);
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wsef-ticker__link,
.wsef-ticker__text {
  color: inherit !important;
  text-decoration: none !important;
}
.wsef-ticker__link:hover,
.wsef-ticker__link:focus-visible {
  text-decoration: underline !important;
}
.wsef-ticker__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.wsef-ticker__sep {
  padding-left: 10px;
  opacity: 0.5;
}
.wsef-ticker__nav {
  display: none;
}
.wsef-ticker__btn {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0 12px;
  height: 100%;
  min-width: 40px;
  background: transparent;
  color: inherit;
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
}
.wsef-ticker__btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

/* Bewegung reduzieren: statisch, ein Eintrag, Pfeile */
@media (prefers-reduced-motion: reduce) {
  .wsef-ticker__track { animation: none; width: 100%; }
  .wsef-ticker__group[aria-hidden="true"] { display: none; }
  .wsef-ticker__group { width: 100%; }
  .wsef-ticker__item { display: none; padding-right: 8px !important; overflow: hidden; text-overflow: ellipsis; }
  .wsef-ticker__item.is-current { display: flex; }
  .wsef-ticker__sep { display: none; }
  .wsef-ticker__nav { display: flex; flex: 0 0 auto; }
  .wsef-ticker__label::before { animation: none; }
}
@media (max-width: 767px) {
  .wsef-ticker--no-mobile { display: none; }
}

/* ---------- Einreichen ---------- */
.wsef-sub {
  font-family: var(--wsef-f-font, inherit);
  max-width: 760px;
}
.wsef-sub-form {
  display: grid;
  gap: 22px;
}
.wsef-sub-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.wsef-sub-form legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 1.05em;
}
.wsef-sub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wsef-sub-grid > label { grid-column: span 2; }
.wsef-sub-grid > .wsef-col-full { grid-column: 1 / -1; }
.wsef-sub-grid > .wsef-col-wide { grid-column: span 3; }
.wsef-sub-grid > .wsef-col-narrow { grid-column: span 1; }
@media (max-width: 600px) {
  .wsef-sub-grid { grid-template-columns: minmax(0, 1fr); }
  .wsef-sub-grid > label,
  .wsef-sub-grid > .wsef-col-wide,
  .wsef-sub-grid > .wsef-col-narrow { grid-column: 1 / -1; }
}
.wsef-sub-grid label > span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9em;
  font-weight: 600;
}
.wsef-sub-form input[type="text"],
.wsef-sub-form input[type="email"],
.wsef-sub-form input[type="url"],
.wsef-sub-form input[type="date"],
.wsef-sub-form input[type="time"],
.wsef-sub-form input[type="file"],
.wsef-sub-form select,
.wsef-sub-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c9c9c9;
  border-radius: var(--wsef-f-radius, 10px);
  background: #fff;
  color: inherit;
  font: inherit;
}
.wsef-sub-form textarea { min-height: 0; }
.wsef-sub-form input:focus-visible,
.wsef-sub-form select:focus-visible,
.wsef-sub-form textarea:focus-visible {
  outline: 2px solid var(--wsef-f-accent, #374151);
  outline-offset: 1px;
  border-color: var(--wsef-f-accent, #374151);
}
.wsef-req { color: var(--wsef-f-accent, #374151); }
.wsef-sub-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.wsef-sub-choices--inline {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin: 12px 0;
}
.wsef-sub-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c9c9c9;
  border-radius: var(--wsef-f-radius, 10px);
  cursor: pointer;
  transition: border-color 140ms ease-out, background-color 140ms ease-out;
}
.wsef-sub-choice input { accent-color: var(--wsef-f-accent, #374151); margin: 0; }
.wsef-sub-choice:has(input:checked) {
  border-color: var(--wsef-f-accent, #374151);
  box-shadow: inset 0 0 0 1px var(--wsef-f-accent, #374151);
}
.wsef-sub-choice-label { flex: 1 1 auto; font-weight: 600; }
.wsef-sub-choice-price { font-size: 0.85em; opacity: 0.75; white-space: nowrap; }
.wsef-sub-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  cursor: pointer;
}
.wsef-sub-check input { margin-top: 0.25em; accent-color: var(--wsef-f-accent, #374151); flex: 0 0 auto; }
.wsef-sub-help { margin: 8px 0 0; font-size: 0.85em; opacity: 0.75; }
.wsef-sub-costs {
  padding: 16px !important;
  border: 1px solid var(--wsef-f-accent, #374151) !important;
  border-radius: var(--wsef-f-radius, 10px);
}
.wsef-sub-costs[hidden] { display: none !important; }
.wsef-sub-costs legend { padding: 0 6px !important; }
.wsef-sub-costs-hint { margin: 0 0 12px; font-weight: 600; }
.wsef-sub-submit {
  justify-self: start;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--wsef-f-radius, 10px);
  background: var(--wsef-f-accent, #374151);
  color: var(--wsef-f-accent-text, #fff);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
.wsef-sub-submit:active { transform: scale(0.98); }
.wsef-sub-submit:focus-visible { outline: 2px solid var(--wsef-f-accent, #374151); outline-offset: 3px; }
.wsef-sub-submit[disabled] { opacity: 0.6; cursor: progress; }
.wsef-sub-notice {
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: var(--wsef-f-radius, 10px);
  border-left: 4px solid;
}
.wsef-sub-notice p:last-child { margin-bottom: 0; }
.wsef-sub-notice.is-success { border-color: #1e8e3e; background: #e9f6ec; color: #11371a; }
.wsef-sub-notice.is-error { border-color: #c5221f; background: #fdecea; color: #5c0f0d; }
.wsef-sub-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
[data-wsef-show-for][hidden] { display: none !important; }
