/**
 * CLAUDE: Portfolio Grid Styles - Bild-basiertes Layout
 * CLAUDE: Kachel-Layout für Portfolio-Kategorien mit Bildern
 * CLAUDE: Anpassen: Variablen, Breakpoints, Abstände
 *
 * @package Provimedia
 * @since 2.0.0
 */

/* ============================================================
   CLAUDE: Grid Container
   CLAUDE: 3-spaltiges Grid, responsive zu 2 und 1 Spalte
   ============================================================ */

.pvm-portfolio-grid {
    display: grid;                              /* CLAUDE: CSS Grid Layout */
    grid-template-columns: repeat(3, 1fr);      /* CLAUDE: 3 gleiche Spalten */
    gap: 24px;                                  /* CLAUDE: Abstand zwischen Karten */
    max-width: 1200px;                          /* CLAUDE: Maximale Breite */
    margin: 40px auto;                          /* CLAUDE: Vertikaler Abstand + Zentrierung */
    padding: 0 20px;                            /* CLAUDE: Seitlicher Innenabstand */
}

/* CLAUDE: Responsive - Tablet (2 Spalten) */
/* CLAUDE: Anpassen: Breakpoint-Wert ändern */
@media (max-width: 900px) {
    .pvm-portfolio-grid {
        grid-template-columns: repeat(2, 1fr);  /* CLAUDE: 2 Spalten */
        gap: 20px;                              /* CLAUDE: Etwas weniger Gap */
    }
}

/* CLAUDE: Responsive - Mobile (1 Spalte) */
/* CLAUDE: Anpassen: Breakpoint-Wert ändern */
@media (max-width: 600px) {
    .pvm-portfolio-grid {
        grid-template-columns: 1fr;             /* CLAUDE: 1 Spalte */
        gap: 16px;                              /* CLAUDE: Kompakter */
        padding: 0 16px;                        /* CLAUDE: Weniger Padding */
        margin: 24px auto;                      /* CLAUDE: Weniger Margin */
    }
}

/* ============================================================
   CLAUDE: Portfolio Card
   CLAUDE: Einzelne Kachel mit Bild und Text-Overlay
   ============================================================ */

.pvm-portfolio-card {
    display: block;                             /* CLAUDE: Block für volle Breite */
    position: relative;                         /* CLAUDE: Für Overlay-Positionierung */
    border-radius: 16px;                        /* CLAUDE: Abgerundete Ecken */
    overflow: hidden;                           /* CLAUDE: Bild beschneiden */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12); /* CLAUDE: Schatten */
    text-decoration: none;                      /* CLAUDE: Kein Link-Unterstrich */
    transition: transform 0.3s ease,            /* CLAUDE: Sanfte Hover-Animation */
                box-shadow 0.3s ease;
    aspect-ratio: 4 / 3;                        /* CLAUDE: Einheitliches Seitenverhältnis */
}

/* CLAUDE: Hover-Effekt - Karte hebt sich */
.pvm-portfolio-card:hover {
    transform: translateY(-8px);                /* CLAUDE: Nach oben bewegen */
    box-shadow: 0 16px 48px rgba(76, 65, 224, 0.2); /* CLAUDE: Stärkerer Schatten */
}

/* ============================================================
   CLAUDE: Bild Container
   CLAUDE: Füllt die gesamte Karte aus
   ============================================================ */

.pvm-portfolio-card__image {
    position: absolute;                         /* CLAUDE: Absolut positioniert */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;                                 /* CLAUDE: Hinter Content */
}

.pvm-portfolio-card__image img {
    width: 100%;                                /* CLAUDE: Volle Breite */
    height: 100%;                               /* CLAUDE: Volle Höhe */
    object-fit: cover;                          /* CLAUDE: Bild beschneiden */
    object-position: center;                    /* CLAUDE: Zentriert */
    transition: transform 0.4s ease;            /* CLAUDE: Zoom-Effekt vorbereiten */
}

/* CLAUDE: Hover - Bild zoomt leicht */
.pvm-portfolio-card:hover .pvm-portfolio-card__image img {
    transform: scale(1.08);                     /* CLAUDE: 8% vergrößern */
}

/* ============================================================
   CLAUDE: Content Overlay
   CLAUDE: Text am unteren Rand der Karte
   ============================================================ */

.pvm-portfolio-card__content {
    position: absolute;                         /* CLAUDE: Über dem Bild */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;                                 /* CLAUDE: Über Bild und Overlay */
    padding: 20px;                              /* CLAUDE: Innenabstand */
    background: linear-gradient(               /* CLAUDE: Gradient für Lesbarkeit */
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    color: white;                               /* CLAUDE: Weiße Schrift */
}

/* CLAUDE: Kategorie-Titel */
.pvm-portfolio-card__title {
    font-size: 1.25rem;                         /* CLAUDE: 20px */
    font-weight: 600;                           /* CLAUDE: Semi-bold */
    color: white;                               /* CLAUDE: Weiß */
    margin: 0 0 6px 0;                          /* CLAUDE: Nur unten Abstand */
    line-height: 1.3;                           /* CLAUDE: Kompakte Zeilenhöhe */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);  /* CLAUDE: Lesbarkeit */
}

/* CLAUDE: Webseiten-Anzahl */
.pvm-portfolio-card__count {
    font-size: 0.9rem;                          /* CLAUDE: Etwas kleiner */
    color: rgba(255, 255, 255, 0.9);            /* CLAUDE: Leicht transparent */
    margin: 0;                                  /* CLAUDE: Kein Margin */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);  /* CLAUDE: Lesbarkeit */
}

/* ============================================================
   CLAUDE: Hover Overlay
   CLAUDE: Dunkles Overlay bei Hover mit Pfeil (kein lila Gradient)
   CLAUDE: Scale + Schatten-basierter Hover für bessere UX
   ============================================================ */

.pvm-portfolio-card__overlay {
    position: absolute;                         /* CLAUDE: Über allem */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;                                 /* CLAUDE: Zwischen Bild und Content */
    background: linear-gradient(               /* CLAUDE: Dunkler Overlay statt Brand-Gradient */
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.2) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;                                 /* CLAUDE: Initial versteckt */
    transition: opacity 0.3s ease;
}

/* CLAUDE: Hover - Overlay einblenden */
.pvm-portfolio-card:hover .pvm-portfolio-card__overlay {
    opacity: 1;
}

/* CLAUDE: Pfeil im Overlay */
.pvm-portfolio-card__arrow {
    font-size: 3rem;                            /* CLAUDE: Großer Pfeil */
    color: white;                               /* CLAUDE: Weiß */
    transform: translateX(-20px);               /* CLAUDE: Initial nach links */
    opacity: 0;                                 /* CLAUDE: Initial versteckt */
    transition: transform 0.3s ease,
                opacity 0.3s ease;
}

/* CLAUDE: Hover - Pfeil einblenden und zentrieren */
.pvm-portfolio-card:hover .pvm-portfolio-card__arrow {
    transform: translateX(0);                   /* CLAUDE: In Position */
    opacity: 1;                                 /* CLAUDE: Sichtbar */
}

/* ============================================================
   CLAUDE: Barrierefreiheit
   CLAUDE: Focus States für Tastaturnavigation
   ============================================================ */

.pvm-portfolio-card:focus {
    outline: 3px solid var(--lila, #8C0AB7);   /* CLAUDE: Sichtbarer Fokus */
    outline-offset: 4px;                        /* CLAUDE: Abstand zum Element */
}

.pvm-portfolio-card:focus:not(:focus-visible) {
    outline: none;
}

.pvm-portfolio-card:focus-visible {
    outline: 3px solid var(--lila, #8C0AB7);
    outline-offset: 4px;
}

/* CLAUDE: Bei Focus auch Overlay zeigen (dunkler Overlay, kein lila) */
.pvm-portfolio-card:focus-visible .pvm-portfolio-card__overlay {
    opacity: 1;
}

.pvm-portfolio-card:focus-visible .pvm-portfolio-card__arrow {
    transform: translateX(0);
    opacity: 1;
}

/* ============================================================
   CLAUDE: Mobile Anpassungen
   ============================================================ */

@media (max-width: 600px) {
    .pvm-portfolio-card {
        aspect-ratio: 16 / 10;                  /* CLAUDE: Flacher auf Mobile */
    }

    .pvm-portfolio-card__content {
        padding: 16px;                          /* CLAUDE: Weniger Padding */
    }

    .pvm-portfolio-card__title {
        font-size: 1.1rem;                      /* CLAUDE: Etwas kleiner */
    }

    .pvm-portfolio-card__arrow {
        font-size: 2rem;                        /* CLAUDE: Kleinerer Pfeil */
    }
}

/* ============================================================
   CLAUDE: Tablet Anpassungen
   ============================================================ */

@media (max-width: 900px) and (min-width: 601px) {
    .pvm-portfolio-card__title {
        font-size: 1.15rem;                     /* CLAUDE: Mittlere Größe */
    }
}

/* ============================================================
   CLAUDE: Print Styles
   ============================================================ */

@media print {
    .pvm-portfolio-grid {
        display: block;
    }

    .pvm-portfolio-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 16px;
        aspect-ratio: auto;
        height: auto;
    }

    .pvm-portfolio-card__overlay {
        display: none;
    }

    .pvm-portfolio-card__content {
        position: static;
        background: #f5f5f5;
        color: #333;
    }

    .pvm-portfolio-card__title,
    .pvm-portfolio-card__count {
        color: #333;
        text-shadow: none;
    }
}
