/* Tool-Katalog (tools.html): Seitenkopf mit Suche und grossem Knopf, Kategorie-Knöpfe, Raster.
   Die Kacheln selbst stehen in cards.css. */

/* ---------- Seitenkopf ---------- */
.cat-head { position: relative; padding: 52px 0 62px; overflow: hidden; }
.cat-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.cat-head h1 { font-size: clamp(40px, 6.2vw, 76px); line-height: 1; letter-spacing: -.025em; text-wrap: balance; }
.cat-head h1 em { font-style: normal; color: var(--coral); }
.cat-head-copy > p { max-width: 560px; }
/* Schichtlinien als Abschluss der Fläche */
.cat-head-layers { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; }

/* Suchfeld: sitzt wie ein Knopf auf einer Kante und drückt sich ein, sobald man tippt */
.search-box { position: relative; max-width: 560px; margin-top: 28px; transition: transform .09s ease; }
.search-box:focus-within { transform: translateY(2px); }
.search-icon { position: absolute; left: 20px; top: 50%; margin-top: -11px; color: var(--ink-2); pointer-events: none; }
.search-box:focus-within .search-icon { color: var(--blue); }
.search {
  display: block; width: 100%; height: 58px; padding: 0 60px 0 54px; border: 0; border-radius: 18px;
  background: var(--card); font-size: 17px; -webkit-appearance: none; appearance: none;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 5px 0 var(--line-2);
  transition: box-shadow .09s ease;
}
.search::placeholder { color: #747884; opacity: 1; }
.search::-webkit-search-cancel-button, .search::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search:focus, .search:focus-visible { outline: none; border-radius: 18px; box-shadow: inset 0 0 0 2.5px var(--blue), 0 3px 0 var(--blue-d); }
.search-key, .search-clear { position: absolute; right: 16px; top: 50%; margin-top: -14px; width: 28px; height: 28px; display: grid; place-items: center; }
.search-key {
  border-radius: 8px; background: var(--paper); color: var(--ink-2);
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 2px 0 var(--line-2); pointer-events: none;
}
.search-clear { border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink); cursor: pointer; }
.search-clear:hover { background: var(--ink); color: #fff; }
.search-key[hidden], .search-clear[hidden] { display: none; }
@media (hover: none) { .search-key { display: none; } }
@media (max-width: 620px) {
  .search { height: 54px; padding: 0 48px 0 48px; font-size: 16px; border-radius: 16px; }
  .search:focus, .search:focus-visible { border-radius: 16px; }
  .search-icon { left: 16px; }
  .search-key { display: none; }
  .search-key, .search-clear { right: 12px; }
}

/* Der grosse Knopf rechts: drücken öffnet ein zufälliges Tool */
.lucky { display: grid; justify-items: center; gap: 8px; padding: 0 8px; text-align: center; -webkit-tap-highlight-color: transparent; }
.lucky:focus-visible { border-radius: 28px; outline-offset: 8px; }
.lucky-btn { width: clamp(180px, 19vw, 236px); height: auto; overflow: visible; }
.lucky-top { transition: transform .12s ease; }
.lucky-shadow { fill: rgba(22, 24, 31, .12); transform-origin: 120px 246px; transition: transform .12s ease; }
.lucky:hover .lucky-top { transform: translateY(5px); }
.lucky:active .lucky-top { transform: translateY(21px); transition-duration: .05s; }
.lucky:active .lucky-shadow { transform: scale(.94); }
.lucky-label b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.25; }
.lucky-label small { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 900px) {
  .cat-head { padding: 40px 0 52px; }
  .cat-head-grid { grid-template-columns: minmax(0, 1fr); }
  .lucky { display: none; }
}

/* ---------- Filterzeile ---------- */
.catalog { padding-top: 30px; }
.cat-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.cats { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 4px; min-width: 0; }
/* Kategorie-Knopf: die gewählte Kategorie bleibt eingedrückt */
.cat-chip {
  flex: none; display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 7px 0 16px;
  border: 0; border-radius: var(--r-full); background: var(--card); color: var(--ink); cursor: pointer;
  font-family: var(--font-display); font-weight: 500; font-size: 15.5px; white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 var(--line-2);
  transition: transform .09s ease, box-shadow .09s ease, background .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.cat-chip small {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--paper-2); color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.cat-chip:hover { transform: translateY(1px); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 2px 0 var(--line-2); }
.cat-chip:active, .cat-chip[aria-pressed="true"] { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 0 var(--line-2); }
.cat-chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 var(--ink); }
.cat-chip[aria-pressed="true"] small { background: var(--sun); color: var(--pill-ink); }
.cat-chip:focus-visible { border-radius: var(--r-full); }

.count-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; min-height: 32px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em; color: var(--ink-2); }
.count-line b { font-weight: 600; color: var(--ink); }
.reset { border: 0; background: none; padding: 4px 0; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--blue); }
.reset:hover { text-decoration: underline; text-underline-offset: 3px; }
.reset[hidden] { display: none; }

/* Auf dem Handy: Kategorien in einer Zeile zum Wischen, die Seite selbst scrollt nie seitlich */
@media (max-width: 720px) {
  .catalog { padding-top: 22px; }
  .cat-bar { gap: 6px; margin-bottom: 18px; }
  .cats {
    flex-wrap: nowrap; align-self: stretch; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 8px; scroll-padding: 0 var(--pad);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .cats::-webkit-scrollbar { display: none; }
  .cat-chip { scroll-snap-align: start; }
}

/* ---------- Raster: Trenner, Rechner-Kachel, leerer Zustand ---------- */
.grid-divider {
  grid-column: 1 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 22px; padding-top: 30px; border-top: 2px dashed var(--line-2);
}
.grid-divider.first { margin-top: 0; padding-top: 0; border-top: 0; }
.grid-divider h2 { font-size: 30px; }
.grid-divider p { color: var(--ink-2); font-size: 15.5px; }

/* Kachel zum Kostenrechner: dunkel wie die Fusszeile, mit Sonne als einziger Farbe */
.promo-tile {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-width: 0;
  padding: 26px 24px 26px; border-radius: var(--r-card); background: var(--ink); color: #fff;
  box-shadow: 0 5px 0 #000;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.promo-tile:hover { transform: translateY(-4px); box-shadow: 0 9px 0 #000, 0 28px 36px -14px rgba(22, 24, 31, .4); }
.promo-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; transition-duration: .06s; }
.promo-tile:focus-visible { border-radius: var(--r-card); outline-offset: 4px; }
.promo-tile .eyebrow { color: var(--sun); }
.promo-tile .eyebrow::before {
  background-image: radial-gradient(circle at 34% 50%, var(--ink) 1.4px, transparent 1.9px), radial-gradient(circle at 66% 50%, var(--ink) 1.4px, transparent 1.9px);
}
.promo-tile h3 { margin-top: 16px; font-size: clamp(28px, 2.8vw, 34px); line-height: 1.05; letter-spacing: -.02em; text-wrap: balance; }
.promo-tile p { margin-top: 14px; color: #C3C7D1; font-size: 15.5px; line-height: 1.5; }
/* Die Rechnung als Kassenzettel: Posten untereinander, unten das Ergebnis */
.promo-sum {
  margin-top: auto; padding-top: 22px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75; letter-spacing: .02em; color: #AEB3BF;
}
.promo-sum b { display: block; margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed rgba(255, 255, 255, .28); font-weight: 600; color: var(--sun); }
.promo-tile .btn { margin-top: 22px; align-self: flex-start; }
.promo-tile .btn svg { transition: transform .25s var(--ease); }
.promo-tile:hover .btn { transform: translateY(1px); box-shadow: inset 0 0 0 1.5px var(--btn-edge), 0 calc(var(--press) - 1px) 0 var(--btn-shade); }
.promo-tile:hover .btn svg { transform: translateX(2px); }
.promo-tile:active .btn { transform: translateY(var(--press)); box-shadow: inset 0 0 0 1.5px var(--btn-edge), 0 0 0 var(--btn-shade); }
/* Schichtlinien in Sonne, oben rechts wie ein angeschnittener Druck */
.promo-layers {
  position: absolute; z-index: -1; right: -84px; top: -96px; width: 220px; height: 220px; border-radius: 50%;
  background: repeating-linear-gradient(to bottom, var(--sun) 0 2px, transparent 2px 8px); opacity: .5;
}

.empty {
  grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 44px 24px 52px; border: 2px dashed var(--line-2); border-radius: var(--r-xl); color: var(--ink-3);
}
.empty h2 { margin-top: 8px; font-size: clamp(26px, 3.4vw, 34px); color: var(--ink); }
.empty p { max-width: 420px; color: var(--ink-2); }
.empty .btn { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .search-box:focus-within, .lucky:hover .lucky-top, .cat-chip:hover, .promo-tile:hover, .promo-tile:active { transform: none; }
}
