/*
 * COACCM PREMIUM DESIGN SYSTEM v3.1
 * Revisión completa de estilos del tema Flavor para COACCM
 * Nota: Google Fonts (Inter + Outfit) se cargan en class-assets.php — no duplicar aquí.
 *
 * ARQUITECTURA: Todos los selectores usan alta especificidad nativa
 * (body .entry-content) para evitar el uso de !important.
 * Las únicas excepciones de !important son los resets de inline styles
 * inyectados dinámicamente por WordPress.
 */

/* ── 1. FONDO DE PÁGINA suave ──────────────────────────────────────────────── */
/* Aplica a todas las páginas interiores para que las tarjetas blancas resalten */
body:not(.home) .site-content {
    background: #f6f3ea;
}
body:not(.home) .content-column,
body:not(.home) article.page,
body:not(.home) article.post {
    background: transparent; /* El fondo lo da site-content */
}

/* ── 2. RESET SELECTIVO: colores inline incorrectos ────────────────────────── */
/* Estos SÍ necesitan !important porque sobreescriben style="" inline de WP */
body .entry-content .wp-block-group[style*="background-color:#002"],
body .entry-content .wp-block-group[style*="background-color: #002"],
body .entry-content .wp-block-group[style*="background-color:#003"],
body .entry-content .wp-block-group[style*="background-color: #003"],
body .entry-content .wp-block-group[style*="background-color:rgb(0,"],
body .entry-content [style*="background-color:#ffd"],
body .entry-content [style*="background-color: #ffd"],
body .entry-content [style*="background-color:yellow"] {
    background-color: transparent !important;
    background: none !important;
}
body .entry-content .wp-block-group[style*="background-color:#002"] *,
body .entry-content .wp-block-group[style*="background-color: #002"] *,
body .entry-content .wp-block-group[style*="background-color:#003"] *,
body .entry-content .wp-block-group[style*="background-color: #003"] * {
    color: #334155 !important;
}

/* ── 3. TIPOGRAFÍA GLOBAL de contenido ─────────────────────────────────────── */
body .entry-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #334155;
    line-height: 1.75;
    font-size: 1rem;
}

/* H2 — Titular de sección */
body .entry-content h2,
body .entry-content h2.wp-block-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.2;
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* H3 — Subtítulo de tarjeta */
body .entry-content h3,
body .entry-content h3.wp-block-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #064e3b;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* H4 — Label secundario */
body .entry-content h4,
body .entry-content h4.wp-block-heading {
    font-size: 0.875rem;
    font-weight: 700;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* P genérico */
body .entry-content p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.75;
    margin-bottom: 1em;
}

/* Strong */
body .entry-content strong,
body .entry-content b {
    color: #1e293b;
    font-weight: 700;
}

/* ── 4. SECCIONES (wp-block-group) ─────────────────────────────────────────── */
body .entry-content > .wp-block-group {
    padding: 4rem 2rem;
    position: relative;
}

/* Alternancia blanco / gris claro */
body .entry-content > .wp-block-group:nth-child(odd) {
    background: #ffffff;
}
body .entry-content > .wp-block-group:nth-child(even) {
    background: #f6f3ea;
}

/* Filete de latón bajo el H2 de cada sección (también en contenido plano,
   sin wp-block-group, como las páginas escritas directamente en Gutenberg) */
body .entry-content > .wp-block-group > h2::after,
body .entry-content > .wp-block-group > .wp-block-heading::after,
body .entry-content > h2::after {
    content: '';
    display: block;
    width: 64px;
    height: 1px;
    background: #b58a4b;
    margin: 1rem auto 0;
    box-shadow: 0 0 0 0.5px rgba(181, 138, 75, 0.35);
}

/* Párrafo intro de sección */
body .entry-content > .wp-block-group > p:first-of-type {
    text-align: center;
    font-size: 1.1rem;
    color: #64748b;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
}

/* ── 5. TARJETAS PREMIUM (columnas) ────────────────────────────────────────── */
body .entry-content .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0 0.5rem;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body .entry-content .wp-block-column {
    background: #ffffff;
    padding: 2.25rem 2rem;
    border-radius: 6px;
    border: 1px solid #e7dfcd;
    box-shadow:
        0 1px 2px rgba(58, 42, 18, 0.04),
        0 4px 16px rgba(58, 42, 18, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    flex: 1 1 280px;
    min-width: 0;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}

/* Filete de latón superior */
body .entry-content .wp-block-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #b58a4b, #caa14a);
    border-radius: 6px 6px 0 0;
}

/* Hover sobrio */
body .entry-content .wp-block-column:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 24px rgba(58, 42, 18, 0.09),
        0 3px 8px rgba(58, 42, 18, 0.05);
    border-color: #cdae7d;
}

/* H3 dentro de tarjeta */
body .entry-content .wp-block-column h3,
body .entry-content .wp-block-column h3.wp-block-heading {
    font-size: 1.15rem;
    color: #0f172a;
    margin-bottom: 0.75rem;
    padding-top: 0.25rem;
}
body .entry-content .wp-block-column h3::after {
    display: none;
}

/* P dentro de tarjeta */
body .entry-content .wp-block-column p {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
}

/* H2 dentro de columna (pasos "01. Solicita...") */
body .entry-content .wp-block-column h2,
body .entry-content .wp-block-column h2.wp-block-heading {
    font-size: 1rem;
    color: #0f172a;
    text-align: left;
    margin-bottom: 0.6rem;
    padding-bottom: 0;
    letter-spacing: normal;
}
body .entry-content .wp-block-column h2::after {
    display: none;
}

/* ── 6. LISTAS ──────────────────────────────────────────────────────────────── */
body .entry-content ul:not(.wp-block-social-links):not([class*="nav"]) {
    list-style: none;
    background: #f8f4e9;
    border: 1px solid #eadfc8;
    border-left: 3px solid #064e3b;
    border-radius: 0 6px 6px 0;
    padding: 1.75rem 2rem 1.75rem 2rem;
    margin: 2rem auto;
    max-width: 820px;
}

body .entry-content ul:not(.wp-block-social-links):not([class*="nav"]) li {
    padding: 0.375rem 0;
    padding-left: 1.6rem;
    color: #334155;
    font-size: 0.975rem;
    line-height: 1.65;
    position: relative;
}
body .entry-content ul:not(.wp-block-social-links):not([class*="nav"]) li::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: #b58a4b;
    font-size: 0.7rem;
}

body .entry-content li strong {
    color: #064e3b;
    font-weight: 700;
}

/* ── 7. BOTONES ─────────────────────────────────────────────────────────────── */
body .entry-content .wp-block-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

body .entry-content .wp-block-button__link,
body .entry-content .wp-block-button .wp-element-button {
    background: #064e3b !important;
    background-image: none !important;
    color: #ffffff !important;
    padding: 14px 32px !important;
    border-radius: 4px !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600 !important;
    font-size: 0.975rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(6, 78, 59, 0.22) !important;
    transition: all 0.25s ease;
    border: 1px solid transparent !important;
    display: inline-block;
    line-height: 1.4;
}

body .entry-content .wp-block-button__link:hover,
body .entry-content .wp-block-button .wp-element-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(6, 78, 59, 0.3) !important;
    color: #ffffff !important;
    background: #052a1e !important;
    border-color: #b58a4b !important;
}

/* Botón outline/secundario */
body .entry-content .wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent !important;
    border: 1px solid #b58a4b !important;
    color: #064e3b !important;
    box-shadow: none !important;
}
body .entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: rgba(181, 138, 75, 0.1) !important;
    color: #052a1e !important;
}

/* ── 8. SEPARADORES ─────────────────────────────────────────────────────────── */
body .entry-content hr.wp-block-separator {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(181, 138, 75, 0.55), transparent);
    margin: 2.5rem auto;
    max-width: 220px;
}

/* ── 9. IMAGEN DESTACADA ───────────────────────────────────────────────────── */
body .entry-content .wp-block-image img {
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(58, 42, 18, 0.12);
}

/* ── 10. CITAS/BLOCKQUOTE (registro de discurso institucional) ─────────────── */
body .entry-content blockquote {
    border-left: 3px solid #b58a4b;
    background: #f8f4e9;
    padding: 1.75rem 2.25rem;
    border-radius: 0 6px 6px 0;
    margin: 2rem 0;
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    color: #1e293b;
    font-size: 1.15rem;
    line-height: 1.7;
}
body .entry-content blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a6a37;
}

/* ── 10b. TÍTULO DE PÁGINA (entry-header) ──────────────────────────────────── */
body .entry-header .entry-title {
    font-family: 'Fraunces', Georgia, serif;
    color: #064e3b;
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 1.2em 0 0.4em;
}
body .entry-header .entry-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 1px;
    background: #b58a4b;
    margin: 1.1rem auto 0;
}

/* ── 11. RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    body .entry-content .wp-block-columns {
        flex-direction: column;
        gap: 1rem;
    }
    body .entry-content .wp-block-column {
        padding: 1.75rem 1.5rem;
        flex: 1 1 100%;
    }
}
@media (max-width: 780px) {
    body .entry-content > .wp-block-group {
        padding: 2.5rem 1rem;
    }
    body .entry-content h2 {
        font-size: 1.75rem;
    }
}

/* ── 12. PANELES DE CONTACTO Y CONTENIDO CON IFRAMES ──────────────────────── */
/* Asegurar que columnas que contienen iframes (mapas, PDFs) no los recorten */
body .entry-content .wp-block-column iframe,
body .entry-content .wp-block-column .wp-block-embed {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
}

/* Cuando el layout usa sidebar y las columnas son demasiado estrechas,
   forzar que el .content-column use todo el ancho disponible */
.site-content .content-column {
    max-width: 100%;
    overflow: visible;
}
