/* light-theme: manual
   bewerbung.html redesign on top of bewerbung.css: check-chip grid for the
   general requirements, a 3-step process strip, projects as big accent cards
   with a live open-roles counter, roles as a tile grid (an opened role spans
   the full row) and a closing CTA card. Uses the --nx-* tokens from
   home-lower.css. Selectors start with :root to outrank the generated
   light-theme rules; light variant at the end. */

:root .bewerbung-page { max-width: 1120px; }

/* --- general requirements: chip grid --- */
:root .bewerbung-universal {
  border: 1px solid transparent;
  border-radius: 26px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  margin-bottom: 1.5rem;
  background:
    linear-gradient(var(--nx-surface), var(--nx-surface)) padding-box,
    linear-gradient(120deg, rgba(16, 185, 129, 0.6), rgba(59, 130, 246, 0.3), rgba(168, 85, 247, 0.6)) border-box;
}

:root .bewerbung-universal::before { display: none; }

:root .universal-list {
  list-style: none;
  padding: 0;
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
  line-height: 1.45;
}

:root .universal-list li {
  position: relative;
  padding: 0.85rem 0.9rem 0.85rem 2.6rem;
  border-radius: 14px;
  border: 1px solid var(--nx-line);
  background: var(--nx-surface-2);
  color: var(--nx-muted);
  font-size: 0.9rem;
}

:root .universal-list li b { color: var(--nx-text); }

:root .universal-list li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  display: grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  font-size: 0.6rem;
  color: #04120c;
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* --- process steps --- */
.bw-steps {
  list-style: none;
  margin: 0 0 3rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: bw;
}

.bw-steps li {
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: 1.4rem 1.4rem 1.3rem;
  border-radius: 22px;
  border: 1px solid var(--nx-line);
  background: var(--nx-surface);
  overflow: hidden;
}

.bw-steps li > i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 0.6rem;
  border-radius: 14px;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
}

.bw-steps li:nth-child(2) > i { background: #5865f2; }
.bw-steps li:nth-child(3) > i { background: linear-gradient(135deg, #10b981, #38bdf8); }

.bw-steps b { font-size: 1.1rem; color: var(--nx-text); }
.bw-steps li > span:not(.bw-step-num) { color: var(--nx-muted); font-size: 0.9rem; line-height: 1.55; }

.bw-step-num {
  position: absolute;
  right: 1rem;
  bottom: -1.6rem;
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--nx-dim);
  pointer-events: none;
}

/* connector arrows between the steps */
.bw-steps li:not(:last-child)::after {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: -0.85rem;
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
  font-size: 0.75rem;
  color: var(--nx-muted);
}

/* --- project cards --- */
:root .bewerbung-topic {
  --accent: #a855f7;
  margin-bottom: 1.2rem;
  border-radius: 26px;
  border: 1px solid var(--nx-line);
  background:
    radial-gradient(500px circle at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--nx-surface);
  transition: border-color 0.3s ease;
}

:root .bewerbung-topic:has(.topic-icon.craft) { --accent: #10b981; }
:root .bewerbung-topic:has(.topic-icon.space) { --accent: #818cf8; }
:root .bewerbung-topic:has(.topic-icon.pal) { --accent: #f08a3c; }

:root .bewerbung-topic:hover,
:root .bewerbung-topic[open] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

:root .bewerbung-topic > .topic-header,
:root .collapsible-topic:not([open]) > .topic-header {
  padding: 1.3rem 1.5rem;
  margin: 0;
  border-bottom: 0;
  gap: 1rem;
}

:root .bewerbung-topic .topic-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 16px;
  font-size: 1.3rem;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent);
}

:root .bewerbung-topic .topic-title { font-size: 1.4rem; letter-spacing: -0.02em; color: var(--nx-text); }
:root .bewerbung-topic .topic-subtitle { color: var(--nx-muted); }

.bw-open-count {
  flex-shrink: 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.bw-open-count.is-zero { color: var(--nx-muted); background: var(--nx-surface-2); border-color: var(--nx-line); }

:root .bewerbung-topic .topic-chevron {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--nx-line);
  background: var(--nx-surface-2);
  margin-left: 0;
}

/* --- roles: tile grid, an opened role takes the whole row --- */
/* bewerbung.css clips .topic-content (overflow: hidden), which cut off the
   hover lift and the active tile's glow ring at the top edge */
:root .bewerbung-topic .topic-content { overflow: visible; }

:root .bewerbung-topic .bewerbung-accordion {
  padding-top: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.8rem;
  padding: 0 1.5rem 1.5rem;
}

:root .bewerbung-item {
  border-radius: 18px;
  border: 1px solid var(--nx-line);
  background: var(--nx-surface-2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

:root .bewerbung-item:not([open]):hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  transform: translateY(-2px);
}

/* no-JS fallback: the native <details> opens across the row */
:root .bewerbung-accordion:not(.has-drawer) .bewerbung-item[open] {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

:root .bewerbung-item summary { padding: 1rem 1.1rem; min-height: 0; }

:root .bewerbung-item summary .role-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 1rem; }

:root .bewerbung-item summary .role-name { font-size: 1rem; color: var(--nx-text); }

:root .bewerbung-item .role-content { border-top-color: var(--nx-line); }

:root .bewerbung-item .role-content ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.2rem 1.5rem;
  padding-left: 1.1rem;
}

:root .bewerbung-item .role-content li { color: var(--nx-muted); }
:root .bewerbung-item .role-content li b { color: var(--nx-text); }
:root .bewerbung-item .role-content li::marker { color: var(--accent); }

:root .bewerbung-item.role-closed { opacity: 0.5; }

/* --- closing CTA --- */
:root .bewerbung-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-top: 3rem;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  border-radius: 32px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    radial-gradient(600px circle at 15% 0%, rgba(14, 165, 233, 0.3), transparent 60%),
    radial-gradient(600px circle at 85% 100%, rgba(124, 58, 237, 0.3), transparent 60%),
    #070b18;
  backdrop-filter: none;
}

:root .bewerbung-cta h3 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.035em;
  color: #f1f5f9;
}

:root .bewerbung-cta p { color: #cbd5e1; font-size: 1.05rem; }

:root .cta-btn {
  padding: 0.9rem 1.4rem;
  border-radius: 14px;
  font-weight: 700;
  border: 0;
  color: #fff;
}

:root .cta-btn.netting { background: linear-gradient(135deg, #a855f7, #6366f1); }
:root .cta-btn.craft { background: linear-gradient(135deg, #0ea5e9, #10b981); }
:root .cta-btn.space { background: linear-gradient(135deg, #7c3aed, #3b82f6); }
:root .cta-btn.pal { background: linear-gradient(135deg, #f08a3c, #0e7490); }
:root .cta-btn:hover { filter: brightness(1.12); transform: translateY(-2px); }

@media (max-width: 760px) {
  .bw-steps { grid-template-columns: minmax(0, 1fr); }
  .bw-steps li:not(:last-child)::after { content: none; }
  :root .bewerbung-topic > .topic-header,
  :root .collapsible-topic:not([open]) > .topic-header { flex-wrap: wrap; }
  .bw-open-count { order: 3; }
  :root .bewerbung-topic .bewerbung-accordion { padding: 0 1rem 1rem; }
}

/* --- light theme --- */
html[data-theme="light"] .bewerbung-cta {
  background:
    radial-gradient(600px circle at 15% 0%, rgba(14, 165, 233, 0.15), transparent 60%),
    radial-gradient(600px circle at 85% 100%, rgba(124, 58, 237, 0.15), transparent 60%),
    #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .bewerbung-cta h3 { color: #0f172a; }
html[data-theme="light"] .bewerbung-cta p { color: #334155; }
html[data-theme="light"] .bewerbung-item[open] { box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08); }
html[data-theme="light"] .bw-open-count:not(.is-zero) { color: #15803d; }

/* role colours from bewerbung.css were always overridden by the generic
   ".bewerbung-item summary .role-icon" rule - restore them */
:root .bewerbung-item summary .role-icon { border: 0; color: #fff; }
:root .bewerbung-item summary .role-icon.manager   { background: linear-gradient(135deg, #9333ea, #7e22ce); }
:root .bewerbung-item summary .role-icon.admin     { background: linear-gradient(135deg, #ef4444, #dc2626); }
:root .bewerbung-item summary .role-icon.developer { background: linear-gradient(135deg, #3b82f6, #2563eb); }
:root .bewerbung-item summary .role-icon.builder   { background: linear-gradient(135deg, #f59e0b, #d97706); }
:root .bewerbung-item summary .role-icon.moderator { background: linear-gradient(135deg, #10b981, #059669); }
:root .bewerbung-item summary .role-icon.helper    { background: linear-gradient(135deg, #06b6d4, #0891b2); }
:root .bewerbung-item summary .role-icon.media     { background: linear-gradient(135deg, #ec4899, #db2777); }
:root .bewerbung-item summary .role-icon.supporter { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
:root .bewerbung-item summary .role-icon.staff     { background: linear-gradient(135deg, #fb923c, #ea580c); }

/* --- drawer (assets/js/bewerbung-drawer.js): tile stays, requirements slide in below its row --- */
:root .bewerbung-item.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--nx-surface-2));
  box-shadow: 0 0 0 1px var(--accent), 0 12px 30px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: none;
}

:root .bewerbung-item.is-active summary .chevron { transform: rotate(180deg); }

.bw-drawer {
  grid-column: 1 / -1;
  position: relative;
  height: 0;
  overflow: hidden;
  opacity: 0;
}

.bw-drawer.is-open { opacity: 1; }

.bw-drawer-inner {
  position: relative;
  margin-top: 10px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background:
    radial-gradient(400px circle at var(--bw-arrow, 50%) 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--nx-surface-2);
  transition: opacity 0.15s ease, translate 0.25s ease;
}

.bw-drawer-inner.is-swapping { opacity: 0; translate: 0 6px; }

/* little arrow pointing up at the opened tile */
.bw-drawer::before {
  content: "";
  position: absolute;
  top: 4px;
  left: var(--bw-arrow, 50%);
  width: 14px;
  height: 14px;
  translate: -50% 0;
  rotate: 45deg;
  z-index: 1;
  border-left: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--nx-surface-2));
  transition: left 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.bw-drawer .role-content {
  padding: 1.3rem 1.5rem 1.4rem;
  border-top: 0;
}

.bw-drawer .role-content ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.2rem 1.5rem;
  margin: 0;
  padding-left: 1.1rem;
}

.bw-drawer .role-content li { color: var(--nx-muted); line-height: 1.8; }
.bw-drawer .role-content li b { color: var(--nx-text); }
.bw-drawer .role-content li::marker { color: var(--accent); }
