/* Granfluencers · reglas del sistema de diseño que theme.json no puede expresar.
   Los valores salen de las variables de la paleta (theme.json). */

/* Foco del teclado: anillo sólido de 2px en terracota, separado 2px. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.wp-element-button:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent);
    outline-offset: 2px;
}

/* Enlaces dentro del texto con subrayado fino (el menú y los títulos no cambian). */
:where(.wp-site-blocks) :where(p, li, td, dd, figcaption, cite) a:where(:not(.wp-element-button)) {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

/* Sobre la franja oscura, los enlaces van en el color del texto (on-band). */
:where(.has-band-background-color, .has-contrast-background-color, .has-ink-background-color, .has-black-background-color, .has-accent-3-background-color, .is-style-section-5, .wp-block-cover) a:where(:not(.wp-element-button)) {
    color: inherit;
}

/* Botón secundario (estilo «Contorno»): sin relleno, borde y texto del color
   del texto que lo rodea. Sobre la franja oscura queda en blanco (on-band). */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
    background-color: transparent;
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
    color: inherit;
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-border-color) {
    border-color: currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link {
    border-width: 1.5px;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
    background-color: color-mix(in srgb, currentColor 12%, transparent);
    color: inherit;
}

/* Botones: negro con texto blanco sobre fondos claros (theme.json). Sobre la franja
   oscura, las secciones oscuras y las portadas, TODOS los botones (relleno o contorno,
   con o sin color elegido en el editor) son la misma píldora blanca con texto en tinta,
   y al pasar el ratón se tiñen de terracota claro. !important porque las clases de
   color del editor (has-base-background-color…) llevan !important. */
.wp-element-button {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color, .has-black-background-color, .has-ink-background-color, .wp-block-cover) .wp-block-button > .wp-block-button__link {
    background-color: var(--wp--preset--color--paper) !important;
    color: var(--wp--preset--color--ink) !important;
    border: 1.5px solid var(--wp--preset--color--paper) !important;
}
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color, .has-black-background-color, .has-ink-background-color, .wp-block-cover) .wp-block-button > .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--accent-tint) !important;
    border-color: var(--wp--preset--color--accent-tint) !important;
}
@media (prefers-reduced-motion: reduce) {
    .wp-element-button { transition: none; }
}

/* Citas: la fuente de la cita vuelve a Manrope, como metadato. */
.wp-block-quote cite,
.wp-block-pullquote cite {
    font-family: var(--wp--preset--font-family--manrope);
    font-size: var(--wp--preset--font-size--etiqueta);
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: var(--wp--preset--color--ink-muted);
}

/* Las URL largas (DOI, enlaces) se parten en vez de desbordar en el móvil. */
.wp-site-blocks :where(p, li, td, dd) {
    overflow-wrap: break-word;
}
/* Iframes incrustados (Figshare, vídeos): nunca más anchos que su columna. */
.wp-site-blocks iframe {
    max-width: 100%;
}

/* Fotos recortadas con radius-md (las de ancho completo y las redondas no). */
.wp-site-blocks .wp-block-image:not(.alignfull):not(.is-style-rounded) img,
.wp-site-blocks .wp-block-media-text__media img {
    border-radius: 8px;
}

/* Menú: la página actual (y su sección, si está en un submenú) subrayada en terracota. */
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation .has-child:has(.current-menu-item) > .wp-block-navigation-item__content {
    text-decoration-line: underline;
    text-decoration-color: var(--wp--preset--color--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.4em;
}

/* Pie en la franja oscura: pegado a la última sección (sin el hueco del espaciado
   entre bloques, que dejaba ver una línea blanca) y separado por una línea terracota. */
.wp-site-blocks > footer.wp-block-template-part {
    margin-block-start: 0;
}
.gf-pie {
    border-top: 3px solid var(--wp--preset--color--data-2, #f07f3c);
}
.gf-pie .custom-logo {
    border-radius: 8px;
}
.gf-pie .gf-cookies-pref {
    color: inherit;
    font-size: var(--wp--preset--font-size--small);
}

/* Botón flotante de cookies: en el móvil se oculta porque tapa contenido;
   las preferencias siguen accesibles desde el enlace del pie. */
@media (max-width: 599px) {
    .cookieadmin_re_consent {
        display: none !important;
    }
}

/* Páginas de lectura larga (clase gf-lectura, ver functions.php):
   cada sección con un filete y aire encima; tablas y recuadros como tarjetas. */
.gf-lectura .wp-block-post-content h2.wp-block-heading {
    margin-top: var(--wp--preset--spacing--60);
    padding-top: var(--wp--preset--spacing--40);
    border-top: 1px solid var(--wp--preset--color--line);
}
.gf-lectura .wp-block-post-content :is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color) h2.wp-block-heading {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.gf-lectura .wp-block-post-content > .wp-block-group > :is(figure.wp-block-table, .wp-block-group.alignwide, .wp-block-columns) {
    /* !important: algunos recuadros traen padding 0 en línea desde el editor. */
    padding: clamp(16px, 3vw, 24px) !important;
    background: var(--wp--preset--color--paper-warm);
    border-radius: 8px;
}

/* Tablas de contenido: filetes finos, cabecera en tinta. */
.wp-block-table table {
    border-collapse: collapse;
}
.wp-block-table :is(th, td) {
    padding: 8px 12px 8px 0;
    border: 0;
    border-bottom: 1px solid var(--wp--preset--color--line);
    text-align: left;
    vertical-align: top;
}
.wp-block-table thead th,
.wp-block-table thead td {
    font-weight: 600;
    border-bottom: 1.5px solid currentColor;
}
.wp-block-table figcaption {
    font-size: var(--wp--preset--font-size--etiqueta);
    color: var(--wp--preset--color--ink-muted);
}

/* Tablas de perfiles (DataTables). En claro y en las secciones oscuras. */
.gf-tabla {
    font-size: 16px;
}
.gf-tabla .dt-container {
    font-size: inherit;
    color: inherit;
}
.gf-tabla table.dataTable thead > tr > :is(th, td) {
    font-size: var(--wp--preset--font-size--etiqueta);
    font-weight: 600;
    letter-spacing: 0.2px;
    border-bottom: 1.5px solid currentColor;
}
.gf-tabla table.dataTable.display > tbody > tr > * {
    border-top: 1px solid var(--wp--preset--color--line);
    box-shadow: none;
}
.gf-tabla table.dataTable.display > tbody > tr:nth-child(odd) > * {
    box-shadow: inset 0 0 0 9999px color-mix(in srgb, currentColor 3%, transparent);
}
.gf-tabla table.dataTable.display > tbody > tr:hover > * {
    box-shadow: inset 0 0 0 9999px var(--wp--preset--color--accent-tint);
    color: var(--wp--preset--color--ink);
}
.gf-tabla table.dataTable.display > tbody > tr:hover a {
    color: var(--wp--preset--color--accent-text);
}
.gf-tabla table.dataTable td a[target="_blank"] {
    white-space: nowrap;
}
.gf-tabla table.dataTable td.gf-num,
.gf-tabla table.dataTable th.gf-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.gf-tabla div.dt-container .dt-input {
    padding: 6px 10px;
    color: inherit;
    background: transparent;
    border: 1px solid var(--wp--preset--color--line-strong);
    border-radius: 4px;
    font: inherit;
}
.gf-tabla .dt-info,
.gf-tabla .dt-length label,
.gf-tabla .dt-search label {
    font-size: var(--wp--preset--font-size--etiqueta);
    opacity: 0.85;
}
.gf-tabla div.dt-container .dt-paging .dt-paging-button {
    min-width: 2.4em;
    color: inherit !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 9999px !important;
}
.gf-tabla div.dt-container .dt-paging .dt-paging-button.current {
    border: 1.5px solid currentColor !important;
}
.gf-tabla div.dt-container .dt-paging .dt-paging-button:not(.disabled):not(.current):hover {
    color: var(--wp--preset--color--ink) !important;
    background: var(--wp--preset--color--accent-tint) !important;
}
.gf-tabla table.dataTable > tbody > tr > td.dtr-control::before {
    border-left-color: var(--wp--preset--color--accent) !important;
}
.gf-tabla table.dataTable > tbody > tr.dtr-expanded > td.dtr-control::before {
    border-top-color: var(--wp--preset--color--accent) !important;
}
.gf-tabla table.dataTable > tbody > tr.child ul.dtr-details > li {
    border-bottom-color: var(--wp--preset--color--line);
}
/* En las secciones oscuras: filetes y resaltado en tonos oscuros. */
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color) .gf-tabla table.dataTable.display > tbody > tr > *,
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color) .gf-tabla table.dataTable.display > tbody > tr.child ul.dtr-details > li {
    border-color: #34322f;
}
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color) .gf-tabla table.dataTable.display > tbody > tr:hover > * {
    box-shadow: inset 0 0 0 9999px #45220f;
    color: #f4f2ec;
}
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color) .gf-tabla table.dataTable.display > tbody > tr:hover a {
    color: inherit;
}
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color) .gf-tabla div.dt-container .dt-input {
    border-color: #6a6760;
}
:is(.is-style-section-5, .has-contrast-background-color, .has-band-background-color) .gf-tabla div.dt-container .dt-paging .dt-paging-button:not(.disabled):not(.current):hover {
    color: #f4f2ec !important;
    background: #45220f !important;
}

/* Plantilla «Artículo de divulgación»: titular y texto en Source Serif 4.
   Tablas, gráficas, botones, pies de figura y formularios siguen en Manrope. */
.gf-articulo {
    font-family: var(--wp--preset--font-family--source-serif-4);
    font-size: var(--wp--preset--font-size--lectura);
    line-height: 30px;
}
.gf-articulo :where(h1, h2, h3, h4, h5, h6) {
    font-family: var(--wp--preset--font-family--source-serif-4);
    font-weight: 600;
}
.gf-articulo :where(h1) {
    font-size: var(--wp--preset--font-size--titular-articulo);
    line-height: 1.15;
    letter-spacing: -0.3px;
}
.gf-articulo :is(table, figcaption, .wp-block-table, .wp-block-buttons, .wp-element-button, .gf-viz, .wp-block-file, form, nav, .wp-block-details summary) {
    font-family: var(--wp--preset--font-family--manrope);
}
/* Referencias (bloque Lista con la clase gf-referencias, o elementos sueltos en una
   columna): sin viñetas, con sangría francesa como en APA e interlineado más corto
   que el de lectura. */
.gf-referencias,
.gf-articulo .wp-block-column:has(> li) {
    list-style: none;
    padding-left: 0;
}
.gf-referencias > li,
.gf-articulo :is(.has-small-font-size, .wp-block-column) > li {
    list-style: none;
    padding-left: 1.5em;
    text-indent: -1.5em;
    line-height: 1.5;
    margin-bottom: 0.6em;
}
.gf-articulo .has-small-font-size p {
    line-height: 1.5;
}.gf-articulo figcaption {
    font-size: var(--wp--preset--font-size--etiqueta);
    color: var(--wp--preset--color--ink-muted);
}
