/* ==========================================================================
   BestBlogTheme — Homepage (Slider + Articles + Widgets Zone)
   ========================================================================== */

/* -- Reset homepage main padding (slider flush with header) --------------- */
.bbt-home.bbt-site-main,
.bbt-site-main.bbt-home {
    padding-top: 0;
    padding-block-start: 0;
}

/* -- Slider --------------------------------------------------------------- */
.bbt-slider {
    position: relative;
    width: 100%;
    height: 75vh;
    min-height: 500px;
    max-height: 700px;
    overflow: hidden;
    border-bottom: 3px solid var(--bbt-color-secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

@media (max-width: 767px) {
    .bbt-slider {
        height: auto;
        min-height: auto;
        max-height: none;
    }
}

/* -- Slides Container (full width background) ----------------------------- */
.bbt-slider__slides {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* -- Individual Slide ----------------------------------------------------- */
.bbt-slider__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.bbt-slider__slide.is-active {
    opacity: 1;
    z-index: 2;
}

@media (max-width: 767px) {
    .bbt-slider__slides {
        position: relative;
        height: 55vh;
        min-height: 350px;
    }

    .bbt-slider__slide {
        align-items: flex-start;
    }
}

/* -- Overlay -------------------------------------------------------------- */
.bbt-slider__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* -- Slide Content -------------------------------------------------------- */
.bbt-slider__content {
    position: relative;
    z-index: 3;
    padding: 3rem 3rem 3.5rem;
    max-width: calc(100% - 360px);
    color: #fff;
}

@media (max-width: 1023px) {
    .bbt-slider__content {
        max-width: calc(100% - 300px);
    }
}

@media (max-width: 767px) {
    .bbt-slider__content {
        padding: 2rem 1.5rem 2.5rem;
        max-width: 100%;
    }
}

.bbt-slider__category {
    display: inline-block;
    font-family: var(--bbt-font-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.75rem;
}

.bbt-slider__title {
    font-family: var(--bbt-font-primary);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    margin-bottom: 1.25rem;
}

.bbt-slider__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: var(--bbt-color-primary);
    color: #fff;
    font-family: var(--bbt-font-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s ease, gap 0.2s ease;
}

.bbt-slider__cta:hover {
    background: var(--bbt-color-secondary);
    color: #fff;
    gap: 0.75rem;
}

.bbt-slider__cta svg {
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* -- Sidebar (right side list overlay) ------------------------------------ */
.bbt-slider__sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: stretch;
    z-index: 5;
}

@media (max-width: 1023px) {
    .bbt-slider__sidebar {
        width: 280px;
    }
}

@media (max-width: 767px) {
    .bbt-slider__sidebar {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        background: rgba(0, 0, 0, 0.6);
        border-left: none;
    }
}

.bbt-slider__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

@media (max-width: 767px) {
    .bbt-slider__list {
        flex-direction: row;
    }
}

/* -- List Item ------------------------------------------------------------ */
.bbt-slider__list-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}

.bbt-slider__list-item:last-child {
    border-bottom: none;
}

@media (max-width: 767px) {
    .bbt-slider__list-item {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem 1.25rem;
    }

    .bbt-slider__list-item:last-child {
        border-right: none;
    }
}

.bbt-slider__list-item.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.bbt-slider__list-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.bbt-slider__list-link {
    font-family: var(--bbt-font-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bbt-slider__list-link:hover {
    color: #fff;
}

@media (max-width: 767px) {
    .bbt-slider__list-link {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
    }
}

/* -- Progress bar under active item --------------------------------------- */
.bbt-slider__list-progress {
    height: 2px;
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.bbt-slider__list-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--bbt-color-primary);
    border-radius: 2px;
    transition: none;
}

.bbt-slider__list-item.is-active .bbt-slider__list-progress-bar {
    animation: bbt-slider-progress linear forwards;
}

@keyframes bbt-slider-progress {
    from { width: 0%; }
    to { width: 100%; }
}

/* -- Articles Section ----------------------------------------------------- */
.bbt-home__articles {
    padding-block: 3rem;
}

/* -- Masonry Alternating Layout ------------------------------------------- */
.bbt-masonry {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-auto-rows: minmax(220px, auto);
    gap: 1.25rem;
}

@media (max-width: 767px) {
    .bbt-masonry {
        grid-template-columns: 1fr;
    }
}

.bbt-masonry__item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #1e293b;
    min-height: 280px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bbt-masonry__item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Alternating row pattern :
   row 1: large (col 1-2), small (col 1)
   row 2: small (col 1), large (col 1-2)
   etc. */
.bbt-masonry__item:nth-child(4n+1) {
    grid-column: 1 / 2;
    grid-row: span 2;
    min-height: 460px;
}

.bbt-masonry__item:nth-child(4n+2) {
    grid-column: 2 / 3;
}

.bbt-masonry__item:nth-child(4n+3) {
    grid-column: 2 / 3;
}

.bbt-masonry__item:nth-child(4n+4) {
    grid-column: 1 / 3;
    min-height: 320px;
}

@media (max-width: 767px) {
    .bbt-masonry__item:nth-child(4n+1),
    .bbt-masonry__item:nth-child(4n+2),
    .bbt-masonry__item:nth-child(4n+3),
    .bbt-masonry__item:nth-child(4n+4) {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 280px;
    }
}

.bbt-masonry__link {
    position: absolute;
    inset: 0;
    display: block;
    color: #fff;
    text-decoration: none;
}

.bbt-masonry__media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
}

.bbt-masonry__media--placeholder {
    background: linear-gradient(135deg, var(--bbt-color-primary), var(--bbt-color-secondary));
}

.bbt-masonry__item:hover .bbt-masonry__media {
    transform: scale(1.05);
}

.bbt-masonry__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.45) 45%,
        rgba(0, 0, 0, 0.15) 100%
    );
    transition: background 0.3s ease;
}

.bbt-masonry__item:hover .bbt-masonry__overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.6) 45%,
        rgba(0, 0, 0, 0.25) 100%
    );
}

.bbt-masonry__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem 1.75rem;
    z-index: 2;
}

.bbt-masonry__category {
    display: inline-block;
    font-family: var(--bbt-font-primary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    padding: 0.25rem 0.7rem;
    background: var(--bbt-color-secondary);
    border-radius: 20px;
    margin-bottom: 0.65rem;
}

.bbt-masonry__title {
    font-family: var(--bbt-font-primary);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    margin: 0 0 0.65rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.bbt-masonry__item:nth-child(4n+1) .bbt-masonry__title {
    font-size: 1.7rem;
}

.bbt-masonry__item:nth-child(4n+4) .bbt-masonry__title {
    font-size: 1.55rem;
}

@media (max-width: 767px) {
    .bbt-masonry__title,
    .bbt-masonry__item:nth-child(4n+1) .bbt-masonry__title,
    .bbt-masonry__item:nth-child(4n+4) .bbt-masonry__title {
        font-size: 1.25rem;
    }
}

.bbt-masonry__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--bbt-font-primary);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    backdrop-filter: blur(6px);
}

/* -- Load More ------------------------------------------------------------ */
.bbt-home__loadmore-wrap {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.bbt-home__loadmore {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: transparent;
    color: var(--bbt-color-primary);
    font-family: var(--bbt-font-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    border: 2px solid var(--bbt-color-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.bbt-home__loadmore:hover {
    background: var(--bbt-color-primary);
    color: #fff;
}

.bbt-home__loadmore.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

.bbt-home__loadmore.is-done {
    display: none;
}

/* -- Homepage Widgets Zone ------------------------------------------------ */
.bbt-home__widgets {
    padding-block: 3rem;
}

.bbt-home__widgets-grid {
    display: grid;
    gap: 1.5rem;
}

.bbt-home__widgets-grid--3 {
    grid-template-columns: 1fr;
}

.bbt-home__widgets-grid--4 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .bbt-home__widgets-grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .bbt-home__widgets-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bbt-home__widgets-grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bbt-home__widgets-col {
    padding: 1.5rem;
    border-radius: 10px;
}
