/* ==========================================================================
   Eduard — front end.

   READS THE SEMANTIC VARIABLES, NEVER THE RAW TOKENS.

   The host theme (SPRiCH) defines --surface/--fg/--fg-strong/--fg-muted/--line/
   --ok/--kicker in base.css and re-points the SAME NAMES inside .section--paper
   to flip a whole section onto the light "paper" ground. Reading --c-blue-700
   here instead of --surface would produce a panel that stays dark blue on a
   paper section — a bug with no error, visible only to someone looking at that
   one page.

   Every var() therefore carries a fallback, because this plugin has to render
   on a site that never heard of SPRiCH. The fallbacks are the SPRiCH values,
   so the plugin looks the same with or without the theme.

   Brand rule kept: ZIS red (#D01C20) is NEVER a filled area in the product
   layer. It appears here only as a dot and as a 3px rule on the conflict and
   sold-out states.

   The focus ring is the theme's contract — 2px orange, offset 2 — and is not
   restyled. Only border-radius is inherited so a pill keeps its shape.
   ========================================================================== */

.eduard {
  --ed-surface:   var(--surface,   #2C3A6B);
  --ed-surface-2: var(--surface-2, #25325F);
  --ed-line:      var(--line,      #3C4A80);
  --ed-fg:        var(--fg,        #E8ECF4);
  --ed-fg-strong: var(--fg-strong, #FCFCFC);
  --ed-fg-muted:  var(--fg-muted,  #9AA6C8);
  --ed-ok:        var(--ok,        #3DDC97);
  --ed-accent:    var(--c-orange,  #FC8828);
  --ed-alert:     var(--c-red,     #D01C20);
  --ed-ink:       var(--c-ink,     #10141C);

  --ed-r-card:    var(--r-card,    20px);
  --ed-r-control: var(--r-control, 10px);
  --ed-r-pill:    var(--r-pill,    999px);

  --ed-s1: var(--s1, 8px);
  --ed-s2: var(--s2, 16px);
  --ed-s3: var(--s3, 24px);
  --ed-s4: var(--s4, 32px);
  --ed-s5: var(--s5, 40px);

  --ed-ui:      var(--f-ui, "Inter", system-ui, sans-serif);
  --ed-display: var(--f-display, "Source Sans 3", system-ui, sans-serif);

  color: var(--ed-fg);
  font-family: var(--ed-display);
  /* min-width:0 lets every descendant grid/flex child actually shrink. Without
     it a long word or a wide table pushes the whole page sideways, which is
     the single most common cause of horizontal scroll at 360px. */
  min-width: 0;
}

.eduard *,
.eduard *::before,
.eduard *::after { box-sizing: border-box; }

.eduard :where(ul, ol) { margin: 0; padding: 0; list-style: none; }
.eduard :where(p) { margin: 0; }

/* --------------------------------------------------------------------------
   1. Panels
   -------------------------------------------------------------------------- */
.eduard-panel {
  background: var(--ed-surface);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r-card);
  padding: var(--ed-s3);
  margin-block: var(--ed-s3);
  min-width: 0;
}

.eduard-panel__title {
  font-family: var(--ed-ui);
  font-weight: 600;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.36;
  color: var(--ed-fg-strong);
  margin: 0 0 var(--ed-s2);
}

/* --------------------------------------------------------------------------
   2. The information list
   Two columns on a comfortable viewport, one below 560px. The label column is
   sized with minmax(0, ...) so a long German compound never forces the grid
   wider than its container.
   -------------------------------------------------------------------------- */
.eduard-info__list { display: grid; gap: 2px; }

.eduard-info__row {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: var(--ed-s1) var(--ed-s3);
  align-items: baseline;
  padding: 12px var(--ed-s2);
  background: var(--ed-surface-2);
  border-radius: var(--ed-r-control);
}

.eduard-info__row dt {
  font-family: var(--ed-ui);
  font-weight: 600;
  font-size: 13px;
  color: var(--ed-fg-muted);
  margin: 0;
}

.eduard-info__row dd {
  margin: 0;
  min-width: 0;
  color: var(--ed-fg-strong);
  overflow-wrap: anywhere;
}

.eduard-info__row dd a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.eduard-muted { color: var(--ed-fg-muted); }
.eduard-ok    { color: var(--ed-ok); }
.eduard-full  { color: var(--ed-alert); }

.eduard-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: .02em;
}

/* --------------------------------------------------------------------------
   3. Badges — the red rule, kept
   -------------------------------------------------------------------------- */
.eduard-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ed-s1);
  margin-block: var(--ed-s2);
}

.eduard-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--ed-r-pill);
  background: var(--ed-line);
  color: var(--ed-fg);
  font-family: var(--ed-ui);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  letter-spacing: var(--tr-label, .12em);
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}

a.eduard-badge:hover { color: var(--ed-fg-strong); }

.eduard-badge--ok { background: var(--ed-ok); color: var(--ed-ink); }

/* "Running now" is the one live signal. The red is the DOT, not the field —
   a filled red pill is exactly what the brand rules forbid in this layer. */
.eduard-badge--live {
  background: transparent;
  border-color: var(--ed-alert);
  color: var(--ed-fg-strong);
}
.eduard-badge--live::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ed-alert);
}

.eduard-badge--cancelled {
  background: transparent;
  border-color: var(--ed-alert);
  color: var(--ed-fg-muted);
  text-decoration: line-through;
}

.eduard-badge--muted { background: transparent; border-color: var(--ed-line); color: var(--ed-fg-muted); }

/* --------------------------------------------------------------------------
   4. Organizers — a wrapping list, not a carousel
   The plugin this replaces used a JS slider; a slider can hide a person behind
   a control that did not initialise. These simply wrap.
   -------------------------------------------------------------------------- */
.eduard-organizers__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--ed-s2);
}

.eduard-organizer {
  display: flex;
  align-items: center;
  gap: var(--ed-s2);
  min-width: 0;
  padding: var(--ed-s2);
  background: var(--ed-surface-2);
  border-radius: var(--ed-r-control);
}

.eduard-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ed-line);
}

.eduard-avatar__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.eduard-avatar__fallback {
  font-family: var(--ed-ui);
  font-weight: 700;
  font-size: 18px;
  color: var(--ed-fg-strong);
}

.eduard-organizer__text { display: grid; gap: 2px; min-width: 0; }

.eduard-organizer__name {
  font-family: var(--ed-ui);
  font-weight: 600;
  color: var(--ed-fg-strong);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.eduard-organizer__name:hover { text-decoration: underline; text-underline-offset: 3px; }

.eduard-organizer__role { font-size: 13px; color: var(--ed-fg-muted); }

.eduard-organizer__mail {
  font-size: 13px;
  color: var(--ed-fg-muted);
  overflow-wrap: anywhere;
}

.eduard-bio { margin-top: var(--ed-s2); color: var(--ed-fg); }

/* --------------------------------------------------------------------------
   5. Join
   -------------------------------------------------------------------------- */
.eduard-join { margin-top: var(--ed-s3); }
.eduard-join__note { color: var(--ed-fg-muted); font-size: 14px; }

.eduard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ed-s1);
  min-height: 44px;
  padding: 0 var(--ed-s3);
  border: 1px solid transparent;
  border-radius: var(--ed-r-pill);
  background: transparent;
  color: var(--ed-fg-strong);
  font-family: var(--ed-ui);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.eduard-btn--primary { background: var(--ed-accent); color: var(--ed-ink); }
.eduard-btn--ghost   { border-color: var(--ed-fg-muted); }
.eduard-btn--ghost:hover { border-color: var(--ed-fg-strong); }

.eduard-btn:focus-visible { border-radius: inherit; }

.eduard-btn[disabled],
.eduard-btn[aria-disabled="true"] {
  background: var(--ed-surface-2);
  color: var(--ed-fg-muted);
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   6. Cards
   auto-fit + minmax(min(100%, 20rem), 1fr) is the load-bearing line: at 360px
   `min(100%, 20rem)` resolves to 100%, so the track can never be wider than
   the container. Writing minmax(20rem, 1fr) alone overflows every phone.
   -------------------------------------------------------------------------- */
.eduard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--ed-s2);
  margin-block: var(--ed-s3);
}

.eduard-card {
  display: flex;
  flex-direction: column;
  gap: var(--ed-s1);
  min-width: 0;
  padding: var(--ed-s3);
  background: var(--ed-surface);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r-card);
}

.eduard-card.is-past { opacity: .72; }
.eduard-card.is-cancelled { border-color: var(--ed-alert); }

.eduard-card__when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ed-s1);
  font-family: var(--ed-ui);
  font-size: 13px;
  color: var(--ed-fg-muted);
}

.eduard-card__date { font-weight: 700; color: var(--ed-fg-strong); }

.eduard-card__title {
  font-family: var(--ed-ui);
  font-weight: 600;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.3;
  margin: 0;
  color: var(--ed-fg-strong);
  overflow-wrap: anywhere;
}
.eduard-card__title a { color: inherit; text-decoration: none; }
.eduard-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.eduard-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ed-s1);
  font-size: 13px;
  color: var(--ed-fg-muted);
  min-width: 0;
}

.eduard-card__meta > li { min-width: 0; overflow-wrap: anywhere; }
.eduard-card__room a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.eduard-card__orgs { font-size: 14px; color: var(--ed-fg); overflow-wrap: anywhere; }

.eduard-card__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--ed-s1);
  margin-top: auto;
  padding-top: var(--ed-s2);
  border-top: 1px solid var(--ed-line);
  font-size: 14px;
}

.eduard-card__price { font-family: var(--ed-ui); font-weight: 700; color: var(--ed-fg-strong); }

/* --------------------------------------------------------------------------
   7. Filters and tabs
   -------------------------------------------------------------------------- */
.eduard-list__heading {
  font-family: var(--ed-ui);
  font-weight: 600;
  font-size: clamp(19px, 1.8vw, 24px);
  color: var(--ed-fg-strong);
  margin: 0 0 var(--ed-s2);
}

.eduard-filters { display: grid; gap: var(--ed-s2); }

.eduard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  background: var(--ed-surface);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r-pill);
  /* width:max-content would be nicer but overflows at 360px once the labels
     are German; capping it at 100% keeps the pill shape AND the viewport. */
  max-width: 100%;
  width: max-content;
}

.eduard-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--ed-s2);
  border-radius: var(--ed-r-pill);
  font-family: var(--ed-ui);
  font-weight: 600;
  font-size: 14px;
  color: var(--ed-fg-muted);
  text-decoration: none;
  white-space: nowrap;
}

.eduard-tab:hover { color: var(--ed-fg-strong); }
.eduard-tab.is-active { background: var(--ed-accent); color: var(--ed-ink); }
.eduard-tab:focus-visible { border-radius: var(--ed-r-pill); }

.eduard-filters__form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--ed-s2);
  min-width: 0;
}

.eduard-filters__reset { font-size: 14px; color: var(--ed-fg-muted); }

/* --------------------------------------------------------------------------
   8. Fields
   -------------------------------------------------------------------------- */
.eduard-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-block: var(--ed-s2); }
.eduard-field--inline { flex: 1 1 12rem; margin-block: 0; }
.eduard-field--short  { max-width: 10rem; }

.eduard-field--check { flex-direction: row; }
.eduard-field--check label { display: flex; gap: var(--ed-s1); align-items: flex-start; font-size: 14px; }
.eduard-field--check input { margin-top: 3px; flex: none; }

.eduard-field__label {
  font-family: var(--ed-ui);
  font-weight: 600;
  font-size: 13px;
  color: var(--ed-fg-muted);
}

.eduard-field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px var(--ed-s2);
  background: var(--ed-surface-2);
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r-control);
  color: var(--ed-fg-strong);
  font-family: var(--ed-display);
  font-size: 16px; /* 16px or iOS zooms the page on focus, which reads as a layout bug */
  line-height: 1.4;
}

textarea.eduard-field__input { min-height: 96px; resize: vertical; }
select.eduard-field__input { min-height: 48px; }
.eduard-field__input:hover { border-color: var(--ed-fg-muted); }
.eduard-field__input:focus-visible { border-color: var(--ed-accent); }

/* --------------------------------------------------------------------------
   9. Booking
   -------------------------------------------------------------------------- */
.eduard-booking__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ed-s3);
  margin-bottom: var(--ed-s2);
  padding-bottom: var(--ed-s2);
  border-bottom: 1px solid var(--ed-line);
}

.eduard-booking__label { display: block; font-family: var(--ed-ui); font-size: 12px; color: var(--ed-fg-muted); text-transform: uppercase; letter-spacing: var(--tr-label, .12em); }
.eduard-booking__value { font-family: var(--ed-ui); font-weight: 700; color: var(--ed-fg-strong); }

.eduard-booking__closed {
  padding: var(--ed-s2);
  border-left: 3px solid var(--ed-alert);
  background: var(--ed-surface-2);
  border-radius: var(--ed-r-control);
  color: var(--ed-fg);
}

.eduard-form__submit { margin-top: var(--ed-s3); }
.eduard-form__hint { margin-top: var(--ed-s2); font-size: 13px; color: var(--ed-fg-muted); }

/* The honeypot. Not display:none — some bots skip hidden fields and some
   password managers do odd things with them. Off-canvas and untabbable. */
.eduard-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.eduard-notice {
  padding: var(--ed-s2);
  border-radius: var(--ed-r-control);
  background: var(--ed-surface-2);
  border-left: 3px solid var(--ed-ok);
  color: var(--ed-fg-strong);
  margin-bottom: var(--ed-s3);
}

.eduard-notice--error { border-left-color: var(--ed-alert); }

/* --------------------------------------------------------------------------
   10. Archive page, pagination, empty states
   -------------------------------------------------------------------------- */
.eduard-archive__title {
  font-family: var(--ed-display);
  font-weight: 700;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.125;
  color: var(--fg-strong, #FCFCFC);
  margin: 0 0 var(--s3, 24px);
}

.eduard-archive__intro { color: var(--fg, #E8ECF4); margin-bottom: var(--s4, 32px); max-width: 60ch; }

.eduard-empty { color: var(--ed-fg-muted); padding: var(--ed-s3) 0; }

.eduard-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ed-s1);
  margin-top: var(--ed-s3);
}

.eduard-pagination a,
.eduard-pagination span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-r-pill);
  font-family: var(--ed-ui);
  font-size: 14px;
  color: var(--ed-fg);
  text-decoration: none;
}

.eduard-pagination .current { background: var(--ed-accent); border-color: var(--ed-accent); color: var(--ed-ink); }

.eduard-schedule__past { margin-top: var(--ed-s3); }
.eduard-schedule__past summary { cursor: pointer; font-family: var(--ed-ui); font-weight: 600; color: var(--ed-fg-muted); }

/* --------------------------------------------------------------------------
   11. Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .eduard-info__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .eduard-panel { padding: var(--ed-s2); }
  .eduard-booking__facts { gap: var(--ed-s2); }
  .eduard-field--short { max-width: none; }
  .eduard-filters__form > * { flex: 1 1 100%; }
  .eduard-organizer { flex-direction: row; }
}

@media (prefers-reduced-motion: reduce) {
  .eduard * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* --------------------------------------------------------------------------
   12. The plugin's own single frame
   Only rendered when the theme has no template for these post types. The
   containers (.section/.wrap) are the THEME's, so the width and gutters come
   from the site, not from here.
   -------------------------------------------------------------------------- */
.eduard-single__title {
  font-family: var(--f-display, "Source Sans 3", system-ui, sans-serif);
  font-weight: 700;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.125;
  color: var(--fg-strong, #FCFCFC);
  margin: 0 0 var(--s3, 24px);
  text-wrap: balance;
}

.eduard-single__figure { margin: 0 0 var(--s4, 32px); }

.eduard-single__image {
  width: 100%;
  height: auto;
  border-radius: var(--r-image, 28px);
}

.eduard-single__body { color: var(--fg, #E8ECF4); min-width: 0; }
.eduard-single__body > p { margin-bottom: var(--s2, 16px); max-width: 70ch; }
