/* =========================================================
   rpg_pinterestwall.css - Pinterest Wall Styling
   Version: 1.7.0
   ---------------------------------------------------------
   Zeigt Pinterest-Bilder als Mosaik-Grid im Profilhero.
   ========================================================= */

/* =========================================================
   PINTEREST WALL CONTAINER
   ========================================================= */

.pinterest-wall {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* =========================================================
   GRID - Dynamisches Grid mit CSS Variables
   ========================================================= */

.pinterest-wall__grid {
    display: grid;
    /* Spalten und Rows über CSS Variables gesteuert (vom PHP gesetzt) */
    grid-template-columns: repeat(var(--pin-cols, 6), 1fr);
    grid-template-rows: repeat(var(--pin-rows, 4), 1fr);
    /* Dense packing - füllt Lücken automatisch */
    grid-auto-flow: dense;
    /* Überschüssige Rows verstecken */
    grid-auto-rows: 0;
    gap: 4px;
    
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* =========================================================
   EINZELNE ITEMS
   ========================================================= */

.pinterest-wall__item {
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.pinterest-wall__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================
   MOSAIK PATTERN - Nur erstes Bild groß
   ========================================================= */

/* Erstes Bild: 2x2 Hero - das einzige größere Element */
.pinterest-wall__item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

/* =========================================================
   GRAYSCALE FILTER (Standard: an)
   ========================================================= */

/* Standard: Schwarz-Weiß */
.pinterest-wall:not(.pinterest-wall--color) .pinterest-wall__item img {
    filter: grayscale(100%) brightness(0.9);
    transition: filter 0.3s ease;
}

/* Hover: Farbe zeigen */
.pinterest-wall:not(.pinterest-wall--color) .pinterest-wall__item:hover img {
    filter: grayscale(0%) brightness(1);
}

/* Wenn --color Klasse: immer Farbe */
.pinterest-wall--color .pinterest-wall__item img {
    filter: none;
}

/* =========================================================
   PLATZHALTER (Kein Board hinterlegt)
   ========================================================= */

.pinterest-wall--default {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.pinterest-wall__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--muted, #6b7280);
    opacity: 0.6;
}

.pinterest-wall__placeholder i {
    font-size: 3rem;
}

.pinterest-wall__placeholder span {
    font-size: 0.9rem;
}

/* =========================================================
   NAME OVERLAY - Über den Bildern (mit hoher Spezifität!)
   ========================================================= */

/* Overlay muss über der Pinterest Wall liegen */
.profile-hero__main {
    position: relative;
}

/* Name-Overlay mit dunklem Gradient */
.profile-hero .profile-hero__main .profile-hero__name-overlay,
.profile-hero__name-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10 !important;
    padding: 3rem 2rem 1.5rem 2rem !important;
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.9) 0%, 
        rgba(0, 0, 0, 0.7) 40%,
        rgba(0, 0, 0, 0.3) 70%,
        transparent 100%
    ) !important;
    /* Pointer-Events deaktiviert - Hover auf Bilder durchlassen */
    pointer-events: none;
}

/* Links im Overlay bleiben klickbar */
.profile-hero__name-overlay a,
.profile-hero__name-overlay button,
.profile-hero__name-overlay .profile-hero__charname,
.profile-hero__name-overlay .profile-hero__usertitle {
    pointer-events: auto;
}

/* Pinterest Wall unter dem Overlay */
.pinterest-wall {
    z-index: 1;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablets */
@media (max-width: 900px) {
    .pinterest-wall {
        --pin-cols: 4 !important;
    }
    
    /* Erstes Bild bleibt 2x2 */
    .pinterest-wall__item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .pinterest-wall {
        --pin-cols: 3 !important;
    }
    
    .pinterest-wall__grid {
        gap: 2px;
    }
    
    /* Erstes Bild nur noch 1x1 auf Mobile */
    .pinterest-wall__item:nth-child(1) {
        grid-column: span 1;
        grid-row: span 1;
    }
}