/**
 * Custom Sections Styling
 * Organized and cleaned up for maintainability
 * 
 * Table of Contents:
 * 1. Section Layout & Spacing
 * 2. View More Links
 * 3. Post Title Links
 * 4. Display Template Styles
 * 5. Slider Text Position Styles
 * 6. Column Post Item Styles
 * 7. Carousel Styles
 * 8. Responsive Adjustments
 */

/* ========================================
   1. Section Layout & Spacing
   ======================================== */

.homepage-section {
    padding: 40px 0;
    margin: 0;
    background-color: #fff;
    position: relative;
    z-index: 1;
}

.homepage-section:nth-child(even) {
    background-color: #F8F9FA;
}

.homepage-section.section-first {
    padding-top: 20px;
    padding-bottom: 40px;
    margin: 0 0 0 0;
}

/* Title wrap - consistent across ALL sections */
.title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #13542A;
    position: relative;
}

/* Section subtitle */
.section-subtitle {
    font-size: 18px;
    color: inherit;
    margin: 0 0 30px 0;
    line-height: 1.6;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.5px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Custom colors - all child elements inherit text color from section's inline style */
.homepage-section.has-custom-colors .title-wrap h3,
.homepage-section.has-custom-colors .section-subtitle,
.homepage-section.has-custom-colors .view-more-link,
.homepage-section.has-custom-colors h3,
.homepage-section.has-custom-colors h4,
.homepage-section.has-custom-colors p,
.homepage-section.has-custom-colors a,
.homepage-section.has-custom-colors span,
.homepage-section.has-custom-colors time,
.homepage-section.has-custom-colors .post-title,
.homepage-section.has-custom-colors .post-title a,
.homepage-section.has-custom-colors .post-content,
.homepage-section.has-custom-colors .post-content a,
.homepage-section.has-custom-colors .post-content h3,
.homepage-section.has-custom-colors .post-content h3 a,
.homepage-section.has-custom-colors .post-meta,
.homepage-section.has-custom-colors .post-meta a,
.homepage-section.has-custom-colors .post-date,
.homepage-section.has-custom-colors .post-excerpt,
.homepage-section.has-custom-colors .column-post-item,
.homepage-section.has-custom-colors .column-post-item a,
.homepage-section.has-custom-colors .column-post-item h4,
.homepage-section.has-custom-colors .column-post-item h4 a,
.homepage-section.has-custom-colors .column-post-item p {
    color: inherit !important;
}

.homepage-section.has-custom-colors .title-wrap {
    border-bottom-color: currentColor;
}

/* Ensure carousel/four-column section title goes full width */
.blog-carousel-section .title-wrap,
.homepage-section .title-wrap {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Ensure title container row spans full width */
.blog-carousel-section .col-md-12,
.homepage-section .col-md-12 {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.title-wrap h3 {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.title-wrap .view-more-link {
    margin-left: auto;
    white-space: nowrap;
}


.homepage-section .container {

    margin: 0 auto;
}

/* ========================================
   2. View More Links
   ======================================== */

.view-more-link,
.view-more-link:visited,
.view-more-link:link {
    float: right;
    position: relative;

    padding-left: 10px;
    z-index: 1;
    font-size: 14px;
    color: #333 !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.view-more-link:hover,
.view-more-link:visited:hover {
    color: #2271b1 !important;
    text-decoration: none;
}

/* ========================================
   3. Post Title Links
   ======================================== */

.blog-eight-section .post-content h3 a,
.blog-eight-section .post-content h3 a:visited,
.blog-eight-section .post-content h3 a:link {
    color: #333 !important;
}

.blog-eight-section .post-content h3 a:hover {
    color: #2271b1 !important;
}

/* ========================================
   4. Display Template Styles
   ======================================== */

/* Base eight-post grid styles - clean professional cards */
.blog-eight-section {
    padding: 40px 0;
}

.blog-eight-section .card-eight-wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.blog-eight-section .eight-wraps {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.blog-eight-section .eight-wraps:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.blog-eight-section .eight-thumb {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    position: relative;
}

.blog-eight-section .eight-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-eight-section .eight-wraps:hover .eight-thumb img {
    transform: scale(1.05);
}

.blog-eight-section .eight-content-wrap {
    padding: 16px;
}

.blog-eight-section .eight-content-wrap h3 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.blog-eight-section .eight-content-wrap h3 a {
    color: #1B4F72;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-eight-section .eight-content-wrap h3 a:hover {
    color: #5DADE2;
}

.blog-eight-section .post-meta {
    font-size: 12px;
    color: #888;
}

/* Responsive 4-column grid */
@media (max-width: 991px) {
    .blog-eight-section .card-eight-wrap {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .blog-eight-section .card-eight-wrap {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Default template - FORCE image on top, text below layout */
/* Override ALL overlay/background styles for eight-post grid */
/* 4-column grid - default styles (not overlay) */
.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background),
.blog-eight-section .eight-wraps.image-top {
    background: #fff !important;
    position: relative !important;
}


.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .eight-content-wrap {
    display: block !important;
    position: relative !important;
    min-height: auto !important;
    background: transparent !important;
}

.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .eight-thumb {
    position: relative !important;
    margin-bottom: 15px;
    width: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* Remove gradients for non-overlay cards */
.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .eight-thumb::after,
.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .eight-content-wrap::before,
.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .eight-content-wrap::after {
    display: none !important;
    content: none !important;
}

.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .post-content {
    position: relative !important;
    padding: 0 !important;
    color: #333 !important;
    background: transparent !important;
    z-index: auto !important;
}

.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .post-content h3 a {
    color: #333 !important;
    text-shadow: none !important;
}

.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .post-content p,
.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .post-content .post-excerpt {
    color: #666 !important;
}

.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .post-meta,
.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .post-meta span,
.blog-eight-section .eight-wraps:not(.text-overlay):not(.image-background) .post-meta a {
    color: #888 !important;
}

/* Responsive eight-post grid - handled in style.css */

/* Image Position: Left */
.eight-wraps.image-left .eight-content-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.eight-wraps.image-left .eight-thumb {
    flex: 0 0 auto;

    margin-bottom: 0;
}

.eight-wraps.image-left .post-content {
    flex: 1;
}

/* Image Position: Right */
.eight-wraps.image-right .eight-content-wrap {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
}

.eight-wraps.image-right .eight-thumb {
    flex: 0 0 auto;

    margin-bottom: 0;
}

.eight-wraps.image-right .post-content {
    flex: 1;
}

/* Image Position: Background (Overlay) - uses unified overlay card styles */
.eight-wraps.image-background .eight-content-wrap {
    position: relative;
    overflow: hidden;
}

/* Removed - using unified overlay card styles below */

/* Text Overlay - uses unified overlay card styles */
.eight-wraps.text-overlay .eight-content-wrap {
    position: relative;
    overflow: hidden;
}

/* Removed - using unified overlay card styles below */

/* Image Sizes */
.eight-wraps.image-size-small .eight-thumb {
    max-width: 120px;
}




.eight-wraps.image-size-full .eight-thumb {
    width: 100%;
}

/* Image Cropping */
.eight-wraps.image-cropped .eight-thumb {
    overflow: hidden;
}

.eight-wraps.image-cropped .eight-thumb img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.eight-wraps.image-cropped.image-size-small .eight-thumb img {
    height: 100px;
    aspect-ratio: 3 / 2;

}

.eight-wraps.image-cropped.image-size-large .eight-thumb img {
    height: 250px;
    aspect-ratio: 3 / 2;

}

.eight-wraps.image-cropped.image-size-full .eight-thumb img {
    height: 300px;
    aspect-ratio: 3 / 2;

}

/* No Image */
.eight-wraps.no-image .eight-thumb {
    display: none;
}

/* Template: Overlay */
.template-overlay .eight-wraps {
    margin-bottom: 20px;
}

.template-overlay .eight-wraps .eight-content-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.template-overlay .eight-wraps .eight-thumb {
    transition: transform 0.4s ease;
}

.template-overlay .eight-wraps .eight-thumb img {
    transition: transform 0.4s ease;
}

.template-overlay .eight-wraps:hover .eight-thumb img {
    transform: scale(1.05);
}

.template-overlay .eight-wraps .eight-thumb::after {
    transition: opacity 0.4s ease;
}

.template-overlay .eight-wraps:hover .eight-thumb::after {
    opacity: 0.5;
}

.template-overlay .eight-wraps .post-content h3 a {
    transition: all 0.3s ease;
}

.template-overlay .eight-wraps:hover .post-content h3 a {
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Template: Minimal */
.template-minimal .eight-wraps {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.template-minimal .post-content {
    padding: 0;
}

/* Template: Compact */
.template-compact .eight-wraps {
    margin-bottom: 15px;
}

.template-compact .post-content h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.template-compact .post-meta {
    font-size: 12px;
}

/* Template: Magazine */
.template-magazine .eight-wraps:first-child {
    grid-column: 1 / -1;
}

.template-magazine .eight-wraps:first-child .eight-thumb img {
    height: 400px;
}

.template-magazine .eight-wraps:first-child .post-content h3 {
    font-size: 28px;
}

/* Post Meta Styling */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.post-meta .post-author {
    font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .eight-wraps.image-left .eight-content-wrap,
    .eight-wraps.image-right .eight-content-wrap {
        flex-direction: column;
    }
    
    .eight-wraps.image-left .eight-thumb,
    .eight-wraps.image-right .eight-thumb {
        margin: 0 0 15px 0;
        max-width: 100%;
    }
    
    .eight-wraps.image-background .eight-content-wrap {
        min-height: 250px;
    }
    
    .template-magazine .eight-wraps:first-child .eight-thumb img {
        height: 250px;
    }
}

/* ========================================
   5. Slider Containment & Image Sizing
   ======================================== */

/* Main slider container */
.col-md-6 .main-slider,
.main-slider {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.main-slider .slick-list {
    overflow: hidden;
}

/* CRITICAL: Force Slick defaults to prevent width accumulation bug */
.main-slider .slick-track {
    display: block !important;
}

.main-slider .slick-slide {
    float: left !important;
    height: 100%;
    min-height: 1px;
}

.main-slider.slick-initialized .slick-slide {
    display: block !important;
}

/* Before Slick initializes - hide all but first slide */
.main-slider:not(.slick-initialized) .main-slider-wrap {
    display: none;
}

.main-slider:not(.slick-initialized) .main-slider-wrap:first-child {
    display: block;
}

/* Slide wrapper */
.main-slider-wrap {
    box-sizing: border-box;
}

.main-slider-wrap .carousel-thumb {
    overflow: hidden;
}

.main-slider-wrap .carousel-thumb img,
.main-slider-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Main slider container - no background, transparent */
.main-slider {
    position: relative;
    background: transparent;
    overflow: hidden;
}

.main-slider .slick-list {
    overflow: hidden;
}

.main-slider-wrap {
    position: relative;
}

.main-slider-wrap .carousel-thumb {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 3 / 2;
}

.main-slider-wrap .carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    max-width: none;
}

.main-slider-wrap:hover .carousel-thumb img {
    transform: scale(1.02);
}

.main-slider .post-content {
    padding: 15px 0;
    background: transparent;
}

.main-slider .post-content h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px 0;
}

.main-slider .post-content h3 a {
    color: #1B4F72;
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-slider .post-content h3 a:hover {
    color: #5DADE2;
}

.main-slider .post-content .post-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.main-slider .post-content .post-meta li {
    list-style: none;
}

.main-slider .post-content p {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* Unified professional arrow styling for sliders and carousels - using divs with icons */
.main-slider .slick-arrow,
.card-slider-wrap .slick-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 100 !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(27, 79, 114, 0.95) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.main-slider:hover .slick-arrow,
.card-slider-wrap:hover .slick-arrow {
    opacity: 1 !important;
}

.main-slider .slick-arrow:hover,
.card-slider-wrap .slick-arrow:hover {
    background: #1B4F72 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-50%) scale(1.15) !important;
}

.main-slider .slick-prev,
.card-slider-wrap .slick-prev {
    left: 20px !important;
}

.main-slider .slick-next,
.card-slider-wrap .slick-next {
    right: 20px !important;
}

.main-slider .slick-arrow i,
.card-slider-wrap .slick-arrow i {
    color: #fff !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

/* Remove default Slick button styling */
.main-slider .slick-arrow:before,
.card-slider-wrap .slick-arrow:before {
    content: none !important;
    display: none !important;
}

/* Main slider dots - positioned over the image */
.main-slider .slick-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex !important;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    z-index: 10;
}

.main-slider .slick-dots li {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0;
    padding: 0;
}

.main-slider .slick-dots li button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    font-size: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.main-slider .slick-dots li button:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.main-slider .slick-dots li.slick-active button {
    background: #fff;
    transform: scale(1.3);
}

/* Three column section layout */
.main-slider-section {
    background: #f8f9fa;
    padding: 40px 0;
}

/* CRITICAL: Constrain slider parent to prevent width growth */
.main-slider-section .col-md-6 {
    overflow: hidden;
    max-width: 50%;
}

@media (max-width: 991px) {
    .main-slider-section .col-md-6 {
        max-width: 100%;
    }
}

/* Side columns - clean card style */

/* Column sections - match heights */
.main-slider-section .col-md-6,
.main-slider-section .col-md-3 {
    display: flex;
    flex-direction: column;
}

/* With-thumbnail column styles */
.with-thumbnail-section {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.with-thumbnail-wrap {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.with-thumbnail-wrap:first-child {
    padding-top: 0;
}

.with-thumbnail-wrap:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.with-thumbnail-wrap .carousel-thumb {
    flex: 0 0 90px;
    width: 90px;
    aspect-ratio: 3 / 2;
    margin-right: 12px;
    overflow: hidden;
}

.with-thumbnail-wrap .carousel-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

/* Default template in 3-column section - 3:2 aspect ratio */
.main-slider-section .col-md-3 .column-post-item .post-thumb {

    overflow: hidden;
}

.main-slider-section .col-md-3 .column-post-item .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Default template cards in 3-column section */
.main-slider-section .col-md-3 .column-post-item:not(.image-left):not(.image-right) .post-thumb {
    aspect-ratio: 3 / 2;
    margin-bottom: 10px;
}

.main-slider-section .col-md-3 .column-post-item:not(.image-left):not(.image-right) .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.with-thumbnail-wrap .post-content {
    flex: 1;
    min-width: 0;
}

.with-thumbnail-wrap .post-content h3 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 5px 0;
}

.with-thumbnail-wrap .post-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.with-thumbnail-wrap .post-content h3 a:hover {
    color: #1B4F72;
}

.with-thumbnail-wrap .post-meta {
    font-size: 11px;
    color: #888;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* No-thumbnail column styles */
.no-thumbnail-section {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.no-thumbnail-wrap {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.no-thumbnail-wrap:first-child {
    padding-top: 0;
}

.no-thumbnail-wrap:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.no-thumbnail-wrap .post-content h3 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 5px 0;
}

.no-thumbnail-wrap .post-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.no-thumbnail-wrap .post-content h3 a:hover {
    color: #1B4F72;
}

.no-thumbnail-wrap .post-meta {
    font-size: 11px;
    color: #888;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ========================================
   Slider Text Position Styles
   ======================================== */

/* Default: Text below image */
.main-slider.text-position-below .main-slider-wrap {
    position: relative;
}

.main-slider.text-position-below .carousel-thumb {
    position: relative;
}

.main-slider.text-position-below .post-content {
    position: relative;
    padding: 15px 0;
    background: transparent;
}

/* Overlay: Text over image - uses unified overlay card styles */
.main-slider.text-position-overlay .main-slider-wrap {
    position: relative;
}

.main-slider.text-position-overlay .carousel-thumb {
    position: relative;
}

.main-slider.text-position-overlay .carousel-thumb::after {
    display: none;
}

/* ========================================
   6. Unified Overlay Card Styles
   All overlay cards share the same hover behavior
   ======================================== */

/* Base overlay card styles - applies to all overlay cards */
.overlay-card,
.column-post-item.image-background,
.eight-wraps.image-background,
.carousel-wraps.overlay-style,
.main-slider-wrap.overlay-style,
.carousel-wraps.text-overlay,
.main-slider-wrap.text-overlay {
    position: relative;
    overflow: hidden;
}

/* Overlay card thumbnail container */
.overlay-card .post-thumb,
.overlay-card .carousel-thumb,
.overlay-card .eight-thumb,
.column-post-item.image-background .post-thumb,
.eight-wraps.image-background .eight-thumb,
.carousel-wraps.overlay-style .carousel-thumb,
.carousel-wraps.text-overlay .carousel-thumb,
.main-slider-wrap.overlay-style .carousel-thumb,
.main-slider-wrap.text-overlay .carousel-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Overlay card images - standardized height */
.overlay-card .post-thumb img,
.overlay-card .carousel-thumb img,
.overlay-card .eight-thumb img,
.column-post-item.image-background .post-thumb img,
.eight-wraps.image-background .eight-thumb img,
.carousel-wraps.overlay-style .carousel-thumb img,
.carousel-wraps.text-overlay .carousel-thumb img,
.main-slider-wrap.overlay-style .carousel-thumb img,
.main-slider-wrap.text-overlay .carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

/* Overlay gradient - removed for white background style */
.overlay-card .post-thumb::after,
.overlay-card .carousel-thumb::after,
.overlay-card .eight-thumb::after,
.column-post-item.image-background .post-thumb::after,
.eight-wraps.image-background .eight-thumb::after {
    display: none;
}

/* Unified hover effects for all overlay cards */
.overlay-card:hover .post-thumb img,
.overlay-card:hover .carousel-thumb img,
.overlay-card:hover .eight-thumb img,
.column-post-item.image-background:hover .post-thumb img,
.eight-wraps.image-background:hover .eight-thumb img,
.carousel-wraps.overlay-style:hover .carousel-thumb img,
.carousel-wraps.text-overlay:hover .carousel-thumb img,
.main-slider-wrap.overlay-style:hover .carousel-thumb img,
.main-slider-wrap.text-overlay:hover .carousel-thumb img {
    transform: scale(1.05);
}


/* Overlay card content positioning - sterile medical aesthetic */
.overlay-card .post-content,
.column-post-item.image-background .post-content,
.eight-wraps.image-background .post-content,
.carousel-wraps.overlay-style .post-content,
.carousel-wraps.text-overlay .post-content,
.main-slider-wrap.overlay-style .post-content,
.main-slider-wrap.text-overlay .post-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 14px 16px;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
    border-radius: 0;
    border-top: 2px solid rgba(52, 152, 219, 0.2);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

/* Overlay card text styles - clinical typography */
.overlay-card .post-title a,
.overlay-card .post-title a:visited,
.column-post-item.image-background .post-title a,
.column-post-item.image-background .post-title a:visited,
.eight-wraps.image-background .post-content h3 a,
.eight-wraps.image-background .post-content h3 a:visited,
.carousel-wraps.overlay-style .post-content h3 a,
.carousel-wraps.overlay-style .post-content h3 a:visited,
.carousel-wraps.text-overlay .post-content h3 a,
.carousel-wraps.text-overlay .post-content h3 a:visited,
.main-slider-wrap.overlay-style .post-content h3 a,
.main-slider-wrap.overlay-style .post-content h3 a:visited,
.main-slider-wrap.text-overlay .post-content h3 a,
.main-slider-wrap.text-overlay .post-content h3 a:visited {
    color: #2c3e50 !important;
    text-shadow: none;
    transition: all 0.25s ease;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.overlay-card:hover .post-title a,
.column-post-item.image-background:hover .post-title a,
.eight-wraps.image-background:hover .post-content h3 a,
.carousel-wraps.overlay-style:hover .post-content h3 a,
.carousel-wraps.text-overlay:hover .post-content h3 a,
.main-slider-wrap.overlay-style:hover .post-content h3 a,
.main-slider-wrap.text-overlay:hover .post-content h3 a {
    color: #3498db !important;
}

.overlay-card .post-meta,
.column-post-item.image-background .post-meta,
.eight-wraps.image-background .post-meta,
.carousel-wraps.overlay-style .post-meta,
.carousel-wraps.text-overlay .post-meta,
.main-slider-wrap.overlay-style .post-meta,
.main-slider-wrap.text-overlay .post-meta {
    color: #7f8c8d;
    text-shadow: none;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.overlay-card .post-meta a,
.column-post-item.image-background .post-meta a,
.eight-wraps.image-background .post-meta a,
.carousel-wraps.overlay-style .post-meta a,
.carousel-wraps.text-overlay .post-meta a,
.main-slider-wrap.overlay-style .post-meta a,
.main-slider-wrap.text-overlay .post-meta a {
    color: #7f8c8d !important;
    transition: color 0.25s ease;
}

.overlay-card .post-meta a:hover,
.column-post-item.image-background .post-meta a:hover,
.eight-wraps.image-background .post-meta a:hover,
.carousel-wraps.overlay-style .post-meta a:hover,
.carousel-wraps.text-overlay .post-meta a:hover,
.main-slider-wrap.overlay-style .post-meta a:hover,
.main-slider-wrap.text-overlay .post-meta a:hover {
    color: #3498db !important;
}

.overlay-card .post-excerpt,
.overlay-card .post-excerpt p,
.column-post-item.image-background .post-excerpt p,
.eight-wraps.image-background .post-excerpt p {
    color: #5a6c7d;
    text-shadow: none;
    line-height: 1.6;
    font-size: 14px;
}

/* Standardized card heights for all overlay types */
.column-post-item.image-background,
.carousel-wraps.overlay-style,
.carousel-wraps.text-overlay {
    height: 250px;
    margin-bottom: 12px;
}

.eight-wraps.image-background {
    height: 250px;
    margin-bottom: 12px;
}

.main-slider-wrap.overlay-style,
.main-slider-wrap.text-overlay {
    height: 400px;
}

/* 3-column + slider section - smaller column cards to match slider */
.main-slider-section .column-post-item.image-background {
    height: 130px;
    margin-bottom: 8px;
}

.column-post-item.image-background .post-content {
    /* min-height removed - auto height based on content */
}

.column-post-item.image-background .post-title {
    font-size: 15px;
    line-height: 1.3;
    margin: 0;
}

/* Default and other templates for column posts */
.column-post-item:not(.image-background) {
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

.column-post-item:not(.image-background):last-child {
    border-bottom: none;
}

.column-post-item:not(.image-background) .post-thumb {
    margin-bottom: 10px;
}

.column-post-item:not(.image-background) .post-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Compact template - Image on left */
.column-post-item.image-left {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.column-post-item.image-left .post-thumb {
    flex: 0 0 70px;
    width: 70px;
    margin-right: 10px;
    margin-bottom: 0;
}

.column-post-item.image-left .post-thumb img {
    width: 70px;
    height: 70px;
    object-fit: cover;
}

.column-post-item.image-left .post-content {
    flex: 1;
    min-width: 0;
    max-height: 70px;
    overflow: hidden;
}

.column-post-item.image-left .post-title {
    font-size: 12px;
    line-height: 1.2;
    margin: 0 0 2px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.column-post-item.image-left .post-meta {
    font-size: 11px;
}

.column-post-item.image-left .post-excerpt {
    font-size: 11px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
}

/* Image on right */
.column-post-item.image-right {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
}

.column-post-item.image-right .post-thumb {
    flex: 0 0 80px;
    width: 80px;
    margin-left: 12px;
    margin-bottom: 0;
}

.column-post-item.image-right .post-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.column-post-item.image-right .post-content {
    flex: 1;
    min-width: 0;
}

.column-post-item:not(.image-background) .post-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.4;
}

.column-post-item:not(.image-background) .post-title a {
    color: #333 !important;
    text-decoration: none;
    transition: color 0.3s;
}

.column-post-item:not(.image-background) .post-title a:hover {
    color: #2271b1 !important;
}

.column-post-item:not(.image-background) .post-meta {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.column-post-item:not(.image-background) .post-excerpt {
    font-size: 14px;
    color: #555;
    margin-top: 8px;
}

/* ========================================
   7. Carousel Styles
   ======================================== */

/* Prevent FOUC - hide carousel items until Slick initializes */
.card-slider-wrap:not(.slick-initialized) {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
}

.card-slider-wrap:not(.slick-initialized) .carousel-wraps {
    flex: 0 0 25%;
    max-width: 25%;
    min-width: 25%;
}

/* Carousel slides per view - Desktop sizing (only before slick init) */
.card-slider-wrap.slides-per-view-3:not(.slick-initialized) .carousel-wraps {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.card-slider-wrap.slides-per-view-4:not(.slick-initialized) .carousel-wraps {
    flex: 0 0 25%;
    max-width: 25%;
}

.card-slider-wrap.slides-per-view-5:not(.slick-initialized) .carousel-wraps {
    flex: 0 0 20%;
    max-width: 20%;
}

/* After slick initializes, let slick control widths */
.card-slider-wrap.slick-initialized .carousel-wraps {
    flex: none;
    max-width: none;
    min-width: auto;
}

/* CRITICAL: Constrain the carousel container to prevent width expansion */
.card-slider-wrap,
.threecolumn {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.card-slider-wrap .slick-list,
.threecolumn .slick-list {
    overflow: hidden;
}

/* Slick slide styling */
.card-slider-wrap.slick-initialized .slick-slide {
    margin: 0 10px;
}

.card-slider-wrap.slick-initialized .slick-list {
    margin: 0 -10px;
}

/* Carousel image sizing - 3:2 aspect ratio */
.card-slider-wrap .carousel-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
}

.card-slider-wrap .carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Carousel arrows styling - hide by default, show on hover */
.card-slider-wrap .slick-prev,
.card-slider-wrap .slick-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0 !important;
}

.card-slider-wrap:hover .slick-prev,
.card-slider-wrap:hover .slick-next {
    opacity: 1 !important;
}

.card-slider-wrap .slick-prev:hover,
.card-slider-wrap .slick-next:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.card-slider-wrap .slick-prev {
    left: 15px;
}

.card-slider-wrap .slick-next {
    right: 15px;
}

.card-slider-wrap .slick-prev:before,
.card-slider-wrap .slick-next:before {
    color: white;
    font-size: 24px;
    font-weight: bold;
    line-height: 46px;
}

/* Carousel dots - horizontal layout */
.card-slider-wrap .slick-dots {
    display: flex !important;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    gap: 8px;
}

.card-slider-wrap .slick-dots li {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0;
    padding: 0;
}

.card-slider-wrap .slick-dots li button {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid #333;
    border-radius: 50%;
    background: transparent;
    font-size: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-slider-wrap .slick-dots li button:hover {
    background: #666;
    border-color: #666;
}

.card-slider-wrap .slick-dots li.slick-active button {
    background: #333;
    border-color: #333;
}

/* Carousel - Text below image (default) */
.card-slider-wrap.carousel-text-below .carousel-wraps {
    position: relative;
}

.card-slider-wrap.carousel-text-below .carousel-thumb {
    position: relative;
}

.card-slider-wrap.carousel-text-below .post-content {
    position: relative;
    padding: 15px 0;
    background: transparent;
}

/* Carousel - Text overlay on image */
.card-slider-wrap.carousel-text-overlay .carousel-wraps {
    position: relative;
    overflow: hidden;
}

.card-slider-wrap.carousel-text-overlay .carousel-content-wrap {
    position: relative;
    overflow: hidden;
}

.card-slider-wrap.carousel-text-overlay .carousel-thumb {
    position: relative;
}

.card-slider-wrap.carousel-text-overlay .carousel-thumb img {
    transition: transform 0.4s ease;
}

.card-slider-wrap.carousel-text-overlay .carousel-thumb::after {
    display: none;
}

/* Carousel overlay hover effects - matches unified overlay cards */
.card-slider-wrap.carousel-text-overlay .carousel-wraps:hover .carousel-thumb img {
    transform: scale(1.05);
}

.card-slider-wrap.carousel-text-overlay .post-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
    border-radius: 0;
    border-top: 2px solid rgba(52, 152, 219, 0.2);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    color: #2c3e50;
    z-index: 2;
}
.card-slider-wrap.carousel-text-overlay .post-content h3 {
    margin: 0;
    padding: 0;
}
.card-slider-wrap.carousel-text-overlay .post-content h3 a {
    color: #2c3e50 !important;
    text-shadow: none;
    transition: all 0.25s ease;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.card-slider-wrap.carousel-text-overlay .carousel-wraps:hover .post-content h3 a {
    color: #3498db !important;
}



.card-slider-wrap.carousel-text-overlay .post-content .post-meta,
.card-slider-wrap.carousel-text-overlay .post-content .post-meta a,
.card-slider-wrap.carousel-text-overlay .post-content .post-meta time {
    color: #7f8c8d !important;
    text-shadow: none;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.25s ease;
}

.card-slider-wrap.carousel-text-overlay .post-content .post-meta a:hover {
    color: #3498db !important;
}

.card-slider-wrap.carousel-text-overlay .post-content p {
    color: #5a6c7d;
    text-shadow: none;
    line-height: 1.6;
    font-size: 14px;
}

/* Template-specific adjustments */
.template-default .column-post-item:not(.image-left):not(.image-right):not(.image-background) .post-thumb img {
    object-fit: cover;
}

.template-minimal .column-post-item {
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.template-minimal .column-post-item .post-title {
    font-size: 14px;
    line-height: 1.3;
}

.template-minimal .column-post-item .post-meta {
    font-size: 11px;
}

.template-magazine .column-post-item:first-child {
    margin-bottom: 20px;
}

.template-magazine .column-post-item:first-child .post-thumb img {
    max-height: 200px;
    object-fit: cover;
}

.template-magazine .column-post-item:not(:first-child) {
    margin-bottom: 10px;
}

.template-magazine .column-post-item:not(:first-child) .post-title {
    font-size: 14px;
}

/* ========================================
   8. Responsive Adjustments
   ======================================== */

@media (max-width: 991px) {
    .homepage-section {
        padding: 25px 0;
    }
    
    .homepage-section.section-first {
        padding-top: 35px;
        margin-top: 15px;
    }
}

@media (max-width: 991px) {
    .main-slider-section .col-md-3,
    .main-slider-section .col-md-6 {
        margin-bottom: 20px;
    }
    
    /* Ensure slider container doesn't exceed screen width on mobile */
    .main-slider,
    .main-slider-section .main-slider,
    .col-md-6 .main-slider {
        max-width: 100%;
        width: 100%;
        overflow: hidden;
    }
    
    .main-slider .slick-list {
        overflow: hidden;
    }
    
    .main-slider-wrap .carousel-thumb {
        height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .main-slider-wrap .carousel-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

@media (max-width: 768px) {
    .homepage-section {
        padding: 20px 0;
    }
    
    .homepage-section.section-first {
        padding-top: 25px;
        margin-top: 10px;
    }
    
    /* Mobile slider container */
    .main-slider,
    .main-slider-section .main-slider {
        max-width: 100%;
        overflow: hidden;
    }
    
    .main-slider-wrap .carousel-thumb {
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ========================================
   HTML Section Styles
   ======================================== */

.html-section {
    padding: 30px 0;
}

.html-section.full-width {
    padding: 30px 0;
}

.html-section.full-width .html-content {
    max-width: 100%;
}

.html-section .html-content {
    line-height: 1.7;
}

.html-section .html-content img {
    max-width: 100%;
    height: auto;
}

.html-section .html-content p {
    margin-bottom: 1em;
}

.html-section .html-content h1,
.html-section .html-content h2,
.html-section .html-content h3,
.html-section .html-content h4,
.html-section .html-content h5,
.html-section .html-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.html-section .html-content ul,
.html-section .html-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.html-section .html-content blockquote {
    border-left: 4px solid #5DADE2;
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: #555;
}
