/* ==========================================================================
   UNIVERSALLES KACHEL- UND LISTEN-RASTER FÜR TV ERSINGEN
   Enthält das Kachel-Design (Sport & Service) sowie das PDF-Listen-Design
   ========================================================================== */

/* Internes flüssiges scrollen */
html { scroll-behavior: smooth; }

/* ==========================================================================
   1. DAS KACHEL-RASTER (KACHEL-ANZEIGE OBEN)
   ========================================================================== */

/* Das flexible Grid für die Kacheln */
.tve-link-cards { 
    list-style: none; 
    margin: 0; 
    padding: 10px 0; 
    display: grid; 
    gap: 12px; 
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    width: 100%; 
}

/* Anpassung für große Bildschirme ab 992px */
@media (min-width: 992px) { 
    .tve-link-cards { 
        display: grid;
        gap: 16px; 
        /* Die genaue Spaltenanzahl (z.B. 5er-Reihe) wird dynamisch vom JS gesetzt! */
    } 
}

/* Die einzelne Kachel */
.tve-card-item { 
    display: flex; 
    flex-direction: column; 
    background: #fff; 
    border-radius: 12px; 
    border: 1px solid #e5e7eb; 
    overflow: hidden; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); 
    transition: all 0.2s ease-in-out; 
	height: 100%;
    text-decoration: none; 
    color: inherit; 
}

/* Hover-Effekt für die Kacheln */
.tve-card-item:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.06); 
    border-color: #c4002a; 
}

/* ==========================================================================
   ZENTRALE KACHEL-BASIS (Hier pflegst du Ecken, Schatten, Höhen für ALLE Kacheln)
   ========================================================================== */
.tve-card-image {
    width: 100%;
    height: 130px;
    position: relative;
    overflow: hidden;
    background-color: #ffffff; /* Rein weißer Hintergrund für alle Kacheln */
    
    /* Sorgt dafür, dass Icons automatisch perfekt in der Mitte sitzen */
    display: flex;
    align-items: center;
    justify-content: center;
}

.tve-card-image img {
    display: block;
}

/* ==========================================================================
   SPEZIALFALL 1: FOTOS (Füllen die Box aus & bekommen den Schleier)
   ========================================================================== */
.tve-card-image.is-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* Schneidet Fotos perfekt im Kachel-Rechteck ab */
    object-position: center; /* Fokussiert das Wesentliche in der Bildmitte */
}

/* Roter Schleier (Overlay) NUR bei echten Fotos */
.tve-card-image.is-foto::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(196, 0, 42, 0.25); /* Euer TVE-Rot mit 25% Deckkraft */
    mix-blend-mode: multiply; 
    pointer-events: none; 
    transition: opacity 0.3s ease-in-out;    /* Macht das Ein- und Ausblenden butterweich */
}

/* Hover-Effekt für den Schleier (nur bei Fotos auf Desktop-Geräten) */
.tve-card-item:hover .tve-card-image.is-foto::after {
    opacity: 0;
}

/* ==========================================================================
   SPEZIALFALL 2: ICONS (Bleiben klein, unverzerrt und zentriert)
   ========================================================================== */
.tve-card-image.is-icon img {
    max-width: 75px;   /* Hier steuerst du zentral die Icon-Größe für alle Service-Kacheln */
    max-height: 75px;
    object-fit: contain; /* Verhindert das Aufblasen oder Verzerren der Icons */
}

/* ==========================================================================
   SPEZIALFALL 3: INSET (Gleichmäßiger Rahmen um das Bild)
   ========================================================================== */
.tve-card-image.is-inset {
  /* Rundherum exakt gleicher Innenabstand */
  padding: 12px 12px 0 12px;
  box-sizing: border-box;
}

.tve-card-image.is-inset img {
  width: 100%;
  height: 100%;
  
  /* Mittlerer Bildausschnitt unverzerrt (Center-Crop) */
  object-fit: cover;
  object-position: center;
  
  /* Abgerundete Ecken für das innere Bild */
  border-radius: 5px;
}

/* Inhalt unterhalb des Bildes */
.tve-card-content { 
    padding: 12px 8px;       
    display: flex;
    flex: 1;                 /* DAS HIER FEHLTE: Der weiße Kasten wächst nun aktiv mit! */
    align-items: center;     /* Zentriert den Text jetzt absolut perfekt von oben nach unten */
    justify-content: center; /* Zentriert den Text von links nach rechts */
    width: 100%;             
    box-sizing: border-box; 
}

/* Kachel-Überschrift (Verhindert abgehackte Wort-Umbrüche bei langen Texten) */
/* Basis-Schriftgröße für kleinere Bildschirme / Tablets */
.tve-card-title {
    font-weight: 800; 
    color: #1f2937; 
    font-size: 0.95rem;      
    line-height: 1.2;        
    text-align: center;      
    display: block;          
    width: 100%;             
    overflow-wrap: break-word; 
    hyphens: auto;
}

/* Erst bei echten Desktop-Bildschirmen darf die Schrift wieder größer werden */
@media (min-width: 1200px) {
  .tve-card-title {
    font-size: 1rem;       /* Volle Größe auf großen Monitoren */
  }
}



/* ==========================================================================
   2. DIE DOWNLOAD-ZEILEN (PDF-LISTEN-ANZEIGE UNTEN)
   ========================================================================== */

/* Styling für die flacheren, kompakten PDF-Download-Zeilen */
.tve-download-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px; /* Kompaktes Padding für sportliche Zeilenhöhe */
    text-decoration: none;
    color: #1f2937;
    font-weight: 700;
    font-size: 0.95rem; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
    transition: all 0.2s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

/* Hover-Effekt für die Download-Zeilen */
.tve-download-row:hover {
    border-color: #c4002a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    transform: translateX(4px); /* Schiebt die Zeile beim Hovern dezent nach rechts */
    color: #c4002a; /* Text färbt sich im TVE-Rot */
}

/* Das neue, gestochen scharfe SVG-Download-Symbol auf der rechten Seite */
.tve-download-svg {
    width: 20px;
    height: 20px;
    color: #6b7280; /* Standardfarbe Grau */
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    flex-shrink: 0; /* Verhindert, dass das Icon auf kleinen Bildschirmen gequetscht wird */
}

/* Farbwechsel und dezenter Bewegungseffekt des Pfeils beim Hovern */
.tve-download-row:hover .tve-download-svg {
    color: #c4002a; /* Färbt das Symbol im TVE-Rot */
    transform: translateY(2px); /* Der Pfeil senkt sich als Klick-Anreiz minimal ab */
}

/* Verhindert abgehackte Worttrennungen beim Kurztext unter der Überschrift */
.tve-card-content span:last-child {
    word-break: keep-all;     /* Wörter werden nicht mehr mitten im Wort zerschnitten */
    overflow-wrap: break-word; /* Falls ein Wort absolut zu lang ist, bricht es sauber um */
    hyphens: auto;            /* Nutzt die automatische, korrekte Silbentrennung */
}

/* ==========================================================================
   3. TVE INTRO-BOX (Zentralisiertes & Bereinigtes Layout)
   ========================================================================== */

/* Die gemeinsame Basis-Struktur */
.tve-intro-box {
  display: flex;
  flex-direction: column; /* 📱 Mobil: Immer sauber untereinander (kein Überlagern) */
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 25px;
}

/* --- OPTIK-VARIANTE 1: Kacheloptik --- */
.tve-intro-box.is-card {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}

/* --- OPTIK-VARIANTE 2: Flaches Layout --- */
.tve-intro-box.is-flat {
  background: transparent;
  border: none;
  padding: 10px 0;
}

/* --- INHALT (Gilt für beide Varianten) --- */
.tve-intro-box .tve-intro-main {
  flex: 1;         /* 💡 Dehnt sich automatisch auf 100% aus, wenn rechts ausgeblendet ist */
  min-width: 0;    /* Verhindert Text-Ausbrechen */
}

.tve-intro-box .tve-intro-main h2 {
  color: #c4002a;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.tve-intro-box .tve-intro-main p {
  margin-bottom: 0;
  color: #444444;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* --- RECHTE SEITE (Links) --- */
.tve-intro-box .tve-intro-side {
  width: 100%;     /* Mobil volle Breite unter dem Text */
}

.tve-intro-box .tve-intro-links {
  display: block !important;
}

.tve-intro-box .tve-intro-label {
  display: block;
  font-weight: 800;
  color: #1f2937;
  margin-top: 0;
  margin-bottom: 6px;
  line-height: 1.2;
}

.tve-intro-box .tve-intro-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.tve-intro-box .tve-intro-links-row a {
  color: #3b82f6;
  font-weight: normal;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.tve-intro-box .tve-intro-links-row a:hover {
  text-decoration: underline;
  color: #2563eb;
}

.tve-intro-box .tve-intro-divider {
  color: #cbd5e1;
  font-weight: normal;
  padding: 0 10px;
  user-select: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Ab Tablet / PC)
   ========================================================================== */
@media (min-width: 768px) {
  .tve-intro-box {
    flex-direction: row; /* 🖥️ PC: Schaltet auf Nebeneinander-Modus */
    justify-content: space-between;
    align-items: flex-start;
  }

  .tve-intro-box.is-card { gap: 40px; }
  .tve-intro-box.is-flat { gap: 5%; }

  .tve-intro-box .tve-intro-main {
    min-width: 320px;
  }

  .tve-intro-box .tve-intro-side {
    width: 30%;
    min-width: 250px;
    flex-shrink: 0; /* Verhindert das Zusammenquetschen der Linkbox */
  }

  /* Der Trennbalken: Greift am PC nur in der flachen Ansicht */
  .tve-intro-box.is-flat .tve-intro-side {
    border-left: 2px solid #e5e7eb;
    padding-left: 25px;
  }
}
