/*
 * Celler Garnison-Museum – Sammlungsübersicht
 * Zentrales CGM-Design: Navy / Papier / Messing, Caudex + Hind.
 */

:root {
    --cgm-collections-paper: #f3f0e8;
    --cgm-collections-navy: #0b2c45;
    --cgm-collections-navy-deep: #061827;
    --cgm-collections-gold: #b49a62;
    --cgm-collections-gold-dark: #8d7136;
    --cgm-collections-line: rgba(11, 44, 69, .14);
    --cgm-collections-muted: #647482;
}

body.cgm-collections-page {
    background: var(--cgm-collections-navy-deep);
}

body.cgm-collections-page #content {
    max-width: none;
    padding: 0;
    background: var(--cgm-collections-paper);
}

body.cgm-collections-page #wrap > footer {
    display: none !important;
}

body.cgm-collections-page .cgm-collections-shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

/* Hero */
body.cgm-collections-page .cgm-collections-hero {
    padding: clamp(70px, 8vw, 106px) 0 clamp(62px, 7vw, 90px);
    background: var(--cgm-collections-navy);
    color: #fff;
}

body.cgm-collections-page .cgm-collections-kicker {
    margin: 0 0 12px;
    color: var(--cgm-collections-gold);
    font-family: "Hind", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .17em;
    line-height: 1.2;
    text-transform: uppercase;
}

body.cgm-collections-page .cgm-collections-hero h1 {
    margin: 0;
    color: #fff;
    font-family: "Caudex", serif;
    font-size: clamp(44px, 5.6vw, 74px);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.02;
}

body.cgm-collections-page .cgm-collections-lede {
    max-width: 820px;
    margin: 22px 0 0;
    color: rgba(255,255,255,.78);
    font-family: "Hind", sans-serif;
    font-size: 19px;
    line-height: 1.6;
}

/* Main */
body.cgm-collections-page .cgm-collections-main {
    padding: 52px 0 76px;
    background: var(--cgm-collections-paper);
}

body.cgm-collections-page .cgm-collections-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 27px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--cgm-collections-line);
    font-family: "Hind", sans-serif;
}

body.cgm-collections-page .cgm-collections-count {
    color: var(--cgm-collections-navy);
    font-size: 14px;
    font-weight: 600;
}

/* Omeka browse_sort_links() */
body.cgm-collections-page .cgm-collections-sort {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    color: var(--cgm-collections-muted);
    font-size: 13px;
    white-space: nowrap;
}

body.cgm-collections-page .cgm-collections-sort-label {
    color: var(--cgm-collections-muted);
}

body.cgm-collections-page .cgm-collections-sort ul,
body.cgm-collections-page .cgm-collections-sort .sort-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.cgm-collections-page .cgm-collections-sort li {
    margin: 0;
    padding: 0;
}

body.cgm-collections-page .cgm-collections-sort a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(11,44,69,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.48);
    color: var(--cgm-collections-navy) !important;
    font-weight: 600;
    text-decoration: none !important;
}

body.cgm-collections-page .cgm-collections-sort a:hover,
body.cgm-collections-page .cgm-collections-sort a:focus {
    border-color: var(--cgm-collections-gold);
    background: #fff;
    color: var(--cgm-collections-gold-dark) !important;
    outline: none;
}

/* Cards */
body.cgm-collections-page .cgm-collections-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

body.cgm-collections-page .cgm-collection-card {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--cgm-collections-line);
    border-radius: 3px;
    background: rgba(255,255,255,.64);
    box-shadow: 0 10px 28px rgba(11,44,69,.055);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.cgm-collections-page .cgm-collection-card:hover {
    transform: translateY(-3px);
    border-color: rgba(180,154,98,.72);
    box-shadow: 0 18px 38px rgba(11,44,69,.10);
}

body.cgm-collections-page .cgm-collection-card-link {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    color: inherit !important;
    text-decoration: none !important;
}

body.cgm-collections-page .cgm-collection-card-media {
    position: relative;
    min-height: 228px;
    overflow: hidden;
    background-position: center;
    background-size: cover;
    background-color: var(--cgm-collections-navy);
}

body.cgm-collections-page .cgm-collection-card-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(6,24,39,.82) 0%, rgba(6,24,39,.26) 44%, rgba(6,24,39,.04) 100%);
}

body.cgm-collections-page .cgm-collection-card-type {
    position: absolute;
    z-index: 2;
    left: 18px;
    bottom: 15px;
    color: #f0d7a0;
    font-family: "Hind", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
}

body.cgm-collections-page .cgm-collection-card-media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(180,154,98,.14), transparent 42%),
        repeating-linear-gradient(
            135deg,
            rgba(255,255,255,.022) 0,
            rgba(255,255,255,.022) 1px,
            transparent 1px,
            transparent 18px
        ),
        var(--cgm-collections-navy);
}

body.cgm-collections-page .cgm-collection-card-empty-mark {
    color: rgba(255,255,255,.12);
    font-family: "Caudex", serif;
    font-size: 76px;
    font-weight: 700;
    letter-spacing: -.05em;
}

body.cgm-collections-page .cgm-collection-card-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 24px 24px 22px;
}

body.cgm-collections-page .cgm-collection-card-meta {
    margin-bottom: 8px;
    color: var(--cgm-collections-gold-dark);
    font-family: "Hind", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .11em;
    line-height: 1.3;
    text-transform: uppercase;
}

body.cgm-collections-page .cgm-collection-card h2 {
    margin: 0;
    color: var(--cgm-collections-navy);
    font-family: "Caudex", serif;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.018em;
    line-height: 1.12;
}

body.cgm-collections-page .cgm-collection-card p {
    margin: 15px 0 18px;
    color: #415a6d;
    font-family: "Hind", sans-serif;
    font-size: 15px;
    line-height: 1.55;
}


body.cgm-collections-page .cgm-collection-card-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-top: auto;
    margin-left: auto;
    border: 1px solid rgba(11,44,69,.16);
    border-radius: 50%;
    color: var(--cgm-collections-navy);
    font-family: "Hind", sans-serif;
    font-size: 18px;
    line-height: 1;
    transition: transform .18s ease, border-color .18s ease, color .18s ease;
}

body.cgm-collections-page .cgm-collection-card:hover .cgm-collection-card-arrow {
    transform: translateX(3px);
    border-color: var(--cgm-collections-gold);
    color: var(--cgm-collections-gold-dark);
}

body.cgm-collections-page .cgm-collection-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    color: var(--cgm-collections-navy);
    font-family: "Hind", sans-serif;
    font-size: 14px;
    font-weight: 700;
}

body.cgm-collections-page .cgm-collection-card-cta > span {
    transition: transform .18s ease;
}

body.cgm-collections-page .cgm-collection-card:hover .cgm-collection-card-cta > span {
    transform: translateX(4px);
}

/* Pagination */
body.cgm-collections-page .cgm-collections-pagination {
    margin-top: 32px;
}

body.cgm-collections-page .cgm-collections-pagination:empty {
    display: none;
}

body.cgm-collections-page .cgm-collections-pagination ul {
    margin: 0;
}

/* Bottom cross-links */
body.cgm-collections-page .cgm-collections-crosslinks {
    display: grid;
    grid-template-columns: minmax(0,1.2fr) minmax(300px,.8fr);
    gap: 44px;
    align-items: center;
    margin-top: 64px;
    padding: 34px 0 0;
    border-top: 1px solid var(--cgm-collections-line);
}

body.cgm-collections-page .cgm-collections-crosslinks h2 {
    margin: 0;
    color: var(--cgm-collections-navy);
    font-family: "Caudex", serif;
    font-size: clamp(28px, 3vw, 39px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
}

body.cgm-collections-page .cgm-collections-crosslinks-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

body.cgm-collections-page .cgm-collections-crosslinks-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--cgm-collections-line);
    background: rgba(255,255,255,.52);
    color: var(--cgm-collections-navy) !important;
    font-family: "Hind", sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
}

body.cgm-collections-page .cgm-collections-crosslinks-links a:hover,
body.cgm-collections-page .cgm-collections-crosslinks-links a:focus {
    border-color: var(--cgm-collections-gold);
    background: #fff;
    color: var(--cgm-collections-gold-dark) !important;
    outline: none;
}

/* Empty state */
body.cgm-collections-page .cgm-collections-empty {
    padding: 54px 0;
    text-align: center;
}

body.cgm-collections-page .cgm-collections-empty h2 {
    margin: 0 0 8px;
    color: var(--cgm-collections-navy);
    font-family: "Caudex", serif;
}

body.cgm-collections-page .cgm-collections-empty p {
    color: var(--cgm-collections-muted);
    font-family: "Hind", sans-serif;
}

@media screen and (max-width: 980px) {
    body.cgm-collections-page .cgm-collections-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    body.cgm-collections-page .cgm-collections-crosslinks {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}

@media screen and (max-width: 680px) {
    body.cgm-collections-page .cgm-collections-shell {
        width: calc(100% - 28px);
    }

    body.cgm-collections-page .cgm-collections-hero {
        padding: 50px 0 46px;
    }

    body.cgm-collections-page .cgm-collections-lede {
        font-size: 16px;
    }

    body.cgm-collections-page .cgm-collections-main {
        padding: 36px 0 54px;
    }

    body.cgm-collections-page .cgm-collections-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    body.cgm-collections-page .cgm-collections-sort {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 10px;
    }

    body.cgm-collections-page .cgm-collections-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body.cgm-collections-page .cgm-collection-card-media {
        min-height: 205px;
    }

    body.cgm-collections-page .cgm-collection-card-copy {
        padding: 21px 20px 20px;
    }

    body.cgm-collections-page .cgm-collection-card h2 {
        font-size: 25px;
    }

    body.cgm-collections-page .cgm-collections-crosslinks {
        margin-top: 46px;
    }

    body.cgm-collections-page .cgm-collections-crosslinks-links {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.cgm-collections-page .cgm-collection-card,
    body.cgm-collections-page .cgm-collection-card-arrow {
        transition: none;
    }
}


/* ==========================================================
   Mobile sort controls
   Override Big Picture's icon-only mobile sort presentation.
   ========================================================== */
@media screen and (max-width: 800px) {
    body.cgm-collections-page .cgm-collections-sort {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        width: 100%;
        white-space: nowrap;
    }

    body.cgm-collections-page .cgm-collections-sort-label {
        flex: 0 0 auto;
        margin: 0 !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list,
    body.cgm-collections-page .cgm-collections-sort .sort-links {
        display: flex !important;
        flex: 0 1 auto;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        list-style: none !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li {
        display: block !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li:not(:last-child) {
        margin-right: 0 !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a {
        position: static !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 34px;
        padding: 6px 11px !important;
        text-indent: 0 !important;
        line-height: 1.2 !important;
        white-space: nowrap;
    }

    /* Big Picture replaces the labels with icons below 800 px.
       Suppress those generated icons and restore the actual link text. */
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a::before,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a::after {
        display: none !important;
        content: none !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list .sort-icon {
        display: none !important;
    }

    /* Keep a restrained direction indicator on the active sorting field. */
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.sorting.asc a::after {
        display: inline !important;
        content: "↑" !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        text-indent: 0 !important;
        font-size: 12px;
        line-height: 1;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.sorting.desc a::after {
        display: inline !important;
        content: "↓" !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        text-indent: 0 !important;
        font-size: 12px;
        line-height: 1;
    }
}

@media screen and (max-width: 430px) {
    body.cgm-collections-page .cgm-collections-sort {
        gap: 7px !important;
    }

    body.cgm-collections-page .cgm-collections-sort-label {
        font-size: 12px;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list {
        gap: 5px !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a {
        min-height: 32px;
        padding: 5px 9px !important;
        font-size: 12px;
    }
}


/* CGM consistency: active sort button uses the same visual language
   as the collection detail pages. */
body.cgm-collections-page .cgm-collections-sort li.sorting a,
body.cgm-collections-page .cgm-collections-sort li.asc a,
body.cgm-collections-page .cgm-collections-sort li.desc a {
    border-color: rgba(180,154,98,.75) !important;
    background: #fff !important;
    color: var(--cgm-collections-gold-dark) !important;
}


/* ==========================================================
   Compact overview hero – harmonised with Ausstellungen
   ========================================================== */
body.cgm-collections-page .cgm-collections-hero {
    padding: 44px 0 40px;
}

body.cgm-collections-page .cgm-collections-kicker {
    margin-bottom: 8px;
    font-size: 11px;
}

body.cgm-collections-page .cgm-collections-hero h1 {
    font-size: clamp(36px, 4.6vw, 56px);
    line-height: 1.04;
}

body.cgm-collections-page .cgm-collections-lede {
    margin-top: 15px;
    max-width: 760px;
    font-size: 17px;
    line-height: 1.52;
}

@media screen and (max-width: 620px) {
    body.cgm-collections-page .cgm-collections-hero {
        padding: 30px 0 29px;
    }

    body.cgm-collections-page .cgm-collections-hero h1 {
        font-size: clamp(32px, 9vw, 44px);
    }

    body.cgm-collections-page .cgm-collections-lede {
        margin-top: 12px;
        font-size: 16px;
    }
}


/* ==========================================================
   /collections – DESKTOP ONLY: sort pills horizontal
   Mobile is intentionally left untouched because it already works.
   ========================================================== */
@media screen and (min-width: 801px) {
    body.cgm-collections-page .cgm-collections-sort {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        white-space: nowrap;
    }

    body.cgm-collections-page .cgm-collections-sort-label {
        flex: 0 0 auto;
        margin-right: 6px !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list,
    body.cgm-collections-page .cgm-collections-sort .sort-links {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        list-style: none !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.asc,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.desc,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.sorting {
        display: block !important;
        float: none !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li:not(:last-child) {
        margin-right: 0 !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a {
        position: static !important;
        display: inline-flex !important;
        align-items: center !important;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 30px !important;
        padding: 5px 10px !important;
        border: 1px solid rgba(11,44,69,.14) !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,.48) !important;
        color: var(--cgm-collections-navy) !important;
        font-family: "Hind", sans-serif;
        font-size: 13px !important;
        font-weight: 600;
        line-height: 1.2 !important;
        text-indent: 0 !important;
        text-decoration: none !important;
        white-space: nowrap;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a::before,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a::after,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list .sort-icon {
        display: none !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a:hover,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li a:focus,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.sorting a,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.asc a,
    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.desc a {
        border-color: var(--cgm-collections-gold) !important;
        background: #fff !important;
        color: var(--cgm-collections-gold-dark) !important;
        outline: none;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.sorting.asc a::after {
        display: inline !important;
        content: "↑" !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin-left: 5px;
        font-size: 11px;
        line-height: 1;
        text-indent: 0 !important;
    }

    body.cgm-collections-page .cgm-collections-sort #sort-links-list li.sorting.desc a::after {
        display: inline !important;
        content: "↓" !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin-left: 5px;
        font-size: 11px;
        line-height: 1;
        text-indent: 0 !important;
    }
}
