/*
Theme Name:        Qubotech Block
Theme URI:         https://www.qubotech.pe
Author:            Glob Digital
Author URI:        https://www.globdigital.com.pe
Description:       Tema de bloques (Full Site Editing) a medida para Qubo Technologies. Reemplaza al tema legacy "qubotech" (framework Elos + OptionTree + Visual Composer) conservando los CPT portfolio y kwlogos, sus taxonomías y meta keys. Compatible con Master Slider.
Version:           1.0.0
Requires at least: 6.5
Tested up to:      6.6
Requires PHP:      8.1
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       qubotech
Tags:              full-site-editing, block-patterns, block-styles, custom-colors, editor-style, wide-blocks
*/

/* ==========================================================================
   Utilidades
   ========================================================================== */
.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;
}
.screen-reader-text:focus {
	clip-path: none;
	height: auto;
	width: auto;
	z-index: 100000;
	padding: .75rem 1rem;
	background: #fff;
	color: #000;
}
img { height: auto; max-width: 100%; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }

/* ==========================================================================
   Barra superior
   ========================================================================== */
.qubo-topbar a { text-decoration: none; }
.qubo-topbar__contact { margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.qubo-topbar__contact a { display: inline-flex; align-items: center; gap: .45rem; }
.qubo-icon-phone::before,
.qubo-icon-mail::before {
	content: "";
	width: 1.4em;
	height: 1.4em;
	border-radius: 50%;
	background: rgba(255,255,255,.15) center / 60% no-repeat;
}
.qubo-icon-phone::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M6.6 10.8a15 15 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1l-2.3 2.2Z'/%3E%3C/svg%3E"); }
.qubo-icon-mail::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M2 5h20v14H2V5Zm2 2v.5l8 5 8-5V7H4Z'/%3E%3C/svg%3E"); }
.qubo-topbar .wp-block-social-links { gap: .9rem; }
.qubo-topbar .wp-block-social-links .wp-social-link svg { width: 1.5rem; height: 1.5rem; }

/* ==========================================================================
   Cabecera y navegación
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.qubo-header { box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.qubo-header .wp-block-site-logo img { max-height: 120px; width: auto; }
.qubo-nav .wp-block-navigation-item__content { color: #222; padding-block: .3rem; transition: color .2s ease; }
.qubo-nav .wp-block-navigation-item__content:hover,
.qubo-nav .current-menu-item > .wp-block-navigation-item__content,
.qubo-nav .wp-block-navigation-item__content[aria-current="page"] { color: var(--wp--preset--color--primary); }
.qubo-nav .wp-block-navigation__submenu-container { border: 0 !important; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: .95rem; }

/* Iconos de menú: añade la clase "menu-icon-home" o "menu-icon-mail" al enlace en el editor */
.qubo-nav .menu-icon-home > .wp-block-navigation-item__content::before,
.qubo-nav .menu-icon-mail > .wp-block-navigation-item__content::before {
	content: "";
	display: inline-block;
	width: 1.05em;
	height: 1.05em;
	margin-right: .5em;
	vertical-align: -.1em;
	background: var(--wp--preset--color--primary);
	-webkit-mask: var(--qubo-icon) center / contain no-repeat;
	mask: var(--qubo-icon) center / contain no-repeat;
}
.qubo-nav .menu-icon-home { --qubo-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 12h3v9h6v-6h2v6h6v-9h3L12 3Z'/%3E%3C/svg%3E"); }
.qubo-nav .menu-icon-mail { --qubo-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 5h20v14H2V5Zm2 2v.5l8 5 8-5V7H4Z'/%3E%3C/svg%3E"); }

/* ==========================================================================
   Barra de título (qubo/title-bar)
   ========================================================================== */
.qubo-titlebar {
	position: relative;
	color: var(--qubo-titlebar-subtitle, #fff);
	background: var(--wp--preset--color--night) var(--qubo-titlebar-bg) center / cover no-repeat;
	padding: 2.2rem var(--wp--style--root--padding-right, 16px) 2.2rem var(--wp--style--root--padding-left, 16px);
}
.qubo-titlebar__inner { position: relative; max-width: var(--wp--style--global--content-size, 1170px); margin-inline: auto; }
.qubo-titlebar .qubo-titlebar__title {
	margin: 0;
	color: var(--qubo-titlebar-title, #fff);
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(2.25rem, 4.5vw, 3.25rem);
	font-weight: 300;
	letter-spacing: -.01em;
	line-height: 1.15;
}
.qubo-titlebar__subtitle { margin: .5rem 0 0; font-size: 1.1rem; }
.qubo-breadcrumbs { margin-top: .4rem; font-size: .95rem; color: var(--qubo-titlebar-crumbs, #fff); }
.qubo-breadcrumbs a { color: var(--qubo-titlebar-crumbs, #9aa3ad); text-decoration: none; }
.qubo-breadcrumbs a:hover { color: var(--qubo-titlebar-crumbs-hover, #fff); }
.qubo-breadcrumbs__sep { margin: 0 .35rem; opacity: .6; }

.qubo-titlebar.is-variant-modern { padding-block: 3.5rem 4.25rem; text-align: center; }
.qubo-titlebar.is-variant-modern .qubo-titlebar__title { display: inline-block; padding: 0 1rem 1.4rem; border-bottom: 2px solid var(--wp--preset--color--accent); font-size: clamp(2.5rem, 5vw, 4rem); }
.qubo-titlebar__nav { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; gap: .5rem; }
.qubo-titlebar__nav a,
.qubo-titlebar__nav span { color: var(--wp--preset--color--accent); font-size: 3.5rem; line-height: 1; text-decoration: none; transition: transform .2s ease; }
.qubo-titlebar__nav a:hover { transform: scale(1.15); }
.qubo-titlebar__nav .is-disabled { opacity: .3; }
@media (max-width: 700px) {
	.qubo-titlebar__nav { position: static; transform: none; justify-content: center; margin-bottom: .5rem; }
}

/* ==========================================================================
   Contenido
   ========================================================================== */
.wp-block-post-content a:where(:not(.wp-element-button)) { text-underline-offset: .15em; }

/* Título de sección con línea inferior */
.wp-block-heading.qubo-section-title { padding-bottom: 1rem; border-bottom: 1px solid var(--wp--preset--color--border); font-weight: 400; }
.qubo-section-title strong { font-weight: 700; }

/* Estilo de encabezado "Subrayado centrado" */
.is-style-qubo-underline { position: relative; width: fit-content; margin-inline: auto !important; padding: 0 1.5rem .6rem; border-bottom: 1px solid var(--wp--preset--color--border); }
.is-style-qubo-underline::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 12px; height: 5px; transform: translateX(-50%); background: radial-gradient(circle, #bbb 1.5px, transparent 2px) 0 0 / 4px 5px repeat-x; }
.is-style-qubo-underline strong { font-weight: 700; }

/* Iconos circulares (Misión / Visión) */
.wp-block-image.is-style-qubo-icon-circle img {
	box-sizing: border-box;
	padding: 24px;
	border: 1px solid var(--wp--preset--color--primary);
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	transition: background-color .3s ease, transform .3s ease;
}
.qubo-features .wp-block-column:hover .is-style-qubo-icon-circle img { transform: translateY(-4px); }
.qubo-features .wp-block-column:hover h3 { color: var(--wp--preset--color--primary); }
.qubo-features h3 { transition: color .3s ease; }

/* Lista "Línea de tiempo" con checks */
.is-style-qubo-timeline { position: relative; list-style: none; margin: 0; padding: 1.5rem 0 1.5rem 0; }
.is-style-qubo-timeline::before { content: ""; position: absolute; left: 27px; top: 0; bottom: 0; width: 1px; background: #222; }
.is-style-qubo-timeline::after,
.is-style-qubo-timeline > li:first-child::after { content: ""; position: absolute; left: 24px; width: 7px; height: 7px; border-radius: 50%; background: #111; }
.is-style-qubo-timeline::after { bottom: 0; }
.is-style-qubo-timeline > li:first-child::after { top: -1.5rem; }
.is-style-qubo-timeline > li { position: relative; display: flex; align-items: center; min-height: 56px; margin: 0 0 1.75rem; padding-left: 5.25rem; }
.is-style-qubo-timeline > li:last-child { margin-bottom: 0; }
.is-style-qubo-timeline > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 56px;
	height: 56px;
	transform: translateY(-50%);
	border-radius: 50%;
	background: #222 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9.5 16.6 4.9 12l-1.8 1.8 6.4 6.4L21 8.7l-1.8-1.8z'/%3E%3C/svg%3E") center / 26px no-repeat;
}

/* Hero de páginas internas */
.qubo-hero .wp-block-cover__inner-container { max-width: var(--wp--style--global--content-size); }

/* Master Slider a ancho completo */
.qubo-hero-slider { margin-block: 0 !important; }
.qubo-hero-slider .master-slider { margin: 0 auto !important; }

/* Mapa */
.qubo-map { padding: 12px; border: 1px solid var(--wp--preset--color--border); }
.qubo-map iframe { display: block; width: 100%; }

/* ==========================================================================
   Portfolio (detalle)
   ========================================================================== */
.qubo-media__img { display: block; width: 100%; height: auto; box-shadow: var(--wp--preset--shadow--card); }
.qubo-media__video { position: relative; aspect-ratio: 16 / 9; }
.qubo-media__video iframe, .qubo-media__video video { position: absolute; inset: 0; width: 100%; height: 100%; }
.qubo-media__gallery { display: flex; gap: .5rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; }
.qubo-media__slide { flex: 0 0 100%; scroll-snap-align: start; }
.qubo-media__slide img { display: block; width: 100%; height: auto; }
.qubo-portfolio-single__details h2 { margin-top: 0; font-weight: 400; }
.qubo-portfolio-single__content { font-family: var(--wp--preset--font-family--heading); font-size: clamp(1.15rem, 2vw, 1.75rem); line-height: 1.3; }
.qubo-portfolio-single__content strong, .qubo-portfolio-single__content b { font-weight: inherit; }

/* Compartir */
.qubo-share { display: flex; gap: .75rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.qubo-share__link { display: inline-flex; color: #f28b8b; transition: color .2s ease, transform .2s ease; }
.qubo-share__link:hover, .qubo-share__link:focus-visible { color: var(--wp--preset--color--accent); transform: translateY(-2px); }

/* ==========================================================================
   Pie de página
   ========================================================================== */
.qubo-footer .qubo-footer__title { margin: 0 0 1.75rem; font-size: clamp(1.4rem, 2.2vw, 1.75rem); font-weight: 400; text-transform: uppercase; }
.qubo-footer p { font-size: 1.05rem; }
.qubo-footer a { text-decoration: none; }
.qubo-copyright a { text-decoration: none; }
.qubo-copyright p { margin: 0; }
.qubo-copyright__social .wp-social-link { transition: background-color .2s ease; }
.qubo-copyright__social .wp-social-link:hover { background-color: var(--wp--preset--color--dark) !important; }

/* ==========================================================================
   Respeto por movimiento reducido
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
