/*
 * BIG Möbel Referenzen – .com design
 * Structure follows the supplied reference pages; presentation follows the BIG Möbel theme:
 * Open Sans inheritance, Bootstrap-compatible spacing/grid, square controls and #bc1c2b accent.
 */

:root {
    --bmr-accent: #e20917;
    --bmr-accent-dark: rgb(130, 18, 30);
    --bmr-text: #2b2b2b;
    --bmr-muted: #777;
    --bmr-light: #f7f7f7;
    --bmr-border: #e4e4e4;
    --bmr-white: #fff;
}

.bmr-referenzen-archive,
.bmr-referenz-single {
    width: 100%;
    color: var(--bmr-text);
    font-family: inherit;
    background: var(--bmr-white);
}

#primary.bmr-referenzen-archive, 
#primary.bmr-referenz-single {
    max-width: 1870px
}

.bmr-referenzen-archive *,
.bmr-referenz-single * {
    box-sizing: border-box;
}

.bmr-container {
    max-width: 1400px;
}

/* Panoramic hero: close to the shallow proportions of the supplied pages. */
.bmr-hero {
    position: relative;
    min-height: clamp(350px, 25vw, 500px);
    overflow: hidden;
    background: var(--bmr-accent);
}

.bmr-hero.no-image {
    position: relative;
    min-height: clamp(245px, 18vw, 350px);
    overflow: hidden;
    background: var(--bmr-accent);
}

.bmr-hero__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bmr-hero__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.04) 15%, rgba(0,0,0,.55) 100%);
}

.bmr-hero.no-image .bmr-hero__shade {
    background: linear-gradient(115deg, rgba(0,0,0,.16), rgba(0,0,0,.02));
}

.bmr-hero__inner {
    position: relative;
    z-index: 2;
    min-height: inherit;
    display: flex;
    align-items: flex-end;
    padding-top: 48px;
    padding-bottom: 38px;
}

.bmr-hero h1 {
    margin: 0;
    max-width: 1000px;
    color: var(--bmr-white);
    font-size: clamp(2rem, 4vw, 3.45rem);
    line-height: 1.05;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .01em;
}

.bmr-intro,
.bmr-project-intro,
.bmr-copy-block {
    padding: 52px 0;
}

.bmr-prose {
    max-width: 1280px;
    font-size: 1rem;
    line-height: 1.75;
}

.bmr-prose > :last-child {
    margin-bottom: 0;
}

.bmr-prose a,
.bmr-quote a {
    color: var(--bmr-accent);
    font-weight: 600;
    text-decoration: none;
}

.bmr-prose a:hover,
.bmr-quote a:hover {
    text-decoration: underline;
}

/* Archive filters and count mirror the supplied filter/result structure. */
.bmr-listing {
    padding: 42px 0 72px;
}

.bmr-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.bmr-filter__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--bmr-border);
    border-radius: 0;
    background: var(--bmr-white);
    color: var(--bmr-text);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.bmr-filter__item:hover,
.bmr-filter__item:focus,
.bmr-filter__item.is-active {
    border-color: var(--bmr-accent);
    background: var(--bmr-accent);
    color: var(--bmr-white);
}

.bmr-result-count {
    margin-bottom: 22px;
    color: var(--bmr-muted);
    font-size: .94rem;
}

.bmr-result-count strong {
    color: var(--bmr-text);
}

.bmr-grid {
    margin-left: -8px;
    margin-right: -8px;
}

.bmr-grid__column {
    padding: 8px;
    margin-bottom: 0!important;
}

.bmr-card {
    display: block;
    color: inherit;
    text-decoration: none !important;
}

.bmr-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1.37 / 1;
    background: #dedede;
}

.bmr-card__image,
.bmr-card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.bmr-card__placeholder {
    background: linear-gradient(135deg, #ededed, #d5d5d5);
}

.bmr-card__category {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 10px;
    background: rgba(255,255,255,.95);
    color: var(--bmr-text);
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* The source page uses a button-like project caption; here it gets BIG Möbel's red treatment. */
.bmr-card__caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 14px 18px;
    background: rgba(188,28,43,.95);
    color: var(--bmr-white);
    font-size: 1rem;
    line-height: 1.35;
}

.bmr-card__title {
    font-weight: 700;
}

.bmr-card__country {
    font-weight: 400;
}

.bmr-card:hover .bmr-card__image,
.bmr-card:focus .bmr-card__image {
    transform: scale(1.035);
}

.bmr-card:hover .bmr-card__caption,
.bmr-card:focus .bmr-card__caption {
    background: rgba(159,20,33,.97);
}

.bmr-pagination {
    margin-top: 38px;
}

.bmr-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.bmr-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 5px 10px;
    border: 1px solid var(--bmr-border);
    border-radius: 0;
    color: var(--bmr-text);
    text-decoration: none;
}

.bmr-pagination .page-numbers.current,
.bmr-pagination a.page-numbers:hover {
    border-color: var(--bmr-accent);
    background: var(--bmr-accent);
    color: var(--bmr-white);
}

.bmr-empty {
    padding: 40px 0;
}

/* Single project intro. */
.bmr-project__meta {
    margin: 0 0 20px;
    color: var(--bmr-muted);
    font-size: .96rem;
}

.bmr-project__meta-divider {
    display: inline-block;
    margin: 0 8px;
    color: #c2c2c2;
}

/* Repeated 50/50 editorial panels used for facts and quote/contact. */
.bmr-split {
    padding: 25px 0 55px;
}

.bmr-split__row {
    overflow: hidden;
    background: var(--bmr-light);
}

.bmr-split__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 390px;
    padding: 52px!important;
}

.bmr-split__content h2,
.bmr-products__heading {
    margin: 0 0 26px;
    color: var(--bmr-text);
    font-size: clamp(1.55rem, 2.3vw, 2.15rem);
    line-height: 1.15;
    font-weight: 700;
    text-transform: uppercase;
}

.bmr-split__image-wrap {
    min-height: 390px;
    padding: 0;
}

.bmr-split__image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 390px;
    object-fit: cover;
}

.bmr-facts__grid {
    margin: 0;
}

.bmr-facts__row {
    display: grid;
    grid-template-columns: minmax(120px, .75fr) minmax(0, 1.25fr);
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,.09);
}

.bmr-facts__row:first-child {
    padding-top: 0;
}

.bmr-facts__row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.bmr-facts__row dt,
.bmr-facts__row dd {
    margin: 0;
    line-height: 1.5;
}

.bmr-facts__row dt {
    font-weight: 700;
}

.bmr-facts__row dd {
    color: var(--bmr-muted);
}

/* Aspect-ratio-aware project gallery: every image is a gallery item; no automatic lead image. */
.bmr-gallery {
    margin: 0 0 55px;
}

.bmr-gallery__grid {
    margin-top: 0;
}

.bmr-gallery__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.bmr-gallery__row:last-child {
    margin-bottom: 0;
}

.bmr-gallery__item {
    position: relative;
    flex-grow: var(--bmr-ratio);
    flex-shrink: 1;
    flex-basis: 0;
    min-width: 0;
    aspect-ratio: var(--bmr-ratio);
}

.bmr-gallery__item a {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bmr-gallery__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

/* A single-image gallery should not make a portrait image excessively wide/tall. */
.bmr-gallery__row--count-1 {
    justify-content: center;
}

.bmr-gallery__row--count-1 .bmr-gallery__item--portrait {
    flex: 0 1 430px;
    max-width: 430px;
}

.bmr-gallery__row--count-1 .bmr-gallery__item--square {
    flex: 0 1 760px;
    max-width: 760px;
}

.bmr-gallery__hover {
    position: absolute;
    inset: 0;
    background: rgba(188,28,43,0);
    transition: background .25s ease;
}

.bmr-gallery__item a:hover img {
    transform: scale(1.025);
}

.bmr-quote blockquote {
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    color: var(--bmr-text);
    font-size: clamp(1.45rem, 2.5vw, 2.25rem);
    line-height: 1.3;
    font-weight: 700;
    text-transform: uppercase;
}

.bmr-quote__person {
    margin: 0 0 14px;
    line-height: 1.55;
}

.bmr-quote__contact {
    margin: 0;
}

.bmr-quote__contact span {
    display: block;
    margin-top: 4px;
}

.bmr-ambience {
    margin-top: 15px;
    overflow: hidden;
    max-height: 760px;
}

.bmr-ambience__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 760px;
    object-fit: cover;
}

/* Product previews intentionally use the active theme's WooCommerce archive card template. */
.bmr-products {
    padding: 48px 0 60px;
}

.bmr-products__archive-loop ul.products {
    margin-top: 0;
    margin-bottom: 0;
}

/* Mirror the theme's four-column archive sizing even when this custom post type does not
 * receive Storefront's storefront-full-width-content body class. The card itself is rendered
 * by content-product.php, so all product typography, price, image and hover rules remain native. */
.bmr-products__archive-loop ul.products.columns-4 li.product {
    width: 24% !important;
    margin-right: 0 !important;
    padding: 20px !important;
    float: none !important;
    display: inline-block !important;
    vertical-align: top;
    text-align: left;
    background: #fff;
}

.bmr-products__archive-loop ul.products.columns-4 li.product:hover {
    box-shadow: rgba(0, 0, 0, 0.24) 0 3px 8px;
    transition: 0.3s;
}

@media (max-width: 991px) {
    .bmr-products__archive-loop ul.products.columns-4 li.product {
        width: 25% !important;
    }
}

@media (max-width: 767.98px) {
    .bmr-products {
        padding: 44px 0 48px;
    }

    .bmr-products__archive-loop ul.products.columns-4 li.product {
        width: 45% !important;
        padding: 0 15px 15px !important;
    }
}

@media (max-width: 575.98px) {
    .bmr-products__archive-loop ul.products.columns-4 li.product {
        width: 100% !important;
    }
}

/* End-of-project CTA mirrors the source page's "Alle Referenzen" block in BIG Möbel styling. */
.bmr-all-references {
    padding: 48px 0 65px;
}

.bmr-all-references__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    border-top: 5px solid var(--bmr-accent);
    background: var(--bmr-light);
    color: var(--bmr-text);
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}

.bmr-all-references__link span {
    font-size: clamp(1.25rem, 2.4vw, 2rem);
    font-weight: 700;
    text-transform: uppercase;
}

.bmr-all-references__link strong {
    color: var(--bmr-accent);
    font-size: clamp(2rem, 5vw, 4.2rem);
    line-height: 1;
}

.bmr-all-references__link:hover,
.bmr-all-references__link:focus {
    background: var(--bmr-accent);
    color: var(--bmr-white);
}

.bmr-all-references__link:hover strong,
.bmr-all-references__link:focus strong {
    color: var(--bmr-white);
}

/* Plugin lightbox; no theme JavaScript dependency required. */
.bmr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0,0,0,.88);
}

.bmr-lightbox.is-open {
    display: flex;
}

.bmr-lightbox__image {
    display: block;
    max-width: min(1500px, 94vw);
    max-height: 90vh;
    width: auto;
    height: auto;
    box-shadow: 0 15px 60px rgba(0,0,0,.35);
}

.bmr-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--bmr-white);
    color: var(--bmr-text);
    font-size: 30px;
    line-height: 46px;
    cursor: pointer;
}

body.bmr-lightbox-open {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .bmr-facts__row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

@media (max-width: 767.98px) {
    .bmr-hero {
        min-height: 260px;
    }

    .bmr-hero__inner {
        padding-bottom: 28px;
    }

    .bmr-intro,
    .bmr-project-intro,
    .bmr-copy-block {
        padding: 38px 0;
    }

    .bmr-listing {
        padding-top: 30px;
    }

    .bmr-filter {
        gap: 6px;
    }

    .bmr-filter__item {
        min-height: 38px;
        padding: 7px 11px;
        font-size: .82rem;
    }

    .bmr-card__caption {
        padding: 12px 14px;
        font-size: .92rem;
    }

    .bmr-split {
        padding: 10px 0 38px;
    }

    .bmr-split__content {
        min-height: 0;
        padding: 34px 26px;
    }

    .bmr-split__image-wrap,
    .bmr-split__image {
        min-height: 280px;
    }

    .bmr-gallery {
        margin-bottom: 38px;
    }

    .bmr-all-references__link {
        padding: 22px;
    }
}

@media (max-width: 575.98px) {
    .bmr-project__meta-divider {
        display: block;
        width: 0;
        height: 7px;
        overflow: hidden;
        margin: 0;
    }

    .bmr-grid__column {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .bmr-gallery__row {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 8px;
    }

    .bmr-gallery__item {
        flex: 1 1 100%;
        width: 100%;
    }

    .bmr-gallery__item--portrait {
        flex: 0 1 min(78vw, 360px);
        width: min(78vw, 360px);
        margin-left: auto;
        margin-right: auto;
    }

    .bmr-all-references__link {
        align-items: flex-end;
    }
}
