/* ==========================================================================
   EXERGÍA V2 — Complemento de styles.css
   Base: V1 (producción) + efectos de la V7, depurados.
   Se carga DESPUÉS de styles.css. No modifica ninguna regla existente.
   ========================================================================== */

/* ---------- Fondo hexagonal animado del Hero ---------- */
.hero-fondo-animado {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-hex-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.16;
}

.hex-capa polygon {
    fill: none;
    stroke: #ffffff;
    stroke-width: 1.4;
}

.hex-capa-2 polygon,
.hex-capa-4 polygon { stroke: var(--naranja-energia); }

.hex-capa {
    animation: hexDeriva 34s ease-in-out infinite;
    transform-origin: center;
}
.hex-capa-1 { animation-duration: 40s; }
.hex-capa-2 { animation-duration: 30s; animation-direction: reverse; }
.hex-capa-3 { animation-duration: 46s; }
.hex-capa-4 { animation-duration: 26s; animation-direction: reverse; }

@keyframes hexDeriva {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(-18px, 14px) rotate(2.2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}
.hero-glow-1 {
    width: 480px; height: 480px;
    top: -160px; left: -120px;
    background: radial-gradient(circle, rgba(255,117,31,0.22) 0%, transparent 70%);
    animation: glowFlota 22s ease-in-out infinite;
}
.hero-glow-2 {
    width: 560px; height: 560px;
    bottom: -220px; right: -160px;
    background: radial-gradient(circle, rgba(23,76,115,0.35) 0%, transparent 70%);
    animation: glowFlota 28s ease-in-out infinite reverse;
}
@keyframes glowFlota {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(40px, -30px) scale(1.08); }
    100% { transform: translate(0, 0) scale(1); }
}

.hero-content { position: relative; z-index: 10; }

/* ==========================================================================
   LOGO DEL HERO — logo real de EXERGÍA, vectorizado del archivo original
   Colores exactos de marca: azul #174C73 · naranja #FF751F
   ========================================================================== */

.logo-hero-wrap {
    perspective: 1000px;
    cursor: pointer;
    display: grid;
    place-items: center;
    background: #ffffff;
    padding: 2.6rem;
    border-radius: 28px;
    box-shadow: 0 22px 60px rgba(0,0,0,0.30);
    width: fit-content;
    margin: 0 auto 2.4rem;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.logo-hero-wrap:hover {
    box-shadow: 0 28px 74px rgba(0,0,0,0.42),
                0 0 0 1px rgba(255,117,31,0.22);
}

.logo-hero-svg {
    width: clamp(130px, 14vw, 215px);
    height: auto;
    display: block;
    overflow: visible;
}

#logoHeroGroup {
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: 1000px 1000px;
}

/* El trazo naranja se aviva al pasar el mouse */
#logoTrazo { transition: fill 0.4s ease; }
.logo-hero-wrap:hover #logoTrazo { fill: #FF8A33; }

/* ---------- Accesibilidad: reducción de movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
    .hex-capa, .hero-glow { animation: none; }
    #logoHeroGroup { transition: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
    .logo-hero-wrap { padding: 2rem; border-radius: 22px; margin-bottom: 1.8rem; }
}

@media (max-width: 480px) {
    .logo-hero-wrap { padding: 1.5rem; border-radius: 18px; }
    .logo-hero-svg  { width: clamp(105px, 30vw, 145px); }
}

/* ========================================
   INGENIERÍAS - Sección de especialidades
   ======================================== */
.ingenierias {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

.ingenierias-container {
    max-width: 1200px;
    margin: 0 auto;
}

.ingenierias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.ingenieria-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #FF751F;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ingenieria-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.ingenieria-item h3 {
    color: #174C73;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ingenieria-item p {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.ingenieria-item ul {
    list-style: none;
    padding: 0;
}

.ingenieria-item li {
    padding: 0.3rem 0;
    color: #666;
    font-size: 0.9rem;
}

.ingenieria-item li:before {
    content: "▸ ";
    color: #FF751F;
    margin-right: 0.5rem;
}

/* ========================================
   NOTICIAS Y BLOG
   ======================================== */
.noticias-blog {
    padding: 4rem 2rem;
    background: white;
}

.noticias-container {
    max-width: 1200px;
    margin: 0 auto;
}

.noticias-tabs,
.recursos-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    color: #333;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.tab-btn:hover {
    border-color: #FF751F;
    color: #FF751F;
}

.tab-btn.active {
    background: #174C73;
    border-color: #174C73;
    color: white;
}

.noticias-tab,
.recursos-tab {
    display: none;
}

.noticias-tab.active,
.recursos-tab.active {
    display: block;
}

.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.noticia-card {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #FF751F;
    transition: transform 0.3s, box-shadow 0.3s;
}

.noticia-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.noticia-card h4 {
    color: #174C73;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    line-height: 1.3;
}

.noticia-card .meta {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.noticia-card p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ========================================
   RECURSOS Y NORMATIVIDAD
   ======================================== */
.recursos {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

.recursos-container {
    max-width: 1200px;
    margin: 0 auto;
}

.recursos-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.recurso-card {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-top: 3px solid #174C73;
    transition: transform 0.3s, box-shadow 0.3s;
}

.recurso-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.recurso-card h4 {
    color: #174C73;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.recurso-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.recurso-card a {
    color: #FF751F;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: color 0.3s;
}

.recurso-card a:hover {
    color: #174C73;
}

/* Responsiva */
@media (max-width: 768px) {
    .ingenierias-grid {
        grid-template-columns: 1fr;
    }
    
    .noticias-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .recursos-links {
        grid-template-columns: 1fr;
    }
    
    .noticias-tabs,
    .recursos-tabs {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .tab-btn {
        width: 100%;
    }
}


/* ========================================
   DICTÁMENES TÉCNICOS
   ======================================== */
.dictamenes {
    padding: 4rem 2rem;
    background: white;
}

.dictamenes-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.dictamenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dictamen-item {
    background: #f5f7fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-top: 3px solid #174C73;
}

.dictamen-item h4 {
    color: #174C73;
    margin-bottom: 0.5rem;
}

.dictamen-item p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .dictamenes-grid {
        grid-template-columns: 1fr;
    }
}

/* Iconos SVG en tarjetas de ingeniería */
.ingenieria-item h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ing-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* ========================================
   REGIÓN HERO - Los Cabos
   ======================================== */
.region-hero {
    position: relative;
    min-height: 320px;
    background: linear-gradient(180deg, #fdf8f3 0%, #f0e9dd 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.region-illustration {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.region-hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding: 3rem 2rem 3rem 4rem;
}

.region-eyebrow {
    display: inline-block;
    color: #FF751F;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.region-hero-content h2 {
    color: #174C73;
    font-size: 2rem;
    margin: 0 0 1rem 0;
}

.region-hero-content p {
    color: #444;
    font-size: 1.05rem;
    line-height: 1.6;
    background: rgba(255,255,255,0.7);
    padding: 0.5rem 0;
}

@media (max-width: 768px) {
    .region-hero-content {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    .region-hero-content h2 {
        font-size: 1.5rem;
    }
    .region-illustration {
        opacity: 0.5;
    }
}

/* ========================================
   BOTÓN VOLVER ARRIBA
   ======================================== */
.btn-arriba {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #174C73;
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, background 0.3s, visibility 0.3s;
    z-index: 999;
}

.btn-arriba.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-arriba:hover {
    background: #FF751F;
}

@media (max-width: 768px) {
    .btn-arriba {
        bottom: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
    }
}
