/* ==========================================================================
   Daijeng Widget — Tirto.id Clone
   Layout: ~58:42 Split Desktop
   Background: Soft yellow gradient
   Top: Pink wave/scallop ornament
   ========================================================================== */

.daijeng-widget {
    margin-top: 22px;
    margin-bottom: 22px;
    font-family: 'Inter', Arial, Roboto, sans-serif;
    box-sizing: border-box;
    position: relative;
}

.daijeng-widget *,
.daijeng-widget *::before,
.daijeng-widget *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   WAVE / SCALLOP ORNAMENT (SVG via CSS background)
   Pink zigzag line at the very top, purely decorative
   ========================================================================== */
.daijeng-wave {
    width: 100%;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10' preserveAspectRatio='none'%3E%3Cpath d='M0 5 Q5 0 10 5 Q15 10 20 5 Q25 0 30 5 Q35 10 40 5' stroke='%23ff5ea8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 40px 10px;
    background-position: left center;
}

/* ==========================================================================
   WIDGET INNER — Background Gradient & Border
   ========================================================================== */
.daijeng-widget-inner {
    max-width: 1033px;
    margin: 0 auto;
    padding: 18px 22px 20px;
    width: 100%;
    background: linear-gradient(180deg, #fff8d7, #fffef5);
    border-top: 1px solid #ff5ea8;
}

/* Header */
.daijeng-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.daijeng-title-main {
    font-size: 24px;
    font-weight: 700;
    color: #c90954;
    margin: 0;
    line-height: 1.2;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: normal;
    text-transform: lowercase;
    letter-spacing: 1px;
}

.daijeng-more {
    font-size: 14px;
    color: #2d5bd1;
    text-decoration: none;
    font-weight: 500;
}
.daijeng-more:hover {
    text-decoration: underline;
}

/* ==========================================================================
   LAYOUT GRID UTAMA (Kiri 58% vs Kanan 42%)
   ========================================================================== */
.daijeng-layout {
    display: grid;
    grid-template-columns: minmax(420px, 58%) 1fr;
    gap: 28px;
    align-items: start;
}

/* ==========================================================================
   KIRI: HEADLINE BESAR
   ========================================================================== */
.daijeng-main {
    display: flex;
    flex-direction: column;
}

.daijeng-main-article {
    display: flex;
    flex-direction: column;
}

.daijeng-main-imglink {
    display: block;
    margin-bottom: 12px;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #222;
}

.daijeng-main-thumb {
    margin: 0;
    padding: 0;
    line-height: 0;
    background: #eee;
    aspect-ratio: 16 / 9;
}
.daijeng-main-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.daijeng-main-article:hover .daijeng-main-thumb img {
    transform: scale(1.03);
}

.daijeng-main-content {
    display: flex;
    flex-direction: column;
}

/* Meta (Kategori | Waktu) */
.daijeng-meta {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    line-height: 1;
}

.daijeng-category {
    font-size: 13px;
    color: #3a5fd9;
    font-weight: 600;
    text-decoration: none;
}
.daijeng-category:hover {
    text-decoration: underline;
}

.daijeng-meta-sep {
    margin: 0 6px;
    color: #ccc;
    font-size: 11px;
}

.daijeng-time {
    font-size: 12px;
    color: #777;
}

/* Judul Headline */
.daijeng-main-heading {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
    margin: 0 0 8px;
}
.daijeng-main-heading a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.daijeng-main-article:hover .daijeng-main-heading a {
    color: #0d47a1;
}

/* Ringkasan / Excerpt */
.daijeng-excerpt {
    font-size: 15px;
    color: #444;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   KANAN: GRID BERITA KECIL
   ========================================================================== */
.daijeng-side {
    display: grid;
    row-gap: 20px;
    column-gap: 0;
}

/* Konfigurasi Kolom */
.daijeng-side.cols-1 { grid-template-columns: 1fr; }
.daijeng-side.cols-2 { grid-template-columns: 1fr 1fr; }
.daijeng-side.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Border vertikal antar kolom */
.daijeng-side.cols-2 .daijeng-item:nth-child(even) {
    border-left: 1px solid #e8e0c4;
    padding-left: 14px;
}
.daijeng-side.cols-2 .daijeng-item:nth-child(odd) {
    padding-right: 14px;
}

.daijeng-side.cols-3 .daijeng-item:not(:nth-child(3n+1)) {
    border-left: 1px solid #e8e0c4;
    padding-left: 12px;
}
.daijeng-side.cols-3 .daijeng-item:not(:nth-child(3n)) {
    padding-right: 12px;
}

/* Item */
.daijeng-item {
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e0c4;
}

/* Hapus border bawah di baris terakhir */
.daijeng-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.daijeng-side.cols-2 .daijeng-item:nth-last-child(-n+2) {
    border-bottom: none;
    padding-bottom: 0;
}
.daijeng-side.cols-3 .daijeng-item:nth-last-child(-n+3) {
    border-bottom: none;
    padding-bottom: 0;
}

/* Thumbnail */
.daijeng-item-imglink {
    display: block;
    margin-bottom: 10px;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #222;
}

.daijeng-item-thumb {
    margin: 0;
    padding: 0;
    line-height: 0;
    background: #eee;
    aspect-ratio: 16 / 9;
}
.daijeng-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.daijeng-item:hover .daijeng-item-thumb img {
    transform: scale(1.03);
}

/* Judul Grid */
.daijeng-item-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px;
}
.daijeng-item-title a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.daijeng-item:hover .daijeng-item-title a {
    color: #0d47a1;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .daijeng-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .daijeng-side.cols-1,
    .daijeng-side.cols-2,
    .daijeng-side.cols-3 {
        grid-template-columns: 1fr 1fr;
    }

    /* Override 3-col borders to 2-col pattern */
    .daijeng-side.cols-3 .daijeng-item:not(:nth-child(3n+1)) {
        border-left: none;
        padding-left: 0;
    }
    .daijeng-side.cols-3 .daijeng-item:not(:nth-child(3n)) {
        padding-right: 0;
    }
    .daijeng-side.cols-3 .daijeng-item:nth-child(even) {
        border-left: 1px solid #e8e0c4;
        padding-left: 14px;
    }
    .daijeng-side.cols-3 .daijeng-item:nth-child(odd) {
        padding-right: 14px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .daijeng-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .daijeng-main-heading {
        font-size: 20px;
        margin-top: 6px;
    }
    .daijeng-excerpt {
        display: none !important; /* Hilangkan excerpt di mobile sesuai desain */
    }
    
    .daijeng-main-imglink {
        border-radius: 8px;
        border: 1px solid #e0e0e0;
    }

    /* Small Cards Wrapper (Grid Slider) */
    .daijeng-side.cols-1,
    .daijeng-side.cols-2,
    .daijeng-side.cols-3 {
        display: grid !important;
        grid-template-columns: none !important;
        grid-auto-flow: column !important;
        grid-auto-columns: 88% !important; /* Standar slider agar sebelahnya terlihat sedikit */
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 12px !important;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .daijeng-side::-webkit-scrollbar {
        display: none;
    }

    .daijeng-side .daijeng-item {
        width: 100% !important;
        max-width: none !important;
        background: #fff;
        border-radius: 10px !important;
        padding: 12px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
        display: grid !important;
        grid-template-columns: 1fr 100px !important;
        gap: 14px !important;
        align-items: center !important;
        border: 1px solid #eee !important;
        scroll-snap-align: start;
        margin: 0 !important;
        box-sizing: border-box;
    }

    .daijeng-side .daijeng-item-content {
        order: 1; /* Teks di Kiri */
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0; /* PENTING: Mencegah flex child overflow */
    }
    
    .daijeng-side .daijeng-meta {
        order: -1; /* Kategori & waktu di atas judul */
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
    }
    
    .daijeng-side .daijeng-category {
        color: #2d5bd1 !important; /* Biru tebal seperti Decode */
        font-weight: 700;
        text-transform: capitalize;
    }

    .daijeng-side .daijeng-meta-sep {
        color: #ccc;
    }

    .daijeng-side .daijeng-time {
        color: #888;
    }
    
    .daijeng-side .daijeng-item-title {
        font-family: 'PT Serif', 'Merriweather', 'Times New Roman', serif;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.4;
        margin: 0;
        color: #222;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .daijeng-side .daijeng-item-imglink {
        order: 2; /* Gambar di Kanan */
        width: 100px;
        height: 75px;
        margin: 0 !important;
        display: block;
        border-radius: 6px;
        overflow: hidden;
    }
    
    .daijeng-side .daijeng-item-thumb {
        aspect-ratio: auto;
        width: 100px;
        height: 75px;
        object-fit: cover;
        border-radius: 6px;
    }
}
