/* BLOG LAYOUT */
.layout {
    display: grid;
    grid-template-columns: 3fr 1fr; /* right side smaller */
    gap: 30px;
    width: 90%;
    max-width: 1520px;
    margin: 10px auto;
    align-items: stretch;
}

/* FIXED HEIGHT FOR BOTH PANELS */
.left-panel,
.right-panel {
    height: 700px;
    overflow: hidden;
}

/* FEATURED ARTICLE */
.featured {
    background: white;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    height: 100%;
    overflow-y: auto;
}

/* SLIDER */
.slider {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 20px;
}

.slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* SLIDER ARROWS */
.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 22px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 10;
}

.prev { left: 10px; }
.next { right: 10px; }

.prev:hover,
.next:hover {
    background: rgba(0,0,0,0.7);
}

/* RIGHT PANEL */
.right-panel {
    background: white;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding-right: 10px;
    overflow-y: auto;
}

.latest-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 15px 10px;
    font-size: 22px;
    font-weight: bold;
    border-bottom: 2px solid #1a73e8;
    z-index: 10;
}

/* POSTS LIST */
.posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
}

/* POST CARD */
.post {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: 0.2s ease;
}

.post:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.post img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.post h3 {
    font-size: 16px;
    margin: 0;
}

/* MOBILE */
@media (max-width: 768px) {
    .layout {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 10px 0px;
        grid-template-columns: 1fr;
    }

    .featured {
        padding: 5px;
    }

  .left-panel,
    .right-panel {
        height: auto;
        overflow: visible;
    }

    /* RIGHT PANEL MOBILE SCROLL */
    .right-panel {
        overflow-x: auto;
        overflow-y: visible;
        padding-bottom: 10px;
    }

    .posts {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 15px;
        padding-left: 10px;
        padding-right: 20px;
    }

    .post {
        min-width: 70%;
        max-width: 70%;
        scroll-snap-align: start;
    }

    /* SLIDER MOBILE */
    .slider {
        height: 220px;
    }
}
