/* ===== Impressionen Section (eigenes Stylesheet) ===== */

/* Optional: etwas vertikaler Rhythmus in der Section */
.impressionen-section .section-inner {
    row-gap: 1rem;
    /* Für moderne Layouts: Container-Queries aktivieren (optional) */
    /* container-type: inline-size; */
}

/* Galerie-Grid: passt Spalten je nach verfügbarer Breite an */
.impressions-gallery {
    --gap: clamp(8px, 1.2vw, 16px);
    --tile-size: clamp(120px, 18vw, 220px); /* Basis-Kachelgröße */
    --radius: 6px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--tile-size), 1fr));
    gap: var(--gap);

    list-style: none;
    padding: 0;
    margin: 0;

    align-items: start;
    justify-items: stretch;

    /* Smooth scrollen bei Tastatur/PageUp/Down */
    scroll-behavior: smooth;

    /* Touch verbessert */
    touch-action: pan-x pinch-zoom;
}

/* Einzelkachel: immer quadratisch, Inhalt mittig gecroppt */
.impression-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    /*border-radius: var(--radius);*/
    border:none;
    background: #e9eef4;
}

.impression-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;     /* schneidet zu, um Quadrat zu füllen */
    object-position: center;
    display: block;
}

/* Leerer Zustand */
.impressions-empty {
    color: #5f7b93;
    font-style: italic;
}

/* Größere Screens: Kacheln dürfen größer werden */
@media (min-width: 1400px) {
    .impressions-gallery { --tile-size: clamp(160px, 14vw, 260px); }
}

/* ===== Responsive: mobil horizontal scrollbar, 1 Zeile ===== */
@media (max-width: 900px) {
    .impressions-gallery {
        display: flex;                /* statt Grid */
        overflow-x: auto;
        overflow-y: hidden;
        gap: var(--gap);
        padding-bottom: 8px;          /* Platz für native Scrollbar */
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }
    .impression-item {
        flex: 0 0 auto;
        width: clamp(140px, 48vw, 260px); /* Kachelbreite mobil */
        aspect-ratio: 1 / 1;
        scroll-snap-align: start;
    }

}

/* ===== Hover-Caption nur für Desktop (pointer: fine, hover verfügbar) ===== */
.impression-item {
    position: relative; /* Anker für Caption */
}

.impression-caption {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    /* eckiges, halbtransparentes Weiß */
    background: rgba(255,255,255,0.88);
    color: #123b5d;
    padding: 8px 10px;
    border-radius: 0;                 /* explizit eckig */
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    max-width: 92%;

    /* animiert ein-/ausblenden */
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease;

    pointer-events: none; /* blockiert keine Klicks/Scrolls */
}

.impression-caption__inner {
    font-family: "Henriette", serif;
    font-size: clamp(.9rem, .6vw + .7rem, 1.1rem);
    line-height: 1.3;
}

/* nur auf Geräten mit Hover und präzisem Pointer zeigen */
@media (hover: hover) and (pointer: fine) {
    .impression-item:hover .impression-caption {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auf mobilen Geräten grundsätzlich ausblenden (falls Browser media-queries nicht korrekt melden) */
@media (max-width: 900px) {
    .impression-caption { display: none; }
}

/* ===== Responsive: mobil — große Kacheln (80vw) ===== */
@media (max-width: 900px) {
    .impressions-gallery {
        display: flex;                /* statt Grid */
        overflow-x: auto;
        overflow-y: hidden;
        gap: var(--gap);
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;

        /* optional: etwas Luft am Rand + schöneres Einrasten */
        padding-inline: 4vw;
        scroll-padding-left: 4vw;
    }

    .impression-item {
        flex: 0 0 auto;
        width: 80vw;                  /* <-- hier die gewünschte Breite */
        max-width: 520px;             /* optionaler Deckel für sehr breite Phones */
        aspect-ratio: 1 / 1;
        scroll-snap-align: start;
    }
}
