/* ============================================================
   BLOCK-CSS: Job-Liste (as-schoendienst/job-listing)
   Nur Frontend + Block-Editor (Loader enqueued block.css).
   Design-Werte aus den Tokens (tokens.css) / Brand-Guidelines:
     $primary   #056ab4  (Blau, --as-color-accent-brand)
     $secondary #06284b  (Navy, --as-color-navy-deep)
     $muted     #64748b  (--as-color-text-muted)
   Liste als responsive Grid-Karte; abgelaufene Stellen gedimmt
   (gestrichelte Border, ohne Hover/Link).
   ============================================================ */
@import "../../../assets/tokens.css" layer(sdc-tokens);

/* ------------------------------------------------------------
   Basis: Sektion (heller Grund, wie KPI/services)
   ------------------------------------------------------------ */
.as-job-listing {
  padding: var(--as-space-section, 5rem) 0;
  background: var(--as-color-light, #f8fafc);
}

/* Kopfbereich (section-head-Molekül) auf hellem Grund:
   Tokens default (Text/Navy), keine Overrides nötig —
   aber Abstand zur Liste. */
.as-job-listing .as-section-head {
  margin-bottom: 2.25rem;
}

/* ------------------------------------------------------------
   Grid-Liste der Stellen
   ------------------------------------------------------------ */
.as-job-listing__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.as-job-listing__item {
  margin: 0;
}

/* Offene Stellen: verlinkte Karte */
.as-job-listing__item-link {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1.5rem;
  background: var(--as-color-white, #fff);
  border: 1px solid var(--as-color-border, #e2e8f0);
  border-radius: var(--as-radius, 10px);
  box-shadow: var(--as-shadow, 0 4px 20px rgba(10, 25, 47, 0.08));
  color: var(--as-color-text, #1e293b);
  text-decoration: none;
  transition:
    border-color 0.2s var(--as-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 0.2s var(--as-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.2s var(--as-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.as-job-listing__item-link:hover,
.as-job-listing__item-link:focus-visible {
  border-color: var(--as-color-accent-brand, #056ab4);
  box-shadow: 0 8px 28px rgba(10, 25, 47, 0.14);
  transform: translateY(-2px);
}

.as-job-listing__item-link:focus-visible {
  outline: 2px solid var(--as-color-accent-brand, #056ab4);
  outline-offset: 2px;
}

.as-job-listing__item-title {
  margin: 0;
  font-family: var(--as-font-sans, "Sora", system-ui, sans-serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--as-color-navy-deep, #06284b);
}

/* Badges (Pills) */
.as-job-listing__badge {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.as-job-listing__badge--featured {
  background: var(--as-color-accent-brand, #056ab4);
  color: var(--as-color-white, #fff);
}

/* Meta-Zeile: Standort, Anstellungsart, Bewerbungsfrist */
.as-job-listing__item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--as-color-text-muted, #64748b);
}

.as-job-listing__item-meta-entry {
  display: inline-block;
}

.as-job-listing__item-arrow {
  margin-top: auto;
  align-self: flex-end;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--as-color-accent-brand, #056ab4);
}

/* ------------------------------------------------------------
   Abgelaufene Stellen: KEIN Link, "Nicht aktiv"-Badge,
   gedimmt + gestrichelte Border (reduzierter Stil)
   ------------------------------------------------------------ */
.as-job-listing__item-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1.5rem;
  background: var(--as-color-neutral, #eceef1);
  border: 1px dashed var(--as-color-border, #e2e8f0);
  border-radius: var(--as-radius, 10px);
  opacity: 0.75;
  cursor: default;
}

.as-job-listing__item--expired .as-job-listing__item-title {
  color: var(--as-color-text-muted, #64748b);
  font-weight: 500;
}

.as-job-listing__badge--expired {
  background: var(--as-color-text-muted, #64748b);
  color: var(--as-color-white, #fff);
}

.as-job-listing__item--expired .as-job-listing__item-meta {
  color: var(--as-color-text-muted, #64748b);
}

/* ------------------------------------------------------------
   Leerzustand
   ------------------------------------------------------------ */
.as-job-listing__empty {
  margin: 0;
  padding: 1.5rem;
  background: var(--as-color-white, #fff);
  border: 1px dashed var(--as-color-border, #e2e8f0);
  border-radius: var(--as-radius, 10px);
  color: var(--as-color-text-muted, #64748b);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .as-job-listing__list {
    grid-template-columns: 1fr;
  }
}
