/* =============================
   CONTAINER
============================= */

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 10px;
}

/* =============================
   HOME LAYOUT
============================= */

#homepage {
    background: #f5f5f5;
    padding: 20px 0;
}

.home-layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 20px;
}

/* =============================
   TICKER
============================= */

.ticker {
    background: #111;
    color: #fff;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 20px;
}

.ticker-title {
    font-weight: bold;
    margin-right: 20px;
    white-space: nowrap;
}

.ticker-list {
    display: flex;
    gap: 40px;
    animation: tickerScroll 30s linear infinite;
}

.ticker-list li {
    list-style: none;
    white-space: nowrap;
}

.ticker-list a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =============================
   SIDEBARS (STICKY)
============================= */

.home-left,
.home-right {
    position: sticky;
    top: 20px;
    align-self: start;

    background: #fff;
    padding: 15px;
    border-radius: 6px;

    transition: box-shadow 0.3s ease;
}

.home-left:hover,
.home-right:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* =============================
   CENTER CONTENT
============================= */

.home-center {
    min-width: 0;
}

.home-center > * {
    margin-bottom: 20px;
}

/* =============================
   MOST POPULAR
============================= */

.popular-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
}

.popular-item img {
    width: 70px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* =============================
   HERO SLIDER (IMPROVED)
============================= */

.hero-slider {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.slide {
    position: absolute;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    position: relative;
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* =============================
   GRID POSTS
============================= */

.grid-posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.grid-item {
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.grid-item:hover {
    transform: translateY(-3px);
}

.grid-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

/* =============================
   MIXED POSTS
============================= */

.mixed-posts {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
}

.top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* =============================
   LATEST NEWS (LIVE READY)
============================= */

.latest-news ul {
    list-style: none;
    padding: 0;
    transition: opacity 0.3s ease;
}

.latest-news li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.latest-news a {
    color: #333;
    text-decoration: none;
}

.latest-news a:hover {
    color: #000;
}

.latest-news .date {
    font-size: 12px;
    color: #888;
}

/* Highlight new posts */
.latest-news li.new {
    background: #fff3cd;
    transition: background 0.5s ease;
}

/* =============================
   CRITICAL FIXES (DO NOT REMOVE)
============================= */

#homepage,
.home-layout,
body {
    overflow: visible !important;
    height: auto !important;
}

/* =============================
   RESPONSIVE
============================= */

@media (max-width: 1024px) {
    .home-layout {
        grid-template-columns: 1fr;
    }

    .home-left,
    .home-right {
        position: static;
    }
}

@media (max-width: 600px) {
    .grid-posts {
        grid-template-columns: 1fr;
    }

    .slide img {
        height: 250px;
    }
}