/*!
Theme Name: Avante Construction
Theme URI: http://underscores.me/
Author: Orvit Design
Author URI: https://orvit.design
Description: Avante Construction is a custom WordPress theme developed for a Florida-based general contractor.
Version: 1.2.0
Text Domain: avante
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1.  Variables & Reset Premium (Avante Red Edition)
2.  Generic (Normalize)
3.  Typography (Responsive & Modern)
4.  Layouts & Grid System
5.  Header & Navigation (Solid Black & Hybrid)
6.  Hero Section (BACKGROUND-IMAGE VERSION)
7.  Components (Cards, Buttons, Footer)
8.  Animations (Reveal)
--------------------------------------------------------------*/

/*--------------------------------------------------------------
1. VARIABLES & RESET PREMIUM (AVANTE RED EDITION)
--------------------------------------------------------------*/
:root {
    --bg-dark: #000000;
    --bg-panel: #111111;
    --text-main: #ffffff;
    --text-muted: #999999;
    --accent: #D32F2F;
    --border-light: rgba(255, 255, 255, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --container-width: 1300px;
    --gutter: 20px;
    --section-spacing: 6rem;
    --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    box-sizing: border-box;
    font-size: 16px;
    scroll-behavior: smooth;
}

*, *::before, *::after { 
    box-sizing: inherit; 
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    margin: 0;
    overflow-x: hidden;
}

/*--------------------------------------------------------------
2. GENERIC (NORMALIZE SIMPLIFIED)
--------------------------------------------------------------*/
main { display: block; }
hr { box-sizing: content-box; height: 0; overflow: visible; }
pre { font-family: monospace, monospace; font-size: 1em; }
a { background-color: transparent; text-decoration: none; color: inherit; transition: all 0.3s; }
abbr[title] { border-bottom: none; text-decoration: underline dotted; }
b, strong { font-weight: bolder; }
img { border-style: none; height: auto; max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 100%; margin: 0; }
button { overflow: visible; text-transform: none; }
[type="button"], [type="submit"], button { -webkit-appearance: button; cursor: pointer; }

/*--------------------------------------------------------------
3. TYPOGRAPHY (RESPONSIVE REMs)
--------------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: #fff;
    font-weight: 600;
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

h1 { 
    font-size: clamp(2.5rem, 5vw + 1rem, 5rem); 
}

h2 { 
    font-size: clamp(2rem, 4vw + 1rem, 3.5rem); 
}

h3 { font-size: 1.75rem; }

p { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.lead-text {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #e0e0e0;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
}

.text-primary { color: var(--accent) !important; }
.text-center { text-align: center; }
.text-white { color: #fff !important; }

/*--------------------------------------------------------------
4. LAYOUTS & GRID SYSTEM
--------------------------------------------------------------*/
.container {
    width: 100%;
    max-width: var(--container-width);
    padding: 0 var(--gutter);
    margin: 0 auto;
}

.container-fluid { width: 100%; padding: 0 var(--gutter); }

section {
    padding: var(--section-spacing) 0;
    position: relative;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-6, .col-lg-4, .col-md-4, .col-lg-8, .col-xl-8, .col-lg-10, .col-12 {
    padding: 0 15px;
    width: 100%;
    position: relative;
}

.d-flex { display: flex; }
.d-none { display: none !important; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.mb-5 { margin-bottom: 4rem; }
.mt-5 { margin-top: 3rem; }
.gap-4 { gap: 2rem; }

@media (min-width: 768px) {
    .col-md-4 { width: 33.333%; }
    .col-md-6 { width: 50%; }
    .d-md-block { display: block !important; }
    .text-md-start { text-align: left; }
    .text-md-end { text-align: right; }
}

@media (min-width: 992px) {
    .col-lg-4 { width: 33.333%; }
    .col-lg-8 { width: 66.666%; }
    .col-lg-10 { width: 83.333%; }
    .d-lg-block { display: block !important; }
    .d-lg-none { display: none !important; }
}

/*--------------------------------------------------------------
5. HEADER (SOLID BLACK STRIPE)
--------------------------------------------------------------*/
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #000000;
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    transition: padding 0.3s ease;
}

.site-header.is-sticky {
    padding: 0.8rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

.site-branding {
    display: flex;
    align-items: center;
}

.custom-logo-link {
    display: inline-block;
    line-height: 0; 
}

.desktop-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2.5rem;
}

.desktop-menu-list li a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    padding: 10px 0;
    position: relative;
}

.desktop-menu-list li a:hover { color: var(--accent); }

.btn-header {
    background-color: var(--accent);
    color: #fff;
    padding: 0.7rem 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.btn-header:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-2px);
}

.menu-toggle {
    background: none;
    border: none;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger {
    width: 28px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    transition: all 0.3s;
}

.offcanvas-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.6s var(--ease-luxury);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

body.menu-open .offcanvas-menu {
    transform: translateY(0);
    visibility: visible;
}

.mobile-navigation ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

.mobile-navigation a {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: #fff;
    display: block;
    margin: 15px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.5s;
}

body.menu-open .mobile-navigation a {
    opacity: 1;
    transform: translateY(0);
}

body.menu-open li:nth-child(1) a { transition-delay: 0.1s; }
body.menu-open li:nth-child(2) a { transition-delay: 0.2s; }
body.menu-open li:nth-child(3) a { transition-delay: 0.3s; }

/*--------------------------------------------------------------
6. HERO SECTION (BACKGROUND-IMAGE VERSION - CORREGIDO)
--------------------------------------------------------------*/
.hero-section {
    padding-top: 100px; 
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #000;
}

.hero-media-wrapper {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 0; 
    overflow: hidden;
    background: #000;
}

/* ============================================
   CORRECCIÓN CRÍTICA PARA BACKGROUND-IMAGE
   Los .hero-slide ahora son DIVs con background-image
   ============================================ */

.hero-slide {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    
    /* CRÍTICO: background properties para DIVs */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Estados de visibilidad */
    opacity: 0;
    transform: scale(1.15);
    z-index: 0;
    
    /* B&W por defecto */
    filter: grayscale(100%) contrast(1.1);
    
    /* Sin transiciones CSS (JS las controla) */
    transition: none;
}

/* ✅ FALLBACK CSS: Primera imagen visible sin JS */
.hero-slide:first-child {
    opacity: 1;
    z-index: 1;
}

/* Nested .slide-bg también debe heredar las propiedades */
.hero-slide .slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Cuando JS está activo */
.hero-media-wrapper.js-active .hero-slide:first-child {
    opacity: 1;
}

/* Interacción Color (wake-up effect) */
#hero.user-active .hero-slide {
    filter: grayscale(0%) contrast(1);
    transition: filter 0.8s ease;
}

#hero.user-active .hero-slide .slide-bg {
    filter: grayscale(0%) contrast(1);
    transition: filter 0.8s ease;
}

/* Overlay (Vignette) */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 90%);
    z-index: 4;
    pointer-events: none;
}

/* Contenido (Texto) */
.hero-content {
    position: relative;
    z-index: 5;
    width: 100%;
}

/*--------------------------------------------------------------
7. COMPONENTS
--------------------------------------------------------------*/
.service-card, .project-card, .value-card {
    background: linear-gradient(145deg, #111 0%, #0a0a0a 100%);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 2.5rem;
    transition: all 0.5s var(--ease-luxury);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover, .value-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.value-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    margin-bottom: 1.5rem;
    transition: background 0.3s;
}

.value-card:hover .value-icon-wrapper {
    background: var(--accent);
}

.value-icon-wrapper i {
    font-size: 2rem;
    color: #fff;
}

.project-card { 
    padding: 0; 
    border: none; 
    overflow: hidden; 
    margin-bottom: 2rem; 
}

.project-image {
    height: 450px;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: all 0.6s var(--ease-luxury);
}

.project-card:hover .project-image {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--accent);
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn:hover {
    background: #b71c1c;
    transform: translateY(-2px);
    color: #fff;
}

.site-footer {
    padding: 5rem 0;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-muted);
    background: #000;
}

.footer-logo { 
    font-size: 2rem; 
    letter-spacing: -1px; 
    margin-bottom: 0.5rem; 
    color: #fff; 
}

.section-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-weight: 300;
}

/*--------------------------------------------------------------
8. ANIMATIONS (REVEAL)
--------------------------------------------------------------*/
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s var(--ease-luxury);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.screen-reader-text {
    border: 0; 
    clip: rect(1px, 1px, 1px, 1px); 
    height: 1px; 
    margin: -1px; 
    overflow: hidden; 
    padding: 0; 
    position: absolute; 
    width: 1px;
}

.aligncenter { 
    clear: both; 
    display: block; 
    margin-left: auto; 
    margin-right: auto; 
}