/* ==========================================================================
   SAMMLUNG
   ========================================================================== */

.collection-page {
    padding: 0.45rem 0 0;
}

.collection-toolbar {
    position: sticky;
    top: 0;
    z-index: 500;
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr);
    gap: 1rem;
    align-items: end;
    width: min(1400px, 100%);
    margin: 0 auto 1.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e5e7eb;
    backdrop-filter: blur(10px);
}

.toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toolbar-label {
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.search-grid {
    display: grid;
    grid-template-columns: 0.8fr 1fr 1fr;
    gap: 0.65rem;
}

.search-grid input {
    width: 100%;
    min-height: 42px;
    padding: 0.72rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 700;
    outline: none;
    -webkit-appearance: none;
}

.search-grid input:focus {
    border-color: #111;
    background: #fff;
}

.sort-controls {
    display: grid;
    grid-template-columns: 1fr 0.7fr;
    gap: 0.65rem;
}

.tab-nav {
    display: flex;
    min-height: 42px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.65rem;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    user-select: none;
    border: none;
    background: transparent;
    font-family: inherit;
}

.tab-item + .tab-item {
    border-left: 1px solid #e2e8f0;
}

.tab-item.is-active {
    background: #fff;
    color: #111;
}

.result-count {
    align-self: center;
    justify-self: end;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: min(1400px, 100%);
    margin: 0 auto;
    padding-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 20px;
    }
}

.stempel-card {
    background: #fff;
    border: 1px solid #eee;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 216px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.stempel-card:focus,
.stempel-card:active {
    outline: none;
    border-color: #eee;
}

@media (hover: hover) {
    .stempel-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    }
}

.img-container {
    width: 100%;
    height: 144px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.img-container img {
    max-width: 94%;
    max-height: 94%;
    object-fit: contain;
}

.card-info {
    min-height: 72px;
    padding: 8px 10px;
    text-align: center;
    border-top: 1px solid #f8f8f8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.primary-label {
    display: block;
    font-weight: 800;
    font-size: 0.8rem;
    color: #111;
    margin-bottom: 2px;
}

.secondary-label {
    font-size: 0.7rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-backdrop.is-active {
    display: flex;
}

.modal-window {
    background: #fff;
    width: 100%;
    max-width: 800px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.modal-flex {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

.modal-left {
    flex: 1;
    background: #f1f5f9;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-left img {
    max-width: 100%;
    max-height: 25vh;
    object-fit: contain;
}

.modal-right {
    flex: 1;
    padding: 20px;
}

.m-title-bold {
    font-size: 1.2rem;
    font-weight: 800;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.m-info-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
}

.m-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
}

.m-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

#main-content-blur.is-blurred {
    filter: blur(10px);
    pointer-events: none;
}

@media (min-width: 768px) {
    .modal-flex {
        flex-direction: row;
    }

    .modal-window {
        max-height: 85vh;
    }

    .modal-left {
        min-height: 400px;
    }

    .modal-left img {
        max-height: 60vh;
    }

    .modal-right {
        padding: 35px;
    }

    .m-title-bold {
        font-size: 1.6rem;
    }
}

@media (max-width: 900px) {
    .collection-toolbar {
        grid-template-columns: 1fr;
        position: static;
    }

    .search-grid,
    .sort-controls {
        grid-template-columns: 1fr;
    }

    .result-count {
        justify-self: start;
    }
}

@media (max-width: 768px) {
    .collection-page {
        padding: 0.45rem 0.75rem 0;
    }

    .collection-toolbar {
        margin-bottom: 0.85rem;
        padding: 0.8rem;
    }

    .tab-item {
        font-size: 0.62rem;
        padding: 0.6rem 0.4rem;
    }
}

body.has-public-header.page-galerie .collection-page {
    padding: 0.45rem 0 0 !important;
}

body.has-public-header.page-galerie .gallery-grid {
    padding-top: 0 !important;
    padding-bottom: 0.75rem !important;
}
