/* Återanvända delar: knappar, randen, eventkort, filter, siffror, roller, personer, tidslinje. */

/* ---------- Knappar (piller) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 999px;
  background: transparent; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; line-height: 1.2; letter-spacing: 0;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { border-color: currentColor; background: color-mix(in srgb, currentColor 8%, transparent); }
.btn__arrow { display: inline-block; font-size: 1.1em; line-height: 1; transition: transform 0.25s var(--ease); }
.btn:hover .btn__arrow, .link-arrow:hover .btn__arrow { transform: translateX(4px); }
.btn--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--ink:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn--paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--paper:hover { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn--small { min-height: 38px; padding: 0 16px; font-size: 0.875rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
  font-size: 0.9375rem; font-weight: 500;
}

/* ---------- MKRS-randen ---------- */
.stripe { overflow: hidden; padding-block: 24px; margin-block: -24px; pointer-events: none; position: relative; z-index: 1; }
.stripe__band { transform: rotate(-2.5deg); margin-inline: -4vw; background: var(--ink); }
.stripe__track { display: flex; width: max-content; animation: stripe-run 60s linear infinite; }
.stripe__track img { height: clamp(28px, 3.4vw, 44px); width: auto; max-width: none; flex: none; }
@keyframes stripe-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .stripe__track { animation: none; } }

/* ---------- Eventkort: lika stora, datum och kategori i bilden ---------- */
.event-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); grid-auto-rows: 1fr; }
/* På startsidan: en rad att svepa i på mobil. */
.event-grid--row {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px; scroll-padding-inline: var(--gutter);
}
.event-grid--row::-webkit-scrollbar { display: none; }
.event-grid--row > * { flex: 0 0 min(82%, 340px); scroll-snap-align: start; }
@media (min-width: 760px) {
  .event-grid--row { display: grid; overflow: visible; margin-inline: 0; padding: 0; }
}

.event-card {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 6px 6px 16px; border-radius: var(--radius); background: var(--card);
  text-decoration: none; transition: background-color 0.25s var(--ease);
}
.event-card:hover { background: var(--card-hover); }
.event-card__media { position: relative; flex: none; aspect-ratio: 1.91 / 1; overflow: hidden; border-radius: var(--radius-sm); background: #dcdcd6; }
.event-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.event-card:hover .event-card__media img { transform: scale(1.06); }
.event-card__date {
  position: absolute; left: 10px; top: 10px; display: grid; gap: 3px; min-width: 46px;
  padding: 6px 9px; border-radius: 10px; background: var(--paper); color: var(--ink); text-align: center; line-height: 1;
}
.event-card__date b { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; }
.event-card__date span { font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.event-card__cat { position: absolute; right: 10px; top: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(24, 24, 28, 0.75); color: var(--paper); }
.event-card__arrow {
  position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; background: var(--paper); color: var(--ink);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.event-card__arrow span { transition: transform 0.25s var(--ease); }
.event-card:hover .event-card__arrow { background: var(--ink); color: var(--paper); }
.event-card:hover .event-card__arrow span { transform: rotate(-45deg); }
.event-card__body { display: grid; gap: 4px; min-width: 0; padding-inline: 10px; }
.event-card__title {
  height: 2.3em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
}
@media (min-width: 900px) { .event-card__title { font-size: 1.0625rem; } }
.event-card__place { margin: 0; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-card__place svg { display: inline-block; width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }

.empty-state { display: grid; gap: 16px; max-width: 760px; padding: clamp(24px, 5vw, 48px); border-radius: var(--radius); background: var(--card); }
.empty-state h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.04em; }

/* ---------- Filter ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.latest-label { display: block; margin: 48px 0 18px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border: 1px solid rgba(24, 24, 28, 0.22); border-radius: 999px; background: var(--paper); cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; line-height: 1;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip--on-ink { background: transparent; color: var(--paper); border-color: rgba(255, 255, 255, 0.25); }
.chip--on-ink:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--paper); }

/* ---------- Siffror (i en mörk panel) ---------- */
.stats { display: grid; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 16px; border-top: 1px solid var(--line-on-ink); }
.stat__value { font-size: clamp(2.5rem, 12vw, 4.5rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted-on-ink); text-align: right; }
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .stat { flex-direction: column; align-items: flex-start; padding-top: 20px; }
  .stat__value { font-size: clamp(3.5rem, 7vw, 6.5rem); }
  .stat__label { text-align: left; }
}
.award { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-on-ink); }
.award__mark { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.04em; }
.award__title { margin: 0 0 4px; font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.award .label { color: var(--muted-on-ink); }

/* ---------- Definition (maker /ˈmeɪkər/) ---------- */
.definition { display: grid; gap: 20px; max-width: 900px; }
.definition__word { margin: 0; font-size: var(--fs-display); font-weight: 700; letter-spacing: -0.055em; line-height: 0.85; }
.definition__class { font-family: var(--mono); font-size: var(--fs-small); color: var(--muted); }
.definition__class .phonetic { color: var(--ink); margin-right: 12px; }

/* ---------- Roller (utfällbara) ---------- */
.roles { display: grid; gap: 8px; }
.role { border-radius: var(--radius); background: var(--card); padding-inline: clamp(18px, 3vw, 32px); transition: background-color 0.25s var(--ease); scroll-margin-top: calc(var(--header-h) + 16px); }
.role:hover { background: var(--card-hover); }
.role summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-block: 22px; cursor: pointer; list-style: none;
}
.role summary::-webkit-details-marker { display: none; }
.role summary h3 { font-size: clamp(1.5rem, 3.2vw, 2.5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.role summary .label { color: var(--muted); }
.role__icon { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--paper); }
.role__icon::before, .role__icon::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 1.5px; margin-top: -0.75px; background: currentColor; transition: transform 0.25s var(--ease); }
.role__icon::after { transform: rotate(90deg); }
.role[open] .role__icon::after { transform: rotate(0deg); }
.role__body { display: grid; gap: 24px; padding-bottom: 32px; max-width: 760px; }
.role__body ul { margin: 0; padding-left: 1.1em; }
.role__body li { margin-bottom: 4px; }

/* ---------- Personer ---------- */
.people { display: grid; gap: 48px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.person { display: grid; gap: 12px; align-content: start; }
.person img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: var(--radius); background: var(--paper-2); }
.person h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.03em; margin-top: 4px; }
.person .label { color: var(--muted); margin-top: 6px; }
.person__mail { font-family: var(--mono); font-size: var(--fs-small); word-break: break-all; }

/* ---------- Tidslinje ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; gap: 8px 32px; padding-block: 28px; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .timeline li { grid-template-columns: 220px minmax(0, 1fr); } }
.timeline__year { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; letter-spacing: -0.05em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.timeline p { max-width: 680px; }

/* ---------- Löptext (villkor, policy) ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin: 2.2em 0 0.6em; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.125rem; letter-spacing: -0.01em; margin: 1.8em 0 0.4em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose li ul { margin-top: 0.4em; }
/* Stor skärm: rubrikerna i vänsterspalten, texten till höger, så att sidan används i hela bredden. */
@media (min-width: 900px) {
  .prose--cols {
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: clamp(16px, 4vw, 64px);
    align-items: start; max-width: none;
  }
  .prose--cols > * { grid-column: 2; max-width: 72ch; }
  .prose--cols > h2, .prose--cols > h3 { grid-column: 1; margin: 2.5rem 0 0; }
  .prose--cols > h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); }
  .prose--cols > :is(h2, h3) + * { margin-top: 2.5rem; }
  .prose--cols > :first-child, .prose--cols > :first-child + * { margin-top: 0; }
  .prose--parts > h2 { grid-column: 1 / -1; margin: 4.5rem 0 1.75rem; font-size: clamp(1.75rem, 3vw, 2.5rem); }
  .prose--parts > h2 + * { margin-top: 0; }
  .prose--parts > h2 + h3 + * { margin-top: 0; }
  .prose--parts > h2:first-child { margin-top: 0; }
}

.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 56px; list-style: none; padding: 0; }

/* ---------- Bilder: mosaik (fyra bilder) och bildrad (tre bilder) ---------- */
.mosaic {
  display: grid; gap: 8px; grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(120px, 32vw, 200px);
  grid-template-areas: "a a" "a a" "b c" "b d";
}
@media (min-width: 760px) {
  .mosaic { grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(150px, 16vw, 240px); grid-template-areas: "a a b c" "a a b d"; }
}
.mosaic img, .photo-row img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); }
.mosaic img:nth-child(1) { grid-area: a; }
.mosaic img:nth-child(2) { grid-area: b; }
.mosaic img:nth-child(3) { grid-area: c; }
.mosaic img:nth-child(4) { grid-area: d; }

.photo-row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.mosaic + .photo-row { margin-top: 8px; }
.photo-row img { aspect-ratio: 4 / 3; }
.photo-row img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
@media (min-width: 760px) {
  .photo-row { grid-template-columns: repeat(3, 1fr); }
  .photo-row img:first-child { grid-column: auto; aspect-ratio: 4 / 3; }
}
/* Två bilder bredvid varandra. */
.photo-row--pair img:first-child { grid-column: auto; aspect-ratio: 4 / 3; }
@media (min-width: 760px) { .photo-row--pair { grid-template-columns: 1fr 1fr; } }

/* Punktlista i rutor, t.ex. vad MKRS står för */
.perks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.perks li { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 10px; border-radius: 999px; background: var(--paper); font-weight: 600; letter-spacing: -0.01em; }
.perks--list { flex-direction: column; align-items: flex-start; }
.perks--list li { border-radius: var(--radius-sm); background: var(--card); }
.perks li::before {
  content: "✓"; flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-size: 0.75rem; font-weight: 700;
}

/* Partnerloggor i partnernas egna färger. Storleken står per logga (width/height) så att ytorna blir jämna. */
.logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.logos li { flex: 0 0 calc((100% - 16px) / 3); display: grid; place-items: center; height: 72px; padding: 0 6px; }
.logos img, .partner-lead img { max-width: 100%; height: auto; }
@media (max-width: 899px) { .logos img { width: auto; max-height: 40px; } }
@media (min-width: 900px) {
  .logos li { flex-basis: calc((100% - 40px) / 6); height: 120px; }
}
.partner-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: clamp(16px, 3vw, 32px); }
.partner-lead > div {
  display: grid; grid-template-rows: auto 1fr; place-items: center; gap: 12px;
  min-height: clamp(150px, 20vw, 240px); padding: clamp(14px, 2.5vw, 28px); border-radius: var(--radius); background: var(--card);
}
.partner-lead .label { justify-self: start; }

/* ---------- Cookierutan (consent.js) ---------- */
.consent {
  position: fixed; z-index: 60; left: var(--inset); right: var(--inset); bottom: var(--inset);
  max-width: 460px; max-height: calc(100vh - 2 * var(--inset)); overflow: auto;
  padding: clamp(18px, 2.5vw, 24px); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); box-shadow: 0 16px 48px rgba(24, 24, 28, 0.22);
}
.consent__title { margin: 0 0 8px; font-size: var(--fs-h3); outline: none; }
.consent__text { margin: 0 0 16px; font-size: var(--fs-small); line-height: 1.5; }
.consent__text a { color: inherit; text-underline-offset: 3px; }
.consent__choices { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; border: 0; }
.consent__choice { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: var(--fs-small); line-height: 1.4; cursor: pointer; }
.consent__choice input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); }
.consent__choice small { display: block; color: var(--muted); font-size: inherit; }
.consent__actions .btn { flex: 1 1 auto; }

/* ---------- Flytande ansökningsknapp (apply-float.js) ---------- */
.apply-float {
  position: fixed; z-index: 55; right: var(--inset); bottom: calc(var(--inset) + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 12px 32px rgba(24, 24, 28, 0.25);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.apply-float.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
body.menu-open .apply-float { visibility: hidden; opacity: 0; }
@media (max-width: 599px) { .apply-float { left: var(--inset); justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .apply-float { transform: none; transition: none; } }
