/* AsiaWeb Custom Post Display v0.1.1 */
.asiaweb_cpd {
    --asiaweb-cpd-gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

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

.asiaweb_cpd-grid {
    display: grid;
    grid-template-columns: repeat(var(--asiaweb-cpd-columns), minmax(0, 1fr));
    gap: var(--asiaweb-cpd-gap);
}

.asiaweb_cpd-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--asiaweb-cpd-gap);
}

.asiaweb_cpd-item {
    min-width: 0;
}

.asiaweb_cpd-grid .asiaweb_cpd-item {
    display: flex;
    flex-direction: column;
}

.asiaweb_cpd-list .asiaweb_cpd-item {
    display: grid;
    grid-template-columns: var(--asiaweb-cpd-list-image-width) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.asiaweb_cpd-image-wrap {
    width: 100%;
    overflow: hidden;
}

.asiaweb_cpd-grid .asiaweb_cpd-image-wrap {
    width: var(--asiaweb-cpd-image-width);
    max-width: 100%;
    height: var(--asiaweb-cpd-image-height);
    max-height: var(--asiaweb-cpd-image-height);
}

.asiaweb_cpd-list .asiaweb_cpd-image-wrap {
    width: var(--asiaweb-cpd-list-image-width);
    height: var(--asiaweb-cpd-list-image-height);
}

.asiaweb_cpd-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.asiaweb_cpd-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: var(--asiaweb-cpd-object-fit);
}

.asiaweb_cpd-body {
    min-width: 0;
}

.asiaweb_cpd-category {
    margin: 12px 0 6px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.asiaweb_cpd-category a,
.asiaweb_cpd-title a,
.asiaweb_cpd-read-more a {
    text-decoration: none;
    align-items: center;
}

.asiaweb_cpd-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    line-height: 1.4;
}

.asiaweb_cpd-date {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.asiaweb_cpd-excerpt {
    margin-bottom: 10px;
    line-height: 1.65;
}

.asiaweb_cpd-read-more {
    margin: 12px 0 0;
}

.asiaweb_cpd-meta {
    margin-top: 10px;
}

.asiaweb_cpd-meta-field {
    display: flex;
    gap: 6px;
    line-height: 1.6;
}

.asiaweb_cpd-meta-key {
    font-weight: 600;
}

.asiaweb_cpd-empty {
    margin: 0;
    padding: 24px;
    text-align: center;
}

.asiaweb_cpd-pagination {
    margin-top: 30px;
}

.asiaweb_cpd-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.asiaweb_cpd-pagination-left ul {
    justify-content: flex-start;
}

.asiaweb_cpd-pagination-center ul {
    justify-content: center;
}

.asiaweb_cpd-pagination-right ul {
    justify-content: flex-end;
}

.asiaweb_cpd-pagination a,
.asiaweb_cpd-pagination span {
    display: inline-flex;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    text-decoration: none;
    border: 1px solid currentColor;
    border-radius: 4px;
}

.asiaweb_cpd-pagination .current {
    font-weight: 700;
}

@media (max-width: 1024px) {
    .asiaweb_cpd-grid {
        grid-template-columns: repeat(var(--asiaweb-cpd-tablet-columns), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .asiaweb_cpd-grid {
        grid-template-columns: repeat(var(--asiaweb-cpd-mobile-columns), minmax(0, 1fr));
    }

    .asiaweb_cpd-list .asiaweb_cpd-item {
        grid-template-columns: 1fr;
    }

    .asiaweb_cpd-list .asiaweb_cpd-image-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: var(--asiaweb-cpd-list-image-width) / var(--asiaweb-cpd-list-image-height);
    }
}
