/*
Theme Name: abaton B/N
Theme URI: https://centromedicoabaton.com/
Description: Tema hijo de "abaton" (hijo de Twenty Twenty) convertido a blanco y negro estricto: escala de grises en toda la web, imágenes, fondos, botones y acentos.
Author: M (Hermes) para centro médico Abatón
Template: twentytwenty
Version: 1.2.0
Text Domain: abaton-bn
*/

/* ============================================================
   BLANCO Y NEGRO ESTRICTO
   Nota de estructura: WordPress no permite "nietos" de tema
   (un hijo no puede ser padre). Por eso el Template: apunta al
   padre original (Twenty Twenty) y este hijo re-aplica los
   estilos custom del hijo "abaton" a traves de abaton-custom.css,
   que se encola el ultimo en functions.php.
   ============================================================ */

/* 1. Todo el contenido visible en escala de grises (imagenes,
      videos, fondos, SVG, canvas, iconos) */
html {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
}

/* 2. Salvaguarda explicita para medios y elementos con fondo */
img,
picture,
video,
canvas,
svg,
iframe,
object,
embed,
.wp-post-image,
.post-thumbnail,
.custom-logo,
figure img,
[class*="image"] img {
    filter: grayscale(100%) !important;
    -webkit-filter: grayscale(100%) !important;
}

/* 3. Acentos de color forzados a escala de grises:
      el sitio usa accent #e22658 (rosa) y botones #0D7D74 (verde) */
:root {
    --accent-color: #666666 !important;
}

button:not(.toggle),
.button,
.faux-button,
.wp-block-button__link,
.wp-block-file .wp-block-file__button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.bg-accent,
.bg-accent-hover:hover,
.bg-accent-hover:focus,
:root .has-accent-background-color,
.comment-reply-link,
a.button,
button,
[type="submit"] {
    background-color: #2b2b2b !important;
    border-color: #2b2b2b !important;
}

button:hover:not(.toggle),
.button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
a.button:hover {
    background-color: #000000 !important;
}

/* Enlaces de acento: negro/gris, sin color */
a:hover,
a:focus,
.has-accent-color,
.has-text-accent-color {
    color: inherit;
}

/* Fondos de acento (banners, bloques) en gris */
.bg-accent,
.has-accent-background-color,
.wp-block-button__link {
    background-color: #2b2b2b !important;
}

/* Borde de acento */
.has-accent-border-color {
    border-color: #666666 !important;
}

/* ============================================================
   4. PIE DE PAGINA EN GRIS OSCURO / NEGRO
   Para que se distinga claramente del resto de la pagina
   (que tras el filtro queda en tonos claros de gris).
   ============================================================ */
.footer-nav-widgets-wrapper,
#site-footer,
.footer-top,
.footer-widgets-outer-wrapper {
    background-color: #1a1a1a !important;
    border-color: #333333 !important;
    color: #f0f0f0 !important;
}

/* Texto y enlaces del pie: claros para contrastar */
#site-footer,
#site-footer a,
#site-footer .footer-copyright,
#site-footer .footer-credits,
.footer-menu a,
.footer-credits .privacy-policy,
.powered-by-wordpress,
.to-the-top,
.to-the-top-long,
.to-the-top-short {
    color: #f0f0f0 !important;
}

#site-footer a:hover,
#site-footer a:focus,
.footer-menu a:hover,
.footer-menu a:focus {
    color: #ffffff !important;
}

/* Iconos sociales del pie: boton oscuro con icono claro */
.footer-social a {
    background-color: #333333 !important;
    color: #f0f0f0 !important;
}

.footer-social a:hover,
.footer-social a:focus {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Separadores internos del pie */
.footer-top {
    border-bottom: 0.1rem solid #333333 !important;
}

.footer-widgets-outer-wrapper {
    border-bottom: 0.1rem solid #333333 !important;
}

/* ============================================================
   5. MENU: HOVER CON SUBRAYADO EN VEZ DE CAMBIO DE COLOR
   El usuario reporta que al pasar el raton por encima del menu
   la fuente se pone blanca y no se distingue. En vez de cambiar
   el color, se fuerza subrayado + mismo color de texto que el
   estado normal (negro sobre fondo claro, blanco sobre fondo
   oscuro del submenu/modal), para garantizar contraste.
   ============================================================ */

/* Menu principal de cabecera (escritorio) */
.primary-menu a,
.primary-menu a:link,
.primary-menu a:visited {
    color: inherit;
    text-decoration: none;
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current_page_ancestor,
.primary-menu li.current-menu-item > a,
.primary-menu li.current-menu-item > .link-icon-wrapper > a {
    color: inherit !important;
    text-decoration: underline !important;
}

.primary-menu li.current-menu-item > a:hover,
.primary-menu li.current-menu-item > .link-icon-wrapper > a:hover,
.primary-menu li.current-menu-item > a:focus,
.primary-menu li.current-menu-item > .link-icon-wrapper > a:focus {
    color: inherit !important;
    text-decoration: underline !important;
}

/* Submenu desplegable (fondo negro heredado del padre): subrayado,
   y el color de texto se mantiene en el heredado (blanco sobre negro). */
.primary-menu ul a,
.primary-menu ul a:link,
.primary-menu ul a:visited {
    color: inherit;
    text-decoration: none;
}

.primary-menu ul a:hover,
.primary-menu ul a:focus {
    color: inherit !important;
    text-decoration: underline !important;
}

/* Menu modal (movil / menu a pantalla completa) */
.modal-menu a,
.modal-menu a:link,
.modal-menu a:visited {
    color: inherit;
    text-decoration: none;
}

.modal-menu a:hover,
.modal-menu a:focus,
.modal-menu li.current-menu-item > .ancestor-wrapper > a,
.modal-menu li.current_page_ancestor > .ancestor-wrapper > a {
    color: inherit !important;
    text-decoration: underline !important;
}

/* Asegura que los enlaces del menu no hereden el blanco
   forzado por reglas de cabecera/pie si no corresponde. */
.primary-menu a {
    color: #000000 !important;
}

.primary-menu ul a {
    color: #ffffff !important;
}

.modal-menu a {
    color: #000000 !important;
}

/* ============================================================
   6. HOVER DE ENLACES DE MENU - CORRECCION FINAL
   Selectores reforzados para cubrir el anidamiento real
   li > .ancestor-wrapper > a (no solo li > a), que es como
   Twenty Twenty renderiza el menu modal (movil) y parte del
   menu principal. Se usa color fijo por contexto + !important
   y subrayado en hover, sin cambio de color.
   ============================================================ */

/* Menu principal cabecera (escritorio, fondo claro) - negro SIEMPRE */
.header-inner .primary-menu > li > a,
.header-inner .primary-menu > li > a:link,
.header-inner .primary-menu > li > a:visited,
.header-inner .primary-menu > li > .link-icon-wrapper > a,
.header-inner .primary-menu > li > .link-icon-wrapper > a:link,
.header-inner .primary-menu > li > .link-icon-wrapper > a:visited,
.header-inner .primary-menu .current_page_ancestor,
.header-inner .primary-menu li.current-menu-item > a,
.header-inner .primary-menu li.current-menu-item > .link-icon-wrapper > a,
.header-inner .primary-menu li > .ancestor-wrapper > a,
.header-inner .primary-menu li > .ancestor-wrapper > a:link,
.header-inner .primary-menu li > .ancestor-wrapper > a:visited {
    color: #000000 !important;
    text-decoration: none;
}

.header-inner .primary-menu > li > a:hover,
.header-inner .primary-menu > li > a:focus,
.header-inner .primary-menu > li > .link-icon-wrapper > a:hover,
.header-inner .primary-menu > li > .link-icon-wrapper > a:focus,
.header-inner .primary-menu .current_page_ancestor:hover,
.header-inner .primary-menu .current_page_ancestor:focus,
.header-inner .primary-menu li.current-menu-item > a:hover,
.header-inner .primary-menu li.current-menu-item > a:focus,
.header-inner .primary-menu li.current-menu-item > .link-icon-wrapper > a:hover,
.header-inner .primary-menu li.current-menu-item > .link-icon-wrapper > a:focus,
.header-inner .primary-menu li > .ancestor-wrapper > a:hover,
.header-inner .primary-menu li > .ancestor-wrapper > a:focus {
    color: #000000 !important;
    text-decoration: underline !important;
}

/* Submenu escritorio (fondo negro) - blanco SIEMPRE, hover subrayado */
.header-inner .primary-menu ul li > a,
.header-inner .primary-menu ul li > a:link,
.header-inner .primary-menu ul li > a:visited,
.header-inner .primary-menu ul li > .ancestor-wrapper > a,
.header-inner .primary-menu ul li > .ancestor-wrapper > a:link,
.header-inner .primary-menu ul li > .ancestor-wrapper > a:visited {
    color: #ffffff !important;
    text-decoration: none;
}

.header-inner .primary-menu ul li > a:hover,
.header-inner .primary-menu ul li > a:focus,
.header-inner .primary-menu ul li > .ancestor-wrapper > a:hover,
.header-inner .primary-menu ul li > .ancestor-wrapper > a:focus {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Menu modal (movil / pantalla completa) - fondo blanco, texto negro
   Cubre el anidamiento li > .ancestor-wrapper > a que Twenty Twenty
   genera para cada item (p.ej. li.menu-item-593 > div.ancestor-wrapper > a). */
.menu-modal .modal-menu li > a,
.menu-modal .modal-menu li > a:link,
.menu-modal .modal-menu li > a:visited,
.menu-modal .modal-menu li > .ancestor-wrapper > a,
.menu-modal .modal-menu li > .ancestor-wrapper > a:link,
.menu-modal .modal-menu li > .ancestor-wrapper > a:visited,
.menu-modal .modal-menu li.current-menu-item > .ancestor-wrapper > a,
.menu-modal .modal-menu li.current_page_ancestor > .ancestor-wrapper > a {
    color: #000000 !important;
    text-decoration: none;
}

.menu-modal .modal-menu li > a:hover,
.menu-modal .modal-menu li > a:focus,
.menu-modal .modal-menu li > .ancestor-wrapper > a:hover,
.menu-modal .modal-menu li > .ancestor-wrapper > a:focus,
.menu-modal .modal-menu li.current-menu-item > .ancestor-wrapper > a:hover,
.menu-modal .modal-menu li.current-menu-item > .ancestor-wrapper > a:focus,
.menu-modal .modal-menu li.current_page_ancestor > .ancestor-wrapper > a:hover,
.menu-modal .modal-menu li.current_page_ancestor > .ancestor-wrapper > a:focus {
    color: #000000 !important;
    text-decoration: underline !important;
}

/* Submenu dentro del menu modal */
.menu-modal .modal-menu ul li > a,
.menu-modal .modal-menu ul li > a:link,
.menu-modal .modal-menu ul li > a:visited,
.menu-modal .modal-menu ul li > .ancestor-wrapper > a,
.menu-modal .modal-menu ul li > .ancestor-wrapper > a:link,
.menu-modal .modal-menu ul li > .ancestor-wrapper > a:visited {
    color: #000000 !important;
}

.menu-modal .modal-menu ul li > a:hover,
.menu-modal .modal-menu ul li > a:focus,
.menu-modal .modal-menu ul li > .ancestor-wrapper > a:hover,
.menu-modal .modal-menu ul li > .ancestor-wrapper > a:focus {
    color: #000000 !important;
    text-decoration: underline !important;
}

/* Anti-herencia: mata color:#fff de .header-footer-group / .toggle
   si se propaga por herencia hacia cualquier enlace de menu. */
.header-footer-group .primary-menu a,
.header-footer-group .primary-menu a:hover,
.header-footer-group .primary-menu a:focus,
.header-footer-group .primary-menu li > .ancestor-wrapper > a,
.header-footer-group .primary-menu li > .ancestor-wrapper > a:hover,
.header-footer-group .primary-menu li > .ancestor-wrapper > a:focus,
#site-header .toggle .primary-menu a,
#site-header .toggle .primary-menu a:hover,
#site-header .toggle .primary-menu a:focus {
    color: #000000 !important;
}

.header-footer-group .primary-menu ul a,
.header-footer-group .primary-menu ul a:hover,
.header-footer-group .primary-menu ul a:focus,
.header-footer-group .primary-menu ul li > .ancestor-wrapper > a,
.header-footer-group .primary-menu ul li > .ancestor-wrapper > a:hover,
.header-footer-group .primary-menu ul li > .ancestor-wrapper > a:focus {
    color: #ffffff !important;
}

/* ============================================================
   7. CABECERAS DE CONTENIDO (entry-header / archive-header)
   en el mismo gris oscuro que el pie de pagina (#1a1a1a),
   con texto claro encima. Excluida la home: en la home el
   body lleva la clase 'template-cover' + 'overlay-header'
   (banner con imagen de fondo), que se deja intacta.
   ============================================================ */

/* Archivo / listados */
body:not(.template-cover) .archive-header,
body:not(.template-cover) .archive-header * {
    background-color: #1a1a1a !important;
    color: #f0f0f0 !important;
    border-color: #333333 !important;
}

body:not(.template-cover) .archive-header a,
body:not(.template-cover) .archive-header a:hover,
body:not(.template-cover) .archive-header a:focus {
    color: #f0f0f0 !important;
}

body:not(.template-cover) .archive-header a:hover,
body:not(.template-cover) .archive-header a:focus {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Entradas / paginas individuales */
body:not(.template-cover) .singular .entry-header,
body:not(.template-cover) .singular .entry-header * {
    background-color: #1a1a1a !important;
    color: #f0f0f0 !important;
    border-color: #333333 !important;
}

body:not(.template-cover) .singular .entry-header a,
body:not(.template-cover) .singular .entry-header a:hover,
body:not(.template-cover) .singular .entry-header a:focus {
    color: #f0f0f0 !important;
}

body:not(.template-cover) .singular .entry-header a:hover,
body:not(.template-cover) .singular .entry-header a:focus {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Titulos de categoria/etiqueta de entrada sobre el fondo oscuro */
body:not(.template-cover) .singular .entry-header .entry-categories a,
body:not(.template-cover) .singular .entry-header .post-meta a {
    color: #cfcfcf !important;
}

body:not(.template-cover) .singular .entry-header .entry-categories a:hover,
body:not(.template-cover) .singular .entry-header .post-meta a:hover {
    color: #ffffff !important;
}

/* ============================================================
   8. SOBRESCRITURA DIRECTA - CABECERA entry-header
   Refuerzo final: el fondo blanco viene de twentytwenty/style.css
   (.singular .entry-header { background-color: #fff }) y de posibles
   estilos globales. Se fija aqui con el selector exacto que usa
   Twenty Twenty para el header de pagina/entrada:
   <header class="entry-header has-text-align-center header-footer-group">
   ============================================================ */

body.singular:not(.template-cover) header.entry-header,
body.singular:not(.template-cover) .entry-header,
body.singular:not(.template-cover) header.entry-header.has-text-align-center.header-footer-group {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    color: #f0f0f0 !important;
    border-color: #333333 !important;
}

body.singular:not(.template-cover) .entry-header *,
body.singular:not(.template-cover) .entry-header .entry-title,
body.singular:not(.template-cover) .entry-header h1,
body.singular:not(.template-cover) .entry-header h2,
body.singular:not(.template-cover) .entry-header .post-meta,
body.singular:not(.template-cover) .entry-header .entry-categories {
    color: #f0f0f0 !important;
    background-color: transparent !important;
}

body.singular:not(.template-cover) .entry-header a,
body.singular:not(.template-cover) .entry-header a:link,
body.singular:not(.template-cover) .entry-header a:visited {
    color: #f0f0f0 !important;
}

body.singular:not(.template-cover) .entry-header a:hover,
body.singular:not(.template-cover) .entry-header a:focus {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* ============================================================
   9. AJUSTE EXACTO PEDIDO POR EL USUARIO
   El usuario confirmo que el selector problematico es exactamente
   .singular .entry-header { background-color: #fff; } de
   twentytwenty/style.css. Regla final, con maxima prioridad:
   ============================================================ */

/* La home (body.template-cover) usa .cover-header .entry-header sobre una imagen
   de fondo y Twenty Twenty lo deja en background:transparent. Aqui NO se toca. */
body.singular:not(.template-cover) .entry-header {
    background-color: #1a1a1a !important;
}

body:not(.template-cover) .singular .entry-header {
    background-color: #1a1a1a !important;
}

/* ============================================================
   10. TOGGLES DE CABECERA (Menú / Buscar) en escritorio
   El boton (area oscura, background #2b2b2b) envuelve icono y
   texto. Ajustes pedidos por el usuario:
   - Texto ("Menú"/"Buscar") en BLANCO sobre el fondo oscuro.
   - Separacion JUSTA (gap) entre icono y texto para que el texto
     entre holgado dentro del recuadro sin salirse.
   ============================================================ */

.header-inner .toggle {
    height: auto !important;
    min-height: 4.4rem !important;
    padding: 1.2rem 2.4rem !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #2b2b2b !important;
    color: #ffffff !important;
}

.header-inner .toggle .toggle-inner {
    position: static !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.6rem !important;
    overflow: visible !important;
    padding-top: 0 !important;
}

.header-inner .toggle .toggle-inner .toggle-icon {
    display: block !important;
    overflow: visible !important;
}

.header-inner .toggle .toggle-inner .toggle-icon svg,
.header-inner .toggle .toggle-inner svg {
    fill: #ffffff !important;
    color: #ffffff !important;
}

.header-inner .toggle .toggle-inner .toggle-text {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    white-space: nowrap !important;
    text-align: center !important;
    font-size: 1.1rem !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
}

/* Hover/focus: subrayado en el texto, sin cambiar el color */
.header-inner .toggle:hover .toggle-text,
.header-inner .toggle:focus .toggle-text {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* ============================================================
   11. CAJETIN DE BUSCAR: texto en NEGRO
   El input de busqueda (.search-modal .search-field) hereda el
   color blanco del overlay/modal. El usuario quiere el texto
   que se escribe en NEGRO, asi como el placeholder.
   ============================================================ */

.search-modal .search-field,
.search-modal input[type="search"],
.search-modal input.search-field {
    color: #000000 !important;
    background-color: #ffffff !important;
}

.search-modal .search-field::placeholder,
.search-modal input[type="search"]::placeholder,
.search-modal .search-field::-webkit-input-placeholder,
.search-modal .search-field::-moz-placeholder,
.search-modal .search-field:-ms-input-placeholder {
    color: #000000 !important;
    opacity: 1 !important;
}

/* ============================================================
   12. OCULTAR DUPLICADO DE TOGGLES EN ESCRITORIO
   El tema marca los toggles mobile con .mobile-search-toggle /
   .mobile-nav-toggle y los desktop con .desktop-search-toggle /
   .desktop-nav-toggle. Nuestra seccion 10 afectaba a .header-inner .toggle
   en general, haciendo visibles tambien los mobile (que deberian
   seguir ocultos en escritorio). Se asegura que solo queden los
   desktop (los de la derecha).
   ============================================================ */

@media (min-width: 1000px) {
    .header-inner .mobile-search-toggle,
    .header-inner .mobile-nav-toggle {
        display: none !important;
    }
}

/* ============================================================
   13. TOGGLES DE ESCRITORIO: MISMAS DIMENSIONES
   El recuadro de "Menú" y el de "Buscar" deben tener exactamente
   el mismo tamaño (ancho y alto) para que se vean simetricos.
   Se fija un ancho/alto fijo y se centra el contenido (icono+texto)
   igual en ambos.
   ============================================================ */

.header-inner .toggle.desktop-nav-toggle,
.header-inner .toggle.desktop-search-toggle {
    width: 9.5rem !important;
    height: 7.6rem !important;
    min-height: 7.6rem !important;
    padding: 1.2rem 1.2rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.header-inner .toggle.desktop-nav-toggle .toggle-inner,
.header-inner .toggle.desktop-search-toggle .toggle-inner {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.6rem !important;
}

/* ============================================================
   14. TELEFONO Y CORREO EN LA CABECERA: FUENTE EN BLANCO
   Estos dos elementos son <li> del menu principal (.primary-menu),
   dentro de .header-navigation-wrapper. Nuestra seccion de menus
   forzaba color negro (#000000 !important) sobre todos los
   .primary-menu li > .ancestor-wrapper > a, incluidos estos.
   Se les da color blanco, igual que el resto del texto de cabecera.
   ============================================================ */


/* ============================================================
   15. TELEFONO Y CORREO EN CABECERA - REGLA FINAL (mas especifica
   que la anti-herencia de la seccion 6, que forzaba #000000 sobre
   .primary-menu a). Estos dos items del menu principal son
   li.menu-item-486 (tel:) y li.menu-item-525 (mailto:), y deben
   verse en BLANCO sobre el fondo de cabecera.
   ============================================================ */

.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-486.menu-item-486 > a,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-525.menu-item-525 > a,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-486.menu-item-486 > a:link,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-525.menu-item-525 > a:link,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-486.menu-item-486 > a:visited,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-525.menu-item-525 > a:visited {
    color: #ffffff !important;
}

.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-486.menu-item-486 > a:hover,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-525.menu-item-525 > a:hover,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-486.menu-item-486 > a:focus,
.header-navigation-wrapper.header-navigation-wrapper .primary-menu.primary-menu li.menu-item-525.menu-item-525 > a:focus {
    color: #ffffff !important;
    text-decoration: underline !important;
}
