/**
 * THSF Carousel Plugin - Additional Styles
 * 
 * This file contains additional CSS styles for the carousel components.
 * You can customize these styles to match your theme's design.
 */

/* Latest Posts Carousel Styles */
.latest-posts-carousel-wrapper {
    margin: 2rem 0;
    border: 0 !important;
    box-shadow: none !important;
}

.latest-posts-carousel {
    position: relative;
}

/* New hero + thumbnails layout */
.latest-posts-hero {
    position: relative;
    border: 0 !important;
    box-shadow: none !important;
}
.latest-posts-main {
    position: relative;
    border: 0 !important;
    box-shadow: none !important;
}
.latest-posts-main .hero-slide {
    position: relative;
    background-color: #000;
    min-height: 520px;
    max-height: 720px;
    overflow: hidden;
}
.latest-posts-main .hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.latest-posts-main .hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    background: linear-gradient(180deg, rgba(0,0,0,0.0) 40%, rgba(0,0,0,0.75) 100%);
}
.latest-posts-main .hero-title {
    margin: 0 0 6px 0;
    color: #fff;
    font-size: 40px;
    line-height: 1.1;
}
.latest-posts-main .hero-meta {
    color: #fff;
    opacity: .85;
}

.latest-posts-thumbs {
    margin: 0 auto 0;
    max-width: 1200px;
    display: flex;
    gap: 0;
    border-bottom: 0 !important;
}
.latest-posts-thumbs .thumb-slide {
    padding: 0;
    flex: 1 1 0;
    min-width: 0;
}
.latest-posts-thumbs .thumb-slide img {
    width: 120%;
    max-width: none;
    height: 74px;
    object-fit: contain;
    display: block;
    margin-left: -10%;
    background-color: #f0f0f0;
}

/* Opera/WebKit flex-basis fix: equalize widths */
.latest-posts-thumbs { -webkit-box-align: stretch; -ms-flex-align: stretch; align-items: stretch; }
.latest-posts-thumbs .thumb-slide { -webkit-box-flex: 1; -ms-flex: 1 1 0; flex: 1 1 0; }

/* Remove unexpected gaps by forcing slick track/item alignment */
.latest-posts-thumbs .slick-list { overflow: hidden; }

/* Active thumb underline */
.latest-posts-thumbs .thumb-slide { position: relative; cursor: pointer; overflow: hidden; }
.latest-posts-thumbs .thumb-slide.is-active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: #e6582f;
}

.carousel-slide {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
}

.carousel-slide-content {
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 2rem;
    width: 100%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.carousel-slide-content:hover {
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    text-decoration: none;
    color: white;
}

.carousel-slide-content h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.carousel-meta {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Multi-Image Carousel Styles */
.multi-image-carousel {
    margin: 2rem 0;
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.carousel-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
}

.carousel-items {
    margin: 0 -10px;
}

.carousel-item {
    padding: 0 10px;
}

.image-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-container:hover {
    transform: translateY(-5px);
}

.image-container img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    display: block;
    background-color: #f0f0f0;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.image-container:hover .image-overlay {
    transform: translateY(0);
}

.item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Slick Carousel Customization */
.slick-prev,
.slick-next {
    background: rgba(0,0,0,0.5) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
    z-index: 10 !important;
    transition: background 0.3s ease !important;
}

/* Bring big-image arrows slightly inside and vertically center */
.latest-posts-main .slick-prev { left: 16px; }
.latest-posts-main .slick-next { right: 16px; }
.latest-posts-main .slick-prev,
.latest-posts-main .slick-next {
    top: 50%;
    transform: translateY(-50%);
}

/* Hide default Slick arrow text */
.slick-prev:before,
.slick-next:before {
    display: none !important;
}

.slick-prev:hover,
.slick-next:hover {
    background: rgba(0,0,0,0.8) !important;
}

.slick-dots {
    bottom: 20px !important;
}

.slick-dots li button:before {
    color: white !important;
    opacity: 1 !important; /* ensure inactive dots stay solid white */
}

.slick-dots li.slick-active button:before {
    color: #BA1B1B !important;
    opacity: 1 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .carousel-slide {
        min-height: 300px;
    }
    .latest-posts-main .hero-slide { min-height: 360px; }
    .latest-posts-main .hero-title { font-size: 26px; }
    .latest-posts-thumbs .thumb-slide img { height: 70px; object-fit: contain; }
    
    .carousel-slide-content h2 {
        font-size: 1.2rem;
    }
    
    .carousel-title {
        font-size: 1.5rem;
    }
    
    .image-container img {
        height: 150px;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .carousel-slide {
        min-height: 250px;
    }
    
    .carousel-slide-content {
        padding: 1rem;
    }
    
    .carousel-slide-content h2 {
        font-size: 1rem;
    }
    .latest-posts-main .hero-slide { min-height: 300px; }
    .latest-posts-main .hero-title { font-size: 22px; }
} 

/* THSF Blog Carousel Styles */
.thsf-blog-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 30px;
    min-height: 750px;
    z-index: 1;
    margin-top: calc(-1 * var(--thsf-header-height, 220px) - 20px);
}

.thsf-blog-carousel {
    width: 100%;
    margin-bottom: 0 !important;
    height: 750px;
}

.thsf-blog-carousel .slick-list,
.thsf-blog-carousel .slick-track {
    height: 100%;
}

.thsf-slide {
    position: relative;
    height: 750px;
    overflow: hidden;
    outline: none;
}

.thsf-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transition: transform 6s ease;
}

.thsf-slide.slick-active .thsf-slide-bg {
    transform: scale(1.05);
}

.thsf-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 100%);
    z-index: 2;
}

.thsf-slide-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    max-width: 100%; /* allow full-width span */
    left: 50%;
    transform: translateX(-50%);
    padding: 0 20px 100px 20px;
}

.thsf-slide-content {
    max-width: 800px;
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.3s;
    margin-bottom: 39px;
    margin-left: 50px;
}

.thsf-slide.slick-active .thsf-slide-content {
    opacity: 1;
    transform: translateY(0);
}

.thsf-slide-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #fff;
}

.thsf-slide-excerpt {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.thsf-slide-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}

.thsf-slide-btn:hover {
    background-color: #fff;
    color: #000;
}

/* Navigation */
.thsf-blog-carousel .slick-arrow {
    z-index: 10;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none;
}

.thsf-blog-carousel .slick-arrow:hover {
    background: rgba(255, 255, 255, 0.4);
}

.thsf-blog-carousel .slick-prev:before,
.thsf-blog-carousel .slick-next:before {
    display: none;
}

.thsf-blog-carousel .slick-prev {
    left: auto;
    right: 129px; /* 50px right arrow offset + 48px arrow width + 31px gap */
    bottom: 39px;
    top: auto;
    transform: none;
}

.thsf-blog-carousel .slick-next {
    right: 50px;
    bottom: 39px;
    top: auto;
    transform: none;
}

.thsf-blog-carousel .slick-dots {
    bottom: 52px !important; /* adjusted per request */
    right: 222px; /* left arrow right offset + 48px arrow width + 45px gap */
    width: auto;
    text-align: right;
    z-index: 10;
}

.thsf-blog-carousel .slick-dots li {
    margin: 0 4px;
    width: 10px;
    height: 10px;
}

.thsf-blog-carousel .slick-dots li button {
    width: 10px;
    height: 10px;
    padding: 0;
}

.thsf-blog-carousel .slick-dots li button:before {
    font-size: 10px;
    color: #fff;
    opacity: 1;
    width: 10px;
    height: 10px;
    line-height: 10px;
}

.thsf-blog-carousel .slick-dots li.slick-active button:before {
    color: #BA1B1B; /* Active dot color */
    opacity: 1;
}

/* Container constraint for arrows/dots if needed */
@media (max-width: 768px) {
    .thsf-blog-carousel-wrapper,
    .thsf-blog-carousel {
        min-height: 500px;
        height: 500px;
    }
    .thsf-slide {
        height: 500px;
    }
    .thsf-slide-title {
        font-size: 20px;
        /* Limit title to 2 lines on mobile */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .thsf-slide-excerpt {
        font-size: 13px;
        /* Limit excerpt to 2 lines on mobile */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .thsf-slide-content-wrapper {
        padding: 0 20px 80px 20px;
        width: 100%;
        left: 0;
        transform: none;
        align-items: flex-end;
    }
    .thsf-slide-content {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
    
    .thsf-blog-carousel .slick-prev {
        right: 70px;
        bottom: 20px;
    }
    .thsf-blog-carousel .slick-next {
        right: 10px;
        bottom: 20px;
    }
    .thsf-blog-carousel .slick-dots {
        bottom: 36px;
        right: 130px;
    }
}

/* Latest posts variant: match reference mobile typography (bigger title + 3 lines) */
@media (max-width: 768px) {
    /* Increase image/slide height on mobile for latest posts */
    .thsf-blog-carousel-wrapper:has(.thsf-blog-carousel.latest-posts-variant),
    .thsf-blog-carousel.latest-posts-variant {
        min-height: 600px;
        height: 600px;
    }
    .thsf-blog-carousel.latest-posts-variant .thsf-slide {
        height: 600px;
    }

    .thsf-blog-carousel.latest-posts-variant .thsf-slide-title {
        font-size: clamp(20px, 5.8vw, 26px);
        line-height: 1.15;
        -webkit-line-clamp: 3 !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .thsf-blog-carousel.latest-posts-variant .thsf-slide-excerpt {
        font-size: 13px;
        line-height: 1.4;
        -webkit-line-clamp: 2 !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .thsf-blog-carousel.latest-posts-variant .thsf-slide-content {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .thsf-blog-carousel-wrapper:has(.thsf-blog-carousel.latest-posts-variant),
    .thsf-blog-carousel.latest-posts-variant {
        min-height: 520px;
        height: 520px;
    }
    .thsf-blog-carousel.latest-posts-variant .thsf-slide {
        height: 520px;
    }

    .thsf-blog-carousel.latest-posts-variant .thsf-slide-title {
        font-size: clamp(18px, 6.5vw, 24px);
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .thsf-blog-carousel.latest-posts-variant .thsf-slide-excerpt {
        font-size: 12px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .thsf-blog-carousel.latest-posts-variant .thsf-slide-content {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .thsf-slide-title {
        font-size: 18px;
    }
    .thsf-slide-excerpt {
        font-size: 12px;
    }
}