/**
 * Estilos específicos para los bloques Gutenberg en entradas
 * Scope: .post-content-gutenberg
 */
.post-content-gutenberg {
    color: #01161e;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.8rem;
    line-height: 1.75;
}

/* Ancho de bloques dentro de la columna */
.post-content-gutenberg > * {
    max-width: 100%;
}

/* Alineaciones nativas de Gutenberg */
.post-content-gutenberg > .alignwide {
    max-width: 114rem;
    width: 100%;
}

.post-content-gutenberg > .alignfull {
    max-width: 100vw;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}

.post-content-gutenberg .aligncenter {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.post-content-gutenberg .alignleft {
    float: left;
    margin-right: 2.4rem;
    margin-bottom: 1.6rem;
}

.post-content-gutenberg .alignright {
    float: right;
    margin-left: 2.4rem;
    margin-bottom: 1.6rem;
}

/* Tipografía */
.post-content-gutenberg p {
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1.75;
    color: #01161e;
    margin-top: 0;
    margin-bottom: 2.4rem;
}

.post-content-gutenberg p.has-large-font-size {
    font-size: 2.2rem;
    line-height: 1.6;
}

.post-content-gutenberg h1,
.post-content-gutenberg .title-big {
    font-family: Poppins, sans-serif;
    font-size: 4rem;
    font-weight: 600;
    line-height: 1.25;
    color: #01161e;
    margin-top: 0;
    margin-bottom: 1.6rem;
}

@media screen and (max-width: 768px) {
    .post-content-gutenberg h1,
    .post-content-gutenberg .title-big {
        font-size: 2.8rem;
        line-height: 1.3;
    }
}

.post-content-gutenberg h2,
.post-content-gutenberg h3,
.post-content-gutenberg h4,
.post-content-gutenberg h5,
.post-content-gutenberg h6 {
    font-family: Poppins, sans-serif;
    font-weight: 700;
    color: #01161e;
    line-height: 1.3;
}

.post-content-gutenberg h2 {
    font-size: 2.8rem;
    margin-top: 4.8rem;
    margin-bottom: 2rem;
}

.post-content-gutenberg h3 {
    font-size: 2.2rem;
    margin-top: 3.6rem;
    margin-bottom: 1.6rem;
}

.post-content-gutenberg h4 {
    font-size: 1.9rem;
    margin-top: 2.8rem;
    margin-bottom: 1.2rem;
}

.post-content-gutenberg a:not(.wp-block-button__link),
.post-content-gutenberg a:not(.wp-block-button__link) *,
.post-content-gutenberg p a,
.post-content-gutenberg p a *,
.post-content-gutenberg li a,
.post-content-gutenberg li a *,
.post-content-gutenberg a [style*="color"],
.post-content-gutenberg [class*="has-"] a,
.post-content-gutenberg a [class*="has-"] {
    color: #1362FB !important;
    font-weight: 600;
    text-decoration: underline !important;
    text-decoration-color: #1362FB !important;
    transition: color 0.2s ease;
}

.post-content-gutenberg a:not(.wp-block-button__link):visited,
.post-content-gutenberg a:not(.wp-block-button__link):visited *,
.post-content-gutenberg p a:visited,
.post-content-gutenberg p a:visited *,
.post-content-gutenberg li a:visited,
.post-content-gutenberg li a:visited * {
    color: #1362FB !important;
    text-decoration-color: #1362FB !important;
}

.post-content-gutenberg a:not(.wp-block-button__link):hover,
.post-content-gutenberg a:not(.wp-block-button__link):hover *,
.post-content-gutenberg p a:hover,
.post-content-gutenberg p a:hover *,
.post-content-gutenberg li a:hover,
.post-content-gutenberg li a:hover * {
    color: #2C2A4A !important;
    text-decoration-color: #2C2A4A !important;
}

/* Listas estándar (bloques Gutenberg de lista) */
.post-content-gutenberg ul:not(.simpletoc-list),
.post-content-gutenberg ol:not(.simpletoc-list) {
    font-size: 1.8rem;
    line-height: 1.75;
    margin-top: 0;
    margin-bottom: 2.4rem;
    padding-left: 2.8rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.post-content-gutenberg ul:not(.simpletoc-list) {
    list-style: disc outside !important;
    list-style-type: disc !important;
}

.post-content-gutenberg ol:not(.simpletoc-list) {
    list-style: decimal outside !important;
    list-style-type: decimal !important;
}

.post-content-gutenberg ul:not(.simpletoc-list) > li,
.post-content-gutenberg ol:not(.simpletoc-list) > li,
.post-content-gutenberg ul:not(.simpletoc-list) li,
.post-content-gutenberg ol:not(.simpletoc-list) li {
    font-size: 1.8rem !important;
    font-weight: 400 !important;
    line-height: 1.75 !important;
    color: #01161e;
    background: none !important; /* Elimina la flecha > del tema clásico */
    padding-left: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0.8rem !important;
}

.post-content-gutenberg ul:not(.simpletoc-list) li + li,
.post-content-gutenberg ol:not(.simpletoc-list) li + li {
    margin-top: 0.8rem !important;
}

.post-content-gutenberg ul:not(.simpletoc-list) li:last-child,
.post-content-gutenberg ol:not(.simpletoc-list) li:last-child {
    margin-bottom: 0 !important;
}

/* Sublistas anidadas */
.post-content-gutenberg ul:not(.simpletoc-list) ul,
.post-content-gutenberg ol:not(.simpletoc-list) ol,
.post-content-gutenberg ul:not(.simpletoc-list) ol,
.post-content-gutenberg ol:not(.simpletoc-list) ul {
    margin-top: 0.8rem !important;
    margin-bottom: 0.8rem !important;
    padding-left: 2.4rem !important;
}

.post-content-gutenberg ul:not(.simpletoc-list) ul {
    list-style-type: circle !important;
}

.post-content-gutenberg ul:not(.simpletoc-list) ul ul {
    list-style-type: square !important;
}

/* Citas y Párrafos destacados (Quote & Callout) */
.post-content-gutenberg blockquote,
.post-content-gutenberg .wp-block-quote,
.post-content blockquote,
.wp-block-quote {
    border-left: 4px solid #1362fb;
    background: #f8f9fc;
    padding: 2.4rem 2.8rem;
    margin-top: 3.2rem;
    margin-bottom: 3.2rem;
    border-radius: 0 8px 8px 0;
    box-sizing: border-box;
}

.post-content-gutenberg blockquote p,
.post-content-gutenberg .wp-block-quote p,
.post-content blockquote p,
.wp-block-quote p {
    font-size: 1.9rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.65;
    color: #01161e;
    margin-bottom: 0.8rem;
}

.post-content-gutenberg blockquote p:last-child,
.post-content-gutenberg .wp-block-quote p:last-child,
.wp-block-quote p:last-child {
    margin-bottom: 0;
}

.post-content-gutenberg blockquote em,
.post-content-gutenberg .wp-block-quote em,
.wp-block-quote em {
    font-style: italic;
}

.post-content-gutenberg .wp-block-quote cite,
.wp-block-quote cite {
    font-size: 1.4rem;
    font-style: normal;
    font-family: Poppins, sans-serif;
    color: #666;
    display: block;
    margin-top: 1.2rem;
}

/* Imágenes de Gutenberg */
.post-content-gutenberg .wp-block-image {
    margin-top: 2.4rem;
    margin-bottom: 3.2rem;
}

.post-content-gutenberg .wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.post-content-gutenberg figcaption,
.post-content-gutenberg .wp-block-image figcaption {
    font-size: 1.4rem;
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
}

/* Columnas de Gutenberg */
.post-content-gutenberg .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 3.2rem;
    margin-top: 2.4rem;
    margin-bottom: 3.2rem;
}

@media screen and (max-width: 768px) {
    .post-content-gutenberg .wp-block-columns {
        flex-direction: column;
        gap: 2rem;
    }
}

.post-content-gutenberg .wp-block-column {
    flex: 1;
    min-width: 0;
}

/* -------------------------------------------------------------
 * Botones de Gutenberg (Alineados con el Header: #1362FB / #1D2C49)
 * ------------------------------------------------------------- */
.post-content-gutenberg .wp-block-buttons,
.post-content .wp-block-buttons,
.wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.6rem;
    margin-top: 2.8rem;
    margin-bottom: 3.6rem;
}

.post-content-gutenberg .wp-block-button,
.post-content .wp-block-button,
.wp-block-button {
    margin: 0;
}

/* Base común del botón (Idéntica a .button del tema principal) */
.post-content-gutenberg .wp-block-button__link,
.post-content .wp-block-button__link,
.wp-block-button__link,
.wp-element-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 5rem !important;
    height: 5rem !important;
    padding: 0.9rem 2.4rem !important;
    font-size: 1.5rem !important;
    font-family: Poppins, sans-serif !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-decoration-color: transparent !important;
    border-radius: 8px !important;
    border-style: solid !important;
    border-width: 0.2rem !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease-in-out !important;
}

/* 1. Botón Fill (Exactamente igual que "S'inscrire" del header: #1362FB) */
.wp-block-button:not(.is-style-outline) .wp-block-button__link,
.wp-block-button.is-style-fill .wp-block-button__link,
.wp-block-button__link.has-vivid-cyan-blue-background-color,
.wp-block-button__link.has-primary-background-color,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
    background-color: #1362FB !important;
    border-color: #1362FB !important;
    color: #ffffff !important;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
.wp-block-button.is-style-fill .wp-block-button__link:hover,
.wp-block-button.is-style-fill .wp-block-button__link:focus,
.wp-block-button__link.has-vivid-cyan-blue-background-color:hover,
.wp-block-button__link.has-primary-background-color:hover {
    background-color: #2C2A4A !important;
    border-color: #2C2A4A !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 42, 74, 0.2);
}

/* 2. Botón Outline (Exactamente igual que "Se connecter" del header: #1D2C49) */
.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent !important;
    border-color: #1D2C49 !important;
    color: #1D2C49 !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus {
    background-color: #1D2C49 !important;
    border-color: #1D2C49 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 44, 73, 0.2);
}

/* Si se selecciona explícitamente color azul para el outline */
.wp-block-button.is-style-outline.has-primary-color .wp-block-button__link,
.wp-block-button.is-style-outline.has-vivid-cyan-blue-color .wp-block-button__link {
    border-color: #1362FB !important;
    color: #1362FB !important;
}

.wp-block-button.is-style-outline.has-primary-color .wp-block-button__link:hover,
.wp-block-button.is-style-outline.has-vivid-cyan-blue-color .wp-block-button__link:hover {
    background-color: #1362FB !important;
    border-color: #1362FB !important;
    color: #ffffff !important;
}

/* Tablas */
.post-content-gutenberg .wp-block-table {
    margin-top: 2.4rem;
    margin-bottom: 3.2rem;
    overflow-x: auto;
}

.post-content-gutenberg table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.6rem;
}

.post-content-gutenberg th,
.post-content-gutenberg td {
    padding: 1.2rem 1.6rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.post-content-gutenberg th {
    background: #f8f9fc;
    font-family: Poppins, sans-serif;
    font-weight: 600;
}

/* Separadores */
.post-content-gutenberg hr,
.post-content-gutenberg .wp-block-separator {
    border: 0;
    border-top: 1px solid #e2e8f0;
    max-width: 20rem;
    margin: 4.8rem auto;
}

/* Bloques de código y preformateado */
.post-content-gutenberg pre,
.post-content-gutenberg .wp-block-code {
    background: #f4f6f8;
    padding: 2rem;
    border-radius: 6px;
    font-size: 1.5rem;
    overflow-x: auto;
    margin-top: 2rem;
    margin-bottom: 2.8rem;
    border: 1px solid #e2e8f0;
}

.post-content-gutenberg code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: #eef1f5;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}

/* Embeds y videos */
.post-content-gutenberg .wp-block-embed {
    margin-top: 2.4rem;
    margin-bottom: 3.2rem;
}

.post-content-gutenberg .wp-block-embed iframe {
    max-width: 100%;
}

/* -------------------------------------------------------------
 * Tabla de contenidos (SimpleTOC)
 * ------------------------------------------------------------- */
.simpletoc,
.wp-block-simpletoc-toc,
.post-content .simpletoc,
.post-content-gutenberg .simpletoc,
.post-content-gutenberg .wp-block-simpletoc-toc {
    background-color: #edf67d !important;
    padding: 2.8rem 3.2rem !important;
    border-radius: 8px !important;
    margin-top: 3.2rem !important;
    margin-bottom: 3.6rem !important;
    border: none !important;
    box-sizing: border-box !important;
}

.post-content-gutenberg .simpletoc-title {
    font-family: Poppins, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #01161e;
    margin-top: 0;
    margin-bottom: 2rem;
    line-height: 1.3;
}

.post-content-gutenberg .simpletoc-list {
    margin: 0 !important;
}

/* OPCIÓN 1: Lista ordenada (icono 1 2 3 en el editor flotante) -> 01., 02., etc. */
.post-content-gutenberg ol.simpletoc-list {
    margin: 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
    counter-reset: simpletoc-counter;
}

.post-content-gutenberg ol.simpletoc-list > li {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    counter-increment: simpletoc-counter !important;
    position: relative !important;
    list-style: none !important;
    list-style-type: none !important;
    background: none !important;
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 1.4rem !important;
    font-size: 1.7rem !important;
    line-height: 1.5 !important;
}

.post-content-gutenberg ol.simpletoc-list > li:last-child {
    margin-bottom: 0 !important;
}

.post-content-gutenberg ol.simpletoc-list > li::before {
    content: counter(simpletoc-counter, decimal-leading-zero) "." !important;
    position: static !important;
    display: inline-block !important;
    min-width: 3.4rem !important;
    flex-shrink: 0 !important;
    font-family: Poppins, sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.7rem !important;
    line-height: 1.5 !important;
    color: #01161e !important;
}

.post-content-gutenberg ol.simpletoc-list > li > a {
    flex: 1 1 auto;
    line-height: 1.5;
}

/* OPCIÓN 2: Lista desordenada (icono de viñetas en el editor flotante) -> viñetas limpias */
.post-content-gutenberg ul.simpletoc-list {
    margin: 0 !important;
    padding-left: 2.4rem !important;
    list-style-type: disc !important;
}

.post-content-gutenberg ul.simpletoc-list > li {
    position: relative !important;
    list-style-type: disc !important;
    background: none !important; /* Anula el icono flecha > del tema clásico */
    padding-left: 0.6rem !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 1.2rem !important;
    font-size: 1.7rem !important;
    line-height: 1.5 !important;
}

.post-content-gutenberg ul.simpletoc-list > li:last-child {
    margin-bottom: 0 !important;
}

.post-content-gutenberg ul.simpletoc-list > li::before {
    content: none !important; /* Sin números si es desordenada */
}

/* Enlaces del índice */
.post-content-gutenberg .simpletoc-list a {
    color: #1362FB !important;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(19, 98, 251, 0.4);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.post-content-gutenberg .simpletoc-list a:hover {
    color: #003cc7 !important;
    text-decoration-color: #003cc7;
}

/* Subniveles anidados (ej: H3 dentro de H2) */
.post-content-gutenberg .simpletoc-list ol,
.post-content-gutenberg .simpletoc-list ul {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
    padding-left: 2rem;
}

/* Margen superior de anclaje para no solapar con el header fijo */
.post-content-gutenberg h1[id],
.post-content-gutenberg h2[id],
.post-content-gutenberg h3[id],
.post-content-gutenberg h4[id],
.post-content-gutenberg h5[id],
.post-content-gutenberg h6[id] {
    scroll-margin-top: 10rem;
}
