/* Referenzen Neu Template */

/* Prevent horizontal scrollbar on mobile */
html,
body {
    overflow-x: hidden;
}

body.page-template-page-referenzen-neu {
    overflow-x: hidden;
}

/* Referenzen Neu Header */
header.page-header-referenzen-neu {
    width: 100%;
    max-width: none;
    height: 280px;
    background: #fff;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: visible !important;
    padding: 60px 80px;
}

header.page-header-referenzen-neu .bgoverlay {
    height: 100%;
    width: 100%;
    position: absolute;
    background-size: cover;
    background-position: center;
    background-image: url("https://www.froeschl.at/wp-content/uploads/2023/02/header-gutmann.png");
    top: 0;
    left: 0;
}

header.page-header-referenzen-neu .bgoverlay:after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    width: 100%;
    left: 0;
    background: url(../img/bg-beton.jpg);
    background-repeat: repeat;
    height: 20px;
}

header.page-header-referenzen-neu .ref-neu-header-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

header.page-header-referenzen-neu button {
    margin-top: 0;
}

header.page-header-referenzen-neu h1 {
    font-size: 48px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

header.page-header-referenzen-neu .ref-neu-filter-horizontal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Submenu styling - matching main site navigation */
.ref-neu-filter-wrapper {
    position: relative;
    display: inline-block;
}

.ref-neu-children-data {
    background-color: #ffd42b;
    display: flex;
    position: absolute;
    flex-direction: column;
    bottom: 100%;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s 0.3s;
}

.ref-neu-filter-wrapper.has-children:hover .ref-neu-children-data {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s;
}

.ref-neu-children-data:hover {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s;
}

/* Keep parent button styled when hovering over submenu */
.ref-neu-filter-wrapper:hover .ref-neu-filter-parent.has-children,
.ref-neu-filter-wrapper:focus-within .ref-neu-filter-parent.has-children {
    background: #0097d5;
    color: #ffffff;
}

.ref-neu-children-data > div {
    padding: 11px 13px 9px;
    margin: 2px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 600;
    color: #0097d5;
    white-space: nowrap;
}

.ref-neu-children-data > div:first-child {
    margin-top: 0;
}

.ref-neu-children-data > div:hover {
    background-color: #0097d5;
    color: #ffffff;
}

.ref-neu-children-data > div.active {
    background-color: #0097d5;
    color: #ffffff;
    font-weight: 800;
}

/* Referenzen Neu Content */
.referenzen-neu {
    padding: 0 0 60px 0;
}

.referenzen-neu .inner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
}

.ref-neu-filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #0097d5;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    flex-shrink: 0;
}

.ref-neu-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    justify-content: center;
}

.ref-neu-filter-item {
    padding: 12px 24px;
    border: none;
    background: rgba(255, 255, 255, 0.33);
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1d;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ref-neu-filter-parent {
    font-weight: 600;
}

.ref-neu-filter-item:hover {
    background: #0097d5;
    color: #ffffff;
}

.ref-neu-filter-item.active {
    background: #ffd42b;
    color: #0097d5;
    font-weight: 800;
}

.ref-neu-toggle {
    font-size: 18px;
    font-weight: 700;
    display: inline-block;
}

/* Sub category specific styles */
.ref-neu-filter-child {
    font-weight: 600;
    font-size: 15px;
    padding: 12px 16px;
}

/* Main Content */
.ref-neu-main {
    flex: 1;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

/* Grid */
.ref-neu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
    min-height: 200px;
    position: relative;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    justify-content: center;
    align-items: center;
    display: none;
}

.loading-spinner.active {
    display: flex;
}

/* Reference Card */
.ref-neu-card {
    background: white;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 320px;
}

.ref-neu-card-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.ref-neu-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.ref-neu-card-image img.ref-neu-img-default {
    opacity: 1;
}

.ref-neu-card-image img.ref-neu-img-hover {
    opacity: 0;
}

.ref-neu-card:hover .ref-neu-card-image img.ref-neu-img-default {
    opacity: 0;
}

.ref-neu-card:hover .ref-neu-card-image img.ref-neu-img-hover {
    opacity: 1;
}

/* Disable hover effect when no different hover image */
.ref-neu-card.no-hover .ref-neu-card-image img {
    position: static;
    transition: none;
}

.ref-neu-card.no-hover:hover .ref-neu-card-image img {
    opacity: 1;
    transform: none;
}

.ref-neu-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ref-neu-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1d;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.ref-neu-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ref-neu-card-arrow {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.14;
    text-transform: uppercase;
    background: #ffd42b;
    color: #0097d5;
    margin-top: auto;
    align-self: flex-end;
}

/* Load More Button */
.ref-neu-more-wrapper {
    text-align: center;
    margin-top: 40px;
}

.ref-neu-btn-load {
    padding: 16px 48px;
    background: #ffd42b;
    border: none;
    border-radius: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0097d5;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#ref-neu-load-more {
    display: none;
}

/* Empty State */
.ref-neu-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

@media only screen and (max-width: 1200px) {
    header.page-header-referenzen-neu {
        height: 240px;
        padding: 48px 48px;
    }

    .ref-neu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .ref-neu-card {
        min-width: 0;
    }
}

@media only screen and (max-width: 1024px) {
    header.page-header-referenzen-neu {
        height: auto;
        padding: 40px 32px;
    }

    header.page-header-referenzen-neu h1 {
        font-size: 36px;
    }

    header.page-header-referenzen-neu .ref-neu-filter-horizontal {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 0;
    }

    .ref-neu-filter-wrapper {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .ref-neu-filter-item {
        padding: 10px 18px;
        font-size: 14px;
    }

    .ref-neu-filter-item.has-children {
        padding-right: 24px;
        position: relative;
    }

    /* remove arrow indicator on child filter items */
    .ref-neu-filter-item.has-children:after {
        content: none;
    }

    .ref-neu-filter-wrapper.is-open .ref-neu-filter-parent.has-children {
        background: #0097d5;
        color: #ffffff;
    }

    .ref-neu-children-data {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        display: none;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
        z-index: 2;
    }

    .ref-neu-filter-wrapper.is-open .ref-neu-children-data {
        display: flex;
    }

    .ref-neu-children-data > div {
        white-space: normal;
        font-size: 14px;
    }

    .ref-neu-grid {
        gap: 20px;
    }

    .ref-neu-card-image {
        height: 200px;
    }

    .ref-neu-btn-load {
        width: 100%;
        max-width: 360px;
    }
}

@media only screen and (max-width: 1024px) {
    header.page-header {
        width: auto;
    }

    header.page-header-referenzen-neu {
        width: auto;
        padding: 32px 20px;
    }

    header.page-header-referenzen-neu h1 {
        font-size: 30px;
    }

    .referenzen-neu .inner-content {
        padding: 0 20px;
    }

    header.page-header-referenzen-neu .ref-neu-filter-horizontal {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .ref-neu-filter-horizontal > .ref-neu-filter-item {
        width: 100%;
        text-align: left;
    }

    .ref-neu-filter-wrapper {
        width: 100%;
    }

    .ref-neu-filter-item {
        width: 100%;
        text-align: left;
    }

    .ref-neu-children-data {
        width: 100%;
    }

    .ref-neu-children-data > div {
        padding-left: 18px;
    }

    .ref-neu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ref-neu-card-content {
        padding: 20px;
    }

    .ref-neu-card-title {
        font-size: 18px;
    }
}

@media only screen and (max-width: 768px) {
    .ref-neu-grid {
        grid-template-columns: 1fr;
    }
}

@media only screen and (max-width: 480px) {
    header.page-header-referenzen-neu h1 {
        font-size: 26px;
    }

    .ref-neu-filter-item {
        padding: 9px 14px;
        font-size: 13px;
    }

    .ref-neu-card-image {
        height: 180px;
    }
}