/**
 * Plus Marktplatz - Fohlengalerie Styles
 * Ergänzende Styles zum Frontend-CSS
 */

/* ========================================
   Fohlen Card
   ======================================== */

.fohlen-card {
    background: var(--marktplatz-white);
    border-radius: var(--marktplatz-radius);
    overflow: hidden;
    box-shadow: var(--marktplatz-shadow);
    transition: transform var(--marktplatz-transition), box-shadow var(--marktplatz-transition);
}

.fohlen-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.fohlen-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fohlen-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.fohlen-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--marktplatz-transition);
}

.fohlen-card:hover .fohlen-card-image img {
    transform: scale(1.05);
}

.fohlen-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e8a87c;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fohlen-card-content {
    padding: 16px;
}

.fohlen-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--marktplatz-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fohlen-card-vater {
    font-size: 0.85rem;
    color: var(--marktplatz-text-light);
    margin: 0 0 8px;
}

.fohlen-card-vater .label {
    font-weight: 600;
    color: var(--marktplatz-text);
}

.fohlen-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fohlen-card-meta .meta-item {
    font-size: 0.8rem;
    color: var(--marktplatz-text-light);
    background: var(--marktplatz-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ========================================
   Fohlengalerie Filter
   ======================================== */

.fohlengalerie-filter {
    background: var(--marktplatz-white);
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ========================================
   Fohlengalerie Grid
   ======================================== */

.fohlengalerie-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .fohlengalerie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .fohlengalerie-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Single: Fohlengalerie Badge
   ======================================== */

.fohlengalerie-badge {
    background: #e8a87c !important;
}

/* ========================================
   Form: Fohlengalerie-specific
   ======================================== */

.fohlengalerie-submission-form .form-hint {
    font-size: 0.8rem;
    color: var(--marktplatz-text-light);
    margin-top: 4px;
}

/* ========================================
   Fohlengalerie Modal (Collage Lightbox)
   z-index 9999 — Photo-Lightbox nutzt 99999
   ======================================== */

.fohlengalerie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.fohlengalerie-modal.active {
    opacity: 1;
    visibility: visible;
}

.fohlengalerie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

/* Container */
.fohlengalerie-modal-container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Close — schwebt oben rechts über der Collage */
.fohlengalerie-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.fohlengalerie-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Body */
.fohlengalerie-modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
    position: relative;
}

.fohlengalerie-modal-content {
    padding: 0;
}

.fohlengalerie-modal-description {
    padding: 16px 24px 24px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.fohlengalerie-modal-description:empty {
    display: none;
}

/* Spinner */
.fohlengalerie-modal-spinner {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.fohlengalerie-modal-spinner.active {
    display: flex;
}

.fohlengalerie-modal-spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #c9a227;
    border-radius: 50%;
    animation: fohlengalerie-spin 0.8s linear infinite;
}

@keyframes fohlengalerie-spin {
    to { transform: rotate(360deg); }
}

/* Navigation Buttons */
.fohlengalerie-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.2s;
}

.fohlengalerie-modal-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.fohlengalerie-modal-nav:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.fohlengalerie-modal-nav--prev {
    left: 16px;
}

.fohlengalerie-modal-nav--next {
    right: 16px;
}

/* Counter */
.fohlengalerie-modal-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 16px;
    border-radius: 20px;
}

.fohlengalerie-modal-counter:empty {
    display: none;
}

/* Body scroll lock */
body.fohlengalerie-modal-open {
    overflow: hidden;
}

/* ========================================
   Fohlengalerie Modal — Responsive
   ======================================== */

@media (max-width: 768px) {
    .fohlengalerie-modal-container {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
    }

    .fohlengalerie-modal-description {
        padding: 12px 16px 16px;
    }

    /* Nav buttons at bottom on mobile */
    .fohlengalerie-modal-nav {
        top: auto;
        bottom: 60px;
        transform: none;
        width: 44px;
        height: 44px;
    }

    .fohlengalerie-modal-nav:hover {
        transform: none;
    }

    .fohlengalerie-modal-nav--prev {
        left: 16px;
    }

    .fohlengalerie-modal-nav--next {
        right: 16px;
    }

    .fohlengalerie-modal-counter {
        bottom: 20px;
    }
}
