/* weihnachten-ausmalbilder.de
   Idee: Die Seite ist ein Basteltisch. Weißes Druckerpapier liegt auf
   einer schneeblauen Tischplatte, alle Motive haben echte Ausmal-Konturen,
   und Farbe kommt nur von den Wachsmalstiften. */

:root {
  --table: #E4EDF5;      /* Tischplatte, kühles Schneeblau */
  --paper: #FFFFFF;      /* Druckerpapier */
  --ink: #000000;        /* Kontur wie auf der gedruckten Vorlage */
  --text: #24313F;       /* Fließtext, Schieferblau */
  --muted: #566577;
  --red: #C8102E;        /* Kerzenrot, Hauptaktion */
  --green: #2E8B57;      /* Tannengrün */
  --focus: #1F6FD1;

  --display: "Grandstander", "Comic Sans MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.25rem, 4.6vw, 3.75rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  background: var(--table);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h2 { font-size: var(--step-2); line-height: 1.15; }
h3 { font-size: var(--step-1); line-height: 1.2; font-weight: 600; }

a { color: inherit; }

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

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

/* ---------- Header ---------- */

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.05;
  color: var(--ink);
}
.wordmark-star { width: 2.2rem; height: 2.2rem; flex: none; }
.wordmark-star polygon {
  fill: #F7C548; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round;
}

.site-header nav { display: flex; gap: clamp(0.75rem, 2.5vw, 2rem); }
.site-header nav a {
  text-decoration: none;
  font-weight: 700;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover { border-bottom-color: var(--ink); }

/* ---------- Ausmal-Konturen ---------- */

.motif { display: block; width: 100%; height: auto; }
.motif :is(path, rect, circle, ellipse, polygon) {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.motif .line { fill: none; }
.motif .ink { fill: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem) var(--gutter) clamp(3rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: var(--step-3);
  line-height: 1.04;
  hyphens: manual;
  max-width: 11ch;
}
.lead {
  font-size: var(--step-1);
  line-height: 1.45;
  margin: 1.25rem 0 0;
  max-width: 34ch;
}
.hint {
  color: var(--muted);
  margin: 1rem 0 1.75rem;
  max-width: 38ch;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 var(--step-0)/1.2 var(--body);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.button-solid { background: var(--red); border-color: var(--red); color: #fff; }
.button-solid:hover { background: #A50D26; border-color: #A50D26; }
.button-quiet { background: transparent; color: var(--ink); }
.button-quiet:hover { background: var(--paper); }

/* Das Blatt, auf dem gemalt wird */
.studio { position: relative; }

.paper {
  background: var(--paper);
  padding: clamp(1rem, 3vw, 2rem);
  transform: rotate(-1.2deg);
  box-shadow: 0 1px 0 #C9D6E2, 0 18px 30px -18px rgba(36, 60, 90, 0.45);
}
#canvas :is(path, rect, circle, ellipse, polygon):not(.line):not(.ink) {
  cursor: pointer;
  transition: fill 180ms ease-out;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-top: 1.75rem;
}

/* Wachsmalstifte, die aus ihrer Schachtel ragen */
.crayons {
  display: flex;
  gap: 0.4rem;
  height: 6rem;
  padding: 0 0.75rem;
  overflow: hidden;
  border-bottom: 1.1rem solid var(--green);
  border-radius: 0 0 6px 6px;
}
.crayon {
  width: 2.1rem;
  height: 7.5rem;
  margin-top: 1.6rem;
  padding: 0;
  border: 0;
  cursor: pointer;
  background:
    linear-gradient(to bottom,
      transparent 0 28%,
      rgba(0, 0, 0, 0.22) 28% 31%,
      transparent 31% 56%,
      rgba(0, 0, 0, 0.22) 56% 59%,
      transparent 59%),
    var(--c);
  clip-path: polygon(32% 0, 68% 0, 100% 20%, 100% 100%, 0 100%, 0 20%);
  transition: transform 160ms ease-out;
}
.crayon:hover { transform: translateY(-0.35rem); }
.crayon[aria-pressed="true"] { transform: translateY(-1.35rem); }
.crayon:focus-visible { outline-offset: -3px; }

.eraser {
  --c: #F7DCE3;
  background: linear-gradient(to bottom, #F7DCE3 0 45%, #5C8FC9 45%);
  clip-path: none;
  border-radius: 5px 5px 0 0;
  width: 2.6rem;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.toolbar-actions .button { padding: 0.55rem 1rem; font-size: var(--step--1); }

/* ---------- Motive ---------- */

.gallery {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 6rem);
}

.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font: 700 var(--step--1)/1 var(--body);
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { background: var(--paper); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.sheets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
}

/* Jede Karte ist ein ausgedrucktes Blatt auf einem kleinen Stapel */
.sheet {
  background: var(--paper);
  padding: 1.25rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  box-shadow:
    5px 5px 0 -1px var(--paper),
    5px 5px 0 0 #B9C9D8;
}
.sheet[hidden] { display: none; }
.sheet .motif {
  aspect-ratio: 1;
  padding: 0.5rem;
  margin-bottom: 1rem;
}
.age { margin: 0.15rem 0 1rem; color: var(--muted); font-size: var(--step--1); }
.sheet-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.sheet-actions .button { padding: 0.55rem 1.4rem; }
.text-action {
  font: 700 var(--step--1)/1.3 var(--body);
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0.25rem 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-action:hover { text-decoration-color: var(--red); }

/* ---------- So geht's ---------- */

.steps, .faq {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 5.5rem);
}
.steps h2, .faq h2 { margin-bottom: 1.5rem; }

.steps ol {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem 2.5rem;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 3.75rem;
  max-width: 34ch;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  font: 800 1.5rem/1 var(--display);
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
}
.steps strong { display: block; color: var(--ink); font-size: var(--step-1); font-family: var(--display); font-weight: 600; margin-bottom: 0.25rem; }

/* ---------- Fragen ---------- */

.faq details {
  max-width: 44rem;
  border-top: 2px solid var(--ink);
}
.faq details:last-of-type { border-bottom: 2px solid var(--ink); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 2.5rem 1rem 0;
  position: relative;
  font-weight: 700;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  translate: 0 -50%;
  font: 800 1.5rem/1 var(--display);
  transition: rotate 160ms ease-out;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0 0 1.25rem; max-width: 60ch; }

/* ---------- Footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.5rem; }

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
}
@media (max-width: 30rem) {
  .site-header { flex-wrap: wrap; }
  .site-header nav { width: 100%; gap: 1.25rem; font-size: var(--step--1); }
  .sheets { grid-template-columns: 1fr 1fr; gap: 1.25rem 0.9rem; }
  .sheet { padding: 0.75rem 0.75rem 1rem; }
  .sheet h3 { font-size: 1.05rem; }
  .sheet-actions .button { width: 100%; padding: 0.5rem 0.75rem; }
  .crayon { width: 1.7rem; }
  .eraser { width: 2.1rem; }
}

/* ---------- Druck: nur das gewählte Motiv, A4 hochkant ---------- */

#print-sheet { display: none; }

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; }
  body > :not(#print-sheet) { display: none !important; }
  #print-sheet {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    height: 270mm;
  }
  #print-sheet .motif { width: 100%; max-height: 250mm; }
  #print-sheet .motif :is(path, rect, circle, ellipse, polygon) { stroke-width: 4; }
  #print-sheet p {
    margin: 0;
    text-align: right;
    font: 600 10pt var(--display);
    color: #000;
  }
}
