/* ==========================================================
   Intellivision1 Downloads  –  iv1-downloads.css  v1.3.0
   Alle Selektoren beginnen mit .iv1downloads
   Elementor-kompatibel: kein overflow:hidden auf Wrapper,
   min-width:0 auf Karten für korrekte Grid-Berechnung
   ========================================================== */

/* ----------------------------------------------------------
   CSS Custom Properties  (scoped auf .iv1downloads)
   ---------------------------------------------------------- */
.iv1downloads {
    --iv1-primary:        #1a6ef5;
    --iv1-primary-hover:  #0f50c5;
    --iv1-primary-text:   #ffffff;
    --iv1-surface:        #ffffff;
    --iv1-border:         #e2e8f0;
    --iv1-title-color:    #1e293b;
    --iv1-desc-color:     #475569;
    --iv1-size-color:     #94a3b8;
    --iv1-count-color:    #64748b;
    --iv1-radius-card:    12px;
    --iv1-radius-btn:     8px;
    --iv1-shadow:         0 2px 12px rgba(0, 0, 0, .07);
    --iv1-shadow-hover:   0 8px 28px rgba(0, 0, 0, .13);
    --iv1-thumb-height:   200px;
    --iv1-gap:            1.5rem;
    --iv1-pad:            1.25rem;
    --iv1-transition:     .22s ease;
}

/* ----------------------------------------------------------
   Grid-Wrapper
   ELEMENTOR-FIX: width:100% + box-sizing erzwingt korrekten
   Kontext innerhalb von Elementor-Spalten
   ---------------------------------------------------------- */
.iv1downloads {
    display: grid;
    gap: var(--iv1-gap);
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Spalten */
.iv1downloads--cols-1 { grid-template-columns: 1fr; }
.iv1downloads--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iv1downloads--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iv1downloads--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Responsive – passt sich Elementor-Breakpoints an */
@media (max-width: 1024px) {
    .iv1downloads--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
    .iv1downloads--cols-3,
    .iv1downloads--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .iv1downloads--cols-1,
    .iv1downloads--cols-2,
    .iv1downloads--cols-3,
    .iv1downloads--cols-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ----------------------------------------------------------
   Karte
   ELEMENTOR-FIX: min-width:0 verhindert, dass Grid-Items
   ihre min-content-Breite beanspruchen → kein Text-Overflow
   word-wrap + overflow-wrap für langen Text
   ---------------------------------------------------------- */
.iv1downloads__card {
    min-width: 0;                        /* ← Elementor-Fix */
    background:     var(--iv1-surface);
    border:         1px solid var(--iv1-border);
    border-radius:  var(--iv1-radius-card);
    box-shadow:     var(--iv1-shadow);
    overflow:       hidden;
    display:        flex;
    flex-direction: column;
    box-sizing:     border-box;
    transition:     transform var(--iv1-transition),
                    box-shadow var(--iv1-transition);
}
.iv1downloads__card:hover {
    transform:  translateY(-3px);
    box-shadow: var(--iv1-shadow-hover);
}

/* ----------------------------------------------------------
   Bild / Thumbnail
   ---------------------------------------------------------- */
.iv1downloads__thumb {
    width:       100%;
    height:      var(--iv1-thumb-height);
    overflow:    hidden;
    background:  #f1f5f9;
    flex-shrink: 0;
}
.iv1downloads__img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform var(--iv1-transition);
}
.iv1downloads__card:hover .iv1downloads__img {
    transform: scale(1.04);
}

/* ----------------------------------------------------------
   Body
   ---------------------------------------------------------- */
.iv1downloads__body {
    padding:        var(--iv1-pad);
    display:        flex;
    flex-direction: column;
    flex:           1;
    gap:            .7rem;
    box-sizing:     border-box;
    min-width:      0;   /* Elementor-Fix: verhindert Überlauf */
}

/* ----------------------------------------------------------
   Titel
   ELEMENTOR-FIX: word-break verhindert Overflow bei langem
   Wort in schmaler Spalte
   ---------------------------------------------------------- */
.iv1downloads__title {
    font-size:   1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color:       var(--iv1-title-color);
    margin:      0;
    padding:     0;
    border:      none;
    background:  none;
    word-break:  break-word;
    overflow-wrap: break-word;
}

/* ----------------------------------------------------------
   Beschreibung
   ---------------------------------------------------------- */
.iv1downloads__desc {
    font-size:     .9rem;
    line-height:   1.65;
    color:         var(--iv1-desc-color);
    flex:          1;
    word-break:    break-word;
    overflow-wrap: break-word;
}
.iv1downloads__desc p     { margin: 0 0 .5em; }
.iv1downloads__desc p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------
   Footer (Button-Zeile)
   ---------------------------------------------------------- */
.iv1downloads__footer {
    display:     flex;
    align-items: center;
    gap:         .65rem;
    flex-wrap:   wrap;
    margin-top:  auto;
    padding-top: .2rem;
    min-width:   0;
}

/* ----------------------------------------------------------
   Download-Button
   ---------------------------------------------------------- */
.iv1downloads__btn {
    display:         inline-flex;
    align-items:     center;
    gap:             .45em;
    padding:         .55rem 1.05rem;
    background:      var(--iv1-primary);
    color:           var(--iv1-primary-text) !important;
    font-size:       .875rem;
    font-weight:     600;
    letter-spacing:  .01em;
    line-height:     1;
    text-decoration: none !important;
    border-radius:   var(--iv1-radius-btn);
    border:          none;
    cursor:          pointer;
    white-space:     nowrap;
    box-sizing:      border-box;
    transition:      background var(--iv1-transition),
                     transform  var(--iv1-transition);
    flex-shrink:     0;
}
.iv1downloads__btn:hover,
.iv1downloads__btn:focus {
    background:      var(--iv1-primary-hover);
    color:           var(--iv1-primary-text) !important;
    text-decoration: none !important;
    transform:       translateY(-1px);
    outline:         none;
}
.iv1downloads__btn:focus-visible {
    outline:        2px solid var(--iv1-primary);
    outline-offset: 3px;
}

/* SVG-Icon */
.iv1downloads__icon {
    width:          1em;
    height:         1em;
    flex-shrink:    0;
    vertical-align: middle;
}

/* ----------------------------------------------------------
   Dateigröße
   ---------------------------------------------------------- */
.iv1downloads__size {
    font-size:   .78rem;
    color:       var(--iv1-size-color);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Download-Zähler
   ---------------------------------------------------------- */
.iv1downloads__count {
    display:     inline-flex;
    align-items: center;
    gap:         .3em;
    font-size:   .78rem;
    color:       var(--iv1-count-color);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}
.iv1downloads__count-icon {
    width:  .95em;
    height: .95em;
    opacity: .7;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Leer-Zustand
   ---------------------------------------------------------- */
.iv1downloads__empty {
    color:      var(--iv1-desc-color, #475569);
    font-style: italic;
    margin:     1rem 0;
}
