/**
 * =====================================================================================================================
 * Archivo   : /cms/assets/css/cms-complementos.css
 * Sistema   : CMS del Periódico Oficial del Estado de Hidalgo (POEH)
 * Propósito : Estilos de los COMPLEMENTOS FLOTANTES del portal (accesibilidad, traductor, chatbot, aviso de privacidad)
 *             y de los MODOS DE ACCESIBILIDAD que se aplican a toda la página (clases a11y-* en <html>). También las
 *             piezas nuevas de Apariencia (banner, redes sociales, logo del pie, calendario en la portada).
 *
 * Índice: 1. Botones y paneles flotantes · 2. Accesibilidad (panel) · 3. Modos de accesibilidad · 4. Traductor ·
 *         5. Chatbot · 6. Aviso de privacidad · 7. Apariencia · 8. Adaptable y movimiento reducido
 *
 * BITÁCORA DE CAMBIOS
 *   2026-11-24 | v1.0.0 | Creación del archivo (fase 5).
 * =====================================================================================================================
 */

/* 1. BOTONES Y PANELES FLOTANTES ---------------------------------------------------------------------------------- */
.cmp-flotante { position: fixed; z-index: 900; }
.cmp-a11y-boton, .cmp-chat-boton { border: 2px solid var(--pub-dorado, #BC955B); background: var(--pub-guinda, #691b31); color: #fff; cursor: pointer;
    box-shadow: 0 8px 22px rgba(40, 20, 28, .28); transition: transform .2s, box-shadow .2s; font: inherit; }
.cmp-a11y-boton:hover, .cmp-chat-boton:hover, .cmp-a11y-boton:focus-visible, .cmp-chat-boton:focus-visible { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 26px rgba(40, 20, 28, .35); }
.cmp-panel { position: fixed; z-index: 901; background: #fff; color: #2b2b2b; border-radius: 16px; box-shadow: 0 24px 60px rgba(30, 5, 12, .35); border-top: 5px solid var(--pub-dorado, #BC955B);
    display: flex; flex-direction: column; overflow: hidden; font-size: 16px; line-height: 1.45; }
.cmp-panel[hidden] { display: none; }
.cmp-panel-cabecera { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; background: var(--pub-guinda, #691b31); color: #fff; }
.cmp-panel-cabecera h2 { margin: 0; font-size: 1rem; color: #fff; display: flex; align-items: center; gap: .45rem; }
.cmp-panel-cabecera > div { display: flex; gap: .2rem; }
.cmp-cerrar { background: transparent; border: 0; color: #fff !important; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.cmp-cerrar:hover, .cmp-cerrar:focus-visible { background: rgba(255, 255, 255, .18); }
.cmp-panel-cuerpo { padding: .9rem; overflow-y: auto; }

/* 2. ACCESIBILIDAD (panel) ---------------------------------------------------------------------------------------- */
.cmp-a11y-boton { top: 50%; width: 52px; height: 52px; border-radius: 50%; font-size: 1.55rem; display: inline-flex; align-items: center; justify-content: center; margin-top: -26px; }
.cmp-a11y-boton.cmp-derecha { right: 12px; } .cmp-a11y-boton.cmp-izquierda { left: 12px; }
.cmp-a11y-panel { top: 50%; transform: translateY(-50%); width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
.cmp-a11y-panel.cmp-derecha { right: 74px; } .cmp-a11y-panel.cmp-izquierda { left: 74px; }
.cmp-a11y-texto { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .7rem; background: #faf6ee; border-radius: 10px; margin-bottom: .7rem; font-weight: 600; }
.cmp-a11y-texto > div { display: flex; align-items: center; gap: .4rem; }
.cmp-a11y-texto button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--pub-guinda, #691b31); background: #fff; color: var(--pub-guinda, #691b31); cursor: pointer; }
.cmp-a11y-nivel { min-width: 3.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.cmp-a11y-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cmp-a11y-rejilla button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 78px; padding: .5rem; border-radius: 12px; cursor: pointer;
    border: 2px solid #e4dfd6; background: #fff; color: #2b2b2b; font: inherit; font-size: .86rem; font-weight: 600; text-align: center; }
.cmp-a11y-rejilla button i { font-size: 1.3rem; color: var(--pub-guinda, #691b31); }
.cmp-a11y-rejilla button[aria-pressed="true"] { border-color: var(--pub-guinda, #691b31); background: var(--pub-guinda, #691b31); color: #fff; }
.cmp-a11y-rejilla button[aria-pressed="true"] i { color: var(--pub-arena, #DDC9A3); }
.cmp-a11y-restablecer { width: 100%; margin-top: .7rem; padding: .6rem; border-radius: 10px; border: 2px dashed #c9bfae; background: transparent; cursor: pointer; font: inherit; font-weight: 600; color: #5E6261; }
.cmp-a11y-atajos { margin-top: .7rem; font-size: .86rem; }
.cmp-a11y-atajos summary { cursor: pointer; font-weight: 700; color: var(--pub-guinda, #691b31); }
.cmp-a11y-atajos ul { padding-left: 1rem; margin: .4rem 0 0; }
.cmp-a11y-atajos kbd { background: #eee; border: 1px solid #ccc; border-radius: 4px; padding: 0 .3rem; font-size: .8rem; color: #2b2b2b; }
.cmp-a11y-declaracion { font-size: .82rem; color: #5E6261; margin: .7rem 0 0; }
.cmp-guia { display: none; position: fixed; left: 0; right: 0; height: 36px; z-index: 899; pointer-events: none; background: rgba(255, 230, 100, .25);
    border-top: 2px solid rgba(105, 27, 49, .7); border-bottom: 2px solid rgba(105, 27, 49, .7); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .22); }

/* 3. MODOS DE ACCESIBILIDAD (clases en <html>) --------------------------------------------------------------------- */
html.a11y-guia .cmp-guia { display: block; }
html.a11y-contraste body, html.a11y-contraste body *:not(img):not(video):not(canvas):not(svg):not(i) { background-color: #000 !important; background-image: none !important; color: #fff !important; border-color: #fff !important; text-shadow: none !important; box-shadow: none !important; }
html.a11y-contraste a, html.a11y-contraste a * { color: #ffeb3b !important; text-decoration: underline !important; }
html.a11y-contraste button, html.a11y-contraste input, html.a11y-contraste select, html.a11y-contraste textarea { border: 2px solid #fff !important; }
html.a11y-contraste .cmp-a11y-rejilla button[aria-pressed="true"] { background: #ffeb3b !important; color: #000 !important; }
html.a11y-contraste .cmp-a11y-rejilla button[aria-pressed="true"] * { color: #000 !important; background: transparent !important; }
html.a11y-grises body > *:not(.cmp-flotante):not(.cmp-panel) { filter: grayscale(1); }
html.a11y-espaciado body *:not(i) { letter-spacing: .12em !important; word-spacing: .16em !important; line-height: 1.8 !important; }
html.a11y-espaciado p { margin-bottom: 2em !important; }
html.a11y-enlaces a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; background: #fff3b0 !important; color: #3d0010 !important; outline: 1px solid #c9a000; }
html.a11y-sin-animaciones *, html.a11y-sin-animaciones *::before, html.a11y-sin-animaciones *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-sin-animaciones .tm-capa { display: none !important; }
html.a11y-cursor, html.a11y-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 9-6.5 1.5L9 19z' fill='%23000' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E") 4 2, auto !important; }
html.a11y-legible body, html.a11y-legible body *:not(i):not(.fa-solid):not(.fa-regular):not(.fa-brands) { font-family: Verdana, Tahoma, "Segoe UI", sans-serif !important; }
html.a11y-foco *:focus { outline: 4px solid #ffbf00 !important; outline-offset: 3px !important; box-shadow: 0 0 0 8px #000 !important; }
html.a11y-foco a:hover { outline: 2px dashed #ffbf00; }

/* 4. TRADUCTOR --------------------------------------------------------------------------------------------------- */
.cmp-traductor { display: inline-flex; align-items: center; gap: .35rem; }
.cmp-traductor label { margin: 0; cursor: pointer; font-size: 1.1rem; }
.cmp-traductor select { border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: inherit; border-radius: 8px; padding: .15rem .4rem; font: inherit; font-size: .85rem; max-width: 180px; }
.cmp-traductor select option { color: #2b2b2b; background: #fff; }
.cmp-traductor-flotante { left: 12px; bottom: 12px; background: var(--pub-guinda, #691b31); color: #fff; padding: .45rem .6rem; border-radius: 30px; border: 2px solid var(--pub-dorado, #BC955B); box-shadow: 0 8px 22px rgba(40, 20, 28, .25); }
.pub-barra-derecha { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cmp-google { position: absolute; left: -9999px; top: -9999px; }
/* Google agrega una barra superior y desplaza la página: se oculta (el selector propio ya indica el idioma). */
.goog-te-banner-frame, iframe.skiptranslate, .skiptranslate > iframe, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* 5. CHATBOT ----------------------------------------------------------------------------------------------------- */
.cmp-chat-boton { bottom: 18px; display: inline-flex; align-items: center; gap: .6rem; height: 58px; padding: 0 1.1rem 0 .95rem; border-radius: 30px; font-weight: 700; font-size: .95rem; max-width: calc(100vw - 36px); }
.cmp-chat-boton.cmp-derecha { right: 18px; } .cmp-chat-boton.cmp-izquierda { left: 18px; }
.cmp-chat-boton i { font-size: 1.5rem; color: var(--pub-arena, #DDC9A3); }
.cmp-chat-boton.abierto .cmp-chat-etiqueta { display: none; }
.cmp-chat-etiqueta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-chat-panel { bottom: 88px; width: min(410px, calc(100vw - 24px)); height: min(640px, calc(100vh - 110px)); }
.cmp-chat-panel.cmp-derecha { right: 18px; } .cmp-chat-panel.cmp-izquierda { left: 18px; }
.cmp-chat-marco { flex: 1 1 auto; display: flex; background: #f5f3ef; }
.cmp-chat-marco iframe { border: 0; width: 100%; height: 100%; }
.cmp-chat-invitacion { position: fixed; bottom: 88px; z-index: 900; max-width: 280px; background: #fff; color: #2b2b2b; border-radius: 14px; padding: .8rem 2.2rem .8rem .9rem; cursor: pointer;
    box-shadow: 0 12px 30px rgba(40, 20, 28, .25); border-left: 5px solid var(--pub-dorado, #BC955B); animation: cmp-aparecer .35s ease-out both; }
.cmp-chat-invitacion.cmp-derecha { right: 18px; } .cmp-chat-invitacion.cmp-izquierda { left: 18px; }
.cmp-chat-invitacion p { margin: 0; font-size: .92rem; }
.cmp-chat-invitacion .cmp-cerrar { position: absolute; top: 4px; right: 4px; color: #5E6261 !important; width: 28px; height: 28px; }
/* El botón «volver arriba» sube para no encimarse con el chat. */
.cmp-con-chat-derecha .pub-arriba { bottom: 92px; }
@keyframes cmp-aparecer { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 6. AVISO DE PRIVACIDAD (aviso inicial) ------------------------------------------------------------------------- */
.cmp-aviso { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 950; margin: 0 auto; max-width: 980px; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: #fff; color: #2b2b2b; border-radius: 14px; padding: .9rem 1.1rem; box-shadow: 0 18px 44px rgba(30, 5, 12, .3); border-top: 4px solid var(--pub-dorado, #BC955B); animation: cmp-aparecer .4s ease-out both; }
.cmp-aviso-texto { display: flex; gap: .7rem; align-items: flex-start; flex: 1 1 380px; }
.cmp-aviso-texto i { color: var(--pub-guinda, #691b31); font-size: 1.4rem; margin-top: .15rem; }
.cmp-aviso-texto p { margin: 0; font-size: .92rem; }

/* 7. APARIENCIA (piezas nuevas del portal) ----------------------------------------------------------------------- */
.pub-banner-imagen { line-height: 0; background: var(--pub-guinda-osc); }
.pub-banner-imagen img { width: 100%; height: var(--banner-alto, 260px); object-fit: cover; display: block; }
.pub-banner-slider { padding: 1.2rem 0 0; }
.pub-redes { list-style: none; display: flex; gap: .5rem; padding: 0; margin: .8rem 0 0; }
.pub-redes a { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; background: rgba(255, 255, 255, .12); color: inherit !important;
    border: 1px solid rgba(255, 255, 255, .25); text-decoration: none; transition: background .2s, transform .2s; }
.pub-redes a:hover, .pub-redes a:focus-visible { background: var(--pub-dorado); color: #2b1a0a !important; transform: translateY(-2px); }
.pub-pie-logo { width: 46px; height: 46px; object-fit: contain; border-radius: 10px; background: rgba(255, 255, 255, .9); padding: 3px; }
.pub-pie-aviso { color: inherit !important; text-decoration: underline; }
.pub-portada-calendario { margin: 2rem 0; }
.pub-aviso-simplificado { background: #faf6ee; border-left: 5px solid var(--pub-dorado); border-radius: 10px; padding: .9rem 1.1rem; margin: 1.2rem 0; }
.pub-aviso-simplificado h2 { font-size: 1.05rem; margin: 0 0 .4rem; color: var(--pub-guinda); }
.pub-aviso-simplificado p { margin: 0; }
.pub-imprimir-fila { margin-top: 1.6rem; }
.pub-cabecera-color .pub-buscador input, .pub-cabecera-imagen .pub-buscador input { background: rgba(255, 255, 255, .95); }
.pub-cabecera-color .pub-menu-boton, .pub-cabecera-imagen .pub-menu-boton { color: inherit; border-color: currentColor; }

/* 8. ADAPTABLE Y MOVIMIENTO REDUCIDO ------------------------------------------------------------------------------ */
@media (max-width: 575.98px) {
    .cmp-a11y-boton { top: auto; bottom: 86px; margin-top: 0; width: 46px; height: 46px; font-size: 1.35rem; }
    .cmp-a11y-panel { top: auto; bottom: 12px; transform: none; left: 12px !important; right: 12px !important; width: auto; max-height: 75vh; }
    .cmp-chat-boton { height: 52px; padding: 0 .9rem; }
    .cmp-chat-etiqueta { display: none; }
    .cmp-chat-panel { left: 0 !important; right: 0 !important; bottom: 0; width: 100%; height: 100%; border-radius: 0; }
    .cmp-chat-sin-movil .cmp-chat-boton, .cmp-chat-sin-movil .cmp-chat-invitacion { display: none; }
    .cmp-traductor select { max-width: 130px; }
    .pub-banner-imagen img { height: calc(var(--banner-alto, 260px) * .55); }
}
@media (prefers-reduced-motion: reduce) {
    .cmp-chat-invitacion, .cmp-aviso { animation: none; }
    .cmp-a11y-boton, .cmp-chat-boton { transition: none; }
}
@media print {
    .cmp-flotante, .cmp-panel, .cmp-aviso, .cmp-chat-invitacion, .cmp-guia { display: none !important; }
}
