/* =============================================================================
   RMRS PAGE SECTIONS CSS
   ============================================================================= */

/* Nav transition handled by GSAP matchMedia in functions.php */

/* Container */
.rmrs-container {
    max-width: 100%;
    /* margin: 0 auto; */
    /* padding: 0 20px; */
}

/* Section Base */
.rmrs-section {
    padding: 1em 0;
}

.rmrs-section-heading {
    font-size: 2em;
    color: #1a3c6e;
    margin-bottom: 20px;
    font-weight: 600;
}

.rmrs-section-content {
    font-size: 1.1em;
    line-height: 1.7;
    color: #444;
}

.rmrs-section-intro {
    font-size: 1.1em;
    line-height: 1.7;
    color: #555;
    margin-bottom: 40px;
}

/* Background Colors */
.rmrs-bg-white {
    background-color: #ffffff;
}

.rmrs-bg-light-grey {
    background-color: #f5f5f5;
}

.rmrs-bg-brand-blue {
    background-color: #1a3c6e;
    color: #ffffff;
}

.rmrs-bg-brand-blue .rmrs-section-heading {
    color: #ffffff;
}

.rmrs-bg-brand-blue .rmrs-section-content {
    color: #e0e0e0;
}

.rmrs-bg-brand-green {
    background-color: #4CAF50;
    color: #ffffff;
}

.rmrs-bg-brand-green .rmrs-section-heading {
    color: #ffffff;
}

.rmrs-bg-brand-green .rmrs-section-content {
    color: #e0e0e0;
}

/* =============================================================================
   CONTENT + IMAGE SECTION - Float-based with Squircle & Text Wrap
   ============================================================================= */

.rmrs-content-image-wrapper {
    overflow: hidden; /* Contain floats */
}

.rmrs-content-image-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* Content side - full width, text wraps around image */
.rmrs-content-side {
    /* No width constraint - text wraps around the floated image */
}

/* Image side - floated with squircle shape */
.rmrs-image-side {
    overflow: visible;
    shape-outside: inset(0 round 22%);
    shape-margin: 1.5em;
}

.rmrs-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 22%;
}

/* Image Styles (sizes) */
.rmrs-image-square {
    width: 320px;
    aspect-ratio: 1 / 1;
}

.rmrs-image-landscape {
    width: 400px;
    aspect-ratio: 16 / 9;
}

.rmrs-image-portrait {
    width: 280px;
    aspect-ratio: 3 / 4;
}

/* Image Position - RIGHT (default) */
.rmrs-image-right .rmrs-image-side {
    float: right;
    margin-top: 3.5em; /* Align with text below heading */
    margin-right: 0;
    margin-bottom: 1.5em;
    margin-left: 2em;
}

/* Image Position - LEFT */
.rmrs-image-left .rmrs-image-side {
    float: left;
    margin-top: 3.5em; /* Align with text below heading */
    margin-right: 2em;
    margin-bottom: 1.5em;
    margin-left: 0;
}
/* Buttons */
.rmrs-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
    clear: both; /* Buttons appear below the wrapped content */
}

.rmrs-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1em;
}

.rmrs-btn-filled {
    background-color: #e85a33;
    color: #ffffff;
    border: 2px solid #e85a33;
}

.rmrs-btn-filled:hover {
    background-color: #d14a25;
    border-color: #d14a25;
}

.rmrs-btn-outlined {
    background-color: transparent;
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.rmrs-btn-outlined:hover {
    background-color: #4CAF50;
    color: #ffffff;
}

/* =============================================================================
   CONTENT + YOUTUBE SECTION
   ============================================================================= */

.rmrs-content-youtube-wrapper {
    overflow: hidden;
}

.rmrs-content-youtube-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* Video container with 16:9 aspect ratio */
.rmrs-video-side {
    width: 400px;
    flex-shrink: 0;
}

.rmrs-video-container {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.rmrs-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Video Position - RIGHT (default) */
.rmrs-video-right .rmrs-content-grid {
    grid-template-columns: 1fr 400px;
}

.rmrs-video-right .rmrs-content-grid .rmrs-video-side {
    order: 2;
}

.rmrs-video-right .rmrs-content-grid .rmrs-content-side {
    order: 1;
}

/* Video Position - LEFT */
.rmrs-video-left .rmrs-content-grid {
    grid-template-columns: 400px 1fr;
}

.rmrs-video-left .rmrs-content-grid .rmrs-video-side {
    order: 1;
}

.rmrs-video-left .rmrs-content-grid .rmrs-content-side {
    order: 2;
}

/* =============================================================================
   COLUMN CARDS SECTION
   ============================================================================= */

.rmrs-cards-grid {
    display: grid;
    gap: 30px;
}

.rmrs-cols-1 { grid-template-columns: 1fr; }
.rmrs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rmrs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rmrs-cols-4 { grid-template-columns: repeat(4, 1fr); }

.rmrs-card {
    text-align: left;
}

.rmrs-card-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.rmrs-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rmrs-card-heading {
    font-size: 1.25em;
    color: #1a3c6e;
    margin-bottom: 10px;
    font-weight: 600;
}

.rmrs-card-heading a {
    color: inherit;
    text-decoration: none;
}

.rmrs-card-heading a:hover {
    color: #4CAF50;
}

.rmrs-card-content {
    font-size: 1em;
    line-height: 1.6;
    color: #555;
}

/* =============================================================================
   FULL WIDTH IMAGE SECTION
   ============================================================================= */

.rmrs-full-width-image {
    padding: 0;
}

.rmrs-fw-image-wrapper {
    margin: 0;
}

.rmrs-fw-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.rmrs-fw-caption {
    text-align: center;
    padding: 15px 20px;
    font-size: 0.95em;
    color: #666;
    font-style: italic;
    background: #f5f5f5;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .rmrs-section {
        padding: 50px 0;
    }
    
    .rmrs-section-heading {
        font-size: 1.6em;
    }
    
    /* Stack image above content on mobile */
    .rmrs-image-right .rmrs-image-side,
    .rmrs-image-left .rmrs-image-side {
        float: none;
        width: 100%;
        max-width: 400px;
        margin: 0 auto 1.5em auto;
        shape-outside: none;
    }
    
    .rmrs-cols-2,
    .rmrs-cols-3,
    .rmrs-cols-4 {
        grid-template-columns: 1fr;
    }

    /* Video section responsive */
    .rmrs-video-side {
        width: 100%;
        max-width: 560px;
    }

    .rmrs-video-right .rmrs-content-grid,
    .rmrs-video-left .rmrs-content-grid {
        grid-template-columns: 1fr;
    }

    .rmrs-video-right .rmrs-content-grid .rmrs-video-side,
    .rmrs-video-left .rmrs-content-grid .rmrs-video-side,
    .rmrs-video-right .rmrs-content-grid .rmrs-content-side,
    .rmrs-video-left .rmrs-content-grid .rmrs-content-side {
        order: unset;
    }

    .rmrs-content-youtube .rmrs-video-side {
        margin: 0 auto;
    }

    .rmrs-buttons {
        flex-direction: column;
    }
    
    .rmrs-btn {
        text-align: center;
    }
}

/* =============================================================================
   PAGE CONTENT (WYSIWYG above sections)
   ============================================================================= */

.rmrs-page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-size: 1.1em;
    line-height: 1.7;
    color: #444;
}

.rmrs-page-content h2,
.rmrs-page-content h3,
.rmrs-page-content h4 {
    color: #1a3c6e;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.rmrs-page-content p {
    margin-bottom: 1em;
}

.rmrs-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.rmrs-page-content a {
    color: #2d5f2e;
}

.rmrs-page-content a:hover {
    color: #4CAF50;
}

/* =============================================================================
   Content + Image Grid Layout
   ============================================================================= */
.rmrs-content-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2em;
    align-items: start;
}

/* Image on right: swap column order */
.rmrs-image-right .rmrs-content-grid {
    grid-template-columns: 1fr auto;
}

.rmrs-image-right .rmrs-content-grid .rmrs-image-side {
    order: 2;
}

.rmrs-image-right .rmrs-content-grid .rmrs-content-side {
    order: 1;
}

/* Image on left: default order */
.rmrs-image-left .rmrs-content-grid .rmrs-image-side {
    order: 1;
}

.rmrs-image-left .rmrs-content-grid .rmrs-content-side {
    order: 2;
}

/* Remove float-based styles for grid layout */
.rmrs-content-grid .rmrs-image-side {
    float: none;
    margin: 0;
}

/* Override float margins when using grid layout */
.rmrs-image-left .rmrs-content-grid .rmrs-image-side,
.rmrs-image-right .rmrs-content-grid .rmrs-image-side {
    float: none;
    margin: 0;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .rmrs-content-grid {
        grid-template-columns: 1fr;
    }
    
    .rmrs-content-grid .rmrs-image-side,
    .rmrs-content-grid .rmrs-content-side {
        order: unset;
    }
    
    .rmrs-content-grid .rmrs-image-side {
        max-width: 300px;
        margin: 0 auto;
    }
}
