/* 
 * Home Page Styles 
 * Featured Blogs Section
 */

/* ── Section wrapper ── */
.featured-blogs {
    padding: 80px 0;
}

/* ── Section header ── */
.featured-title {
    font-size: 42px;
    font-weight: 700;
    color: #111;
    margin-bottom: 10px;
    text-align: center;
}

.featured-subtitle {
    font-size: 18px;
    color: #555;
    margin-bottom: 40px;
    text-align: center;
}

/* ── Carousel outer shell (cream bg, arrows on sides) ── */
.blogs-carousel-wrapper {
    background-color: #fff9eb;
    border-radius: 30px;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.blogs-carousel-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Arrow buttons ── */
.carousel-arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    align-self: center;
}

.carousel-arrow:hover {
    transform: scale(1.15);
}

#carousel-prev {
    margin-right: 12px;
}

#carousel-next {
    margin-left: 12px;
}

/* ── Slide track ── */
.blogs-track {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* ── Each slide: column — main card row on top, two small cards row below ── */
.blog-slide {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.45s ease;
}

.blog-slide.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ────────────────────────────────────────
   BIG CARD page-turn animation
   Only .featured-main animates — small cards swap silently.
   perspective() is baked into the transform so no parent changes needed.
──────────────────────────────────────── */

/* Forward (▶) — big card exits to the left */
@keyframes fbExitLeft {
    from { opacity: 1; transform: perspective(900px) translateX(0)     rotateY(0deg)   scale(1);    }
    to   { opacity: 0; transform: perspective(900px) translateX(-60px)  rotateY(-14deg) scale(0.95); }
}
/* Forward (▶) — new big card enters from the right */
@keyframes fbEnterRight {
    from { opacity: 0; transform: perspective(900px) translateX(60px)   rotateY(14deg)  scale(0.95); }
    to   { opacity: 1; transform: perspective(900px) translateX(0)      rotateY(0deg)   scale(1);    }
}
/* Backward (◀) — big card exits to the right */
@keyframes fbExitRight {
    from { opacity: 1; transform: perspective(900px) translateX(0)      rotateY(0deg)   scale(1);    }
    to   { opacity: 0; transform: perspective(900px) translateX(60px)   rotateY(14deg)  scale(0.95); }
}
/* Backward (◀) — new big card enters from the left */
@keyframes fbEnterLeft {
    from { opacity: 0; transform: perspective(900px) translateX(-60px)  rotateY(-14deg) scale(0.95); }
    to   { opacity: 1; transform: perspective(900px) translateX(0)      rotateY(0deg)   scale(1);    }
}

.featured-main.fb-exit-left  { animation: fbExitLeft   0.22s ease-in  forwards; }
.featured-main.fb-enter-right { animation: fbEnterRight 0.30s ease-out forwards; }
.featured-main.fb-exit-right { animation: fbExitRight  0.22s ease-in  forwards; }
.featured-main.fb-enter-left  { animation: fbEnterLeft  0.30s ease-out forwards; }


/* ── The two small cards sit side-by-side ── */
.featured-side {
    display: flex;
    flex-direction: row;
    gap: 24px;
    padding: 0 52px;
}

.featured-side .featured-small {
    flex: 1 1 0;
    min-width: 0;
}

/* ── Shared card shell ── */
.featured-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.08);
}

/* ── Shared anchor (row layout for both card types) ── */
.featured-card-link {
    display: flex;
    flex-direction: row;
    /* image LEFT, content RIGHT */
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* ── Shared image container ── */
.featured-card-image {
    background: #d9d9d9;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Card content ── */
.featured-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 28px 28px 28px 0;
    /* breathing room on right/top/bottom */
}

/* ────────────────────────────────────────
   MAIN (large) card
   Image: ~55% wide, fixed height
   Content: remaining width
──────────────────────────────────────── */
.featured-main {
    width: 100%;
}

.featured-main .featured-card-link {
    min-height: 260px;
}

.featured-main .featured-card-image {
    width: 55%;
    min-height: 260px;
}

.featured-main .featured-card-content {
    padding: 30px 30px 30px 32px;
}

.featured-main .card-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
    margin: 8px 0 12px;
}

/* ────────────────────────────────────────
   SMALL cards (two side-by-side below)
   Image: square on left, content on right
──────────────────────────────────────── */
.featured-small .featured-card-link {
    min-height: 150px;
}

.featured-small .featured-card-image {
    width: 130px;
    height: 130px;
    margin: 20px 0 20px 20px;
    border-radius: 14px;
    flex-shrink: 0;
}

.featured-small .featured-card-content {
    padding: 20px 20px 20px 20px;
}

.featured-small .card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: #111;
    margin: 6px 0 8px;
}

/* ── Typography ── */
.card-category-label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
}

.card-title {
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.card-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 14px 0;
}

.card-date {
    font-size: 13px;
    color: #888;
    display: block;
}

/* ────────────────────────────────────────
   RESPONSIVE — tablet ≤ 900px
   Main card: image on left, shorter height
   Small cards: stay side-by-side but image stacks above text
──────────────────────────────────────── */
@media (max-width: 900px) {
    .blogs-carousel-wrapper {
        padding: 30px 10px;
    }

    #carousel-prev {
        margin-right: 6px;
    }

    #carousel-next {
        margin-left: 6px;
    }

    .featured-side {
        padding: 0 46px;
    }

    .featured-main .featured-card-image {
        width: 50%;
        min-height: 200px;
    }

    .featured-main .featured-card-link {
        min-height: 200px;
    }

    .featured-main .card-title {
        font-size: 20px;
    }

    .featured-small .featured-card-image {
        width: 100px;
        height: 100px;
    }
}

/* ────────────────────────────────────────
   RESPONSIVE — mobile ≤ 600px
   Everything stacks vertically
──────────────────────────────────────── */
@media (max-width: 600px) {
    .featured-side {
        display: none !important;
    }

    .featured-card-link {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .featured-main .featured-card-image,
    .featured-small .featured-card-image {
        width: 100% !important;
        height: 200px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .featured-card-content,
    .featured-main .featured-card-content,
    .featured-small .featured-card-content {
        padding: 20px !important;
    }

    .featured-main .card-title {
        font-size: 20px;
    }
}