/* Globals */
.rap-container {
    font-family: 'Alexandria', sans-serif;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.rap-title-centered {
    font-size: 48px;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 10px;
    color: #3b7b85;
}
.rap-subtitle-centered {
    font-size: 20px;
    font-weight: 300;
    text-align: center;
    color: #555;
    margin: 0 0 40px;
}

/* Sections */
.rap-section {
    padding: 60px 0;
    position: relative;
    background: #fff;
}

.rap-inner-grid {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    gap: 40px;
    padding: 0 20px;
}

.rap-grid-reverse {
    flex-direction: row-reverse;
}

.rap-image-side {
    flex: 1;
    position: relative;
    font-size: 0;
}
.rap-image-side img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.rap-text-side {
    flex: 1;
}

/* Vertical titles */
.rap-has-vertical-title {
    display: flex;
    align-items: center;
    gap: 40px;
}
.rap-vertical-title {
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 42px;
    font-weight: 400;
    margin: 0;
    padding: 0;
    color: #3b7b85;
    letter-spacing: 2px;
    text-align: center;
}
.rap-content-box {
    flex: 1;
}
.rap-subtitle {
    font-size: 24px;
    font-weight: 400;
    color: #333;
    margin: 0 0 20px;
    line-height: 1.3;
}
.rap-text-block {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
}
.rap-text-block p {
    margin-bottom: 15px;
}
.rap-text-block p:last-child {
    margin-bottom: 0;
}

/* 1. INTRO */
.rap-intro {
    padding: 100px 20px;
    background-size: cover;
    background-position: center;
    text-align: center;
    color: #fff;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}
.rap-intro::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}
.rap-intro-content {
    position: relative;
    z-index: 2;
}
.rap-intro-title {
    font-size: 80px;
    font-weight: 400;
    margin: 0 0 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #fff;
}
.rap-intro-subtitle {
    font-size: 43px;
    font-weight: 400;
    margin: 0 0 30px;
    color: #fff;
}
.rap-intro-desc {
    max-width: 500px;
    font-weight: 300;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.6;
}

/* 3 & 6. Overlapping boxes */
.rap-section.rap-community,
.rap-section.rap-future {
    padding: 0; /* Remove vertical padding to let image stretch to top/bottom */
}

.rap-community .rap-inner-grid,
.rap-future .rap-inner-grid {
    padding: 0 20px; /* Reset vertical padding from grids */
    gap: 0; /* Remove flex gap as we overlap */
}

.rap-overlap-box {
    background: #17515c;
    color: #fff;
    padding: 70px 60px;
    display: flex;
    align-items: center; /* wyśrodkowanie w pionie */
    gap: 50px; /* Increase gap to push vertical title left/away from text */
    flex: none;
    z-index: 2;
    align-self: stretch; /* Stretch box to match height, or center. Image looks better if center? Actually if stretch, box takes full height. Let's use center so it's a floating box! */
}
/* If we want it floating and vertically centered: */
.rap-community .rap-overlap-box,
.rap-future .rap-overlap-box {
    align-self: center;
}

.rap-overlap-right {
    width: 60%;
    max-width: 700px;
    margin-left: -15%; /* overlaps the image on the left */
}
.rap-overlap-left {
    width: 60%;
    max-width: 700px;
    margin-right: -15%; /* overlaps the image on the right */
}
.rap-overlap-box .rap-vertical-title {
    color: #206775;
    padding: 0;
}
.rap-overlap-box .rap-subtitle {
    color: #FEECD1;
}
.rap-overlap-box .rap-text-block {
    color: #e0e0e0;
}

.rap-community .rap-image-side,
.rap-future .rap-image-side {
    width: 55%;
    flex: none;
    /* Give it min height to ensure the section is somewhat tall */
    min-height: 600px;
}
.rap-community .rap-image-side img,
.rap-future .rap-image-side img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    position: absolute; /* Using absolute positioning inside image-side to force full height stretch without breaking flex */
    top: 0; left: 0; bottom: 0; right: 0;
}

/* NATURA */
.rap-nature .rap-full-image-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}
.rap-nature .rap-full-image-wrapper img {
    width: 100%;
    display: block;
}
.rap-image-overlay-text {
    position: absolute;
    bottom: 60px;
    left: 80px;
    max-width: 500px;
    color: #fff;
    font-size: 18px;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* CTA */
.rap-cta-image-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}
.rap-cta-image-wrapper img {
    width: 100%;
    display: block;
    margin-top: 40px;
}

/* RWD */
@media(max-width: 991px) {
    .rap-title-centered {
        font-size: 36px;
    }
    .rap-subtitle-centered {
        font-size: 18px;
    }
    .rap-intro-title {
        font-size: 48px;
    }
    .rap-overlap-box {
        position: relative;
        top: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin: -40px 0 0 0;
        padding: 40px 30px;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .rap-community .rap-image-side, .rap-future .rap-image-side {
        max-width: 100%;
        min-height: 400px;
        width: 100%;
    }
    .rap-community .rap-inner-grid, .rap-future .rap-inner-grid, .rap-inner-grid {
        flex-direction: column;
    }
    .rap-future .rap-inner-grid.rap-grid-reverse {
        flex-direction: column;
    }
    .rap-vertical-title {
        writing-mode: horizontal-tb;
        transform: none;
        padding: 0 0 10px 0;
        width: 100%;
        text-align: left;
    }
    .rap-has-vertical-title {
        flex-direction: column;
        gap: 20px;
    }
    .rap-overlap-box.rap-overlap-left .rap-vertical-title {
        transform: none !important;
        writing-mode: horizontal-tb !important;
        padding: 0 0 10px 0 !important;
    }
    .rap-overlap-box.rap-overlap-left {
        flex-direction: column-reverse;
    }
    .rap-image-overlay-text {
        position: relative;
        bottom: 0;
        left: 0;
        background: #17515c;
        padding: 30px;
        max-width: 100%;
        text-shadow: none;
        color: #fff;
    }
}
