/* UGC-guiden — stilmall.
   Redaktionellt uttryck: sans i gränssnittet, serif i brödtexten. Accenten är
   elektrisk indigo, inte Helsamas korall — det är ett annat varumärke. */

:root {
  --paper: #fbfaf8;
  --paper-2: #f2f0ec;
  --card: #ffffff;
  --ink: #15141a;
  --ink-2: #4a4753;
  --ink-3: #7d7a88;
  --line: #e4e1db;
  --accent: #4b2bef;
  --accent-ink: #ffffff;
  --accent-soft: #ece8ff;
  --hot: #ff5a34;
  --ok: #0f7a52;
  --ok-soft: #e2f5ec;
  --warn-soft: #fdeee9;

  --wrap: 1160px;
  /* Artikelns textmått. Rubrik, ingress, byline, brödtext och taggar delar den
     här bredden — annars centreras varje block för sig i .wrap och kolumnerna
     hamnar aldrig i linje med varandra. */
  --measure: 44rem;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 19, 26, .04), 0 8px 24px rgba(20, 19, 26, .06);
  --shadow-lift: 0 2px 6px rgba(20, 19, 26, .06), 0 18px 44px rgba(20, 19, 26, .12);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e0e12;
    --paper-2: #16161c;
    --card: #17171e;
    --ink: #f3f2f7;
    --ink-2: #b6b3c2;
    --ink-3: #8b8898;
    --line: #26262f;
    --accent: #8f78ff;
    --accent-ink: #12101f;
    --accent-soft: #221d3d;
    --hot: #ff7a5c;
    --ok: #4ecfa0;
    --ok-soft: #10281f;
    --warn-soft: #2c1b16;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 44px rgba(0, 0, 0, .45);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.022em; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem); }
h3 { font-size: 1.12rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- huvud ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner { display: flex; align-items: center; gap: 1.6rem; min-height: 66px; }

.logo { display: inline-flex; align-items: baseline; gap: .3rem; text-decoration: none; font-weight: 800; letter-spacing: -.03em; font-size: 1.16rem; }
.logo__mark {
  background: var(--accent); color: var(--accent-ink);
  padding: .12em .38em; border-radius: 6px; font-size: .92em;
}
.logo__word { color: var(--ink); }

.nav { display: flex; gap: 1.35rem; margin-right: auto; font-size: .95rem; font-weight: 500; }
.nav a { text-decoration: none; color: var(--ink-2); padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.site-head__account { display: flex; align-items: center; gap: 1rem; }
.nav__edit {
  font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap;
  padding: .3rem .7rem; border-radius: 999px; background: var(--warn-soft); color: var(--hot);
}
.nav__edit[aria-current="page"] { background: var(--hot); color: var(--paper); }
.nav__out { margin: 0; display: flex; }
.nav__out .btn { padding-inline: 0; font-size: .85rem; }
.nav__me { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; font-size: .92rem; }

.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; order: 3; margin-left: auto; }
  .site-head__account { order: 2; }
  .nav {
    order: 4; width: 100%; flex-direction: column; gap: 0;
    margin: 0; max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .site-head__inner { flex-wrap: wrap; gap: .8rem; padding-bottom: 0; }
  .site-head--open .nav { max-height: 60vh; padding-bottom: .6rem; }
  .site-head--open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .site-head--open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-head--open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(3rem, 2rem + 6vw, 6.5rem) 0 clamp(2.5rem, 2rem + 3vw, 4rem);
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(40rem 24rem at 95% 0%, color-mix(in srgb, var(--hot) 14%, transparent), transparent 65%);
}
.hero__kicker {
  margin: 0 0 1rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.hero__title { max-width: 17ch; margin-bottom: .5rem; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__lead { max-width: 58ch; font-size: 1.12rem; color: var(--ink-2); margin: 0 0 1.8rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; }

/* ---------- knappar ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid var(--line);
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none;
  background: var(--card); color: var(--ink); cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; }
.btn--sm { padding: .45rem .95rem; font-size: .88rem; }
.btn--quiet { background: none; border: 0; color: var(--ink-3); padding-inline: 0; }
.btn--quiet:hover { color: var(--hot); box-shadow: none; transform: none; }

/* ---------- sektioner ---------- */

.section { padding: clamp(2.2rem, 1.6rem + 2vw, 3.6rem) 0; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.section__title { margin: 0 0 .2rem; }
.section__blurb { margin: 0; color: var(--ink-3); font-size: .98rem; }
.section__more { white-space: nowrap; font-weight: 600; font-size: .93rem; text-decoration: none; color: var(--accent); }

.band { background: var(--paper-2); border-block: 1px solid var(--line); }

.page-head { padding: clamp(2.4rem, 2rem + 3vw, 4rem) 0 .5rem; }
.page-head__kicker { margin: 0 0 .6rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.page-head__lead { max-width: 60ch; color: var(--ink-2); font-size: 1.08rem; margin: 0; }

.crumbs { font-size: .87rem; color: var(--ink-3); margin-bottom: 1rem; }
.crumbs a { text-decoration: none; }
.crumbs span { margin: 0 .4rem; }

.empty { color: var(--ink-3); padding: 2rem 0; }

/* ---------- kort ---------- */

.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--lead { grid-template-columns: 1.35fr 1fr; align-items: start; }
.grid__stack { display: grid; gap: 1.1rem; }
@media (max-width: 900px) { .grid--lead { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .22s ease, border-color .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.1rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; }
.card__title { margin: 0; font-size: 1.08rem; letter-spacing: -.015em; }
.card__title a { text-decoration: none; }
.card__title a:hover { color: var(--accent); }
.card__dek { margin: 0; color: var(--ink-2); font-size: .95rem; }
.card__meta { margin: auto 0 0; color: var(--ink-3); font-size: .84rem; }

.card--featured .card__title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem); }
.card--featured .card__media { aspect-ratio: 16 / 9; }
.card--featured .card__dek { font-size: 1.02rem; }
.grid__stack .card { flex-direction: row; }
.grid__stack .card__media { flex: 0 0 108px; aspect-ratio: 1; }
.grid__stack .card__body { padding: .8rem .9rem; }
.grid__stack .card__title { font-size: .98rem; }
.grid__stack .card__dek { display: none; }

/* ---------- etiketter ---------- */

.tag {
  align-self: flex-start; display: inline-block;
  font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: .25em .6em; border-radius: 999px; text-decoration: none;
  background: var(--accent-soft); color: var(--accent);
}
.tag--nyheter { background: var(--accent-soft); color: var(--accent); }
.tag--tips { background: var(--ok-soft); color: var(--ok); }
.tag--intervjuer { background: var(--warn-soft); color: var(--hot); }
.tag--kurs { background: var(--accent-soft); color: var(--accent); }
.tag--plain, .tag--role, .tag--pin, .tag--free, .tag--draft {
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
}
.tag--draft { color: var(--hot); }
.tag--klar { background: var(--ok-soft); color: var(--ok); }
.tag--uppgift { background: var(--warn-soft); color: var(--hot); }

.badge {
  display: inline-flex; align-items: center; gap: .25em; vertical-align: middle;
  font-size: .7em; font-weight: 700; letter-spacing: .04em;
  padding: .3em .6em; border-radius: 999px; white-space: nowrap;
}
.badge--cert { background: var(--ok-soft); color: var(--ok); }

/* ---------- artikel ---------- */

.post { padding-bottom: 2rem; }
.post__head { padding: clamp(2rem, 1.6rem + 2vw, 3.2rem) 0 1.4rem; max-width: var(--measure); }
.post__head h1 { letter-spacing: -.028em; }
.post__dek { font-size: 1.2rem; color: var(--ink-2); margin: .6rem 0 0; }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.4rem; color: var(--ink-3); font-size: .9rem; }
.byline { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; color: var(--ink); }

.post__cover { margin: 0 0 2rem; }
.post__cover img { width: 100%; max-height: 60vh; object-fit: cover; }

.prose { max-width: var(--measure); font-family: var(--serif); font-size: 1.18rem; line-height: 1.72; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-family: var(--sans); font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { font-family: var(--sans); font-size: 1.18rem; margin-top: 1.8em; }
.prose a { color: var(--accent); }
.prose img, .prose figure { margin-block: 2rem; }
.prose figcaption { font-family: var(--sans); font-size: .88rem; color: var(--ink-3); margin-top: .5rem; }
.prose blockquote {
  margin-inline: 0; padding: .3em 0 .3em 1.3em; border-left: 3px solid var(--accent);
  font-size: 1.24rem; color: var(--ink-2);
}
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--paper-2); padding: .15em .4em; border-radius: 4px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }

.post__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2.5rem; max-width: var(--measure); }

.interviewee {
  max-width: 42rem; margin-bottom: 2rem; padding: 1.2rem 1.4rem;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.interviewee h2 { font-size: 1rem; margin: 0 0 .3rem; }
.interviewee p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.interviewee__links { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: .8rem 0 0; font-size: .9rem; }
.interviewee__links a { color: var(--accent); }

.pager { display: flex; justify-content: space-between; margin-top: 2.5rem; font-weight: 600; }
.pager a { text-decoration: none; color: var(--accent); }

/* ---------- kurser ---------- */

.course-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center; padding: clamp(2rem, 1.6rem + 2vw, 3.4rem) 0; }
.course-head__media img { border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.course-head__facts { display: flex; flex-wrap: wrap; gap: 1.2rem; color: var(--ink-3); font-size: .93rem; margin: 1.2rem 0; }
@media (max-width: 860px) { .course-head { grid-template-columns: 1fr; } }

.lessons { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.lesson { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--line); }
.lesson:last-child { border-bottom: 0; }
.lesson a { text-decoration: none; font-weight: 600; }
.lesson a:hover { color: var(--accent); }
.lesson--locked { color: var(--ink-3); }
.lesson__meta { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--ink-3); white-space: nowrap; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; max-width: 42rem; font-weight: 600; }
.lesson-nav a { text-decoration: none; color: var(--accent); }

.lesson__main { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.lesson__check {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.35rem; height: 1.35rem; border-radius: 50%; font-size: .8rem; font-weight: 800;
  background: var(--ok-soft); color: var(--ok);
}
.lesson--done a { color: var(--ink-3); }

.video { max-width: 46rem; margin-bottom: 2rem; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }

/* ---------- utbildning: spår, progression, uppgifter ---------- */

.progress { display: grid; gap: .35rem; margin: 1rem 0; min-width: 11rem; }
.progress__bar {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border: 0; border-radius: 999px;
  background: var(--paper-2); color: var(--accent);
}
.progress__bar::-webkit-progress-bar { background: var(--paper-2); border-radius: 999px; }
.progress__bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.progress__bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.progress__label { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.progress--done .progress__bar::-webkit-progress-value { background: var(--ok); }
.progress--done .progress__bar::-moz-progress-bar { background: var(--ok); }
.progress--done .progress__label { color: var(--ok); }

.tracks { display: grid; gap: 1.5rem; padding: 1.5rem 0 3rem; }
.track {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.3rem, 1rem + 1.4vw, 2.2rem);
}
.track--cert { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 30%, var(--card)); }
.track__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.track__kicker { margin: 0 0 .3rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.track__title { margin: 0 0 .4rem; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); }
.track__summary { margin: 0; max-width: 60ch; color: var(--ink-2); }
.track__goal { margin: .7rem 0 0; max-width: 60ch; font-size: .93rem; color: var(--ink-3); }

.track__courses { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .7rem; }
.modul {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem 1.2rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.modul__text { flex: 1 1 20rem; min-width: 0; }
.modul__title { margin: 0; font-size: 1.05rem; }
.modul__title a { text-decoration: none; }
.modul__title a:hover { color: var(--accent); }
.modul__summary { margin: .25rem 0 0; color: var(--ink-2); font-size: .92rem; }
.modul__facts { display: flex; gap: 1rem; margin: .5rem 0 0; color: var(--ink-3); font-size: .84rem; }
.modul__side { display: grid; gap: .4rem; justify-items: start; min-width: 11rem; }
.modul__side .progress { margin: 0; }

.callout {
  margin-top: 1.4rem; padding: 1.1rem 1.3rem; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px solid var(--line);
  display: grid; gap: .8rem; justify-items: start;
}
.callout h2 { font-size: 1.1rem; margin: 0; }
.callout p { margin: 0; color: var(--ink-2); }
.callout--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.callout--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--hot) 30%, transparent); }

.uppgift {
  max-width: 42rem; margin-top: 2.5rem; padding: 1.4rem 1.5rem;
  background: var(--paper-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.uppgift__kicker { margin: 0 0 .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.uppgift__text > :first-child { margin-top: 0; }
.uppgift__text > :last-child { margin-bottom: 0; }
.uppgift__note { color: var(--ink-2); font-size: .93rem; }
.uppgift__feedback { padding: .8rem 1rem; background: var(--card); border-radius: var(--radius-sm); font-size: .95rem; }
.uppgift .form { max-width: 100%; }

.lesson-done { max-width: 42rem; margin-top: 2.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.lesson-done__hint { margin: 0; color: var(--ink-3); font-size: .9rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; }
.stat {
  padding: 1.1rem 1.2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; gap: .2rem;
}
.stat strong { font-size: 1.9rem; line-height: 1; letter-spacing: -.03em; }
.stat span { color: var(--ink-3); font-size: .85rem; }

.status { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.status--inlamnad { color: var(--ink-3); }
.status--godkand { color: var(--ok); }
.status--underkand { color: var(--hot); }
.linklist__note { color: var(--ink-3); font-size: .88rem; border-bottom: 0; padding-top: 0; }

.cert-state { max-width: 42rem; padding-bottom: 4rem; }
.cert-state .form { max-width: 100%; }

/* ---------- redaktion ---------- */

.count {
  display: inline-block; margin-left: .4rem; vertical-align: middle;
  font-size: .75rem; font-weight: 700; padding: .2em .6em; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

.reviews { display: grid; gap: 1.2rem; max-width: 46rem; }
.review {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; display: grid; gap: .9rem;
}
.review--cert { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.review__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.review__who { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; text-decoration: none; }
.review__meta { color: var(--ink-3); font-size: .85rem; }
.review__meta a { color: inherit; }
.review__note {
  margin: 0; padding: .8rem 1rem; background: var(--paper-2); border-radius: var(--radius-sm);
  font-size: .95rem; color: var(--ink-2);
}
.review__link { justify-self: start; font-weight: 600; color: var(--accent); font-size: .93rem; }
.review__link--broken { color: var(--hot); }
.review__criteria { margin: 0; color: var(--ink-3); font-size: .85rem; }
.review__form { display: grid; gap: .7rem; }
.review__form label { display: grid; gap: .35rem; font-weight: 600; font-size: .88rem; }
.review__form textarea {
  font: inherit; font-size: .95rem; padding: .7rem .85rem; line-height: 1.5;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); width: 100%; resize: vertical;
}
.review__form textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- uppdrag ---------- */

.card--brief .card__body { gap: .6rem; }

.brieffacts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem;
  margin: 0; padding: 1.2rem 1.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.brieffacts dt { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.brieffacts dd { margin: .2rem 0 0; font-weight: 700; }

.applicants { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.applicant {
  display: grid; gap: .6rem; padding: 1rem 1.1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.applicant__who { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.applicant__who a { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; text-decoration: none; }

.form--inline-row { display: flex; gap: .5rem; margin: 0; flex-wrap: wrap; align-items: center; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; }

.form select {
  font: inherit; font-size: 1rem; padding: .7rem .85rem;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); width: 100%;
}
/* Brödtextrutan ska gå att skriva en artikel i, inte bara en kommentar. */
.editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92rem; line-height: 1.6; min-height: 26rem;
}

/* ---------- forum ---------- */

.forum-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 900px) { .forum-layout { grid-template-columns: 1fr; gap: 2rem; } }

.cats { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.cat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; transition: border-color .2s; }
.cat:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cat__name { font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.cat__desc { margin: .25rem 0 0; color: var(--ink-3); font-size: .92rem; }

.threadlist { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; }
.threadlist--compact { gap: 1.1rem; margin-top: 0; }
.threadlist--compact a { font-weight: 600; text-decoration: none; }
.threadlist__meta { margin: .2rem 0 0; color: var(--ink-3); font-size: .85rem; }
.threadlist__meta a { color: inherit; }

.thread { display: flex; gap: 1rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.thread__body { flex: 1; min-width: 0; }
.thread__title { margin: 0; font-size: 1.05rem; }
.thread__title a { text-decoration: none; }
.thread__title a:hover { color: var(--accent); }
.thread__excerpt { margin: .3rem 0 0; color: var(--ink-2); font-size: .93rem; }
.thread__count { display: flex; flex-direction: column; align-items: center; color: var(--ink-3); font-size: .75rem; min-width: 3rem; }
.thread__count strong { font-size: 1.15rem; color: var(--ink); }

.thread-view { display: grid; gap: 1rem; max-width: 48rem; }
.post-item { display: grid; grid-template-columns: 190px 1fr; gap: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.post-item--op { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--card)); }
.post-item__who { display: flex; gap: .7rem; align-items: center; }
.post-item__name { display: block; font-weight: 700; font-size: .93rem; text-decoration: none; }
.post-item__who time { font-size: .8rem; color: var(--ink-3); }
.post-item__text > :first-child { margin-top: 0; }
.post-item__text > :last-child { margin-bottom: 0; }
@media (max-width: 720px) { .post-item { grid-template-columns: 1fr; gap: .9rem; } }

.composer { margin-bottom: 2rem; }
.composer > summary { display: inline-flex; list-style: none; margin-bottom: 1rem; }
.composer > summary::-webkit-details-marker { display: none; }

/* ---------- profiler ---------- */

.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--accent-soft); }
.avatar--sm { width: 26px; height: 26px; }
.avatar--md { width: 46px; height: 46px; }
.avatar--lg { width: 104px; height: 104px; }
.avatar--fallback {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 800; letter-spacing: 0;
}
.avatar--fallback.avatar--sm { font-size: .8rem; }
.avatar--fallback.avatar--md { font-size: 1.2rem; }
.avatar--fallback.avatar--lg { font-size: 2.6rem; }

.profile { padding-top: clamp(2rem, 1.6rem + 2vw, 3.2rem); max-width: 46rem; }
.profile__head { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.profile__head h1 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); margin-bottom: .1em; }
.profile__handle { margin: 0; color: var(--ink-3); font-weight: 600; }
.profile__since { margin: .2rem 0 .8rem; color: var(--ink-3); font-size: .85rem; }
.profile__bio { margin-top: 1.8rem; font-family: var(--serif); font-size: 1.1rem; color: var(--ink-2); }
.profile__links { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.5rem 0 0; }
.profile__links a {
  display: inline-block; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); text-decoration: none; font-size: .88rem; font-weight: 600;
}
.profile__links a:hover { border-color: var(--accent); color: var(--accent); }

.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { display: flex; justify-content: space-between; gap: 1.5rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.linklist a { text-decoration: none; font-weight: 600; }
.linklist span { color: var(--ink-3); font-size: .85rem; white-space: nowrap; }

.grid--members { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.member {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem;
  padding: 1.4rem 1rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; transition: border-color .2s, transform .15s;
}
.member:hover { border-color: var(--accent); transform: translateY(-2px); }
.member span { color: var(--ink-3); font-size: .85rem; }
.member p { margin: .3rem 0 0; color: var(--ink-2); font-size: .85rem; }

/* ---------- formulär ---------- */

.auth { max-width: 27rem; padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0 4rem; }
.auth--wide { max-width: 40rem; }
.auth__lead { color: var(--ink-2); margin-top: -.3rem; }
.auth__alt { margin-top: 1.5rem; color: var(--ink-3); font-size: .93rem; }

.form { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; }
.form small { font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.form input, .form textarea {
  font: inherit; font-size: 1rem; padding: .7rem .85rem;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); width: 100%;
}
.form input[type="file"] { padding: .5rem; font-size: .9rem; }
.form textarea { resize: vertical; min-height: 7rem; line-height: 1.55; }
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 0; }
.form button { justify-self: start; }
.form--inline { margin-top: 2.5rem; }
.form--reply { max-width: 100%; }
.form__avatar { display: flex; gap: 1.3rem; align-items: center; }
.form__avatar label { flex: 1; }
.form__social { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: grid; gap: 1rem; }
.form__social legend { padding-inline: .5rem; font-weight: 700; font-size: .88rem; }
.form__actions { display: flex; gap: .7rem; flex-wrap: wrap; }

.notice { padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .93rem; margin: 1rem 0; border: 1px solid transparent; }
.notice--error { background: var(--warn-soft); color: var(--hot); border-color: color-mix(in srgb, var(--hot) 30%, transparent); }
.notice--ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.notice--info { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); }
.notice a { color: inherit; font-weight: 600; }

.cta { text-align: center; max-width: 34rem; margin-inline: auto; }
.cta p { color: var(--ink-2); }

/* ---------- sidfot ---------- */

.site-foot { margin-top: 4rem; background: var(--paper-2); border-top: 1px solid var(--line); }
.site-foot__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.site-foot nav { display: flex; flex-direction: column; gap: .5rem; font-size: .93rem; }
.site-foot h2 { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .3rem; }
.site-foot a { text-decoration: none; color: var(--ink-2); }
.site-foot a:hover { color: var(--accent); }
.site-foot__tagline { color: var(--ink-3); font-size: .92rem; max-width: 30ch; margin: .8rem 0 0; }
.site-foot__legal { padding-bottom: 2.5rem; color: var(--ink-3); font-size: .84rem; }
.logo--foot { font-size: 1.05rem; }
@media (max-width: 760px) { .site-foot__inner { grid-template-columns: 1fr 1fr; } }

/* ---------- filmer på profilen ---------- */

/* Små rutor, inte en spellista. Profilen ska gå att överblicka på ett ögonkast
   även med tolv filmer, så korten är medvetet smalare än artikelkorten. */
.videos {
  list-style: none; padding: 0; margin: 1.2rem 0 0;
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.video-card { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }

/* Fasaden: knappen ÄR miniatyren fram tills någon klickar, då app.js byter ut
   den mot en iframe. Samma mått på båda så layouten inte hoppar. */
.video-card__play,
.video-card iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper-2); overflow: hidden;
}

.video-card__play {
  position: relative; padding: 0; cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
}
.video-card__play:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.video-card__play img { width: 100%; height: 100%; object-fit: cover; display: block; }

.video-card__placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-3);
  background: linear-gradient(135deg, var(--paper-2), var(--accent-soft));
}

.video-card__icon {
  position: absolute; inset: 0; margin: auto;
  width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
  border-radius: 50%; background: rgba(20, 19, 26, .68); color: #fff;
  font-size: .9rem; padding-left: .15rem;
}
.video-card__play:hover .video-card__icon { background: var(--accent); color: var(--accent-ink); }

.video-card__title {
  margin: 0; font-size: .88rem; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-card__meta { margin: 0; font-size: .78rem; color: var(--ink-3); }
.video-card__meta a { color: inherit; }
.video-card__meta a:hover { color: var(--accent); }

/* Publiceringslistan på profilen får plats för en ingress. */
.linklist--rich li { flex-direction: column; align-items: flex-start; gap: .3rem; }
.linklist__dek { margin: 0; color: var(--ink-2); font-size: .9rem; font-weight: 400; line-height: 1.45; }

@media (max-width: 520px) {
  .videos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
}

/* ---------- nästa steg, utfästelser, värvning ---------- */

/* Ett enda kort, inte en lista. Sidan ska ge ett beslut, inte en meny. */
.next-step {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.6rem 1.6rem 1.4rem; box-shadow: var(--shadow);
}
.next-step__label {
  margin: 0 0 .3rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
}
.next-step__title { margin: 0 0 .4rem; font-size: 1.4rem; line-height: 1.25; }
.next-step__why { margin: 0 0 1.1rem; color: var(--ink-2); max-width: 52ch; }

.commitments { list-style: none; padding: 0; margin: 1rem 0 1.2rem; }
.commitments li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.commitments .form--inline { display: flex; align-items: center; gap: .8rem; margin: 0; }
.commitments time { color: var(--ink-3); font-size: .85rem; white-space: nowrap; }

.form--row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.form--row input { flex: 1 1 12rem; min-width: 0; }
.form--row button { flex: 0 0 auto; }

.form__check { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; }
.form__check input { width: auto; margin-top: .25rem; flex: 0 0 auto; }

.checklist { list-style: none; padding: 0; margin: 1rem 0; max-height: 26rem; overflow-y: auto; }
.checklist li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.checklist label { display: flex; align-items: center; gap: .6rem; font-weight: 400; margin: 0; }
.checklist input { width: auto; flex: 0 0 auto; }
.checklist small { color: var(--ink-3); }

.referral code {
  display: inline-block; padding: .5rem .8rem; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .95rem;
  word-break: break-all;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
