/* ==========================================================================
   Homepage Dedicated Styles (Carousel, Categories & Latest Posts Grid)
   ========================================================================== */

/* 1. Main Container */
.child-home-wrapper {
    max-width: 1340px;
    width: 94%;
    margin: 0 auto;
    padding: 30px 0 60px 0;
}

/* 2. Hero Featured Posts Carousel */
.child-home-hero-section {
    margin-bottom: 48px;
}

.child-home-carousel {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.15);
    background-color: #0f172a;
    width: 100%;
}

.child-carousel-viewport {
    width: 100%;
    overflow: hidden;
}

.child-carousel-track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.child-carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
    position: relative;
    height: 480px;
    display: flex;
    align-items: flex-end;
}

.child-carousel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.8s ease;
}

.child-carousel-slide:hover .child-carousel-bg {
    transform: scale(1.04);
}

.child-carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.6) 50%, rgba(15, 23, 42, 0.95) 100%);
    z-index: 2;
}

.child-carousel-content {
    position: relative;
    z-index: 3;
    padding: 40px 50px;
    max-width: 820px;
    color: #ffffff;
}

.child-carousel-badge {
    display: inline-block;
    background-color: #0284c7;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 9999px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.child-carousel-title {
    font-size: clamp(24px, 3.2vw, 36px);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 16px 0;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.child-carousel-title a {
    color: #ffffff;
    text-decoration: none;
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    background-image: linear-gradient(to left, #dc2626 0%, #ec4899 50%, #09090b 100%);
    background-repeat: no-repeat;
    background-size: 0% 3.5px;
    background-position: right bottom 2px;
    padding-bottom: 4px;
    transition: background-size 0.75s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}

.child-carousel-slide:hover .child-carousel-title a,
.child-carousel-title a:hover {
    background-size: 100% 3.5px;
}

.child-carousel-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13.5px;
    color: #cbd5e1;
    margin-bottom: 22px;
}

.child-carousel-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.child-carousel-btn:hover {
    background-color: #0284c7;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
}

/* Carousel Navigation Arrows */
.child-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    cursor: pointer;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #0f172a;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.child-carousel-nav:hover {
    background-color: #ffffff;
    color: #0284c7;
    transform: translateY(-50%) scale(1.1);
}

.child-carousel-prev {
    left: 20px;
}

.child-carousel-next {
    right: 20px;
}

/* Carousel Dots Indicator */
.child-carousel-dots {
    position: absolute;
    bottom: 20px;
    right: 36px;
    z-index: 4;
    display: flex;
    gap: 8px;
    align-items: center;
}

.child-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.child-carousel-dot.active {
    width: 28px;
    background-color: #38bdf8;
}

/* 3. Categories Quick Browse Bar */
.child-home-categories-bar {
    margin-bottom: 44px;
}

.child-home-categories-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.child-home-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background-color: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 9999px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.child-home-category-chip:hover {
    background-color: #f0f9ff;
    color: #0284c7;
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
}

.child-home-category-count {
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    transition: all 0.25s ease;
}

.child-home-category-chip:hover .child-home-category-count {
    background-color: #0284c7;
    color: #ffffff;
}

/* 4. Section Header */
.child-home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 14px;
}

.child-home-section-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.child-home-section-title::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: #0284c7;
    border-radius: 2px;
}

.child-home-view-all {
    font-size: 14px;
    font-weight: 600;
    color: #0284c7;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.child-home-view-all:hover {
    color: #0369a1;
    transform: translateX(4px);
}

/* 5. Latest Posts 3-Column Animated Grid */
.child-home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.child-home-card {
    background-color: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s ease;
}

.child-home-card:hover {
    box-shadow: 0 20px 32px -8px rgba(2, 132, 199, 0.14),
                0 0 1px 1px rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.6);
}

.child-home-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    max-height: 220px;
    overflow: hidden;
    background-color: #f1f5f9;
}

.child-home-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}

.child-home-card:hover .child-home-card-thumb img {
    transform: scale(1.07);
    filter: brightness(1.02);
}

.child-home-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e2e8f0 100%);
    width: 100%;
    height: 100%;
}

.child-home-card-body {
    padding: 22px 24px 20px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
}

.child-home-card-category {
    margin-bottom: 10px;
}

.child-home-card-category a {
    display: inline-block;
    background-color: #f0f9ff;
    color: #0284c7;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: 9999px;
    text-decoration: none;
    border: 1px solid rgba(186, 230, 253, 0.6);
    transition: all 0.25s ease;
}

.child-home-card-category a:hover {
    background-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.child-home-card-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.child-home-card-title a {
    color: #0f172a;
    text-decoration: none;
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    background-image: linear-gradient(to left, #dc2626 0%, #ec4899 50%, #09090b 100%);
    background-repeat: no-repeat;
    background-size: 0% 3px;
    background-position: right bottom 1px;
    padding-bottom: 3px;
    transition: background-size 1.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}

.child-home-card:hover .child-home-card-title a,
.child-home-card-title a:hover {
    background-size: 100% 3px;
}

.child-home-card-meta {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.child-home-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.child-home-card-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.child-home-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: #0284c7;
    text-decoration: none;
    transition: all 0.25s ease;
}

.child-home-card-readmore span {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.child-home-card:hover .child-home-card-readmore span {
    transform: translateX(5px);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media screen and (max-width: 1024px) {
    .child-carousel-slide {
        height: 400px;
    }

    .child-carousel-content {
        padding: 30px 36px;
    }

    .child-home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media screen and (max-width: 640px) {
    .child-carousel-slide {
        height: 360px;
    }

    .child-carousel-content {
        padding: 24px 20px;
    }

    .child-carousel-title {
        font-size: 20px;
    }

    .child-carousel-nav {
        display: none; /* Swipe used on mobile */
    }

    .child-home-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .child-home-wrapper {
        width: 92%;
        padding-top: 20px;
    }
}

