/* ========================================
   Category Posts Shortcode
   [bongdako_category_posts]
   ======================================== */

.dbk-catposts {
    background: #fff;
}
.dark .dbk-catposts {
    background: #1a1a1a;
}

/* ---------- Header: icon + title ---------- */
.dbk-catposts__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
}

.dbk-catposts__icon {
    font-size: 20px;
    line-height: 1;
}

.dbk-catposts__heading {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: 0.02em;
}

.dbk-catposts__heading a {
    color: inherit;
    text-decoration: none;
}

.dbk-catposts__heading a:hover {
    color: #7C0E0E;
}

/* ---------- Grid 2-col layout ---------- */
.dbk-catposts__grid--2col {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr 1fr;
}

.dbk-catposts__left {
    min-width: 0;
}

.dbk-catposts__right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* ---------- Card base ---------- */
.dbk-catposts__card {
    display: block;
    text-decoration: none;
    color: #1a1a1a;
    transition: opacity 0.2s ease;
}

.dbk-catposts__card:hover {
    opacity: 0.8;
}

.dbk-catposts__card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.dbk-catposts__card-body {
    padding: 8px 0 0;
}

/* ---------- Title ---------- */
.dbk-catposts__title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Date ---------- */
.dbk-catposts__date {
    font-size: 12px;
    color: #888;
}

/* ---------- Excerpt (featured only) ---------- */
.dbk-catposts__excerpt {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dark .dbk-catposts__excerpt {
    color: #fff;
}

/* ---------- Horizontal list item (small right) ---------- */
.dbk-catposts__item {
    display: grid;
    gap: 12px;
    text-decoration: none;
    color: #1a1a1a;
    align-items: start;
    transition: opacity 0.2s ease;
}

.dbk-catposts__item:hover {
    opacity: 0.8;
}

.dbk-catposts__item img {
    display: block;
    object-fit: cover;
}

.dbk-catposts__item-body {
    min-width: 0;
}

/* ==========================================
   SIZE: MEDIUM
   Left: 443x332 | Right: 311x172 (card layout)
   ========================================== */
.dbk-catposts--medium .dbk-catposts__grid--2col {
    grid-template-columns: 443fr 311fr;
}

.dbk-catposts--medium .dbk-catposts__img-left {
    width: 100%;
    aspect-ratio: 443 / 332;
    object-fit: cover;
}

/* Medium right: image on top, text below (vertical card) */
.dbk-catposts--medium .dbk-catposts__card--right {
    display: block;
}

.dbk-catposts--medium .dbk-catposts__img-right {
    width: 100%;
    aspect-ratio: 311 / 172;
    object-fit: cover;
}

.dbk-catposts--medium .dbk-catposts__card--featured .dbk-catposts__title {
    font-size: 18px;
    -webkit-line-clamp: 3;
}

/* ==========================================
   SIZE: SMALL
   Left: 227x127 | Right: 143x80 (horizontal layout)
   ========================================== */
.dbk-catposts--small .dbk-catposts__grid--2col {
    grid-template-columns: 2fr 3fr;
}

.dbk-catposts--small .dbk-catposts__img-left {
    width: 100%;
    aspect-ratio: 227 / 127;
    object-fit: cover;
}

/* Small right: text on left, image on right (horizontal item) */
.dbk-catposts--small .dbk-catposts__grid--2col .dbk-catposts__item {
    grid-template-columns: 1fr 143px;
    align-items: start;
}

.dbk-catposts--small .dbk-catposts__img-right {
    width: 143px;
    height: 80px;
    object-fit: cover;
}

.dbk-catposts--small .dbk-catposts__card--featured .dbk-catposts__title {
    font-size: 16px;
    -webkit-line-clamp: 3;
}

/* ==========================================
   GRID 1: Single column
   Image: 263x148
   ========================================== */
.dbk-catposts__grid--1col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dbk-catposts__item--1col {
    grid-template-columns: 263px 1fr;
}

.dbk-catposts__img-1col {
    width: 263px;
    height: 148px;
    object-fit: cover;
}

.dbk-catposts__item--1col .dbk-catposts__title {
    font-size: 15px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .dbk-catposts--medium .dbk-catposts__grid--2col,
    .dbk-catposts--small .dbk-catposts__grid--2col {
        grid-template-columns: 1fr;
    }

    .dbk-catposts--medium .dbk-catposts__img-left,
    .dbk-catposts--small .dbk-catposts__img-left {
        aspect-ratio: 16 / 9;
    }

    .dbk-catposts--medium .dbk-catposts__img-right {
        aspect-ratio: 16 / 9;
    }

    .dbk-catposts--small .dbk-catposts__item {
        grid-template-columns: 1fr 120px;
    }

    .dbk-catposts--small .dbk-catposts__img-right {
        width: 120px;
        height: 68px;
    }

    .dbk-catposts__item--1col {
        grid-template-columns: 1fr;
    }

    .dbk-catposts__img-1col {
        width: 100%;
        height: auto;
        aspect-ratio: 263 / 148;
    }
}
