.related-posts-carousel {
    margin: 20px 0;
}

.carousel-item {
    padding: 15px;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.carousel-item h3 {
    margin-bottom: 10px;
    width: 100%;
    display: block;
}

/* Title alignment specific styles */
.carousel-item h3[style*="text-align: center"] {
    margin-left: auto;
    margin-right: auto;
}

.carousel-item h3[style*="text-align: right"] {
    margin-left: auto;
}

.carousel-item h3[style*="text-align: left"] {
    margin-right: auto;
}

.excerpt {
    margin-bottom: 15px;
}

.acf-fields {
    font-size: 0.9em;
}

.field {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    display: block;
    width: 100%;
}

/* Ensure alignment works for all content types */
.field img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.field a {
    display: inline-block;
    text-decoration: none;
}

/* Alignment specific styles */
.field[style*="text-align: center"] img,
.field[style*="text-align: center"] a {
    margin: 0 auto;
}

.field[style*="text-align: right"] img,
.field[style*="text-align: right"] a {
    margin-left: auto;
}

.field[style*="text-align: left"] img,
.field[style*="text-align: left"] a {
    margin-right: auto;
}

/* Slick Carousel Custom Styles */
.related-posts-carousel .slick-dots {
    bottom: -30px;
}

.related-posts-carousel .slick-dots li button:before {
    font-size: 12px;
}

.related-posts-carousel .slick-prev,
.related-posts-carousel .slick-next {
    z-index: 1;
}

.related-posts-carousel .slick-prev {
    left: 10px;
}

.related-posts-carousel .slick-next {
    right: 10px;
}

.related-posts-carousel .swiper-slide.is-active {
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    border: 2px solid #0073e6;
    transform: scale(1.04);
    z-index: 2;
} 

.acf-fields-outside-card {
    display: block;
    transition: opacity 0.3s;
    opacity: 1;
}

.swiper-slide.is-active .acf-fields-outside-card {
    display: block;
    opacity: 1;
}

.field-outside {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
}

.field-outside .field-value {
    display: inline-block;
}

/* Department Buttons Styles */
.department-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 25px;
    padding: 20px;
}

.department-buttons a {
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    box-shadow: 0 4px 6px rgba(0, 115, 230, 0.1);
    position: relative;
    overflow: hidden;
}

/* Default Style */
.department-buttons.default a {
    background: linear-gradient(135deg, #0073e6 0%, #005bb7 100%);
    color: white;
}

.department-buttons.default a:hover {
    background: linear-gradient(135deg, #005bb7 0%, #004494 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 115, 230, 0.2);
}

/* Outline Style */
.department-buttons.outline a {
    border: 2px solid #0073e6;
    color: #0073e6;
    background: transparent;
    position: relative;
    z-index: 1;
}

.department-buttons.outline a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0073e6 0%, #005bb7 100%);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.department-buttons.outline a:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 115, 230, 0.2);
}

.department-buttons.outline a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Flat Style */
.department-buttons.flat a {
    color: #0073e6;
    background: transparent;
    box-shadow: none;
}

.department-buttons.flat a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, #0073e6 0%, #005bb7 100%);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.department-buttons.flat a:hover {
    transform: translateY(-3px);
}

.department-buttons.flat a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Button Icons */
.department-buttons a::before {
    margin-right: 10px;
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 16px;
    transition: transform 0.4s ease;
}

.department-buttons a:hover::before {
    transform: scale(1.1);
}

.virtual-tour-btn::before {
    content: '\f3c5'; /* map-marker-alt icon */
}

.prospectus-btn::before {
    content: '\f1c1'; /* file-pdf icon */
}

/* Only show buttons for active slide */
.swiper-slide:not(.is-active) .department-buttons {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .department-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .department-buttons a {
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .department-buttons.default a {
        background: linear-gradient(135deg, #005bb7 0%, #004494 100%);
    }
    
    .department-buttons.outline a {
        border-color: #005bb7;
        color: #005bb7;
    }
    
    .department-buttons.flat a {
        color: #005bb7;
    }
    
    .department-buttons.flat a::after {
        background: linear-gradient(90deg, #005bb7 0%, #004494 100%);
    }
}

.related-posts-carousel .swiper-slide {
  height: auto !important;
}

.related-posts-carousel .acf-fields-outside-card {
  margin-top: 16px;
  /* Optional: add background or padding for clarity */
  /* background: rgba(0,0,0,0.5); */
  /* padding: 8px; */
}

.related-posts-carousel.swiper {
    overflow: hidden !important;
}

/* Swiper Navigation Arrows */
.related-posts-carousel .swiper-button-next,
.related-posts-carousel .swiper-button-prev {
    color: #0073e6;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    top: 50%;
    transform: translateY(-50%);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-size: 22px;
    z-index: 10;
}
.related-posts-carousel .swiper-button-next:hover,
.related-posts-carousel .swiper-button-prev:hover {
    background: #0073e6;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,115,230,0.15);
}
.related-posts-carousel .swiper-button-next:after,
.related-posts-carousel .swiper-button-prev:after {
    font-size: 22px;
    font-weight: bold;
}

/* Swiper Pagination Bullets */
.related-posts-carousel .swiper-pagination {
    bottom: 10px !important;
}
.related-posts-carousel .swiper-pagination-bullet {
    background: #0073e6;
    opacity: 0.4;
    width: 12px;
    height: 12px;
    margin: 0 4px !important;
    transition: opacity 0.2s, transform 0.2s;
}
.related-posts-carousel .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
    background: #005bb7;
    box-shadow: 0 2px 8px rgba(0,115,230,0.15);
}

/* Swiper Slide */
.related-posts-carousel .swiper-slide {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s, border 0.3s;
    overflow: visible;
}
.related-posts-carousel .swiper-slide.is-active {
    box-shadow: 0 6px 24px rgba(0,115,230,0.15);
    border: 2px solid #0073e6;
    z-index: 2;
    transform: scale(1.04);
}

/* Responsive Swiper Slide */
@media (max-width: 900px) {
    .related-posts-carousel .swiper-slide {
        min-width: 80vw;
    }
}
@media (max-width: 600px) {
    .related-posts-carousel .swiper-slide {
        min-width: 95vw;
    }
    .related-posts-carousel .swiper-button-next,
    .related-posts-carousel .swiper-button-prev {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

.related-posts-carousel .swiper-slide[data-bg] {
    position: relative;
}

.related-posts-carousel .swiper-slide[data-bg]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(150deg, #4E4646 0%, #300606 100%);
    opacity: 0.8;
    z-index: 1;
}

.related-posts-carousel .swiper-slide[data-bg] .carousel-item {
    position: relative;
    z-index: 2;
}