/*
Theme Name: Gob Moderno
Theme URI: https://github.com/digitalgobcl
Description: Tema de bloques para sitios de instituciones públicas de Chile, basado en los colores y tipografías del framework gob.cl 3.x. Edición completa del sitio con el editor de bloques, sin jQuery ni Bootstrap, accesible (WCAG 2.2 AA) y escrito para PHP 8.3 a 8.6.
Author: Gob Moderno
Version: 1.1.0
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gob-moderno
Tags: block-patterns, full-site-editing, accessibility-ready, custom-colors, editor-style, wide-blocks, one-column, translation-ready
*/

/* Los estilos principales viven en theme.json. Aquí solo ajustes que theme.json no cubre. */

/* Barra institucional azul/rojo característica de gob.cl */
.gob-barra {
	display: flex;
	height: 6px;
	width: 100%;
}
.gob-barra::before,
.gob-barra::after {
	content: "";
	display: block;
	height: 100%;
}
.gob-barra::before { background: var(--wp--preset--color--primario); flex: 0 0 38%; }
.gob-barra::after  { background: var(--wp--preset--color--secundario); flex: 1 1 auto; }

/* Enlace para saltar al contenido */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--primario);
	z-index: 100000;
}

/* Foco visible para navegación con teclado */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--foco);
	outline-offset: 2px;
}

/* Tarjetas */
.gob-tarjeta {
	transition: box-shadow .2s ease, transform .2s ease;
}
.gob-tarjeta:hover {
	box-shadow: 0 6px 20px rgb(0 28 65 / .12);
	transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
	.gob-tarjeta, .gob-tarjeta:hover { transition: none; transform: none; }
}

/* Aviso de alerta */
.gob-alerta {
	border-left: 6px solid var(--wp--preset--color--secundario);
}

.gob-lista-simple { list-style: none; }
.gob-lista-simple li + li { margin-top: .4rem; }

/* Cabecera con imagen */
.gob-cabecera-marca .wp-block-site-logo img { filter: drop-shadow(0 2px 6px rgb(0 0 0 / .25)); }
.gob-cabecera-marca .wp-block-site-title { text-shadow: 0 2px 8px rgb(0 0 0 / .35); }
.gob-barra-menu .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--terciario); text-decoration: underline; }
.gob-barra-menu .wp-block-navigation__submenu-container { border: 1px solid var(--wp--preset--color--borde) !important; box-shadow: var(--wp--custom--sombra); }

/* Barra lateral */
.gob-lateral > * { width: 100%; }
.gob-red-social { align-items: center; }
.gob-red-social p { margin: 0; }
.gob-red-social a { text-decoration: none; color: var(--wp--preset--color--terciario); }
.gob-red-social a:hover { text-decoration: underline; }
.gob-banner { margin: 0; }
.gob-banner img { display: block; width: 100%; height: auto; box-shadow: var(--wp--custom--sombra); transition: transform .2s ease; }
.gob-banner a:hover img { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .gob-banner a:hover img { transform: none; } }

/* Menú de accesibilidad */
.gob-a11y { position: fixed; left: 0; top: 120px; z-index: 9999; font-family: var(--wp--preset--font-family--roboto); }
.gob-a11y-boton { display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 0 6px 6px 0; background: var(--wp--preset--color--primario); color: #fff; cursor: pointer; box-shadow: var(--wp--custom--sombra); }
.gob-a11y-boton:hover { background: var(--wp--preset--color--terciario); }
.gob-a11y-panel { position: absolute; left: 0; top: 58px; width: 240px; padding: .75rem; background: #fff; border: 1px solid var(--wp--preset--color--borde); border-radius: 0 6px 6px 0; box-shadow: 0 8px 24px rgb(0 28 65 / .18); display: grid; gap: .35rem; }
.gob-a11y-panel[hidden] { display: none; }
.gob-a11y-titulo { margin: 0 0 .25rem; font-weight: 700; color: var(--wp--preset--color--terciario); }
.gob-a11y-panel button { text-align: left; padding: .5rem .75rem; border: 1px solid var(--wp--preset--color--borde); border-radius: 6px; background: #fff; color: var(--wp--preset--color--texto); font: inherit; font-size: .9375rem; cursor: pointer; }
.gob-a11y-panel button:hover { background: var(--wp--preset--color--celeste); }
.gob-a11y-panel button[aria-pressed="true"] { background: var(--wp--preset--color--primario); border-color: var(--wp--preset--color--primario); color: #fff; }
.gob-a11y-panel .gob-a11y-restablecer { color: var(--wp--preset--color--secundario); }

html.gob-a11y-contraste body { background: #000 !important; color: #fff !important; }
html.gob-a11y-contraste body :where(*:not(img, svg, video, .gob-a11y *)) { background-color: #000 !important; color: #fff !important; border-color: #fff !important; }
html.gob-a11y-contraste body a, html.gob-a11y-contraste body a * { color: #ffeb3b !important; }
html.gob-a11y-contraste .wp-block-cover__background { opacity: .85 !important; }
html.gob-a11y-grises body > *:not(.gob-a11y) { filter: grayscale(1); }
html.gob-a11y-enlaces a { text-decoration: underline !important; text-underline-offset: 3px; }
html.gob-a11y-legible body, html.gob-a11y-legible body :where(h1, h2, h3, h4, h5, h6, p, li, a, button, input) { font-family: Verdana, Arial, sans-serif !important; letter-spacing: .02em; }
html.gob-a11y-quieto *, html.gob-a11y-quieto *::before, html.gob-a11y-quieto *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media print { .gob-a11y { display: none; } }

.screen-reader-text { border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }
