main#maincontent {
    max-width: var(--default_width);
    width: 80%;
    margin: 4em auto;
}

h1 {
    letter-spacing: 0.01em;
    color: var(--primary);
    position: relative;
    padding-bottom: 27px;
    margin: 13.5px 0;
}

h1::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    bottom: 0px;
    border-bottom: 1px var(--body) solid;
    width: 27px;
}

.werdegang.wp-block-table td,
.werdegang.wp-block-table th {
    border: unset;
    padding: unset;
}

.werdegang.wp-block-table td {
    min-width: 80px;
}



/*--------------------------------------------------------------
# Referenzliste zweispaltig – nur vor H2 umbrechen
--------------------------------------------------------------*/
.bd-references-grouped {
    margin-top: 4em;
    column-count: 2;
    column-gap: 40px;
}

@media (max-width: 640px) {
    .bd-references-grouped {
        column-count: 1;
        column-gap: unset;
    }
}

/* H2 und zugehörige Liste nicht trennen */
.bd-references-grouped h2,
.bd-references-grouped ul {
    -webkit-column-break-inside: avoid;
    break-inside: avoid-column;
}

/* H2 mit nachfolgender Liste zusammenhalten */
.bd-references-grouped h2 {
    break-after: avoid-column;
    /* vermeidet Spaltenumbruch direkt nach der H2 */
    margin: 0 0 .4rem;
    letter-spacing: 0.05em;
    color: #ccd6cc;
    text-align: left;
    margin-left: 0;
    margin-bottom: 13.5px;
}

.bd-references-grouped h2::after {
    content: unset;
}

.bd-references-grouped h2+ul {
    margin-top: .25rem;
}

.bd-references-grouped ul {
    margin-bottom: 2em;
}

.bd-references-grouped ul li {
    -webkit-column-break-inside: avoid;
    break-inside: avoid-column;
}


/* Gutenberg Galerie als 3/2/1 Grid mit Rahmen und Contain */
.link_gallery.wp-block-gallery {
    --gallery-gap: 1.5rem;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gallery-gap);
}

.wp-block-gallery.has-nested-images.link_gallery figure.wp-block-image.size-large,
.link_gallery figure.wp-block-image.size-large {
    width: 100%;
}

/* Tablet: 2 Spalten */
@media (max-width: 1024px) {
    .link_gallery.wp-block-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 Spalte */
@media (max-width: 640px) {
    .link_gallery.wp-block-gallery {
        grid-template-columns: 1fr;
    }
}

/* Figure-Elemente auf volle Breite + Border */
.link_gallery.wp-block-gallery figure {
    margin: 0 !important;
    width: 100%;
    border: 1px solid #ccd6cc;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    /* optional, falls Bilder transparente Bereiche haben */
    padding: 0.5rem;
    /* optional etwas Innenabstand */
    box-sizing: border-box;
}

/* Bilder im Contain-Modus */
.link_gallery.wp-block-gallery img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}



/*--------------------------------------------------------------
# CF7 Formular Styles (angepasst an bestehendes Kontaktformular)
--------------------------------------------------------------*/

.wpcf7 form input[type="text"],
.wpcf7 form input[type="email"],
.wpcf7 form input[type="tel"],
.wpcf7 form input[type="url"],
.wpcf7 form input[type="number"],
.wpcf7 form input[type="date"],
.wpcf7 form select,
.wpcf7 form textarea {
    display: block;
    width: 100%;
    color: #515b58;
    border: 1px solid #ccd6cc;
    background-color: #fafafa;
    padding: 3px;
    font-size: 16px;
    line-height: 1.4;
    font-family: inherit;
    box-sizing: border-box;
}

/* Fokuszustand */
.wpcf7 form input[type="text"]:focus,
.wpcf7 form input[type="email"]:focus,
.wpcf7 form input[type="tel"]:focus,
.wpcf7 form input[type="url"]:focus,
.wpcf7 form input[type="number"]:focus,
.wpcf7 form input[type="date"]:focus,
.wpcf7 form select:focus,
.wpcf7 form textarea:focus {
    border: 1px solid #515b58;
    background-color: #ffffff;
    outline: none;
}

/* Placeholder Styling */
.wpcf7 form ::placeholder {
    color: #999;
    opacity: 1;
}

/* Button */
.wpcf7 form input[type="submit"] {
    background-color: #515b58;
    color: #ffffff;
    text-transform: uppercase;
    padding: 0.6em 1.2em;
    border: none;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 1px;
    display: inline-block;
}

.wpcf7 form input[type="submit"]:hover {
    background-color: #33393a;
}

/*--------------------------------------------------------------
# Sidebar Kategorien-Liste
--------------------------------------------------------------*/
.bdp-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.bdp-cat-list__item {
    margin: 0;
    padding: 0;
}

.bdp-cat-list__link {
    display: inline-block;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--darker, #1d1d1b);
}

.bdp-cat-list__link:hover {
    filter: brightness(.9);
}

.bdp-cat-sublist {
    margin-top: .4em;
    list-style: none;
    padding-left: .4em;
}

.bdp-cat-sublist__item a {
    color: var(--darker, #1d1d1b);
    text-decoration: none;
}

/*--------------------------------------------------------------
# Kategorien-Grid (2 Spalten)
--------------------------------------------------------------*/
.bdp-grid--cats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.tax-bd_project_category .bdp-grid--cats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 800px) {
    .bdp-grid--cats {
        grid-template-columns: 1fr;
    }
}

@media only screen and (min-width: 768px) and (max-width: 980px) {
    .tax-bd_project_category .bdp-grid--cats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 767px) {
    .tax-bd_project_category .bdp-grid--cats {
        display: block;
        grid-template-columns: unset;
    }
}



/* Karten-Layout */
.bdp-card--cat .bdp-card__figure {
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    margin: 0;
}

.bdp-card--cat .bdp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: none;
}

:root {
    --bdp-caption-peek: 80px;
    --bdp-caption-category-peek: 0px;
}

.bdp-card__caption {
    position: absolute;
    inset: -1px 0;
    background: rgba(255, 255, 255, 0.85);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transform: translateY(calc(100% - var(--bdp-caption-peek)));
    transition: transform 0.7s ease, background 0.7s ease, padding 0.7s ease;
    will-change: transform;
}

.tax-bd_project_category .bdp-card__caption {
    transform: translateY(calc(100% - var(--bdp-caption-category-peek)));
}

.bdp-card__caption .bdp-card__title {
    font-size: 1.69230769em;
    line-height: 1.09090909em;
    letter-spacing: 0.01em;
    color: #515b58;
    margin: 0;
    padding: 0;
    transition: color 0.7s ease;
}

.bdp-card__caption .bdp-card__line,
.bdp-card__caption .bdp-card__cta {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.bdp-card__caption .bdp-card__line {
    width: 40px;
    height: 2px;
    background: var(--darker, #1d1d1b);
}

.bdp-card__caption .bdp-card__cta {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #000;
}

.bdp-card__figure:hover .bdp-card__caption {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 1.5rem;
}

.bdp-card__figure:hover .bdp-card__caption .bdp-card__title {
    color: #1d1d1b;
}

.bdp-card__figure:hover .bdp-card__caption .bdp-card__line,
.bdp-card__figure:hover .bdp-card__caption .bdp-card__cta {
    opacity: 1;
}

@media only screen and (min-width: 981px) {
    .tax-bd_project_category .bdp-card__caption .bdp-card__title {
        font-size: 1.2em;
    }

    .tax-bd_project_category .bdp-card__caption .bdp-card__line {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .bdp-card--cat .bdp-card__img,
    .bdp-card__caption,
    .bdp-card__caption .bdp-card__line,
    .bdp-card__caption .bdp-card__cta {
        transition: none;
    }
}




/*--------------------------------------------------------------
# Layout Wrapper (Sidebar links, Content rechts)
--------------------------------------------------------------*/
.bdp-layout-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 2rem;
}

.bdp-sidebar {
    position: sticky;
    top: 24px;
}

.bdp-content {
    min-width: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .bdp-layout-grid {
        grid-template-columns: 1fr;
    }

    .single-bd_project .bdp-layout-grid {
        display: flex;
        flex-direction: column;
    }

    .single-bd_project .bdp-content {
        order: 1;
        /* zuerst */
    }

    .single-bd_project .bdp-sidebar {
        order: 2;
        /* danach */
    }

    .bdp-sidebar {
        position: relative;
        margin-bottom: 2rem;
    }

    .bdp-card--cat {
        margin-bottom: 2rem;
    }
}


/* Single Project */

/* Credit */
.bdp-project__credit {
    margin: .5rem 0 0;
    font-size: .9rem;
    color: var(--grey, #555)
}

/* Lightbox */
.bdp-lightbox[hidden] {
    display: none !important
}

.bdp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-items: center;
    padding: clamp(8px, 2vw, 24px)
}

.bdp-lightbox__stage {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 95vh;
    pointer-events: none
}

.bdp-lightbox__img {
    max-width: 95vw;
    max-height: 85vh;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    pointer-events: auto
}

.bdp-lightbox__caption {
    margin-top: .5rem;
    color: #ddd;
    font-size: .95rem;
    text-align: center;
    max-width: 90vw
}

.bdp-lightbox__close,
.bdp-lightbox__prev,
.bdp-lightbox__next {
    position: absolute;
    background: rgba(255, 255, 255, .12);
    border: 0;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    cursor: pointer;
    line-height: 44px;
    text-align: center;
    font-size: 26px
}

.bdp-lightbox__close {
    top: 16px;
    right: 16px
}

.bdp-lightbox__prev {
    top: calc(50% - 22px);
    left: 16px;
    font-size: 28px
}

.bdp-lightbox__next {
    top: calc(50% - 22px);
    right: 16px;
    font-size: 28px
}

.bdp-lightbox__close:hover,
.bdp-lightbox__prev:hover,
.bdp-lightbox__next:hover {
    background: rgba(255, 255, 255, .24)
}

/* Grid/Layout */
.bdp-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 48px;
    align-items: start;
    min-width: 0
}

@media (max-width:980px) {
    .bdp-layout {
        grid-template-columns: 1fr
    }
}

.bdp-sidebar {
    position: sticky;
    top: 24px;
    min-width: 0
}

@media (max-width: 768px) {
    .bdp-sidebar {
        position: relative;
        margin-bottom: 2rem;
    }
}

.bdp-content {
    min-width: 0
}

/* WICHTIG für Swiper in CSS-Grid */
.bdp-project__gallery {
    min-width: 0
}

.bdp-swiper {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden
}

/* overflow zur Sicherheit */
.swiper-wrapper {
    align-items: stretch
}

/* Sidebar */
.bdp-acc {
    border: 0;
    padding: 0;
    margin: 0 0 20px 0
}

.bdp-acc>summary {
    list-style: none
}

.bdp-acc>summary::-webkit-details-marker {
    display: none
}

.bdp-acc__title {
    display: inline-block;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--darker, #1d1d1b);
    text-decoration: none
}

.bdp-acc.is-active .bdp-acc__title {
    color: var(--secondary, #007d32)
}

.bdp-acc__list {
    margin: .5rem 0 0;
    padding: 0;
    list-style: none
}

.bdp-acc__list li {
    margin: .35rem 0
}

.bdp-acc__list a {
    text-decoration: none;
    color: var(--grey, #333)
}

.bdp-acc__list a:hover {
    color: var(--secondary, #007d32)
}

.bdp-acc__list a.is-current {
    font-weight: 700;
    color: var(--grey, #333);
    text-decoration: underline;
}

/* Header/Meta */
.bdp-project__header {
    margin: 2rem 0 0 0
}

.bdp-project__title {
    margin: 0 0 .25rem 0
}

.bdp-project__meta {
    color: var(--grey, #555);
    margin: 0 0 1rem 0
}

/* Slides */
.bdp-slide__figure {
    margin: 0;
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius, 8px);
    background: var(--lightgrey, #F2F2F2);
    cursor: zoom-in;
    max-height: min(80vh, 820px);
}

.bdp-slide__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    contain-intrinsic-size: none !important;
    /* neutralisiert WP sizes=auto-Regel */
}

.bdp-slide__caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: .4rem .6rem;
    background: rgba(0, 0, 0, .4);
    color: #fff;
    font-size: .9rem
}

/* Pfeile + Pagination */
.bdp-swiper__topbar {
    z-index: 10;
    display: flex;
    gap: 1rem
}

.bdp-swiper__topbar .swiper-button-prev,
.bdp-swiper__topbar .swiper-button-next {
    position: relative;
    inset: auto;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .45);
    margin-top: unset;
}

.bdp-swiper__topbar .swiper-button-prev:after,
.bdp-swiper__topbar .swiper-button-next:after {
    font-size: 16px;
    color: #333
}

.bd_swiper_nav_wrapper {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.bdp-swiper__topbar {
    flex-shrink: 0;
    justify-content: flex-end;
    padding-left: 1.4em;
}