/* =========================================================
   HAGEDORN REFERENZEN
   ========================================================= */

.hagedorn-references {
    width: min(100% - 60px, 1200px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 90px 0 120px;
    color: #000;
    font-family: "Radio Canada Big", Arial, sans-serif;
}

.hreferences-kicker {
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
}

.hreferences-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    margin-bottom: 30px;
}

.hreferences-heading {
    margin: 0 !important;
    color: #000 !important;
    font-family: "Radio Canada Big", Arial, sans-serif !important;
    font-size: 48px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: -0.5px;
}

/* Suche */
.hreferences-search {
    position: relative;
    display: block;
    flex: 0 0 330px;
    width: 330px;
    background: #000;
}

.hreferences-search__input {
    display: block;
    width: 100%;
    height: 58px;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0;
    padding: 0 62px 0 22px;
    background: transparent !important;
    box-shadow: none !important;
    color: #fff !important;
    font-family: "Radio Canada Big", Arial, sans-serif !important;
    font-size: 14px;
    font-weight: 400;
}

.hreferences-search__input::placeholder {
    color: #fff;
    opacity: 1;
}

.hreferences-search__icon {
    position: absolute;
    top: 50%;
    right: 23px;
    width: 18px;
    height: 18px;
    border: 3px solid #fdc600;
    border-radius: 50%;
    transform: translateY(-56%);
    pointer-events: none;
}

.hreferences-search__icon::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: -4px;
    width: 9px;
    height: 3px;
    background: #fdc600;
    transform: rotate(45deg);
    transform-origin: left center;
}

/* Kategorien: 4 Spalten x 5 Zeilen wie im Layout */
.hreferences-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(5, auto);
    grid-auto-flow: column;
    column-gap: 55px;
    row-gap: 13px;
    padding: 25px 15px 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid rgba(0, 0, 0, 0.45);
}

.hreferences-filter {
    appearance: none;
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    color: #263e50;
    font-family: "Radio Canada Big", Arial, sans-serif !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.hreferences-filter small {
    flex: 0 0 auto;
    font-size: inherit;
    font-weight: inherit;
}

.hreferences-filter:hover {
    color: #000;
}

.hreferences-filter.is-active {
    padding-left: 13px;
    color: #000;
    font-weight: 700;
}

.hreferences-filter.is-active::before {
    content: "›";
    position: absolute;
    top: -1px;
    left: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* Listenüberschrift */
.hreferences-list-head {
    padding: 38px 0 17px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.45);
}

.hreferences-current-category {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

/* Liste */
.hreferences-list {
    transition: opacity 0.2s ease;
}

.hagedorn-references.is-loading .hreferences-list {
    opacity: 0.32;
    pointer-events: none;
}

.hreference-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48%;
    align-items: stretch;
    height: 132px;
    min-height: 132px;
    border-bottom: 0;
    color: #000 !important;
    text-decoration: none !important;
    overflow: hidden;
    transition: height 0.34s cubic-bezier(.4, 0, .2, 1);
}

/* Die komplette Referenzzeile wird beim Hover höher.
 * Dadurch wachsen gelber Textbereich und Bild gemeinsam. */
.hreference-item:hover {
    height: 162px;
}

.hreference-item__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 22px 25px;
    background: transparent;
    transition: background-color 0.25s ease;
}

.hreference-item__title {
    max-width: 390px;
    margin: 0 0 6px !important;
    color: #000 !important;
    font-family: "Radio Canada Big", Arial, sans-serif !important;
    font-size: 25px !important;
    font-weight: 700 !important;
    line-height: 0.96 !important;
    letter-spacing: -0.3px;
}

.hreference-item__date {
    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;
}

.hreference-item__media {
    position: relative;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: transparent;
}

.hreference-item__media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(calc(50% - 41px) 0 calc(50% - 41px) 0);
    transform: scale(1.001);
    transform-origin: center center;
    transition:
        clip-path 0.34s cubic-bezier(.4, 0, .2, 1),
        transform 0.40s ease;
}

.hreference-item:hover .hreference-item__content {
    background: #fdc600;
}

/*
 * Das Bild ist technisch immer so hoch wie die komplette Referenzzeile.
 * Im Normalzustand wird ein 82px hoher Streifen in der Mitte sichtbar.
 * Dadurch öffnet es sich beim Hover gleichmässig nach oben UND unten,
 * ohne Positionssprung.
 */
.hreference-item:hover .hreference-item__media img {
    clip-path: inset(0);
    transform: scale(1.02);
}

.hreferences-empty,
.hreferences-config-error {
    margin: 0;
    padding: 28px 0;
    font-size: 14px;
}

@media (max-width: 991px) {
    .hagedorn-references {
        width: min(100% - 40px, 850px);
        padding: 70px 0 90px;
    }

    .hreferences-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 25px;
    }

    .hreferences-heading {
        font-size: 40px !important;
    }

    .hreferences-search {
        flex-basis: auto;
        width: 100%;
    }

    .hreferences-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-flow: row;
        gap: 13px 35px;
        padding-left: 0;
        padding-right: 0;
    }

    .hreference-item {
        grid-template-columns: minmax(0, 1fr) 44%;
    }
}

@media (max-width: 620px) {
    .hreferences-heading {
        font-size: 34px !important;
    }

    .hreferences-filters {
        grid-template-columns: 1fr;
    }

    .hreference-item {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .hreference-item:hover {
        height: auto;
    }

    .hreference-item__media {
        min-height: 190px;
        order: -1;
    }

    .hreference-item__media img {
        clip-path: inset(0);
        transform: none;
    }

    .hreference-item:hover .hreference-item__media img {
        clip-path: inset(0);
        transform: scale(1.02);
    }

    .hreference-item__title {
        font-size: 22px !important;
    }
}
