/* Post List / Blog (common_post_list)
   WP_Query driven post grid with server-side pagination.
   Namespaced under .common-post-list — must not leak into other widgets. */

.common-post-list {
    /* --cpl-accent y --cpl-cols llegan heredadas desde el wrapper de Elementor
       (controles del widget); definirlas aquí las pisaría. La indirección
       --_cpl-accent aporta el default de marca cuando no hay control. */
    --_cpl-accent: var(--cpl-accent, oklch(58% 0.20 30));
    --cpl-accent-hover: oklch(52% 0.20 30);
    --cpl-bg: oklch(100% 0 0);
    --cpl-border: oklch(92% 0.005 250);
    --cpl-text: oklch(18% 0.02 250);
    --cpl-muted: oklch(54% 0.01 250);

    font-family: 'Inter', system-ui, sans-serif;
    color: var(--cpl-text);
}

.common-post-list__header {
    margin-bottom: 22px;
}

.common-post-list__label {
    display: block;
    font: 600 12px/1 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--_cpl-accent);
    margin-bottom: 10px;
}

.common-post-list__section-title {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 600;
    line-height: 1.15;
    color: var(--cpl-text);
}

.common-post-list__section-title em {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 500;
}

.common-post-list__section-title .accent-dot {
    color: var(--_cpl-accent);
}

.common-post-list__empty {
    color: var(--cpl-muted);
    font-size: 15px;
    text-align: center;
    padding: 32px 16px;
}

.common-post-list__grid {
    display: grid;
    grid-template-columns: repeat(var(--cpl-cols, 3), 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .common-post-list__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .common-post-list__grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.common-post-list__card {
    display: flex;
    flex-direction: column;
    background: var(--cpl-bg);
    border: 1px solid var(--cpl-border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.common-post-list__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.common-post-list__media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

.common-post-list__media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.common-post-list__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    transition: transform 0.35s ease;
}

.common-post-list__card:hover .common-post-list__img {
    transform: scale(1.03);
}

.common-post-list__img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, oklch(95% 0.005 250), oklch(90% 0.005 250));
}

.common-post-list__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px;
    flex: 1;
}

.common-post-list__tag {
    display: inline-block;
    font: 600 11px/1 'Inter', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--_cpl-accent);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in oklch, var(--_cpl-accent) 12%, transparent);
}

.common-post-list__tag:hover {
    color: var(--cpl-accent-hover);
}

.common-post-list__title {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    line-height: 1.35;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.common-post-list__title a {
    color: var(--cpl-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.common-post-list__title a:hover {
    color: var(--_cpl-accent);
}

.common-post-list__excerpt {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cpl-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.common-post-list__date {
    margin-top: auto;
    padding-top: 6px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    color: var(--cpl-muted);
}

/* Pagination */
.common-post-list__pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.common-post-list__pagination span,
.common-post-list__pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    font: 500 14px/1 'Inter', system-ui, sans-serif;
    color: var(--cpl-text);
    text-decoration: none;
    border: 1px solid var(--cpl-border);
    background: var(--cpl-bg);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.common-post-list__pagination a:hover {
    border-color: var(--_cpl-accent);
    color: var(--_cpl-accent);
}

.common-post-list__pagination span.current {
    background: var(--_cpl-accent);
    border-color: var(--_cpl-accent);
    color: #fff;
}

.common-post-list__pagination span.dots {
    border-color: transparent;
    background: transparent;
    color: var(--cpl-muted);
}
