/* Reveal Gallery — Blur/Scharf Bildpaare */

#gallery {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#gallery.initialized {
    opacity: 1;
}

.reveal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .reveal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .reveal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Bildpaar-Container --- */

.image-pair {
    border-radius: 4px;
}

.image-pair-inner {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.image-pair img {
    width: 100%;
    height: auto;
    display: block;
}

.image-pair.has-reveal {
    cursor: pointer;
}

/* Scharfes Bild: überlagert das unscharfe */

.image-pair .sharp-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.image-pair.has-reveal .image-pair-inner:hover .sharp-img,
.image-pair.revealed .sharp-img {
    opacity: 1;
}

/* --- Wimpel / Hinweis-Banner --- */

.reveal-hint {
    position: absolute;
    top: 14px;
    right: -6px;
    background: #c8a855;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 6px 14px 6px 10px;
    letter-spacing: 0.03em;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: opacity 0.3s ease;
}

.reveal-hint::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -6px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 0 0;
    border-color: #9a7f3a transparent transparent transparent;
}

.image-pair.has-reveal .image-pair-inner:hover .reveal-hint,
.image-pair.revealed .reveal-hint {
    opacity: 0;
}

/* --- Beschreibung (Overlay auf Lösungsfoto) --- */

.image-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 0.6em 0.8em;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.image-pair.has-reveal .image-pair-inner:hover .image-description,
.image-pair.revealed .image-description {
    opacity: 1;
}

/* --- Bildname / Caption --- */

.image-caption {
    display: block;
    padding: 0.5em 0.25em;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #333;
}
