/* ==========================================================================
   Pilihan Editor Widget — Tirto.id Clone
   Layout: 5 card horizontal (1 baris)
   Lebar: sama dengan Headline Widget (max-width: 1033px)
   ========================================================================== */

/* ---- Section Wrapper ---- */
.ep-widget-section {
    background: #fff;
    padding: 0;
    border: none !important;
}

/* ---- Inner Container — sejajar headline widget ---- */
.ep-widget-inner {
    max-width: 1033px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    padding: 24px 20px 28px;
}

/* ---- Reset ---- */
.ep-widget-section *,
.ep-widget-section *::before,
.ep-widget-section *::after { box-sizing: border-box; }
.ep-widget-section figure { margin: 0; padding: 0; }
.ep-widget-section img { display: block; max-width: 100%; }
.ep-widget-section a { text-decoration: none; }

/* ==========================================================================
   SECTION TITLE — "Pilihan Editor" dengan garis kiri tebal
   ========================================================================== */
.ep-section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0 0 20px;
    padding: 0;
    line-height: 1.2;
    border: none !important;
}

/* ==========================================================================
   GRID — 5 Kolom Horizontal
   ========================================================================== */
.ep-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    align-items: stretch;
}

/* ==========================================================================
   CARD — Gambar + Meta + Judul
   ========================================================================== */
.ep-card {
    display: flex;
    flex-direction: column;
    border: none !important;
    border-right: 1px solid #e0e0e0 !important;
    padding: 0 16px;
}
.ep-card:first-child {
    padding-left: 0;
}
.ep-card:last-child {
    border-right: none !important;
    padding-right: 0;
}

/* Card Link (gambar) */
.ep-card-link {
    display: block;
}

/* Card Image */
.ep-card-image {
    overflow: hidden;
    background: #f0f0f0;
    line-height: 0;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
}
.ep-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.ep-card:hover .ep-card-image img {
    transform: scale(1.05);
}

/* Card Body */
.ep-card-body {
    padding-top: 10px;
}

/* Card Meta — Kategori | Waktu */
.ep-card-meta {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1;
}

.ep-card-category {
    font-weight: 700;
    color: #1a56db;
    font-size: 12px;
    transition: color 0.2s;
}
.ep-card-category:hover {
    color: #1140a6;
}

.ep-card-sep {
    margin: 0 6px;
    color: #ccc;
    font-size: 10px;
}

.ep-card-time {
    color: #888;
    font-size: 12px;
    font-weight: 400;
}

/* Card Title — ~12px serif bold */
.ep-card-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: #111;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.ep-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ep-card:hover .ep-card-title {
    color: #1a56db;
}

/* ==========================================================================
   RESPONSIVE — Tablet (<=1024px): 3 kolom
   ========================================================================== */
@media (max-width: 1024px) {
    .ep-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .ep-section-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
}

/* ==========================================================================
   RESPONSIVE — Mobile (<=768px)
   ========================================================================== */
@media (max-width: 768px) {
    .ep-widget-section {
        border-top: 8px solid #f2f2f2 !important;
        border-bottom: 8px solid #f2f2f2 !important;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 6px;
        padding-bottom: 0;
    }
    .ep-widget-inner {
        padding: 0 16px 8px;
        border: none !important;
        overflow: hidden;
    }
    .ep-section-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    .ep-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .ep-grid::-webkit-scrollbar {
        display: none;
    }
    .ep-card {
        flex: 0 0 75% !important;
        width: 75% !important;
        max-width: 75% !important;
        flex-shrink: 0 !important;
        scroll-snap-align: center;
        border: 1px solid #eaeaea !important;
        border-radius: 6px;
        padding: 0 !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
        display: flex !important;
        flex-direction: column !important;
    }
    .ep-card-body {
        padding: 10px 12px 12px;
    }
    .ep-card-image {
        border-radius: 6px 6px 0 0;
    }
    .ep-card-title {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }
}

/* ==========================================================================
   RESPONSIVE — Small Mobile (<=480px)
   ========================================================================== */
@media (max-width: 480px) {
    .ep-widget-inner {
        padding: 12px 0 16px 16px;
    }
    .ep-card {
        flex: 0 0 80%;
    }
}
