/*
Theme Name: Montearagón Blocks
Theme URI: https://montearagoncanalizaciones.es/
Author: Montearagón Canalizaciones
Description: Tema de bloques accesible y ligero para Montearagón Canalizaciones.
Version: 0.1.0
Requires at least: 6.7
Requires PHP: 8.3
Text Domain: montearagon-blocks
*/

:root {
    color-scheme: light;
}

html {
    scroll-behavior: smooth;
}

body {
    text-wrap: pretty;
}

a {
    text-underline-offset: 0.18em;
    text-decoration-thickness: 0.08em;
}

:where(a, button, input, textarea, select, summary):focus-visible {
    outline: 3px solid var(--wp--preset--color--white);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px var(--wp--preset--color--deep-navy);
}

.wp-site-blocks {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

.site-header {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--white) 16%, transparent);
}

.site-header .wp-block-site-title a,
.site-footer a {
    text-decoration: none;
}

.site-footer a:not(.wp-block-button__link) {
    color: var(--wp--preset--color--white);
}

.site-header .wp-block-navigation-item__content {
    padding-block: 0.75rem;
}

.hero-home {
    overflow: hidden;
    position: relative;
}

.hero-home::after {
    content: "";
    position: absolute;
    inset: auto -8rem -12rem auto;
    width: 28rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: color-mix(in srgb, var(--wp--preset--color--brand-green) 28%, transparent);
    filter: blur(2px);
    pointer-events: none;
}

.hero-home > .wp-block-group {
    position: relative;
    z-index: 1;
}

.hero-work-image img {
    display: block;
    width: 100%;
    max-height: 34rem;
    object-fit: cover;
    object-position: center 58%;
    border-radius: 0.35rem;
}

.eyebrow {
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
}

.service-card {
    height: 100%;
    border-top: 4px solid var(--wp--preset--color--brand-green);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 1rem 2.5rem rgb(8 20 32 / 10%);
}

.service-card a::after {
    content: " →";
}

.site-footer {
    margin-block-start: 0;
}

.montearagon-project-details {
    padding: var(--wp--preset--spacing--40);
    background: var(--wp--preset--color--mist);
    border-left: 4px solid var(--wp--preset--color--brand-green);
}

.montearagon-project-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: var(--wp--preset--spacing--30);
    margin: 0;
}

.montearagon-project-facts dt {
    color: var(--wp--preset--color--muted);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
    text-transform: uppercase;
}

.montearagon-project-facts dd {
    margin: 0.25rem 0 0;
}

@media (max-width: 781px) {
    .site-header .wp-block-buttons {
        display: none;
    }

    .hero-home {
        min-height: auto !important;
    }

    .hero-home h1 {
        font-size: clamp(2.3rem, 12vw, 3.6rem) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =========================================================
   MONTEARAGON 2026 - RETICULA HERO
   ========================================================= */

.hero-home .wp-block-cover__inner-container > .wp-block-group.alignwide {
	width: calc(100% - 4rem);
	max-width: var(--wp--style--global--wide-size);
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

/* Evita que el padding del Cover duplique el margen */
.hero-home {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Móvil */
@media (max-width: 782px) {
	.hero-home .wp-block-cover__inner-container > .wp-block-group.alignwide {
		width: calc(100% - 2rem);
	}
}

/* Elimina la separación blanca entre cabecera y hero */
.site-header {
	margin-bottom: 0 !important;
}

.site-main {
	margin-top: 0 !important;
}

.hero-home {
	margin-top: 0 !important;
}
/* =========================================================
   MONTEARAGON 2026 - HERO ALTURA RESPONSIVE
   ========================================================= */

@media (min-width: 783px) {
	.hero-home {
		min-height: calc(100dvh - 150px) !important;
	}
}
/* =========================================================
   MONTEARAGON 2026 - TYPEWRITER H1
   El H1 original mantiene siempre su espacio.
   ========================================================= */

.hero-title-stage {
	position: relative;
}

/* El H1 real sigue ocupando su sitio */
.hero-title-stage .hero-title {
	margin: 0;
}

/* Mientras escribe la copia, ocultamos visualmente el original */
.hero-title-stage.is-typing .hero-title {
	visibility: hidden;
}

/* Copia animada exactamente encima del H1 real */
.hero-title-typewriter {
	position: absolute;
	inset: 0;
	margin: 0;
	color: #fff;
	pointer-events: none;
}

/* Cursor de máquina de escribir */
.hero-title-typewriter::after {
	content: "";
	display: inline-block;
	width: 3px;
	height: 0.82em;
	margin-left: 0.08em;
	background: currentColor;
	vertical-align: -0.05em;
	animation: montearagonCursor 0.7s steps(1) infinite;
}

@keyframes montearagonCursor {
	50% {
		opacity: 0;
	}
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
	.hero-title-stage.is-typing .hero-title {
		visibility: visible;
	}

	.hero-title-typewriter {
		display: none;
	}
}
/* =========================================================
   MONTEARAGON 2026 - INDICADOR SCROLL
   ========================================================= */

.hero-scroll-indicator {
	position: absolute;
	left: 50%;
	bottom: 22px;
	z-index: 10;

	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;

	color: #fff;
	text-decoration: none;
	opacity: 0.9;

	transform: translateX(-50%);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.hero-scroll-indicator:hover {
	opacity: 1;
	transform: translateX(-50%) translateY(3px);
}

.hero-scroll-mouse {
	position: relative;
	display: block;
	width: 27px;
	height: 42px;
	border: 2px solid currentColor;
	border-radius: 18px;
}

.hero-scroll-dot {
	position: absolute;
	top: 8px;
	left: 50%;
	width: 4px;
	height: 7px;
	border-radius: 4px;
	background: currentColor;
	transform: translateX(-50%);
	animation: montearagonScrollDot 1.7s ease-in-out infinite;
}

.hero-scroll-arrow {
	display: block;
	width: 10px;
	height: 10px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

@keyframes montearagonScrollDot {
	0% {
		opacity: 0;
		transform: translate(-50%, 0);
	}

	25% {
		opacity: 1;
	}

	100% {
		opacity: 0;
		transform: translate(-50%, 14px);
	}
}

@media (max-width: 782px) {
	.hero-scroll-indicator {
		bottom: 14px;
		transform: translateX(-50%) scale(0.9);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero-scroll-dot {
		animation: none;
	}
}