/* =============================================================
   UCO Ingeniería S.A.S.
   Hoja de estilos única del sitio.
   Orden: 1 Variables · 2 Reset/base · 3 Tipografía · 4 Layout
   utilitario · 5 Header · 6 Footer · 7 Componentes · 8 Secciones
   por página · 9 Animaciones · 10 Media queries (mobile-first)
   ============================================================= */

/* ---------------------------------------------------------------
   1. VARIABLES
   --------------------------------------------------------------- */
:root {
    /* Colores de marca, medidos sobre el logo de UCO (UCO - logos/):
       rojo del nombre, gris cálido del globo y verde agua de las flechas.
       El verde agua claro (#55C2B2) no tiene contraste suficiente sobre
       blanco: se usa solo como acento sobre fondos oscuros. Para texto sobre
       fondo claro está --color-accent-dark. */
    --color-primary: #BB1D23;
    --color-primary-dark: #941318;
    --color-accent: #55C2B2;
    --color-accent-dark: #1E786C;
    --color-brand-gray: #686058;
    --color-dark: #3A3632;
    --color-darker: #24211E;
    --color-light: #EFEDEA;
    --color-white: #FFFFFF;
    --color-text: #1C1A18;
    --color-text-muted: #5C5650;
    --color-text-inverse: #F6F4F2;
    --color-border: #DAD6D1;

    /* Tipografía (sección 10) */
    --font-heading: "Archivo", "Segoe UI", Roboto, system-ui, sans-serif;
    --font-body: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
    --font-label: "Work Sans", "Segoe UI", Roboto, system-ui, sans-serif;

    /* Escala de espaciado consistente */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Otros tokens */
    --container-max: 1200px;
    --container-pad: 1.25rem;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.16);
    --header-height: 76px;
    --transition: 0.2s ease;
}

/* ---------------------------------------------------------------
   2. RESET / BASE
   --------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Al entrar por un ancla (p. ej. servicios.html#alquiler) el header fijo
       tapaba el comienzo de la sección; así la sección queda justo debajo. */
    scroll-padding-top: var(--header-height);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------------------------------------------------------------
   3. TIPOGRAFÍA GLOBAL
   --------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-text);
    text-wrap: balance;
}

/* Escala tipográfica (razón ~1.25). Un solo lugar define los tamaños para que
   los mismos elementos midan igual en todas las páginas. */
h1 {
    font-size: clamp(2.25rem, 4vw + 1.25rem, 3.75rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 2vw + 1rem, 2.375rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
    font-weight: 700;
    line-height: 1.25;
}

/* h4 solo se usa como apoyo; nunca debe verse más pequeño que el cuerpo. */
h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

p {
    max-width: 65ch;
}

/* Enlaces dentro de un párrafo (el correo en Contacto, el fabricante en
   Thermon). Sin esto heredan el color del texto y no se ven: quien lee no
   sabe que puede pulsarlos. Se marcan con subrayado, no con color, para no
   meter acentos de color en el texto; el rojo aparece solo al pasar el ratón.
   No afecta a los .btn ni a los logos enlazados, que no van dentro de <p>. */
main p a:not(.btn) {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

main p a:not(.btn):hover,
main p a:not(.btn):focus-visible {
    color: var(--color-primary);
}

/* --- Ritmo vertical -----------------------------------------------------
   El reset pone margin: 0 en todo, así que el aire entre título y texto se
   define aquí de forma explícita y uniforme en todo el sitio. */
h1+p,
h2+p,
h1+ul,
h2+ul {
    margin-top: var(--space-md);
}

h3+p,
h4+p,
h3+ul {
    margin-top: var(--space-xs);
}

p+p {
    margin-top: var(--space-md);
}

p+h2,
p+h3,
ul+h3,
p+h4 {
    margin-top: var(--space-lg);
}

strong {
    font-weight: 600;
}

/* Palabra destacada dentro de un titular: mismo peso que el titular y color
   de marca (verde agua sobre fondo oscuro, donde el rojo pierde contraste). */
h1 strong,
h2 strong {
    font-weight: inherit;
    color: var(--color-primary);
}

.section--dark h1 strong,
.section--dark h2 strong {
    color: var(--color-accent);
}

/* Eyebrow: texto pequeño de contexto sobre cada titular. Va pegado a su
   título porque ambos forman una sola unidad de lectura. */
.eyebrow {
    display: block;
    font-family: var(--font-label);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

/* ---------------------------------------------------------------
   4. LAYOUT UTILITARIO
   --------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.section {
    padding-block: var(--space-2xl);
}

.section--dark {
    background-color: var(--color-dark);
    color: var(--color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
    color: var(--color-white);
}

.section--light {
    background-color: var(--color-light);
}

.section__header {
    max-width: 60ch;
    margin-bottom: var(--space-xl);
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

/* Enlace de salto al contenido (accesibilidad, sección 21) */
.skip-link {
    position: absolute;
    left: var(--space-xs);
    top: var(--space-xs);
    z-index: 1000;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-white);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    transform: translateY(-150%);
    transition: transform var(--transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------
   5. HEADER Y NAVEGACIÓN
   --------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition);
}

.site-header.is-scrolled {
    box-shadow: var(--shadow-sm);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: var(--header-height);
}

/* El logo nunca cede espacio al menú: sin esto, a 1025px el flex lo comprimía
   y quedaba deformado (82×64 en vez de 113×64). */
.site-header__brand {
    flex-shrink: 0;
}

/* imagenes/marca/logo_uco_horizontal.png es el logo de UCO con el globo a la
   izquierda y el nombre a la derecha (el apilado original dejaba el nombre
   ilegible a esta altura). Viene sin margen transparente. */
.site-header__brand img {
    height: 44px;
    width: auto;
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

.nav-toggle:hover {
    background-color: var(--color-light);
}

.nav-toggle svg {
    width: 26px;
    height: 26px;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-open {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

/* Panel de navegación — móvil primero: oculto y desplegable */
.primary-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: var(--space-md) var(--container-pad) var(--space-lg);
    display: none;
}

.primary-nav.is-open {
    display: block;
}

.primary-nav__list {
    display: flex;
    flex-direction: column;
}

.primary-nav__list a {
    display: block;
    padding: var(--space-sm) 0;
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
    transition: color var(--transition);
}

.primary-nav__list a:hover,
.primary-nav__list a[aria-current="page"] {
    color: var(--color-primary);
}

.primary-nav__social {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.primary-nav__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--color-dark);
    transition: color var(--transition), background-color var(--transition);
}

.primary-nav__social a:hover {
    color: var(--color-white);
    background-color: var(--color-primary);
}

.primary-nav__social svg {
    width: 20px;
    height: 20px;
}

/* ---------------------------------------------------------------
   6. FOOTER
   --------------------------------------------------------------- */
.site-footer {
    background-color: var(--color-darker);
    color: var(--color-text-inverse);
}

.site-footer__inner {
    display: grid;
    gap: var(--space-xl);
    padding-block: var(--space-2xl);
}

/* El logo trae texto rojo y globo gris, poco legibles sobre el pie oscuro:
   se apoya en una placa blanca. */
.site-footer__brand img {
    height: 112px;
    width: auto;
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-sizing: content-box;
}

.site-footer__brand p {
    color: var(--color-text-inverse);
    opacity: 0.8;
}

.site-footer__title {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: var(--space-md);
}

.site-footer__col a,
.site-footer__col li {
    display: block;
    /* El correo (administracion@ucoingenieriasas.com) es largo: se parte
       antes que desbordar la columna en pantallas angostas. */
    overflow-wrap: anywhere;
    padding-block: var(--space-2xs);
    color: var(--color-text-inverse);
    opacity: 0.8;
    transition: opacity var(--transition), color var(--transition);
}

.site-footer__col a:hover {
    opacity: 1;
    color: var(--color-accent);
}

.site-footer__bar {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-block: var(--space-md);
    font-size: 0.85rem;
}

.site-footer__bar .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.site-footer__bar p {
    opacity: 0.7;
    max-width: none;
}

/* La regla global p+p (ritmo vertical) desalineaba la segunda línea de la
   barra: aquí los párrafos van en fila y el espacio lo da el gap del flex. */
.site-footer__bar p+p {
    margin-top: 0;
}

/* ---------------------------------------------------------------
   7. COMPONENTES REUTILIZABLES
   --------------------------------------------------------------- */

/* --- Botones (sección 11) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.8rem 1.6rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: background-color var(--transition), color var(--transition),
        border-color var(--transition), transform var(--transition);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-dark);
}

.btn-secondary:hover {
    background-color: var(--color-dark);
    color: var(--color-white);
}

/* Variantes sobre fondo oscuro */
.section--dark .btn-secondary,
.on-dark .btn-secondary {
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.5);
}

.section--dark .btn-secondary:hover,
.on-dark .btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-white);
}

/* --- Tarjetas (sección 12) --- */
/* Sin gap uniforme: el icono se separa más, y el título queda pegado a su
   texto porque juntos forman una unidad. */
.card {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card__icon {
    align-self: flex-start;
    margin-bottom: var(--space-md);
}

.card h3 {
    margin-bottom: var(--space-xs);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background-color: var(--color-light);
    color: var(--color-primary);
    transition: background-color var(--transition), color var(--transition);
}

.card:hover .card__icon {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.card__icon svg {
    width: 26px;
    height: 26px;
}

.card p {
    color: var(--color-text-muted);
    margin: 0;
}

/* --- Badge / sello (p. ej. "25 años") --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-2xs) var(--space-sm);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-primary);
    background-color: rgba(187, 29, 35, 0.1);
    border-radius: 999px;
}

.badge img {
    height: 40px;
    width: auto;
}

/* --- Fila de CTAs --- */
.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.cta-row--center {
    justify-content: center;
}

/* Tras una rejilla de tarjetas, los 24px de arriba igualaban el hueco entre
   tarjetas, y el botón se leía como una tarjeta más de la rejilla en vez de
   como la acción de toda la sección. Con más aire se separa como bloque.
   (Tras un párrafo se quedan los 24px: ahí el botón sí acompaña a su texto.) */
.services-grid + .cta-row,
.principles__grid + .cta-row {
    margin-top: var(--space-xl);
}

/* ---------------------------------------------------------------
   8. SECCIONES ESPECÍFICAS POR PÁGINA
   (se irán agregando al construir cada página — sección 24)
   --------------------------------------------------------------- */

/* --- Inicio: Hero --- */
.hero-home {
    padding-block: var(--space-2xl);
}

.hero-home__grid {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
}

/* Foto del hero: montaje de un recipiente con grúa (1600×1200, 4:3). */
.hero-home__media img {
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}

.hero-home__text h1 {
    margin-bottom: var(--space-md);
}

.hero-home__text p {
    color: var(--color-text-inverse);
    opacity: 0.85;
    margin-bottom: var(--space-lg);
}

/* --- Inicio: Estadísticas --- */
.stats {
    text-align: center;
}

.stats__header {
    max-width: 60ch;
    margin-inline: auto;
    margin-bottom: var(--space-2xl);
}

.stats__grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: 1fr;
}

.stats__item .stats__number {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--color-primary);
    line-height: 1;
}

.stats__item p {
    margin-top: var(--space-xs);
    color: var(--color-text-muted);
    font-weight: 600;
}

/* --- Inicio: Especialidades (foto de fondo + tarjetas) --- */
.specialties {
    position: relative;
    color: var(--color-white);
    isolation: isolate;
}

.specialties__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.specialties::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(29, 30, 32, 0.88) 0%, rgba(29, 30, 32, 0.94) 100%);
}

.specialties__header {
    max-width: 60ch;
    margin-bottom: var(--space-xl);
}

.specialties__header h2 {
    color: var(--color-white);
}

.specialties__header p {
    color: var(--color-text-inverse);
    opacity: 0.85;
}

.specialties__grid {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.specialties .card {
    background-color: rgba(255, 255, 255, 0.96);
}

/* --- Eyebrow sobre fondos oscuros ---
   El rojo de marca no alcanza contraste suficiente sobre el gris oscuro;
   ahí el eyebrow toma el verde agua de las flechas del logo. */
.section--dark .eyebrow,
.specialties .eyebrow,
.pillars .eyebrow {
    color: var(--color-accent);
}

/* --- Tarjeta de servicio con foto (Inicio y Servicios) ---
   Las fotos salen del brochure y miden ~200 px: por eso la rejilla de
   Servicios usa 4 columnas en escritorio, para no estirarlas de más. */
.service-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.service-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: var(--color-light);
    border-bottom: 3px solid var(--color-accent);
}

/* Posición absoluta: sin ella, una foto más alta que 4:3 estiraba la caja y
   las tarjetas de una misma fila quedaban desiguales. */
.service-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Servicio sin foto propia: un panel con icono en lugar de una imagen
   prestada. */
.service-card__media--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.service-card__media--icon svg {
    width: 64px;
    height: 64px;
}

.service-card__body {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.service-card__body h3 {
    font-size: 1.0625rem;
    line-height: 1.3;
}

.service-card__body p {
    margin-top: var(--space-xs);
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* --- Inicio: Resumen de la política HSEQ --- */
.hseq-summary__grid {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
}

.hseq-summary__text p {
    color: var(--color-text-inverse);
    opacity: 0.85;
}

.hseq-summary__text .cta-row {
    margin-top: var(--space-lg);
}

.hseq-summary__list {
    display: grid;
    gap: var(--space-sm);
}

.hseq-summary__list li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* --- Nosotros: hitos (2002 / 2018) --- */
.milestones {
    display: grid;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.milestone {
    padding: var(--space-md) var(--space-lg);
    background-color: var(--color-light);
    border-radius: var(--radius-md);
    border-top: 3px solid var(--color-primary);
}

.milestone__year {
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--color-primary);
}

.milestone p {
    margin-top: var(--space-xs);
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* --- Política HSEQ: certificados ISO (mismo diseño que la plantilla) ---
   auto-fit: tres por fila cuando caben, y en tablet no deja una tarjeta
   huérfana como haría una rejilla fija de dos columnas. */
.certs-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cert-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.cert-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.cert-card__thumb {
    display: block;
    background-color: var(--color-light);
    padding: var(--space-md);
}

.cert-card__thumb img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    object-position: top;
}

.cert-card__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: var(--space-lg);
}

.cert-card__body h3 {
    margin-bottom: 0;
}

.cert-card__body .cert-card__name {
    margin-top: 0.15rem;
    font-family: var(--font-label);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
}

.cert-card__body p {
    color: var(--color-text-muted);
}

.cert-card__body p + p {
    margin-top: var(--space-xs);
}

.cert-card__meta {
    font-size: 0.85rem;
}

.cert-card__note {
    display: inline-block;
    margin-top: auto;
    padding-top: var(--space-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
}

.cert-card__note:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* --- Política HSEQ: principios y firma --- */
.principles__grid {
    display: grid;
    gap: var(--space-lg);
}

.policy-intro {
    font-size: 1.0625rem;
}

.signature {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.signature__name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
}

.signature__role {
    color: var(--color-text-muted);
    margin-top: 0;
}

/* --- Dato pendiente ---
   Marca visible para los datos que el brochure no trae. Se busca en el
   código por "[PENDIENTE" y se reemplaza por el dato real. */
.pending {
    display: inline-block;
    padding: 0.1em 0.5em;
    font-family: var(--font-label);
    font-size: 0.9em;
    font-weight: 600;
    color: #5C4400;
    background-color: #FFE9A8;
    border: 1px dashed #B88A00;
    border-radius: var(--radius-sm);
}

/* Botón bajo las cifras de Inicio. */
.stats__grid + .cta-row {
    margin-top: var(--space-2xl);
}

/* --- Hero con foto de fondo (Experiencia) --- */
.page-hero--photo {
    position: relative;
    isolation: isolate;
}

.page-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-hero--photo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(36, 33, 30, 0.82) 0%, rgba(36, 33, 30, 0.92) 100%);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    color: var(--color-text-inverse);
    opacity: 0.85;
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

/* --- Experiencia: filtros, tarjetas y ventana de detalle ---
   Filtros en píldora, tarjeta con caja gris de datos y botón rojo de ancho
   completo, y una ventana con encabezado oscuro. */
.projects-intro {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.projects-intro p {
    margin-inline: auto;
    color: var(--color-text-muted);
}

.projects-intro::before,
.projects-intro::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin: 0 auto var(--space-md);
    background-color: var(--color-primary);
}

.projects-intro::after {
    margin: var(--space-md) auto 0;
}

.projects-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.filter-btn span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.is-active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.filter-btn.is-active span {
    color: rgba(255, 255, 255, 0.85);
}

.projects__grid {
    display: grid;
    gap: var(--space-lg);
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    border-left: 4px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card[hidden] {
    display: none;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--color-primary);
}

.project-card__title {
    font-size: 1.125rem;
    line-height: 1.3;
    margin-bottom: var(--space-md);
}

.project-card__details {
    display: grid;
    gap: var(--space-sm);
    padding: var(--space-md);
    margin-top: auto;
    margin-bottom: var(--space-md);
    background-color: var(--color-light);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.project-card__details li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    color: var(--color-text);
}

.project-card__details svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 0.2em;
    color: var(--color-primary);
}

.project-card__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-weight: 600;
    color: var(--color-white);
    background-color: var(--color-primary);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition);
}

.project-card__btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition);
}

.project-card__btn:hover {
    background-color: var(--color-primary-dark);
}

.project-card__btn:hover svg {
    transform: translateX(3px);
}

.projects__grid + .cta-row {
    margin-top: var(--space-xl);
}

/* Ventana de detalle (<dialog> nativo: gestiona el foco y la tecla Esc). */
.project-modal {
    width: min(760px, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: auto;
}

.project-modal::backdrop {
    background: rgba(20, 18, 16, 0.7);
}

.project-modal__header {
    position: relative;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    background: linear-gradient(135deg, var(--color-darker) 0%, var(--color-dark) 100%);
    color: var(--color-white);
}

.project-modal__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.14);
    border-radius: 50%;
}

.project-modal__close:hover {
    background-color: rgba(255, 255, 255, 0.28);
}

.project-modal__year {
    display: inline-block;
    padding: 0.35rem 1rem;
    margin-bottom: var(--space-md);
    font-family: var(--font-label);
    font-weight: 700;
    font-size: 0.85rem;
    background-color: var(--color-primary);
    border-radius: 999px;
}

.project-modal__title {
    color: var(--color-white);
    font-size: clamp(1.4rem, 2vw + 1rem, 2rem);
    padding-right: var(--space-xl);
}

.project-modal__body {
    padding: var(--space-lg);
}

.project-modal__grid {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.project-modal__item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.project-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    color: var(--color-white);
    background-color: var(--color-primary);
    border-radius: var(--radius-md);
}

.project-modal__icon svg {
    width: 22px;
    height: 22px;
}

.project-modal__item h3 {
    font-family: var(--font-label);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.project-modal__item p {
    margin-top: 0.15rem;
    font-weight: 600;
}

.project-modal__desc {
    padding: var(--space-lg);
    background-color: var(--color-light);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
}

.project-modal__desc h3 {
    margin-bottom: var(--space-sm);
}

.project-modal__desc p {
    color: var(--color-text-muted);
    max-width: none;
}

/* --- Inicio: Ubicación --- */
.location__grid {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
}

.location__map {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 0;
    border-radius: var(--radius-lg);
}

/* --- Hero de páginas internas --- */
.page-hero {
    padding-block: var(--space-3xl);
}

/* Titular grande y alineado a la izquierda, como en el sitio de referencia. */
.page-hero h1 {
    font-size: clamp(2.25rem, 6vw + 0.5rem, 5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.page-hero p {
    max-width: 80ch;
}

.page-hero p {
    color: var(--color-text-inverse);
    opacity: 0.85;
}

.page-hero p+p {
    margin-top: var(--space-sm);
}

/* --- Servicios: grid de 12 --- */
.services-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: 1fr;
}

/* --- Servicios: alquiler de maquinaria --- */
.rental__grid {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
}

.rental__media img {
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}


.list-check {
    display: grid;
    gap: var(--space-xs);
    margin-block: var(--space-lg);
}

.list-check li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--color-text-muted);
}

.list-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background-color: var(--color-primary);
}

.section--dark .list-check li {
    color: var(--color-text-inverse);
}

/* --- Banner de cierre / CTA --- */
.cta-banner {
    text-align: center;
}

.cta-banner h2 {
    margin-bottom: var(--space-md);
}

.cta-banner p {
    max-width: 55ch;
    margin-inline: auto;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.section--dark .cta-banner p,
.cta-banner.section--dark p {
    color: var(--color-text-inverse);
    opacity: 0.85;
}

.cta-banner .cta-row {
    justify-content: center;
}

/* --- Nosotros: historia --- */
.history__grid {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
}

.history__media img {
    border-radius: var(--radius-lg);
    aspect-ratio: 3 / 2;
    object-fit: cover;
    width: 100%;
}

.history__text p+p {
    margin-top: var(--space-md);
}

/* --- Nosotros: pilares (misión / visión) --- */
.pillars {
    position: relative;
    color: var(--color-white);
    isolation: isolate;
}

.pillars__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.pillars::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(24, 24, 26, 0.9);
}

.pillars h2 {
    color: var(--color-white);
}

.pillars .section__header p {
    color: var(--color-text-inverse);
    opacity: 0.85;
}

.pillars__grid {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.pillar {
    padding: var(--space-lg);
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
}

.pillar h3 {
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.pillar p {
    color: var(--color-text-inverse);
    opacity: 0.88;
    max-width: none;
}

/* --- Franja roja HSEQ --- */
.hseq-band {
    background-color: var(--color-primary);
    color: var(--color-white);
    text-align: center;
}

.hseq-band .eyebrow {
    color: var(--color-white);
    opacity: 0.9;
}

.hseq-band h2 {
    color: var(--color-white);
    font-size: clamp(1.8rem, 4vw + 1rem, 3.2rem);
    margin-bottom: var(--space-md);
}

.hseq-band p {
    max-width: 60ch;
    margin-inline: auto;
    color: var(--color-white);
    opacity: 0.92;
}

/* --- Contacto --- */
.contact__grid {
    display: grid;
    gap: var(--space-2xl);
    align-items: start;
}

.contact__form {
    display: grid;
    gap: var(--space-md);
    padding: var(--space-lg);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.form-field {
    display: grid;
    gap: var(--space-2xs);
}

.form-field label {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mismo padding vertical que .btn (0.8rem): así los campos miden 54px, lo
   mismo que el botón "Enviar mensaje" que tienen debajo. Antes medían 50,8px
   con valores fuera de la escala (0.7rem 0.9rem). */
.form-field input,
.form-field textarea {
    width: 100%;
    padding: 0.8rem var(--space-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

/* Foco de los campos. Antes se sumaban dos reglas: el borde se volvía rojo y
   encima aparecía el contorno global de :focus-visible (3px rojo, separado
   2px), así que quedaba un anillo rojo doble, grueso y despegado del campo.
   Además era idéntico al estado de error, que también pinta el borde rojo.
   Ahora el foco es gris carbón con un halo suave pegado al campo, y el rojo
   queda reservado para los errores.
   outline transparente (no "none"): en el modo de alto contraste de Windows
   las sombras desaparecen, y ese contorno pasa a ser visible. */
.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid transparent;
    outline-offset: 0;
    border-color: var(--color-dark);
    box-shadow: 0 0 0 3px rgba(58, 54, 50, 0.14);
}

.form-field textarea {
    min-height: 140px;
    resize: vertical;
}

.form-field__error {
    font-size: 0.85rem;
    color: var(--color-primary);
    display: none;
}

.form-field.has-error input,
.form-field.has-error textarea {
    border-color: var(--color-primary);
}

/* Un campo con error sigue en rojo aunque tenga el foco: si no, al volver a
   él para corregirlo el aviso desaparecería justo cuando más se necesita. */
.form-field.has-error input:focus,
.form-field.has-error textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(187, 29, 35, 0.16);
}

.form-field.has-error .form-field__error {
    display: block;
}

.form-note {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Aviso de resultado del formulario (error de validación o de envío).
   Sin borde de color: el fondo rojo claro y el propio texto ya lo señalan
   como error. */
.form-alert {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    background-color: rgba(187, 29, 35, 0.08);
    color: var(--color-text);
    font-size: 0.9rem;
    max-width: none;
}

/* Trampa anti-spam: fuera de pantalla, pero no display:none
   (algunos bots ignoran los campos ocultos con display:none). */
.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-block {
    margin-top: var(--space-xl);
}

.contact-block h3 {
    margin-bottom: var(--space-sm);
}

.contact-block p,
.contact-block li {
    color: var(--color-text-muted);
}

.contact-block a:hover {
    color: var(--color-primary);
}

.contact__map {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 0;
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
}

/* ---------------------------------------------------------------
   9. ANIMACIONES (sección 14)
   --------------------------------------------------------------- */
/* El estado inicial oculto se aplica SOLO si el JS está activo (script.js añade
   la clase "js" al <html>). Así, si el JS falla o está desactivado, el contenido
   sigue visible en lugar de quedarse en opacity: 0 para siempre. */
.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ---------------------------------------------------------------
   10. MEDIA QUERIES (mobile-first, min-width) — sección 8
   --------------------------------------------------------------- */

/* Tablet: 641px+ */
@media (min-width: 641px) {
    :root {
        --container-pad: 2rem;
    }

    .section {
        padding-block: var(--space-3xl);
    }

    .site-footer__inner {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .site-footer__bar .container {
        flex-direction: row;
        justify-content: space-between;
    }

    .stats__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Tres columnas desde tablet: a una sola columna las fotos del brochure
       (~200 px) se estiraban a 750 px y se veían borrosas. */
    .specialties__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .milestones {
        grid-template-columns: repeat(3, 1fr);
    }

    .services-grid,
    .principles__grid,
    .projects__grid,
    .project-modal__grid,
    .pillars__grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* Escritorio: 1025px+ — navegación horizontal, sin hamburguesa */
@media (min-width: 1025px) {
    :root {
        --header-height: 92px;
    }

    .site-header__brand img {
        height: 54px;
    }

    .nav-toggle {
        display: none;
    }

    .primary-nav {
        position: static;
        display: flex;
        align-items: center;
        gap: var(--space-lg);
        padding: 0;
        border: none;
        box-shadow: none;
        background: none;
    }

    .primary-nav__list {
        flex-direction: row;
        gap: var(--space-lg);
    }

    .primary-nav__list a {
        padding: var(--space-xs) 0;
        border-bottom: 2px solid transparent;
    }

    .primary-nav__list a:hover,
    .primary-nav__list a[aria-current="page"] {
        border-bottom-color: var(--color-primary);
    }

    .primary-nav__social {
        margin-top: 0;
        border-left: 1px solid var(--color-border);
        padding-left: var(--space-md);
    }

    /* Un enlace del menú nunca debe partirse en dos líneas. */
    .primary-nav__list a {
        white-space: nowrap;
    }

    .hero-home__grid {
        grid-template-columns: 1fr 1fr;
    }

    .specialties__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .location__grid {
        grid-template-columns: 1.1fr 1fr;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .principles__grid,
    .projects__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .rental__grid,
    .history__grid,
    .hseq-summary__grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact__grid {
        grid-template-columns: 1.1fr 1fr;
    }
}

/* Escritorio estrecho: 1025px–1279px. Se compacta el menú en este rango en
   vez de achicar el logo (heredado de la plantilla; con el logo horizontal
   de UCO el espacio también es justo). */
@media (min-width: 1025px) and (max-width: 1279px) {

    .primary-nav,
    .primary-nav__list {
        gap: var(--space-md);
    }

    .primary-nav__list a {
        font-size: 0.9375rem;
    }

    .primary-nav__social {
        gap: 0;
        padding-left: var(--space-xs);
    }
}
