/*! © 2015–2026 YourWeb (yourweb.se). All rights reserved. Proprietary – see LICENSE.md */
/* Checklistor (/verktyg/checklistor/ and the four lists below it). Linked after verktyg.css.
   One stylesheet for all five pages. Class prefix: .cl-

   Contents
   01 Breadcrumb on the four lists     05 Toolbar, confirm row, "Allt klart"
   02 Cards: the four lists             06 Side column (desktop)
   03 Progress and notes                07 Print
   04 The checklist (groups, rows, drawn checkbox)                                         */

/* ───────────────────────── 01 Breadcrumb on the four lists ───────────────────────── */

/* Four levels do not fit on a phone: the last crumb is shortened, the row never scrolls. */
.crumbs .cl-crumbs {
  overflow: hidden;
}

.cl-crumbs li:last-child {
  flex: 0 1 auto;
  min-width: 0;
}

.cl-crumbs li:last-child > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ───────────────────────── 02 Cards: the four lists ───────────────────────── */

.cl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cl-cards > li {
  display: grid;
  min-width: 0;
}

.cl-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem 0.8rem;
  align-content: start;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 160ms ease, background 160ms ease;
}

.cl-card:hover,
.cl-card:focus-within {
  border-color: rgb(var(--accent-rgb) / 0.6);
  background: rgb(var(--accent-rgb) / 0.06);
}

.cl-card__icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 0.14);
  color: var(--accent);
}

.cl-card__title {
  align-self: center;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* The whole card is the link; the text next to it says what the list is about. */
.cl-card__link {
  color: inherit;
  text-decoration: none;
}

.cl-card__link::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-md);
  content: "";
}

/* The focus ring goes around the whole card, not just around the title. */
.cl-card__link:focus-visible {
  outline: none;
}

.cl-card__link:focus-visible::after {
  outline: 3px solid var(--yellow-500);
  outline-offset: 3px;
}

.cl-card__text {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.cl-card__meta {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem 0.9rem;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.cl-card__progress {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}

.cl-card__progress .icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.4;
}

.cl-card.is-done .cl-card__progress {
  color: var(--ok);
}

.cl-card .cl-bar {
  grid-column: 1 / -1;
  height: 0.3rem;
}

/* Navigation to the other lists, below the FAQ on each list page. */
.cl-nav {
  display: grid;
  gap: 1.1rem;
}

.cl-nav__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.cl-nav__head h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

/* ───────────────────────── 03 Progress and notes ───────────────────────── */

.cl-head {
  display: grid;
  gap: 0.7rem;
}

.cl-progress {
  display: grid;
  gap: 0.6rem;
}

.cl-progress__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.cl-progress__line b {
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.cl-bar {
  height: 0.55rem;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
}

.cl-bar > span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 320ms var(--ease-out);
}

.cl-bar.is-done > span,
.cl-card.is-done .cl-bar > span {
  background: var(--ok);
}

.cl-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
}

.cl-note .icon {
  width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  color: var(--accent);
}

.cl-note.is-blocked {
  color: var(--text-soft);
}

.cl-note.is-blocked .icon {
  color: var(--warn);
}

.cl-note abbr {
  text-decoration: underline dotted;
  text-underline-offset: 0.15em;
}

/* ───────────────────────── 04 The checklist ───────────────────────── */

.cl-groups {
  display: grid;
  gap: 1.75rem;
}

.cl-group {
  display: grid;
  align-content: start;
  min-width: 0;
  scroll-margin-top: 0.75rem;
}

.cl-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line-strong);
}

.cl-group__title {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cl-group__count {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.cl-group__count .icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.4;
}

.cl-group.is-done .cl-group__count {
  color: var(--ok);
}

.cl-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cl-item {
  position: relative;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.cl-item:last-child {
  border-bottom: 0;
}

/* The real checkbox: invisible, but focusable and in the accessibility tree. It is 44 px square and sits
   over the drawn box, which is .cl-mark. */
.cl-box {
  position: absolute;
  top: 0.225rem;
  left: -0.525rem;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  opacity: 0;
}

.cl-label {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  align-items: start;
  gap: 0.85rem;
  padding: 0.85rem 0.1rem 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* The label stretches over the whole item, so the whole row is the tap target. Links sit above it. */
.cl-label::after {
  position: absolute;
  inset: 0;
  content: "";
}

.cl-mark {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--text-dim);
  border-radius: 0.45rem;
  background: var(--surface-sunken);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}

/* The check mark is drawn with borders: it is a shape, not only a colour, and it also prints. */
.cl-mark::after {
  position: absolute;
  top: 43%;
  left: 50%;
  width: 0.4rem;
  height: 0.78rem;
  border: solid var(--ink-950);
  border-width: 0 0.19rem 0.19rem 0;
  content: "";
  opacity: 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0.6);
  transition: opacity 120ms ease, transform 180ms var(--ease-out);
}

.cl-box:checked + .cl-label .cl-mark {
  border-color: var(--accent);
  background: var(--accent);
}

.cl-box:checked + .cl-label .cl-mark::after {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

.cl-box:focus-visible + .cl-label .cl-mark {
  outline: 3px solid var(--yellow-500);
  outline-offset: 3px;
}

.cl-label:active .cl-mark {
  transform: scale(0.92);
}

@media (hover: hover) {
  .cl-label:hover .cl-mark {
    border-color: var(--text);
  }

  .cl-box:checked + .cl-label:hover .cl-mark {
    border-color: var(--accent);
  }
}

.cl-text {
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* A ticked row says so with the check mark and a line through the action, not with colour alone. */
.cl-box:checked + .cl-label .cl-text {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.cl-why {
  margin: 0.3rem 0.1rem 0 2.45rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.cl-box:checked ~ .cl-why {
  color: var(--text-dim);
}

.cl-link {
  position: relative;
  z-index: 1;
  display: block;
  width: fit-content;
  max-width: calc(100% - 2.45rem);
  margin: 0.05rem 0 -0.5rem 2.45rem;
  padding-block: 0.85rem;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.cl-link > span {
  text-decoration: underline;
  text-decoration-color: rgb(var(--accent-rgb) / 0.75);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.cl-link .icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.4rem;
  color: var(--accent);
  vertical-align: -0.2em;
  transition: transform 220ms var(--ease-out);
}

.cl-link:hover > span {
  color: var(--accent);
}

.cl-link:hover .icon {
  transform: translateX(3px);
}

@media (min-width: 40rem) {
  .cl-label {
    gap: 1rem;
  }

  .cl-why,
  .cl-link {
    margin-left: 2.6rem;
  }

  .cl-link {
    max-width: calc(100% - 2.6rem);
  }

  .cl-why {
    font-size: 0.93rem;
  }
}

/* ───────────────────────── 05 Toolbar, confirm row, "Allt klart" ───────────────────────── */

.cl-alldone {
  margin-top: 0.25rem;
}

.cl-tools {
  display: grid;
  gap: 0.85rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.cl-confirm {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgb(var(--warn-rgb) / 0.5);
  border-radius: var(--radius-md);
  background: rgb(var(--warn-rgb) / 0.08);
}

.cl-confirm p {
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
}

.cl-confirm:focus-visible {
  outline-offset: 2px;
}

/* ───────────────────────── 06 Side column (desktop) ───────────────────────── */

.cl-outline {
  display: grid;
  padding: 1rem 1.15rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
}

.cl-outline__title {
  margin: 0 0 0.35rem;
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cl-outline__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cl-outline a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  min-height: 2.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.cl-outline li:first-child a {
  border-top: 0;
}

.cl-outline a:hover .cl-outline__name {
  color: var(--accent);
}

.cl-outline__n {
  flex: none;
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

@media (min-width: 64rem) {
  .cl-side .art {
    height: 11rem;
  }
}

/* The side column follows the reader down a long list, when the window is tall enough to hold it. */
@media (min-width: 64rem) and (min-height: 42rem) {
  .cl-side {
    position: sticky;
    top: 6.5rem;
  }
}

/* ───────────────────────── 07 Print ───────────────────────── */

/* The shared print rules in verktyg.css put ink on white and hide the header, footer, tabs, buttons, side column
   and chat. This is what a checklist needs on top: the list only, with an empty or ticked box and the reason
   for every item, and no item split across two pages. */
@media print {
  .eyebrow,
  .assure,
  .cl-note,
  .cl-bar,
  .cl-tools,
  .cl-alldone,
  .cl-box,
  main > .section,
  main > .page-end,
  noscript {
    display: none !important;
  }

  .tool-hero,
  .tool-hero__copy {
    display: block;
    padding: 0;
  }

  .tool-hero h1 {
    max-width: none;
    margin: 0 0 2mm;
    font-size: 20pt;
    letter-spacing: 0;
    line-height: 1.15;
  }

  .tool-hero .accent {
    color: #000;
  }

  .tool-hero .lead {
    max-width: none;
    margin-bottom: 3mm;
    color: var(--text-soft);
    font-size: 10.5pt;
  }

  .cl-print {
    margin: 0 0 4mm;
    font-size: 9.5pt;
    font-weight: 700;
  }

  /* The panel is a card, and cards stay in one piece: this one holds the whole list. */
  .cl-panel {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    break-inside: auto;
  }

  .cl-head {
    margin-bottom: 5mm;
  }

  .cl-progress__line,
  .cl-progress__line b {
    color: #000;
    font-size: 10.5pt;
  }

  .cl-progress__line .badge {
    display: none;
  }

  .cl-groups {
    display: block;
  }

  .cl-group {
    display: block;
    margin-bottom: 5mm;
  }

  .cl-group__head {
    padding-bottom: 1.5mm;
    border-bottom: 1pt solid #000;
    break-after: avoid;
  }

  .cl-group__title {
    font-size: 12.5pt;
  }

  .cl-group__count {
    color: #000;
  }

  .cl-group__count .icon {
    display: none;
  }

  .cl-item {
    padding-bottom: 2.5mm;
    border-bottom: 0.5pt solid #bbb;
    break-inside: avoid;
  }

  .cl-label {
    grid-template-columns: 5mm minmax(0, 1fr);
    gap: 3mm;
    padding-top: 2.5mm;
  }

  .cl-label::after {
    display: none;
  }

  .cl-mark,
  .cl-box:checked + .cl-label .cl-mark {
    width: 4.8mm;
    height: 4.8mm;
    border: 1.3pt solid #000;
    border-radius: 1mm;
    background: #fff !important;
  }

  .cl-mark::after {
    border-color: #000;
    border-width: 0 1.7pt 1.7pt 0;
  }

  .cl-text,
  .cl-box:checked + .cl-label .cl-text {
    color: #000;
    text-decoration: none;
  }

  .cl-why,
  .cl-box:checked ~ .cl-why {
    margin-left: 8mm;
    color: var(--text-soft);
    font-size: 10pt;
  }

  .cl-why .sr-only {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    font-weight: 700;
    white-space: normal;
  }

  .cl-link {
    max-width: none;
    margin: 1mm 0 0 8mm;
    padding-block: 0;
    font-size: 9.5pt;
  }

  .cl-link > span {
    text-decoration: underline;
  }

  .cl-link .icon {
    display: none;
  }

  /* On paper a link is only useful with its address. */
  .cl-link::after {
    content: " (yourweb.se" attr(href) ")";
    font-weight: 500;
  }
}
