/* Featured Posts (common_featured_posts)
   1 main post + 4 secondary posts, three selectable themes: editorial,
   mosaic, dark. Namespaced under .common-featured-posts (cfp-* for inner
   elements) — must not leak into other widgets. */

.common-featured-posts,
.common-featured-posts *,
.common-featured-posts *::before,
.common-featured-posts *::after {
    box-sizing: border-box;
}

.common-featured-posts {
    --cfp-accent: oklch(58% 0.20 30);
    --cfp-accent-hover: oklch(52% 0.20 30);
    --cfp-text: oklch(18% 0.02 250);
    --cfp-muted: oklch(54% 0.01 250);
    --cfp-surface: oklch(100% 0 0);
    --cfp-border: oklch(92% 0.005 250);

    font-family: 'Inter', system-ui, sans-serif;
    color: var(--cfp-text);
    padding: 56px 0;
}

/* ---------- Header ---------- */

.cfp-header {
    margin-bottom: 40px;
}

.cfp-label {
    display: inline-block;
    font: 700 12px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cfp-accent);
    margin-bottom: 12px;
}

.cfp-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
    color: var(--cfp-text);
}

.cfp-title .accent-dot {
    color: var(--cfp-accent);
}

/* ---------- Shared card bits ---------- */

.cfp-tag {
    display: inline-flex;
    align-items: center;
    font: 700 11px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cfp-accent);
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.cfp-tag:hover {
    color: var(--cfp-accent-hover);
}

.cfp-tag--main {
    font-size: 12px;
}

.cfp-date {
    display: block;
    font: 500 12px/1 'Inter', system-ui, sans-serif;
    color: var(--cfp-muted);
    margin-top: 4px;
}

.cfp-main__title a,
.cfp-sec__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.cfp-main__title a:hover,
.cfp-sec__title a:hover {
    color: var(--cfp-accent);
}

/* Media: image or placeholder, both zoom slightly on hover */

.cfp-main__media,
.cfp-sec__media {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--cfp-border);
}

.cfp-main__media img,
.cfp-sec__media img,
.cfp-media-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cfp-main:hover .cfp-main__media img,
.cfp-main:hover .cfp-media-placeholder,
.cfp-sec:hover .cfp-sec__media img,
.cfp-sec:hover .cfp-media-placeholder {
    transform: scale(1.03);
}

.cfp-media-placeholder {
    background: linear-gradient(135deg, oklch(94% 0.005 250) 0%, oklch(98% 0.005 250) 100%);
    position: relative;
}

.cfp-media-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(135deg, transparent 46%, oklch(88% 0.005 250) 46%, oklch(88% 0.005 250) 54%, transparent 54%);
}

/* ==================================================================== */
/* THEME: editorial — full-bleed deep-navy section. Main card shows the  */
/* text floating INSIDE the box over an orange→navy brand scrim; the 4   */
/* secondary posts are numbered translucent rows that match its height.  */
/* ==================================================================== */

.common-featured-posts--editorial {
    position: relative;
    z-index: 0;
    padding: 56px 0 64px;
}

/* Full-bleed background even inside a boxed Elementor container */
.common-featured-posts--editorial::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 0%, oklch(58% 0.20 30 / 0.20), transparent 52%),
        radial-gradient(ellipse at 95% 100%, oklch(52% 0.20 30 / 0.10), transparent 55%),
        oklch(19% 0.035 255);
}

.common-featured-posts--editorial .cfp-title {
    color: #fff;
}

.common-featured-posts--editorial .cfp-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 28px;
    align-items: stretch;
}

/* --- Main card: media fills the box, content floats at the bottom --- */
.common-featured-posts--editorial .cfp-main {
    position: relative;
    display: block;
    min-height: 480px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px oklch(10% 0.03 255 / 0.5);
}

.common-featured-posts--editorial .cfp-main__media {
    position: absolute;
    inset: 0;
    margin: 0;
    border-radius: 0;
}

.common-featured-posts--editorial .cfp-main__media img,
.common-featured-posts--editorial .cfp-main__media .cfp-media-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Brand scrim: orange melting into the deep navy where the text sits */
.common-featured-posts--editorial .cfp-main__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        186deg,
        oklch(58% 0.20 30 / 0) 34%,
        oklch(58% 0.20 30 / 0.30) 56%,
        oklch(22% 0.05 255 / 0.86) 82%,
        oklch(17% 0.04 255 / 0.96) 100%
    );
}

.common-featured-posts--editorial .cfp-main__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 28px;
}

.common-featured-posts--editorial .cfp-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font: 700 11px/1 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, oklch(58% 0.20 30), oklch(45% 0.18 30));
    box-shadow: 0 6px 18px oklch(58% 0.20 30 / 0.4);
}

.common-featured-posts--editorial .cfp-main .cfp-tag {
    background: oklch(100% 0 0 / 0.14);
    color: #fff;
    backdrop-filter: blur(4px);
}

.common-featured-posts--editorial .cfp-main__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(26px, 2.8vw, 38px);
    font-weight: 600;
    line-height: 1.15;
    margin: 10px 0;
}

.common-featured-posts--editorial .cfp-main__title a {
    color: #fff;
}

.common-featured-posts--editorial .cfp-main__title a:hover {
    color: oklch(85% 0.08 30);
}

.common-featured-posts--editorial .cfp-main__excerpt {
    color: oklch(100% 0 0 / 0.78);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.common-featured-posts--editorial .cfp-main .cfp-date {
    color: oklch(100% 0 0 / 0.6);
}

/* --- Secondary: numbered translucent rows --- */
.common-featured-posts--editorial .cfp-secondary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    justify-content: stretch;
}

.common-featured-posts--editorial .cfp-sec {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    min-height: 88px;
    padding: 0;
    border-radius: 14px;
    background: oklch(100% 0 0 / 0.05);
    border: 1px solid oklch(100% 0 0 / 0.1);
    overflow: hidden;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.common-featured-posts--editorial .cfp-sec:hover {
    background: oklch(100% 0 0 / 0.09);
    border-color: oklch(58% 0.20 30 / 0.45);
    transform: translateX(4px);
}

/* La foto sangra hasta los bordes de su franja: toda la altura de la fila */
.common-featured-posts--editorial .cfp-sec__media {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 112px;
    height: 100%;
    border-radius: 0;
    margin: 0;
}

/* Mayor especificidad que `.elementor img { height: auto }` para que la
   foto llene toda la franja */
.common-featured-posts--editorial .cfp-sec__media img,
.common-featured-posts--editorial .cfp-sec__media .cfp-media-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* La foto se funde con la fila para que el número cabalgue ambos mundos */
.common-featured-posts--editorial .cfp-sec__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 45%, oklch(19% 0.035 255 / 0.65) 100%);
}

/* Sin numeración: en filas de esta altura el numeral compite con foto y
   título sin aportar jerarquía (decisión de diseño del cliente). */
.common-featured-posts--editorial .cfp-sec__num {
    display: none;
}

.common-featured-posts--editorial .cfp-sec__body {
    flex: 1;
    min-width: 0;
    padding: 14px 16px 14px 130px;
}

.common-featured-posts--editorial .cfp-sec .cfp-tag {
    display: none;
}

.common-featured-posts--editorial .cfp-sec__title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.common-featured-posts--editorial .cfp-sec__title a {
    color: #fff;
}

.common-featured-posts--editorial .cfp-sec__title a:hover {
    color: oklch(85% 0.08 30);
}

.common-featured-posts--editorial .cfp-sec .cfp-date {
    color: oklch(100% 0 0 / 0.55);
    font-size: 12px;
}

@media (max-width: 1024px) {
    .common-featured-posts--editorial .cfp-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Mobile: the main card goes portrait (taller than wide) so the
       featured post keeps its hero weight on small screens */
    .common-featured-posts--editorial .cfp-main {
        min-height: 0;
        aspect-ratio: 3 / 4;
        max-height: 640px;
    }

    .common-featured-posts--editorial .cfp-sec {
        flex: none;
        min-height: 80px;
    }

    .common-featured-posts--editorial .cfp-sec__media {
        width: 92px;
    }

    .common-featured-posts--editorial .cfp-sec__body {
        padding-left: 108px;
    }
}

/* The badge and row numbers belong to the editorial design only */
.common-featured-posts--mosaic .cfp-badge,
.common-featured-posts--mosaic .cfp-sec__num,
.common-featured-posts--dark .cfp-badge,
.common-featured-posts--dark .cfp-sec__num {
    display: none;
}

/* ==================================================================== */
/* THEME: mosaic — main spans 2x2 with overlay text, 4 secondary tiles   */
/* ==================================================================== */

.common-featured-posts--mosaic .cfp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 150px;
    gap: 16px;
}

.common-featured-posts--mosaic .cfp-secondary {
    display: contents;
}

.common-featured-posts--mosaic .cfp-main {
    grid-column: span 2;
    grid-row: span 2;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    color: oklch(100% 0 0);
}

.common-featured-posts--mosaic .cfp-main__media {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 0;
}

.common-featured-posts--mosaic .cfp-main::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to top, oklch(0% 0 0 / 0.82) 0%, oklch(0% 0 0 / 0.15) 55%, transparent 80%);
    pointer-events: none;
}

.common-featured-posts--mosaic .cfp-main__body {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 3;
    padding: 28px;
}

.common-featured-posts--mosaic .cfp-main__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 8px;
    color: oklch(100% 0 0);
}

.common-featured-posts--mosaic .cfp-main__excerpt {
    color: oklch(100% 0 0 / 0.85);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 8px;
    max-width: 46ch;
}

.common-featured-posts--mosaic .cfp-main .cfp-date {
    color: oklch(100% 0 0 / 0.7);
}

.common-featured-posts--mosaic .cfp-sec {
    grid-column: span 1;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--cfp-surface);
    border: 1px solid var(--cfp-border);
}

.common-featured-posts--mosaic .cfp-sec__media {
    aspect-ratio: 1 / 1;
    flex: none;
}

.common-featured-posts--mosaic .cfp-sec__body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.common-featured-posts--mosaic .cfp-sec__title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

@media (max-width: 900px) {
    .common-featured-posts--mosaic .cfp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .common-featured-posts--mosaic .cfp-grid {
        grid-template-columns: 1fr;
    }

    .common-featured-posts--mosaic .cfp-main {
        grid-column: 1 / -1;
        grid-row: span 2;
    }

    .common-featured-posts--mosaic .cfp-sec {
        grid-column: 1 / -1;
    }
}

/* ==================================================================== */
/* THEME: dark — navy panel with accent glow, banner main + mini-cards   */
/* ==================================================================== */

.common-featured-posts--dark {
    position: relative;
    background: oklch(25% 0.04 255);
    border-radius: 24px;
    padding: 56px;
    overflow: hidden;
    color: oklch(100% 0 0);
}

.common-featured-posts--dark::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 30% 20%, oklch(58% 0.20 30 / 35%), transparent 50%);
    pointer-events: none;
}

.common-featured-posts--dark .cfp-header,
.common-featured-posts--dark .cfp-grid {
    position: relative;
    z-index: 1;
}

.common-featured-posts--dark .cfp-title {
    color: oklch(100% 0 0);
}

.common-featured-posts--dark .cfp-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.common-featured-posts--dark .cfp-main {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border-radius: 16px;
    overflow: hidden;
    background: oklch(100% 0 0 / 0.06);
    border: 1px solid oklch(100% 0 0 / 0.12);
}

.common-featured-posts--dark .cfp-main__media {
    flex: 0 0 55%;
}

.common-featured-posts--dark .cfp-main__body {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.common-featured-posts--dark .cfp-main__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 10px;
    color: oklch(100% 0 0);
}

.common-featured-posts--dark .cfp-main__excerpt {
    color: oklch(100% 0 0 / 0.75);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 10px;
}

.common-featured-posts--dark .cfp-date {
    color: oklch(100% 0 0 / 0.55);
}

.common-featured-posts--dark .cfp-secondary {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

.common-featured-posts--dark .cfp-sec {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    background: oklch(100% 0 0 / 0.06);
    border: 1px solid oklch(100% 0 0 / 0.12);
}

.common-featured-posts--dark .cfp-sec__media {
    aspect-ratio: 16 / 10;
    border-radius: 8px;
}

.common-featured-posts--dark .cfp-sec__title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: oklch(100% 0 0);
}

.common-featured-posts--dark .cfp-media-placeholder {
    background: oklch(100% 0 0 / 0.1);
}

.common-featured-posts--dark .cfp-media-placeholder::after {
    background-image: none;
}

@media (max-width: 768px) {
    .common-featured-posts--dark {
        padding: 32px 20px;
    }

    .common-featured-posts--dark .cfp-main {
        flex-direction: column;
    }

    .common-featured-posts--dark .cfp-main__media {
        flex: none;
        aspect-ratio: 16 / 10;
    }

    .common-featured-posts--dark .cfp-secondary {
        flex-direction: column;
    }
}
