/* ==========================================================================
   components.css – das Comic-Baukasten-System von canbanis
   Panels · Flächen · Headlines · Buttons · Sprechblasen · Bursts · Sticker
   Board-Karten · Feature-/Schritt-Panels · FAQ-Blasen · Kopf · Fuss

   Kontrast-Regeln (WCAG AA, gerechnet):
   - Fliesstext immer --ink auf hellen Flächen (paper, white, sun, hemp,
     orange, pink, sky) oder --paper auf --ink.
   - Kein kleiner Text auf --purple (4.46:1), nur Icons.
   - Grosse Headlines: Füllfarbe je Fläche über --display-fill, siehe .surface-*.
   ========================================================================== */

/* ---- Panel ------------------------------------------------------------- */
.panel {
  position: relative;
  border: var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--drop);
  padding: clamp(20px, 3vw, 32px);
  background: #fff;
  color: var(--ink);
  --display-fill: var(--hemp-dark);
  --focus-color: var(--ink);
}

/* ---- Flächen ----------------------------------------------------------- */
/* Steht nach .panel, damit eine Fläche das Weiss des Panels ersetzt.
   Jede Fläche setzt Hintergrund, Schriftfarbe und die Headline-Farbe. */
.surface-paper  { background: var(--paper);  color: var(--ink); --display-fill: var(--hemp-dark); }
.surface-white  { background: #fff;          color: var(--ink); --display-fill: var(--hemp-dark); }
.surface-sun    { background: var(--sun);    color: var(--ink); --display-fill: var(--hemp-dark); }
.surface-hemp   { background: var(--hemp);   color: var(--ink); --display-fill: #fff; }
.surface-orange { background: var(--orange); color: var(--ink); --display-fill: var(--ink); --display-shadow: #fff; }
.surface-pink   { background: var(--pink);   color: var(--ink); --display-fill: var(--ink); --display-shadow: #fff; }
.surface-sky    { background: var(--sky);    color: var(--ink); --display-fill: var(--ink); --display-shadow: #fff; }
.surface-ink    { background: var(--ink);    color: var(--paper); --display-fill: var(--sun); --focus-color: var(--sun); }

/* Vollbreite Bänder zwischen den Panels (z. B. Problem-Sequenz, So geht's) */
.band {
  border-block: var(--line-strong);
}
.panel--lg   { box-shadow: var(--drop-lg); padding: clamp(28px, 5vw, 56px); }
.panel--flat { box-shadow: none; }
.panel--clip { overflow: hidden; }
/* leicht schräg: eigene rotate-Eigenschaft, damit Animationen (transform)
   die Schräge nicht überschreiben */
.panel--tilt-l { rotate: -1.2deg; }
.panel--tilt-r { rotate: 1.2deg; }

/* Panel-Raster mit unterschiedlich breiten Panels (Comic-Seite) */
.comic-grid {
  display: grid;
  gap: clamp(20px, 3vw, 28px);
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
}
.comic-grid--uneven { grid-template-columns: 5fr 4fr 6fr; }
.comic-grid > .span-2 { grid-column: span 2; }

@media (max-width: 960px) {
  .comic-grid,
  .comic-grid--uneven { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comic-grid--uneven > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .comic-grid,
  .comic-grid--uneven { grid-template-columns: minmax(0, 1fr); }
  .comic-grid > .span-2,
  .comic-grid--uneven > :last-child { grid-column: auto; }
  .panel--tilt-l, .panel--tilt-r { rotate: none; }
}

/* ---- Headlines --------------------------------------------------------- */
.display {
  font-size: var(--fs-display);
  line-height: .98;
  color: var(--display-fill, var(--hemp-dark));
}
/* Comic-Headline: Füllung + schwarzer Umriss + harter Versatzschatten */
.display--pop,
.h-pop {
  color: var(--display-fill, var(--hemp-dark));
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--display-shadow, var(--ink));
}
.display--pop { -webkit-text-stroke-width: 3px; text-shadow: 6px 6px 0 var(--display-shadow, var(--ink)); }
/* Ink-Füllung braucht keinen Umriss */
.surface-orange .h-pop, .surface-orange .display--pop,
.surface-pink .h-pop,   .surface-sky .h-pop { -webkit-text-stroke: 0; }

.display--slant { display: inline-block; rotate: -2deg; }
.accent        { color: var(--hemp-dark); }
.surface-ink .accent { color: var(--hemp-light); }

.lead {
  font-size: var(--fs-lead);
  font-weight: 700;
  max-width: 34ch;
}

/* Lautmalerei als Text (z. B. «1 · UFF.»): schwarze Schrift, farbiger
   Versatzschatten. Pink/Himmelblau als Schriftfarbe hätten zu wenig Kontrast. */
.bang {
  font-family: var(--font-burst);
  font-size: var(--fs-bang);
  letter-spacing: .04em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--bang-color, var(--sun));
}

/* ---- Buttons ----------------------------------------------------------- */
/* Gesicht und Schatten sind Pseudo-Elemente: Hover und Klick bewegen nur
   transform (der Schatten bleibt stehen, der Knopf rutscht hinein). */
.btn {
  --btn-bg: var(--sun);
  --btn-fg: var(--ink);
  --btn-off: 6px;
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: 14px 26px;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
  color: var(--btn-fg);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 12px;
  transition: transform var(--t-press) ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn::before,
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transition: transform var(--t-press) ease-out;
}
.btn::before {                       /* Schatten */
  z-index: -2;
  background: var(--ink);
  transform: translate(var(--btn-off), var(--btn-off));
}
.btn::after {                        /* Gesicht */
  z-index: -1;
  background: var(--btn-bg);
  border: var(--line-strong);
}
.btn:hover { color: var(--btn-fg); transform: translate(-2px, -2px); }
.btn:hover::before { transform: translate(calc(var(--btn-off) + 2px), calc(var(--btn-off) + 2px)); }
.btn:active { transform: translate(var(--btn-off), var(--btn-off)); }
.btn:active::before { transform: translate(0, 0); }
.btn:focus-visible { outline-offset: calc(var(--btn-off) + 4px); }

.btn--hemp  { --btn-bg: var(--hemp); }
.btn--white { --btn-bg: #fff; }
.btn--lg    { font-size: 22px; padding: 18px 32px; }
.btn--sm    { font-size: 17px; padding: 10px 18px; min-height: 44px; --btn-off: 4px; }
.btn--sm::after { border-width: 3px; }

/* Textlink mit Pfeil (sekundäre Aktion) */
.link-arrow {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* ---- Sprechblase ------------------------------------------------------- */
/* Schwanz aus zwei Dreiecken: schwarz (Umriss) + weiss (Füllung).
   Position über --tail-x; Richtung über Modifier. */
.bubble {
  --bubble-bg: #fff;
  --tail-x: 40px;
  position: relative;
  display: inline-block;
  max-width: 100%;
  background: var(--bubble-bg);
  border: var(--line-strong);
  border-radius: 28px;
  padding: 14px 24px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
  box-shadow: var(--drop-sm);
}
.bubble::before,
.bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tail-x);
  clip-path: polygon(0 0, 100% 0, 12% 100%);
}
.bubble::before { width: 34px; height: 30px; background: var(--ink); margin-top: 0; }
.bubble::after  { width: 22px; height: 19px; background: var(--bubble-bg); margin-top: -5px; margin-left: 5px; }

.bubble--right::before,
.bubble--right::after { left: auto; right: var(--tail-x); transform: scaleX(-1); }
.bubble--right::after { margin-left: 0; margin-right: 5px; }

/* Schwanz nach links (zeigt auf eine Figur links daneben) */
.bubble--left::before,
.bubble--left::after { top: auto; bottom: 18px; left: auto; right: 100%; clip-path: polygon(100% 0, 100% 100%, 0 30%); }
.bubble--left::before { width: 30px; height: 30px; }
.bubble--left::after  { width: 22px; height: 20px; margin: 0 -5px 5px 0; }

.bubble--round { border-radius: 50%; padding: 22px 32px; text-align: center; }
.bubble--sun   { --bubble-bg: var(--sun); }
.bubble--text  { font-family: var(--font-body); font-size: var(--fs-body); font-weight: 700; line-height: 1.5; }

/* ---- Burst (Lautmalerei-Bild) & Sticker ------------------------------ */
.burst {
  position: absolute;
  width: clamp(110px, 13vw, 170px);
  height: auto;
  pointer-events: none;
  rotate: var(--burst-rotate, -8deg);
}
.sticker {
  display: inline-block;
  align-self: flex-start;
  background: #fff;
  border: var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 8px 22px;
  font-family: var(--font-burst);
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: .06em;
  line-height: 1.1;
  rotate: -3deg;
}

/* ---- Maskottchen ------------------------------------------------------- */
.mascot { width: 100%; height: auto; }

/* ---- Board-Ausschnitt (HTML/CSS, kein Screenshot) --------------------- */
/* Kein seitliches Scrollen: drei Spalten teilen sich die Breite,
   unter 640 px stehen sie untereinander (je eine Karte). */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--drop);
}
@media (max-width: 640px) {
  .board { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
  .board__col .task + .task { display: none; }
}
.board__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--paper);
  border: var(--line);
  border-radius: 12px;
}
.board__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-display);
  font-size: 19px;
}
.board__count {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0 9px;
}
.task {
  --task-color: var(--sun);
  background: #fff;
  border: 2.5px solid var(--ink);
  border-left: 12px solid var(--task-color);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--drop-sm);
}
.task__title { font-weight: 800; font-size: 16px; line-height: 1.3; }
.task__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
}
.task--done { opacity: .8; }
.task--done .task__title { text-decoration: line-through; }
.task--tilt { rotate: -2deg; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--avatar, var(--sky));
  font-size: 12px;
  font-weight: 800;
}
.subtasks { display: inline-flex; align-items: center; gap: 6px; }
.subtasks::before {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: linear-gradient(var(--hemp), var(--hemp)) left / var(--done, 0%) 100% no-repeat, #fff;
}

/* Task-Farben (wie die App) */
.c-sun    { --task-color: var(--sun);    --avatar: var(--sun); }
.c-orange { --task-color: var(--orange); --avatar: var(--orange); }
.c-pink   { --task-color: var(--pink);   --avatar: var(--pink); }
.c-purple { --task-color: var(--purple); --avatar: var(--purple); }
.c-sky    { --task-color: var(--sky);    --avatar: var(--sky); }
.c-hemp   { --task-color: var(--hemp);   --avatar: var(--hemp); }

/* ---- Feature-Panel ----------------------------------------------------- */
.feature {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.feature__icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border: var(--line);
  border-radius: 14px;
  background: var(--icon-bg, var(--sun));
  box-shadow: var(--drop-sm);
}
.feature__icon img { width: 36px; height: 36px; }

/* ---- Schritt-Panel (nummeriert) --------------------------------------- */
.step {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.step__num {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin-bottom: var(--s-2);
  border: var(--line);
  border-radius: 50%;
  background: var(--sun);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  box-shadow: var(--drop-sm);
}

/* ---- FAQ als aufklappbare Sprechblasen -------------------------------- */
.faq { display: flex; flex-direction: column; gap: var(--s-5); }
.faq__item {
  background: #fff;
  border: var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--drop);
}
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 18px 24px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  border-radius: 20px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: var(--line);
  border-radius: 50%;
  background: var(--sun);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  transition: transform .2s var(--ease-out);
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__answer {
  position: relative;
  margin: 0 24px 22px;
  padding: 14px 18px;
  background: var(--paper);
  border: var(--line);
  border-radius: 18px;
}

/* ---- Kopf -------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: var(--line-strong);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: var(--header-h);
}
.site-header__logo { display: block; flex: none; line-height: 0; }
.site-header__logo img { height: 48px; width: auto; }
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
  font-weight: 800;
}
.site-nav__links { display: flex; gap: inherit; list-style: none; padding: 0; margin: 0; }
.site-nav__links a { text-decoration: none; padding: 6px 2px; }
.site-nav__links a:hover { text-decoration: underline; }
.site-nav__actions { display: flex; align-items: center; gap: var(--s-4); }

.burger {
  display: none;
  position: relative;
  width: 52px; height: 48px;
  border: var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--drop-sm);
}
.burger__bars,
.burger__bars::before,
.burger__bars::after {
  position: absolute;
  left: 50%;
  width: 24px; height: 3px;
  margin-left: -12px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s var(--ease-out), opacity .2s;
}
.burger__bars { top: 50%; margin-top: -1.5px; }
.burger__bars::before, .burger__bars::after { content: ""; left: 0; margin-left: 0; }
.burger__bars::before { transform: translateY(-8px); }
.burger__bars::after  { transform: translateY(8px); }
.burger[aria-expanded="true"] .burger__bars { transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger__bars::before { opacity: 0; }
.burger[aria-expanded="true"] .burger__bars::after  { transform: rotate(-90deg); }

@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .site-header__logo img { height: 40px; }
  .burger { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-5);
    padding: var(--s-5) var(--gutter) var(--s-6);
    background: var(--paper);
    border-bottom: var(--line-strong);
    font-size: 20px;
    /* zu: unsichtbar, nicht fokussierbar */
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    transition: opacity .2s, transform .2s var(--ease-out), visibility 0s .2s;
  }
  .site-header[data-nav="open"] .site-nav {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: opacity .2s, transform .2s var(--ease-out);
  }
  .site-nav__links { flex-direction: column; gap: var(--s-3); }
  .site-nav__actions { flex-direction: column; align-items: stretch; gap: var(--s-5); }
}
/* ohne JavaScript: Menü bleibt offen sichtbar */
@media (max-width: 900px) and (scripting: none) {
  /* das offene Menü wäre fixiert zu hoch: der Kopf scrollt hier mit */
  .site-header { position: static; }
  [data-include="nav"] { min-height: 0; }
  .burger { display: none; }
  .site-nav { position: static; flex-basis: 100%; padding-inline: 0; border-bottom: 0; opacity: 1; transform: none; visibility: visible; }
  .site-header__inner { flex-wrap: wrap; }
}

/* ---- Fuss -------------------------------------------------------------- */
.site-footer { padding-block: var(--s-7); font-size: var(--fs-small); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}
.site-footer__logo img { height: 36px; width: auto; }
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  list-style: none;
  padding: 0;
}
.site-footer__links a { padding: 4px 0; }
.site-footer__meta { flex-basis: 100%; font-size: 16px; }

/* ---- Bewegung ---------------------------------------------------------- */
/* Nur transform und opacity. Aktiv nur mit html.motion: das setzt das
   Inline-Script im <head>, wenn JS läuft, die Seite nicht im Edit-/Feedback-
   Modus ist und keine reduzierte Bewegung gewünscht wird. Ohne die Klasse
   ist alles sofort sichtbar und statisch. */
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(.96); }
  55%  { opacity: 1; transform: scale(1.012) rotate(-.8deg); }
  78%  { transform: scale(.998) rotate(.45deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes bubble-in {
  0%   { opacity: 0; transform: scale(.4); }
  60%  { opacity: 1; transform: scale(1.08); }
  80%  { transform: scale(.97); }
  100% { opacity: 1; transform: none; }
}
@keyframes burst-in {
  0%   { opacity: 0; transform: scale(.2) rotate(-25deg); }
  65%  { opacity: 1; transform: scale(1.15) rotate(6deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-10px) rotate(-1.5deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .motion [data-pop]:not(.is-in) { opacity: 0; }
  .motion [data-pop].is-in {
    animation: pop-in var(--t-pop) var(--ease-out) both;
    animation-delay: var(--pop-delay, 0s);
  }
  .motion [data-pop="bubble"].is-in { animation-name: bubble-in; animation-duration: .45s; transform-origin: 30% 100%; }
  .motion [data-pop="burst"].is-in  { animation-name: burst-in;  animation-duration: .45s; }
  .motion .bob { animation: bob 3.4s ease-in-out infinite; }
}
