/* ==========================================================================
   Related Content Block
   ========================================================================== */

.related-content-block {
    padding: 40px 0 0 0; /* FIX: Removed bottom padding to eliminate footer gap */
    margin-bottom: 0 !important; /* FIX: Forces flush against the footer */
    background-color: var(--scheme-bg, #ffffff);
    color: var(--scheme-text, #313A4C);
    overflow-x: hidden; 
}

.related-content-block.alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden; 
}

.related-content__container {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.related-content__header {
    text-align: center;
    margin-bottom: 60px;
}

.related-content__heading {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    color: var(--scheme-text, #313A4C); 
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.related-content__subheading {
    font-size: 18px;
    color: var(--scheme-text, #313A4C);
    opacity: 0.8;
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   Carousel Container
   ========================================================================== */
.related-content__carousel {
    position: relative;
    padding: 0 80px 40px 80px; /* Shifted the bottom padding to the carousel to give space below the pagination pills */
}

.related-swiper {
    overflow: hidden;
    padding: 20px;
    margin: -20px;
}

.swiper-slide {
    height: auto;
}

/* ==========================================================================
   Card Styling (Isolated from outer theme to ensure readability)
   ========================================================================== */
.related-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #313A4C;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #313A4C;
    height: 100%;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: var(--eclipse-green, #0D5C22);
    background: var(--halo-green, #F2F6E6);
}

/* Card Image */
.related-card__img {
    height: 200px;
    background: var(--halo-green, #F2F6E6);
    position: relative;
    overflow: hidden;
}

.related-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-card:hover .related-card__img img {
    transform: scale(1.05);
}

.related-card__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #313A4C, #3B824B);
}

.related-card__img-placeholder span {
    font-size: 48px;
    color: var(--aurora-green, #BAD532);
}

.related-card__badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--zenith-green, #C6E0CC);
    color: var(--corona-green, #3B824B);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--corona-green, #3B824B);
    z-index: 2;
}

.cat-tag {
    background: var(--halo-green, #F2F6E6);
    color: var(--eclipse-green, #0D5C22);
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid var(--eclipse-green, #0D5C22);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.related-card:hover .cat-tag {
    background: var(--zenith-green, #C6E0CC);
    border-color: var(--eclipse-green, #0D5C22);
    color: var(--eclipse-green, #0D5C22);
}

.related-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-card__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.related-card__title {
    font-size: 18px;
    line-height: 1.3;
    color: #313A4C;
    margin-bottom: 10px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card__excerpt {
    font-size: 13px;
    color: var(--eclipse-green, #0D5C22);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
}

.related-card__footer {
    padding: 0 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.related-card__meta {
    font-size: 12px;
    color: #707070;
}

.related-card__link {
    display: inline-flex;
    align-items: center;
    padding: 10px 0;
    color: #313A4C;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.related-card__link::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    margin: 5px 0 0 16px;
    background-image: url("../../../img/icon_arrow_right.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    transition: transform 0.3s ease;
}

.related-card:hover .related-card__link::after {
    transform: translateX(5px);
}

/* ==========================================================================
   Navigation Arrows (Inherits Theme Highlight)
   ========================================================================== */
.related-nav-prev,
.related-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    opacity: 0.9;
    background-color: var(--scheme-bg, #ffffff);
    border: 2px solid var(--scheme-highlight, #BAD532);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-nav-prev {
    left: 0px;
}

.related-nav-next {
    right: 0px;
}

.related-nav-prev:hover,
.related-nav-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    border-width: 3px;
    background-color: var(--scheme-highlight, #ffffff);
}

.related-nav-prev.swiper-button-disabled,
.related-nav-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.related-nav-prev::after {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background-image: url("../../../img/icon_arrow_prev.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.related-nav-next::after {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background-image: url("../../../img/icon_arrow_right.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ==========================================================================
   Pagination Pills
   ========================================================================== */
.related-pagination {
    position: relative; 
    bottom: auto; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px; 
}

.related-pagination .swiper-pagination-bullet {
    width: 50px;
    height: 8px;
    background: #E5E5E5;
    border-radius: 10px;
    opacity: 1;
    margin: 0 !important; 
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.related-pagination .swiper-pagination-bullet:hover {
    background: #D0D0D0;
}

.related-pagination .swiper-pagination-bullet-active {
    width: 90px;
    background: #E5E5E5; 
}

.pill-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #BAD532, #0D5C22 100%);
    border-radius: 10px;
    transition: width 0.1s linear;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .related-content__carousel {
        padding: 0 70px 40px 70px;
    }
    
    .related-nav-prev,
    .related-nav-next {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    .related-content-block {
        padding: 40px 0 0 0; /* FIX: Remove padding */
        margin-bottom: 0 !important;
    }
    
    .related-content__container {
        padding: 0 20px;
    }
    
    .related-content__header {
        margin-bottom: 40px;
    }
    
    .related-content__heading {
        font-size: 32px;
        margin-bottom: 12px;
    }
    
    .related-content__subheading {
        font-size: 16px;
    }
    
    .related-content__carousel {
        padding: 0 60px 40px 60px;
    }
    
    .related-nav-prev,
    .related-nav-next {
        width: 44px;
        height: 44px;
    }
    
    .related-nav-prev {
        left: 10px;
    }
    
    .related-nav-next {
        right: 10px;
    }
    
    .related-card__title {
        font-size: 18px;
    }
    
    .related-card__excerpt {
        font-size: 13px;
    }
    
    .related-pagination {
        margin-top: 30px;
        gap: 8px;
    }
    
    .related-pagination .swiper-pagination-bullet {
        width: 40px;
        height: 6px;
    }
    
    .related-pagination .swiper-pagination-bullet-active {
        width: 70px;
    }
}

@media (max-width: 480px) {
    .related-content-block {
        padding: 40px 0 0 0; /* FIX: Remove padding */
        margin-bottom: 0 !important;
    }
    
    .related-content__heading {
        font-size: 28px;
    }
    
    .related-content__carousel {
        padding: 0 50px 30px 50px;
    }
    
    .related-nav-prev,
    .related-nav-next {
        width: 40px;
        height: 40px;
    }
    
    .related-card__body {
        padding: 20px;
    }
    
    .related-card__footer {
        padding: 12px 20px;
    }
}

/* ==========================================================================
   NEW: Header - Form Split Layout
   ========================================================================== */
.related-content__header-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 20px; 
    padding: 0 80px; 
}

.related-content__header-split .related-content__heading {
    text-align: left;
}

.related-content__header-split .related-content__subheading {
    text-align: left;
    margin-bottom: 20px;
}

.related-content__body-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--scheme-text, #313A4C);
}

.related-content__body-text p:last-child {
    margin-bottom: 0;
}

.related-content__header-form {
    width: 100%;
    margin-top: 30px; 
}

.related-content__header-form form {
    width: 100%;
}

.related-content__header-form input[type="text"],
.related-content__header-form input[type="email"],
.related-content__header-form input[type="tel"],
.related-content__header-form select,
.related-content__header-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--scheme-border, #E0E0E0);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background-color: var(--scheme-bg, #ffffff);
    color: var(--scheme-text, #313A4C);
    margin-bottom: 16px;
}

.related-content__header-form button[type="submit"],
.related-content__header-form input[type="submit"] {
    background-color: var(--scheme-button, #BAD532);
    color: var(--scheme-button-text, #313A4C);
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-content__header-form button[type="submit"]:hover,
.related-content__header-form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 1024px) {
    .related-content__header-split {
        padding: 0 70px;
    }
}

@media (max-width: 768px) {
    .related-content__header-split {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 60px;
        margin-bottom: 20px; 
    }
    
    .related-content__header-form {
        margin-top: 0; 
    }
}

@media (max-width: 480px) {
    .related-content__header-split {
        padding: 0 50px;
    }
}