/* Lightweight project listing (replaces Elementor Loop Grid on /projekte/). */

.obermair-project-grid,
.obermair-project-grid * {
    box-sizing: border-box;
}

/*
 * Keep the custom grid in a self-contained normal document-flow context.
 * This prevents Elementor Theme Builder footer markup from visually overlapping
 * dynamic shortcode/AJAX content after pagination updates.
 */
.obermair-project-grid {
    display: flow-root;
    position: relative;
    width: 100%;
    min-height: 1px;
    clear: both;
}

.page-id-676 .elementor-widget-shortcode,
.page-id-676 .elementor-widget-shortcode > .elementor-widget-container,
.page-id-676 .elementor-widget-shortcode .elementor-shortcode {
    display: flow-root;
    width: 100%;
}

.obermair-project-grid__items {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.obermair-project-card {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    padding: 15px 0 22px;
}

.obermair-project-card__content {
    width: 32.56%;
    min-width: 0;
    min-height: 733px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 26px 0 0;
    border-top: 1.5px solid #ded5cc;
    border-right: 1.5px solid #ded5cc;
}

.obermair-project-card__content-top {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.obermair-project-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    font-family: "Inter", Sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    color: #000;
    text-transform: uppercase;
}

.obermair-project-card__meta > span:first-child {
    font-weight: 500;
}

.obermair-project-card__meta-separator {
    font-family: "Rubik", Sans-serif;
    font-weight: 600;
}

.obermair-project-card__content-top h4,
.obermair-project-card__content-top h4 a,
.obermair-project-card__content-top .obermair-project-card__title,
h4.obermair-project-card__title,
h4.obermair-project-card__title a,
.obermair-project-card__title,
.obermair-project-card__title a {
    margin: 0;
    padding: 0;
    font-family: "Rubik", Sans-serif!important;
    font-size: 50px!important;
    font-weight: 400!important;
    line-height: 1.26!important;
    color: #000!important;
}

.obermair-project-card__title a,
.obermair-project-card__title a:hover,
.obermair-project-card__title a:focus {
    color: inherit;
    text-decoration: none;
}

.obermair-project-card__more {
    width: fit-content;
    font-family: "Inter", Sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 18px;
    color: #000;
    text-decoration: underline;
}

.obermair-project-card__more:hover,
.obermair-project-card__more:focus {
    color: #000;
    text-decoration: underline;
}

.obermair-project-card__more--mobile {
    display: none;
}

/*
 * Original Elementor Loop Item #760 image behaviour with dedicated 14:9 crops:
 * - desktop: 1400x900 crop, fixed background, 733px viewport
 * - tablet: 980x630 crop, fixed background, 400px viewport
 * - mobile: 700x450 crop as a deterministic cover background
 * Source-image proportions can no longer affect public card dimensions.
 */
.obermair-project-card__media {
    display: block;
    position: relative;
    width: 66.28%;
    min-width: 0;
    min-height: 733px;
    overflow: hidden;
    background-color: #f4f4f4;
    background-image: var(--obermair-project-bg-desktop, none);
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Desktop/tablet use the cropped image as background for the fixed effect. */
.obermair-project-card__image {
    display: none;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
}

.obermair-project-grid[aria-busy="true"] {
    opacity: .62;
    pointer-events: none;
    transition: opacity .15s ease;
}

.obermair-project-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-top: 30px;
    clear: both;
}

.obermair-project-pagination .page-numbers {
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-family: "Inter", Sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.obermair-project-pagination a.page-numbers:hover,
.obermair-project-pagination a.page-numbers:focus,
.obermair-project-pagination .page-numbers.current {
    background: #000;
    color: #fff;
    border-color: #000;
}

@media (max-width: 1366px) and (min-width: 1025px) {
    .obermair-project-card__title {
        font-size: 48px;
        line-height: 61px;
    }
}

@media (max-width: 1200px) and (min-width: 1025px) {
    .obermair-project-card__title {
        font-size: 45px;
        line-height: 58px;
    }

    .obermair-project-card__meta {
        font-size: 15px;
    }
}

@media (max-width: 1024px) and (min-width: 768px) {
    .obermair-project-card__content {
        width: 40%;
        min-height: 400px;
    }

    .obermair-project-card__media {
        width: 60%;
        min-height: 400px;
        background-image: var(--obermair-project-bg-tablet, var(--obermair-project-bg-desktop, none));
    }

    .obermair-project-card__title {
        font-size: 28px;
        line-height: 35px;
    }

    .obermair-project-card__meta {
        gap: 5px;
        font-size: 12px;
        line-height: 20px;
    }
}

@media (max-width: 767px) {
    .obermair-project-grid__items {
        gap: 60px;
    }

    .obermair-project-card {
        flex-direction: column;
        gap: 20px;
        width: 100%;
        padding: 0;
    }

    .obermair-project-card__content {
        order: 1;
        width: 100%;
        min-height: 0;
        padding: 0;
        border: 0;
        gap: 10px;
    }

    .obermair-project-card__content-top {
        gap: 10px;
    }

    .obermair-project-card__meta {
        order: 2;
        gap: 10px;
        font-size: 12px;
        line-height: 18px;
    }

    /* Match the mobile screendesign hierarchy: title first, then project meta. */
    .obermair-project-card__title {
        display: block;
        order: 1;
        font-size: 28px;
        line-height: 35px;
    }

    /*
     * Mobile is rendered from the same 14:9 crop as a cover background.
     * This intentionally does not depend on img sizing rules from Elementor,
     * the browser, or the source image's intrinsic aspect ratio.
     */
    .obermair-project-card__media {
        order: 2;
        position: relative;
        width: 100%;
        min-height: 0;
        height: auto;
        aspect-ratio: 14 / 9;
        overflow: hidden;
        background-image: var(--obermair-project-bg-mobile, var(--obermair-project-bg-tablet, var(--obermair-project-bg-desktop, none)));
        background-attachment: scroll;
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
        background-color: #f4f4f4;
    }

    /*
     * Retain the image node for semantics/preload, but never let its intrinsic
     * dimensions participate in the visual layout. The background above is the
     * sole visual source on mobile.
     */
    .obermair-project-card__media > img.obermair-project-card__image {
        display: block;
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        object-fit: cover !important;
        object-position: center center !important;
        opacity: 0;
        pointer-events: none;
    }

    .obermair-project-card__more--desktop {
        display: none;
    }

    .obermair-project-card__more--mobile {
        order: 3;
        display: inline-flex;
        font-size: 14px;
        line-height: 18px;
    }

    .obermair-project-pagination {
        margin-top: 30px;
        margin-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .obermair-project-grid,
    .obermair-project-pagination .page-numbers {
        transition: none;
    }
}
