/* ==========================================================================
   Modo oscuro
   Se activa con <html data-theme="dark"> (botón de la cabecera).
   Mantiene los colores corporativos: fondos azul marino muy oscuro,
   acentos en verde claro y botones en verde oscuro.
   ========================================================================== */

html[data-theme="dark"] {
	--sico-dark-bg: #0E1A20;
	--sico-dark-surface: #14232B;
	--sico-dark-surface-2: #1A2C35;
	--sico-dark-border: #2A3D46;
	--sico-dark-text: #DCE5E0;
	--sico-dark-muted: #A3B2AB;
	--sico-dark-heading: #F3F6F4;
	--sico-dark-green: #9DC09A;
	color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .site,
html[data-theme="dark"] .site-content,
html[data-theme="dark"] .inside-article {
	background-color: var(--sico-dark-bg);
	color: var(--sico-dark-text);
}

/* Solo enlaces sin estilo propio (especificidad mínima) */
:where(html[data-theme="dark"]) a {
	color: var(--sico-accent);
}

/* ---------- Cabecera ---------- */
html[data-theme="dark"] .sico-header {
	background-color: var(--sico-dark-bg);
	border-bottom-color: var(--sico-dark-border);
}

html[data-theme="dark"] .sico-nav__list > li > a {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-nav__list > li > a:hover,
html[data-theme="dark"] .sico-nav__list > li.current-menu-item > a,
html[data-theme="dark"] .sico-nav__list > li > a[aria-current="page"] {
	color: var(--sico-accent);
}

html[data-theme="dark"] .sico-nav__list > li > a::after {
	background-color: var(--sico-accent);
}

html[data-theme="dark"] .sico-theme-toggle {
	border-color: var(--sico-dark-border);
	color: var(--sico-accent);
}

html[data-theme="dark"] .sico-theme-toggle:hover,
html[data-theme="dark"] .sico-theme-toggle:focus {
	border-color: var(--sico-accent);
	background-color: var(--sico-accent);
	color: var(--sico-primary);
}

html[data-theme="dark"] .sico-header-btn:hover,
html[data-theme="dark"] .sico-header-btn:focus-visible {
	background-color: var(--sico-accent);
	color: var(--sico-primary);
}

html[data-theme="dark"] .sico-nav__toggle {
	color: var(--sico-accent);
}

html[data-theme="dark"] .sico-header__menu {
	background-color: var(--sico-dark-bg);
	border-top-color: var(--sico-dark-border);
}

html[data-theme="dark"] .sico-nav__list > li > a {
	border-bottom-color: var(--sico-dark-border);
}

html[data-theme="dark"] .sico-header__menu-phone {
	color: var(--sico-dark-text);
}

@media (max-width: 1024px) {
	html[data-theme="dark"] .sico-nav__toggle:hover,
	html[data-theme="dark"] .sico-nav__toggle:focus {
		background-color: var(--sico-dark-surface-2);
		color: var(--sico-accent);
	}

	html[data-theme="dark"] .sico-header.is-open .sico-nav__toggle {
		background-color: var(--sico-accent);
		color: var(--sico-primary);
	}
}

/* ---------- Textos generales de secciones ---------- */
html[data-theme="dark"] .entry-content .sico-eyebrow,
html[data-theme="dark"] .entry-content .sico-services__eyebrow,
html[data-theme="dark"] .entry-content .sico-projects__eyebrow,
html[data-theme="dark"] .entry-content .sico-reviews__eyebrow,
html[data-theme="dark"] .entry-content .sico-contact__eyebrow {
	color: var(--sico-dark-green);
}

html[data-theme="dark"] .entry-content .sico-about__title,
html[data-theme="dark"] .entry-content .sico-services__title,
html[data-theme="dark"] .entry-content .sico-projects__title,
html[data-theme="dark"] .entry-content .sico-247__title,
html[data-theme="dark"] .entry-content .sico-247__eyebrow,
html[data-theme="dark"] .entry-content .sico-reviews__title,
html[data-theme="dark"] .entry-content .sico-contact__title,
html[data-theme="dark"] .entry-content .sico-contact__form-title,
html[data-theme="dark"] .entry-content .sico-stat__number,
html[data-theme="dark"] .entry-content .sico-card__title {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .sico-about__text,
html[data-theme="dark"] .sico-about--bg .sico-about__text,
html[data-theme="dark"] .sico-checklist li,
html[data-theme="dark"] .sico-card__text,
html[data-theme="dark"] .sico-stat__label,
html[data-theme="dark"] .sico-contact__list li {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-checklist li::before,
html[data-theme="dark"] .sico-stat .sico-icon,
html[data-theme="dark"] .sico-contact__list li::before {
	background-color: var(--sico-dark-green);
}

html[data-theme="dark"] .sico-247__title mark,
html[data-theme="dark"] .entry-content mark.has-green-dark-color {
	color: var(--sico-accent);
}

/* ---------- Ventajas (tarjetas) ---------- */
html[data-theme="dark"] .sico-features__item {
	background-color: var(--sico-dark-surface-2);
	box-shadow: 0 0 0 1px var(--sico-dark-border), 0 18px 40px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .sico-features__item:first-child {
	background-color: var(--sico-green-dark);
}

html[data-theme="dark"] .entry-content .sico-features__title {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .entry-content .sico-features__text {
	color: var(--sico-dark-text);
}

/* ---------- Secciones con fondo gris claro ---------- */
html[data-theme="dark"] .sico-services,
html[data-theme="dark"] .sico-reviews {
	background-color: var(--sico-dark-surface);
}

html[data-theme="dark"] .sico-247 {
	background-color: var(--sico-dark-surface-2);
}

html[data-theme="dark"] .sico-card {
	border-color: var(--sico-dark-border);
}

/* Iconos de las tarjetas: negros en claro, blancos en oscuro */
html[data-theme="dark"] .sico-card__icon img {
	filter: brightness(0) invert(1) opacity(.85);
}

html[data-theme="dark"] .sico-team__icon {
	color: var(--sico-dark-muted);
}

/* ---------- Opiniones ---------- */
html[data-theme="dark"] .sico-reviews__score {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .sico-reviews__score::after,
html[data-theme="dark"] .sico-reviews__count,
html[data-theme="dark"] .sico-review__source {
	color: var(--sico-dark-muted);
}

html[data-theme="dark"] .sico-reviews__link a,
html[data-theme="dark"] .sico-review__more {
	color: var(--sico-accent);
}

html[data-theme="dark"] .entry-content .sico-review {
	border-color: var(--sico-dark-border);
	background-color: var(--sico-dark-surface-2);
}

html[data-theme="dark"] .sico-review__text {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-review__name {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .sico-review:nth-child(5n+2) .sico-review__avatar {
	background-color: #2B5D7A;
}

html[data-theme="dark"] .sico-reviews__arrow {
	border-color: var(--sico-dark-border);
	background-color: transparent;
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-reviews__arrow:not(:disabled):hover,
html[data-theme="dark"] .sico-reviews__arrow:focus-visible {
	border-color: var(--sico-accent);
	background-color: var(--sico-accent);
	color: var(--sico-primary);
}

html[data-theme="dark"] .sico-reviews__dot {
	background-color: var(--sico-dark-border);
}

html[data-theme="dark"] .sico-reviews__dot.is-active {
	background-color: var(--sico-accent);
}

@media (max-width: 767px) {
	html[data-theme="dark"] .sico-reviews__rating {
		border-color: var(--sico-dark-border);
		background-color: var(--sico-dark-surface-2);
	}
}

/* ---------- Botones de contenido (estilo B) ---------- */
html[data-theme="dark"] .entry-content .sico-btn .wp-block-button__link:hover,
html[data-theme="dark"] .entry-content .sico-btn .wp-block-button__link:focus-visible {
	background-color: #4E7A4A;
}

/* ---------- Tarjetas de servicios (portada) ---------- */
html[data-theme="dark"] .sico-svc-card {
	background-color: var(--sico-dark-surface-2);
	box-shadow: 0 0 0 1px var(--sico-dark-border);
}

html[data-theme="dark"] .entry-content .sico-svc-card__icon {
	box-shadow: 0 0 0 4px var(--sico-dark-surface-2);
}

html[data-theme="dark"] .entry-content .sico-svc-card__title {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .entry-content .sico-svc-card__text {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-svc-card__link a {
	color: var(--sico-accent);
}

/* ---------- Reformas y mantenimiento (Servicios) ---------- */
html[data-theme="dark"] .entry-content .sico-split__title {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .entry-content .sico-split__text {
	color: var(--sico-dark-text);
}

/* ---------- Galería ---------- */
html[data-theme="dark"] .sico-gallery-filters__btn {
	border-color: var(--sico-dark-border);
	background-color: var(--sico-dark-surface);
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-gallery-filters__btn[aria-pressed="true"] {
	border-color: var(--sico-accent);
	background-color: var(--sico-accent);
	color: var(--sico-primary);
}

html[data-theme="dark"] .sico-gallery-more__count {
	color: var(--sico-dark-muted);
}

html[data-theme="dark"] .sico-gallery-more__btn {
	border-color: var(--sico-accent);
	color: var(--sico-accent);
}

html[data-theme="dark"] .sico-gallery-more__btn:hover {
	background-color: var(--sico-accent);
	color: var(--sico-primary);
}

html[data-theme="dark"] .entry-content .sico-gallery.wp-block-gallery > .wp-block-image img {
	background-color: var(--sico-dark-surface-2);
}

html[data-theme="dark"] .entry-content .sico-gallery.wp-block-gallery > .wp-block-image figcaption {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-cta-card__inner {
	box-shadow: 0 0 0 1px var(--sico-dark-border);
}

/* ---------- Contacto ---------- */
html[data-theme="dark"] .sico-contact__form {
	background-color: var(--sico-dark-surface);
	box-shadow: 0 0 0 1px var(--sico-dark-border);
}

html[data-theme="dark"] .sico-contact__form .wpcf7 input[type="text"],
html[data-theme="dark"] .sico-contact__form .wpcf7 input[type="email"],
html[data-theme="dark"] .sico-contact__form .wpcf7 input[type="tel"],
html[data-theme="dark"] .sico-contact__form .wpcf7 textarea {
	border-color: var(--sico-dark-border);
	background-color: var(--sico-dark-surface-2);
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .sico-contact__form .wpcf7 ::placeholder {
	color: var(--sico-dark-muted);
}

html[data-theme="dark"] .sico-contact__form .wpcf7-list-item label {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .entry-content .sico-contact__intro,
html[data-theme="dark"] .sico-contact__label,
html[data-theme="dark"] .entry-content .sico-contact__form-sub,
html[data-theme="dark"] .sico-cf-note,
html[data-theme="dark"] .sico-cf-consent label {
	color: var(--sico-dark-muted);
}

html[data-theme="dark"] .entry-content .sico-contact__list {
	background-color: var(--sico-dark-surface);
}

html[data-theme="dark"] .sico-contact__list li,
html[data-theme="dark"] .entry-content .sico-contact__form-title,
html[data-theme="dark"] .sico-cf-label {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .sico-contact__list li::before {
	background-color: var(--sico-dark-surface-2);
}

html[data-theme="dark"] .sico-contact__list li::after {
	background-color: var(--sico-accent);
}

html[data-theme="dark"] .sico-cf-services .wpcf7-list-item label {
	border-color: var(--sico-dark-border);
	background-color: var(--sico-dark-surface-2);
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-cf-services .wpcf7-list-item label:has(input:checked) {
	border-color: var(--sico-accent);
	background-color: var(--sico-accent);
	color: var(--sico-primary);
}

/* ---------- Páginas legales ---------- */
html[data-theme="dark"] .sico-legal__inner {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-legal__inner a {
	color: var(--sico-accent);
}

/* ---------- Pie ---------- */
html[data-theme="dark"] .sico-footer__main {
	background-color: var(--sico-dark-surface);
	border-top: 1px solid var(--sico-dark-border);
}

html[data-theme="dark"] .sico-footer__about {
	color: var(--sico-dark-muted);
}

html[data-theme="dark"] .sico-footer__title {
	color: var(--sico-dark-green);
}

html[data-theme="dark"] .sico-footer__menu a,
html[data-theme="dark"] .sico-footer__social {
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-footer__menu a:hover,
html[data-theme="dark"] .sico-footer__menu a:focus-visible,
html[data-theme="dark"] .sico-footer__menu .current-menu-item > a,
html[data-theme="dark"] .sico-footer__social:hover {
	color: var(--sico-accent);
}

html[data-theme="dark"] .sico-footer__card {
	box-shadow: 0 0 0 1px rgba(195, 226, 192, .12);
}

html[data-theme="dark"] .sico-footer a:focus-visible {
	outline-color: var(--sico-accent);
}

html[data-theme="dark"] .sico-footer__bar {
	background-color: #0A1318;
	border-top-color: var(--sico-dark-border);
}

html[data-theme="dark"] .sico-footer__bar p {
	color: var(--sico-dark-muted);
}

/* Transición suave al cambiar de modo (sin afectar a animaciones propias) */
html[data-theme] body,
html[data-theme] .sico-header,
html[data-theme] .sico-footer__main,
html[data-theme] .sico-footer__bar {
	transition: background-color .3s ease, color .3s ease;
}

/* Subtítulos verdes también en oscuro (tipografía unificada) */
html[data-theme="dark"] .entry-content .sico-247__eyebrow,
html[data-theme="dark"] .entry-content .sico-projects__eyebrow {
	color: var(--sico-dark-green);
}

html[data-theme="dark"] .entry-content .sico-247__title mark {
	color: var(--sico-accent);
}

/* Servicio eléctrico 24/7 */
html[data-theme="dark"] .sico-urgencias {
	background-color: var(--sico-dark-bg);
}

html[data-theme="dark"] .entry-content .sico-urgencias__title,
html[data-theme="dark"] .entry-content .sico-urgencias__step-title {
	color: var(--sico-dark-heading);
}

html[data-theme="dark"] .entry-content .sico-urgencias__eyebrow {
	color: var(--sico-dark-green);
}

html[data-theme="dark"] .entry-content .sico-urgencias__text,
html[data-theme="dark"] .entry-content .sico-urgencias__step-text {
	color: var(--sico-dark-muted);
}

html[data-theme="dark"] .entry-content .sico-urgencias__tags li {
	border-color: var(--sico-dark-border);
	background-color: var(--sico-dark-surface);
	color: var(--sico-dark-text);
}

html[data-theme="dark"] .sico-urgencias__step {
	background-color: var(--sico-dark-surface);
	box-shadow: none;
}

html[data-theme="dark"] .sico-urgencias__bar {
	background-color: var(--sico-dark-surface-2);
	border: 1px solid var(--sico-dark-border);
}
