.references-section {
    padding: 60px 20px;
    background: #f8f9fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
}

.reference-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.reference-card {
    display: flex;
    flex-direction: row;
    /* height: 200px; */ /* töröljük */
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.reference-image {
    width: 25%;
    aspect-ratio: 4 / 3;   /* így mindig 4:3 lesz */
    background-size: cover;
    background-position: center;
}

.reference-card:hover {
    transform: translateY(-5px);
}

.reference-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.reference-content h2 {
    margin: 0 0 10px 0;
}

.reference-content p {
    margin: 0;
    line-height: 1.4em;
}

/* Részletes nézet */
.reference-detail {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    text-decoration: none;
    color: #007bff;
}

.reference-images {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.detail-image {
    width: calc(24% - 10px);   /* 4 képet egymás mellé */
    aspect-ratio: 4 / 3;       /* mindig 4:3 arány */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}


/* --- Tablet (max-width: 900px) --- */
@media (max-width: 900px) {
    .reference-card {
        flex-direction: column;
        height: auto; /* automatikus magasság, hogy a tartalom illeszkedjen */
    }

    .reference-image {
        width: 100%;
         aspect-ratio: 4 / 3;
    }

    .reference-content {
        padding: 15px;
    }
    .detail-image {
        width: calc(50% - 7.5px); /* két kép egymás mellett */
        aspect-ratio: 4 / 3;
    }
}

/* --- Mobil (max-width: 600px) --- */
@media (max-width: 600px) {
    .reference-card {
        flex-direction: column;
        height: auto;
    }

    .reference-image {
        width: 100%;
         aspect-ratio: 4 / 3;
    }

    .reference-content {
        padding: 15px;
    }

    .detail-image {
        width: 100%; /* egy kép soronként */
        aspect-ratio: 4 / 3;
    }
}

/* --- Mini mobil (max-width: 400px) --- */
@media (max-width: 400px) {
    .reference-card {
        flex-direction: column;
        height: auto;
    }

    .reference-image {
        width: 100%;
        aspect-ratio: 4 / 3;
    }

    .reference-content {
        padding: 10px;
    }
    .detail-image {
        width: 100%;
        aspect-ratio: 4 / 3;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.modal-content-ref {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.page-hero {
    width: 100%;
    height: 400px;
    background-image: url('../../images/references_bg/header-bg.jpg'); /* ide tegyél saját képet */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-hero-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45); /* sötét overlay a jobb olvashatóságért */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page-hero h1 {
    color: #fff;
    font-size: 48px;
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0;
}

/* ===== RESZPONZÍV ===== */

@media (max-width: 768px) {
    .page-hero {
        height: 320px;
    }

    .page-hero h1 {
        font-size: 32px;
    }
}