/*
 * tour-preview -- eine Tour in der Übersicht unter /touren. Entwurf:
 * `claude_design/tours-trail-1.html`, vom User am 26. Oktober 2026 angenommen.
 *
 * Eigener Block und nicht `card`: Die Karte trägt keinen Knopf, sondern ist als
 * Ganzes der Verweis zur Tour, und sie zeigt Kennzahlen statt eines Fließtextes.
 *
 * Eine Tour je Zeile, auch am Desktop -- drei Karten nebeneinander und Kennzahlen in
 * drei Spalten hat der User verworfen, lange Namen ebenso. Am Handy das Bild oben,
 * ab Tablet links über die ganze Höhe der Karte.
 *
 * tour-previews          die Karten untereinander
 * tour-preview__media    Titelbild oder Platzhalter (image-placeholder), immer gleich
 *                        groß: Karten mit und ohne Bild sind gleich (User, 23. Oktober
 *                        2026)
 * tour-preview__title    der Name; der Verweis darin deckt die ganze Karte ab
 * tour-preview__stats    die Kennzahlen, am Handy untereinander, am Desktop in einer
 *                        Reihe; __stat mit --length, --time oder --stations bestimmt
 *                        das Symbol
 * tour-preview__teaser   die Beschreibung, nach drei Zeilen zu Ende
 * tour-preview__go       der runde Pfeil: Die ganze Karte führt zur Tour
 */

.tour-previews {
  display: grid;
  /* minmax(0, 1fr): Ohne die Null nimmt die Spalte die Mindestbreite ihres
     Inhalts und sprengt schmale Fenster */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Der Fokusrahmen steht um die Karte, nicht um den Namen */
.tour-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3) var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-large);
  background-color: var(--color-card);
  box-shadow: var(--shadow-small);
  transition: box-shadow var(--transition-fast);
}

.tour-preview:hover {
  box-shadow: 0 0 0 3px oklch(93% 0.035 115);
}

.tour-preview:focus-within {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

/* Bild und Platzhalter füllen die Fläche, ohne ihre Größe mitzubestimmen */
.tour-preview__media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-medium);
  overflow: hidden;
}

.tour-preview__media > * {
  position: absolute;
  inset: 0;
}

.tour-preview__image {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.tour-preview__title {
  padding-inline: var(--space-1);
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-heavy);
  line-height: var(--line-height-tight);
}

.tour-preview__title a {
  color: inherit;
  text-decoration: none;
}

.tour-preview__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-large);
}

.tour-preview__title a:focus-visible {
  outline: none;
}

/* Je Zeile Symbol, Wert und Bezeichnung -- so bricht nichts in Spalten um. Im Dokument
   steht die Bezeichnung vor dem Wert, im Bild der Wert vorn. */
.tour-preview__stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding-inline: var(--space-1);
}

.tour-preview__stat {
  display: grid;
  grid-template-columns: 1.25rem auto minmax(0, 1fr);
  grid-template-areas: "icon value label";
  align-items: baseline;
  column-gap: var(--space-2);
}

/* Das Symbol als Maske, damit es die Hausfarbe nimmt (im dunklen Schema Hellgrün) */
.tour-preview__stat::before {
  content: "";
  grid-area: icon;
  align-self: center;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  background-color: var(--color-primary);
  mask: var(--stat-icon) center / contain no-repeat;
}

.tour-preview__stat--length {
  --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h18M7 8l-4 4 4 4M17 8l4 4-4 4'/%3E%3C/svg%3E");
}

.tour-preview__stat--time {
  --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.tour-preview__stat--stations {
  --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6.2 7-12a7 7 0 0 0-14 0c0 5.8 7 12 7 12z'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3C/svg%3E");
}

.tour-preview__stat-label {
  grid-area: label;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.tour-preview__stat-value {
  grid-area: value;
  margin: 0;
  font-weight: var(--font-weight-heavy);
  font-variant-numeric: tabular-nums;
}

.tour-preview__teaser {
  display: -webkit-box;
  padding-inline: var(--space-1);
  color: var(--color-text-muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sieht aus wie ein Knopf, ist aber keiner: Der Verweis ist die ganze Karte */
.tour-preview__go {
  display: grid;
  flex: none;
  place-items: center;
  align-self: flex-end;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  margin-block-start: auto;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.tour-preview__go svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

/* Ab Tablet: das Bild links über die ganze Höhe der Karte, rechts Name, Kennzahlen, Text
   und Pfeil. Wie hoch die Karte wird, bestimmt der Text, nicht das Bild. */
@media (min-width: 40rem) {
  .tour-preview {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: auto auto auto 1fr;
    column-gap: var(--space-5);
    row-gap: var(--space-3);
    align-items: start;
    padding: var(--space-3);
  }

  .tour-preview__media {
    grid-row: 1 / -1;
    align-self: stretch;
    aspect-ratio: auto;
    min-block-size: 12rem;
  }

  .tour-preview__title,
  .tour-preview__stats,
  .tour-preview__teaser,
  .tour-preview__go {
    grid-column: 2;
  }

  .tour-preview__title {
    padding-block-start: var(--space-2);
  }

  .tour-preview__go {
    justify-self: end;
    align-self: end;
  }
}

/* Desktop: Platz genug, die Kennzahlen stehen in einer Reihe nebeneinander */
@media (min-width: 64rem) {
  .tour-preview {
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    column-gap: var(--space-6);
  }

  .tour-preview__media {
    min-block-size: 14rem;
  }

  .tour-preview__stats {
    flex-direction: row;
    column-gap: var(--space-6);
  }

  .tour-preview__teaser {
    max-inline-size: 70ch;
  }
}
