/* ==========================================================================
   Jobriver v2 – Karriere-Magazin (Übersicht + Beitrag)
   Basis (Tokens, Nav, Footer, Buttons, Chips) aus v2-core.css.
   Styleguide: docu/design/v2-styleguide.md
   ========================================================================== */

:root {
    --k2-hero-glow: radial-gradient(38% 60% at 14% 26%, rgba(178, 157, 255, .5), transparent 70%),
                    radial-gradient(32% 55% at 86% 18%, rgba(255, 168, 220, .35), transparent 70%);
    --k2-toc-bg: #f3efff;
}
:root[data-theme="dark"] {
    --k2-hero-glow: radial-gradient(38% 60% at 14% 26%, rgba(114, 79, 255, .35), transparent 70%),
                    radial-gradient(32% 55% at 86% 18%, rgba(176, 70, 140, .25), transparent 70%);
    --k2-toc-bg: #1c1530;
}

.k2 { padding-top: 72px; }
.k2-lead { max-width: 640px; margin: 18px auto 0; font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); text-align: center; }

/* ---------- Übersicht: Kopf ---------- */
.k2-hero { position: relative; padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 4vw, 48px); isolation: isolate; overflow-x: clip; }
.k2-hero__glow { position: absolute; inset: -30% -10% 0; z-index: -1; background: var(--k2-hero-glow); filter: blur(24px); -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 95%); mask-image: linear-gradient(180deg, #000 40%, transparent 95%); }
.k2-hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.k2-hero__title { font-size: var(--fs-h1); line-height: 1.02; font-weight: 600; letter-spacing: -.045em; }
.k2-search { position: relative; display: flex; align-items: center; width: 100%; max-width: 620px; margin-top: 32px; padding: 6px 8px 6px 52px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); transition: box-shadow .25s, border-color .25s; }
.k2-search:focus-within { border-color: var(--brand-200); box-shadow: 0 0 0 6px rgba(114, 79, 255, .1), var(--shadow); }
.k2-search svg { position: absolute; left: 20px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.k2-search input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; }
.k2-search input::placeholder { color: #8d86a0; }
.k2-search input::-webkit-search-cancel-button { cursor: pointer; }
.k2-search kbd { display: grid; place-items: center; min-width: 26px; height: 26px; margin-right: 6px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--tint); font: 600 .75rem var(--font); color: var(--muted); }

/* ---------- Karten ---------- */
.k2-card { position: relative; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.k2-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-3px); }
.k2-card::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(178, 157, 255, .16), transparent 60%); }
.k2-card:hover::before { opacity: 1; }
.k2-card[hidden] { display: none; }
.k2-card__link { display: flex; flex-direction: column; height: 100%; }
.k2-card__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--brand-100), #f6e6fa); }
:root[data-theme="dark"] .k2-card__img { background: linear-gradient(135deg, #22193a, #2b1a33); }
.k2-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.k2-card:hover .k2-card__img img { transform: scale(1.04); }
.k2-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 20px 22px 22px; }
.k2-tag { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.k2-card__title { font-size: 1.1875rem; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; transition: color .2s; }
.k2-card:hover .k2-card__title { color: var(--brand-700); }
.k2-card__ex { color: var(--muted); font-size: .9375rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.k2-card__meta { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.k2-card__meta i { font-style: normal; opacity: .6; }
.k2-card__meta svg, .k2-meta-top svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.k2-card--big .k2-card__title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.15; letter-spacing: -.03em; }
.k2-card--big .k2-card__img { aspect-ratio: 16 / 9; }
.k2-card--big .k2-card__body { padding: 26px 30px 30px; }
.k2-card--big .k2-card__ex { -webkit-line-clamp: 3; font-size: 1rem; }

/* ---------- Bühne ---------- */
.k2-stage { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-bottom: clamp(32px, 5vw, 56px); }
.k2-stage__side { display: grid; grid-template-rows: 1fr 1fr; gap: 20px; }
.k2-stage__side .k2-card__link { flex-direction: row; }
.k2-stage__side .k2-card__img { flex: 0 0 42%; aspect-ratio: auto; }
.k2-stage__side .k2-card__ex { display: none; }

/* ---------- Story des Monats ---------- */
.k2-story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: stretch; margin-bottom: clamp(48px, 6vw, 72px); border-radius: var(--r-xl); overflow: hidden; background: radial-gradient(90% 90% at 80% 0%, var(--plum-2), var(--plum) 70%); color: #e9e3fb; transition: transform .3s var(--ease), box-shadow .3s; }
.k2-story:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.k2-story__img { min-height: 260px; background: #2b1b4a; }
.k2-story__img img { width: 100%; height: 100%; object-fit: cover; }
.k2-story__body { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: clamp(28px, 4vw, 52px); }
.k2-story__k { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #c9b8ff; }
.k2-story strong { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); line-height: 1.15; font-weight: 600; letter-spacing: -.03em; color: #fff; }
.k2-story__ex { color: #cfc4f3; }
.k2-story__go { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 600; color: #fff; }
.k2-story__go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.k2-story:hover .k2-story__go svg { transform: translateX(4px); }

/* ---------- Filter + Raster ---------- */
.k2-browse { padding-bottom: clamp(64px, 8vw, 104px); }
.k2-filterbar { position: sticky; top: 80px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 0 -12px 24px; padding: 10px 12px; border-radius: 22px; transition: background-color .25s, box-shadow .25s; }
.k2-filterbar.is-stuck { background: var(--glass-strong); box-shadow: var(--shadow-sm); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.k2-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.k2-chips .chip { min-height: 38px; }
.k2-count { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.k2-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.k2-grid .k2-card { animation: k2in .5s var(--ease) both; }
@keyframes k2in { from { opacity: 0; transform: translateY(12px); } }
.k2-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 16px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.k2-empty[hidden] { display: none; }
.k2-empty p { color: var(--muted); }
.k2-more { display: flex; justify-content: center; margin-top: 32px; }
.k2-more .btn[hidden] { display: none; }

/* ---------- Band (CTA) ---------- */
.k2-band { margin: 0 var(--edge); border-radius: var(--r-xl); padding: clamp(56px, 7vw, 88px) 0; background: radial-gradient(80% 120% at 85% 0%, #3b2580, var(--plum) 70%); color: #d9d2ee; }
.k2-band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; }
.k2-band .h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); }
.k2-band p { margin-top: 10px; color: #cfc4f3; }
.k2-band__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.k2-btn-outline { border-color: rgba(255, 255, 255, .35); color: #fff; }
.k2-btn-outline:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }

/* ---------- Beitrag ---------- */
.k2-progress { position: fixed; top: 0; left: 0; right: 0; z-index: calc(var(--z-nav) + 1); height: 3px; pointer-events: none; }
.k2-progress i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--brand), #c79bff); }
.k2-layout { display: grid; grid-template-columns: 280px minmax(0, 760px); justify-content: center; gap: clamp(32px, 5vw, 72px); padding-top: clamp(32px, 4vw, 56px); padding-bottom: clamp(56px, 7vw, 88px); }
.k2-side__sticky { position: sticky; scroll-behavior: smooth; top: 96px; display: flex; flex-direction: column; gap: 24px; max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: none; padding-bottom: 8px; }
.k2-side__sticky::-webkit-scrollbar { display: none; }
.k2-side__h { margin-bottom: 10px; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.k2-toc[hidden] { display: none; }
.k2-toc__list { list-style: none; position: relative; display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--line); }
.k2-toc__list a { position: relative; display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; font-size: .875rem; line-height: 1.4; color: var(--muted); transition: color .2s, border-color .2s; }
.k2-toc__list a:hover { color: var(--ink); }
.k2-toc__list a.is-active { color: var(--brand-700); border-left-color: var(--brand); font-weight: 550; }
.k2-cta-mini { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border-radius: 20px; background: var(--feature-grad); }
.k2-cta-mini__k { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); }
.k2-cta-mini strong { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -.01em; }
.k2-cta-mini .btn { margin-top: 6px; }
.k2-latest { display: flex; flex-direction: column; }
.k2-latest a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .9rem; font-weight: 500; line-height: 1.4; color: var(--ink-2); transition: color .2s; }
.k2-latest a:hover { color: var(--brand-700); }
.k2-latest svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.k2-latest a:hover svg { transform: translateX(3px); }

.k2-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.k2-crumbs a:hover { color: var(--brand-700); }
.k2-meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; font-size: .9375rem; color: var(--muted); }
.k2-meta-top i { font-style: normal; opacity: .6; }
.k2-title { margin-top: 12px; font-size: clamp(2.1rem, 1.3rem + 3vw, 3.6rem); line-height: 1.06; font-weight: 600; letter-spacing: -.04em; overflow-wrap: break-word; text-wrap: balance; }
.k2-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.k2-byline > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.3; }
.k2-byline strong { font-weight: 600; }
.k2-byline small { font-size: .8125rem; color: var(--muted); }
.k2-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #8a6bff, #c48bff); color: #fff; font-size: .8125rem; font-weight: 700; }
.k2-avatar img { width: 100%; height: 100%; object-fit: cover; }
.k2-avatar--lg { width: 64px; height: 64px; font-size: 1.125rem; }
.k2-share { display: flex; gap: 6px; margin-left: auto; }
.k2-share__btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); transition: border-color .2s, color .2s, background-color .2s; }
.k2-share__btn:hover { border-color: var(--brand); color: var(--brand-700); }
.k2-share__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.k2-share__btn svg path[fill="currentColor"] { stroke: none; }
.k2-share__tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .75rem; font-weight: 550; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; }
.k2-share__tip:not(:empty) { opacity: 1; }
.k2-hero-img { margin: 28px 0 0; border-radius: var(--r-xl); overflow: hidden; background: var(--tint); }
.k2-hero-img img { width: 100%; height: auto; display: block; }
.k2-lead--article { margin: 28px 0 0; max-width: none; text-align: left; font-size: 1.25rem; color: var(--ink-2); }

/* Fließtext */
.k2-prose { margin-top: 28px; font-size: 1.0625rem; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; }
.k2-prose > * + * { margin-top: 1.1em; }
.k2-prose h2 { margin-top: 2em; font-size: clamp(1.6rem, 1.25rem + 1.2vw, 2.1rem); line-height: 1.15; font-weight: 600; letter-spacing: -.03em; color: var(--ink); scroll-margin-top: 100px; }
.k2-prose h3 { margin-top: 1.6em; font-size: 1.3rem; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; color: var(--ink); scroll-margin-top: 100px; }
.k2-prose p { margin-bottom: 0; }
.k2-prose strong, .k2-prose b { color: var(--ink); font-weight: 600; }
.k2-prose a { color: var(--brand-700); font-weight: 550; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--brand) 40%, transparent); transition: text-decoration-color .2s; }
.k2-prose a:hover { text-decoration-color: currentColor; }
.k2-prose ul, .k2-prose ol { padding-left: 1.3em; }
.k2-prose li + li { margin-top: .45em; }
.k2-prose ul li::marker { color: var(--brand); }
.k2-prose ol li::marker { color: var(--brand-700); font-weight: 600; }
.k2-prose blockquote { margin-left: 0; padding: 18px 22px; border-left: 3px solid var(--brand); border-radius: 0 16px 16px 0; background: var(--k2-toc-bg); color: var(--ink); font-size: 1.125rem; }
.k2-prose code { padding: .15em .4em; border-radius: 6px; background: var(--tint); border: 1px solid var(--line); font-size: .9em; }
.k2-prose pre { padding: 18px; border-radius: 14px; background: var(--plum); color: #ece7fb; overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.k2-prose pre code { padding: 0; border: 0; background: none; color: inherit; }
.k2-prose img { max-width: 100%; height: auto; border-radius: 16px; }
.k2-prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; display: block; overflow-x: auto; }
.k2-prose th, .k2-prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.k2-prose th { background: var(--tint); color: var(--ink); font-weight: 600; }
.k2-prose th, .k2-prose td { hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; }
.k2-prose table { border: 1px solid var(--line); border-radius: 14px; }
/* Tabellentitel direkt nach einer Abschnitts-H2: eine Stufe kleiner (Generator gab ihn als h2 aus) */
.k2-prose h2 + h2:has(+ table) { margin-top: 1.4em; font-size: 1.125rem; line-height: 1.3; letter-spacing: -.01em; }
.k2-prose hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }

.k2-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 40px; }
.k2-tags span { padding: 5px 12px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); font-size: .8125rem; color: var(--ink-2); }
.k2-author { display: flex; gap: 18px; align-items: flex-start; margin-top: 40px; padding: 24px; border-radius: var(--r-lg); background: var(--tint); border: 1px solid var(--line); }
.k2-author__k { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.k2-author__name { display: inline-block; margin-top: 2px; font-size: 1.125rem; font-weight: 600; }
.k2-author__bio { margin-top: 6px; color: var(--muted); font-size: .9375rem; }
.k2-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 404 ---------- */
.k2-404__inner { display: flex; flex-direction: column; align-items: center; padding: clamp(80px, 12vw, 160px) 24px; text-align: center; }
.k2-404__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .k2-layout { grid-template-columns: minmax(0, 1fr); }
    .k2-side { order: 2; }
    .k2-side__sticky { position: static; max-height: none; }
    .k2-toc { display: none; }
    .k2-grid, .k2-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .k2-stage, .k2-story { grid-template-columns: minmax(0, 1fr); }
    .k2-stage__side { grid-template-rows: none; }
    .k2-stage__side .k2-card__link { flex-direction: column; }
    .k2-stage__side .k2-card__img { flex: none; aspect-ratio: 16 / 10; }
    .k2-filterbar { position: static; }
    .k2-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -24px; padding: 2px 24px; }
    .k2-chips::-webkit-scrollbar { display: none; }
    .k2-chips .chip { flex: none; }
}
@media (max-width: 560px) {
    /* Tabellen: Spalten nicht zusammenquetschen, lieber seitlich wischen */
    .k2-prose th, .k2-prose td { min-width: 7.5rem; padding: 9px 12px; }
    .k2-grid, .k2-grid--3 { grid-template-columns: minmax(0, 1fr); }
    .k2-chips { margin-inline: -16px; padding-inline: 16px; }
    .k2-hero__title br { display: none; }
    .k2-share { margin-left: 0; width: 100%; }
    .k2-author { flex-direction: column; }
    .k2-search kbd { display: none; }
    .k2-card--big .k2-card__body { padding: 20px 22px 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .k2-grid .k2-card { animation: none; }
}
