/* --- CSS VARIABLES & RESET --- */
:root {
    --charro-red: #8a1c1c;
    --charro-dark: #4a0e0e;
    --nm-turquoise: #40E0D0;
    --nm-turquoise-dark: #008B8B;
    /* FIX: Darkened Gold for accessibility contrast */
    --gold: #b39226; 
    --gold-light: #f3e5ab;
    --black: #1a1a1a;
    --white: #ffffff;
    --off-white: #f9f9f9;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --transition: all 0.3s ease;
    --container-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); color: var(--black); line-height: 1.6; background-color: var(--off-white); }

/* --- LANGUAGE TOGGLE STYLES --- */
.lang-es { display: none; }
body.spanish-mode .lang-en { display: none !important; }
body.spanish-mode span.lang-es { display: inline; }
body.spanish-mode div.lang-es,
body.spanish-mode p.lang-es,
body.spanish-mode h1.lang-es,
body.spanish-mode h2.lang-es,
body.spanish-mode h3.lang-es,
body.spanish-mode li.lang-es { display: block; }

.btn-lang {
    background: transparent; border: 1px solid var(--gold); color: var(--gold);
    padding: 5px 12px; border-radius: 4px; cursor: pointer;
    font-family: var(--font-body); font-weight: 700; font-size: 0.85rem;
    transition: var(--transition); margin: 0;
}
.btn-lang:hover { background: var(--gold); color: var(--black); }

/* --- TYPOGRAPHY & UTILITIES --- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }

.section-title {
    text-align: center; font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 1rem;
    color: var(--charro-red); position: relative; padding-bottom: 1rem;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 80px; height: 3px;
    background: linear-gradient(90deg, var(--charro-red), var(--gold), var(--charro-red));
}

.text-gold { color: var(--gold); }
.text-red { color: var(--charro-red); }
.text-turquoise { color: var(--nm-turquoise-dark); }

.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }

/* --- BUTTONS --- */
.btn {
    display: inline-block; padding: 12px 30px; font-family: var(--font-body);
    font-weight: 700; text-transform: uppercase; text-decoration: none;
    letter-spacing: 1px; border-radius: 50px; transition: var(--transition);
    cursor: pointer; border: 2px solid transparent; font-size: 1rem;
}
.btn-primary { background-color: var(--charro-red); color: var(--white); box-shadow: 0 4px 15px rgba(138, 28, 28, 0.3); }
.btn-primary:hover { background-color: var(--charro-dark); transform: translateY(-2px); border-color: var(--gold); }
.btn-outline { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--black); }

/* --- HEADER & NAV --- */
header {
    background-color: var(--black); padding: 0.75rem 0; position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); border-bottom: 3px solid var(--charro-red);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo {
    font-family: var(--font-heading); color: var(--white); font-size: 1.5rem;
    text-decoration: none; display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.logo span { color: var(--gold); }

nav { display: flex; align-items: center; }
nav ul { display: flex; list-style: none; gap: 2rem; align-items: center; }
nav a { color: var(--white); text-decoration: none; font-weight: 400; transition: var(--transition); font-size: 0.95rem; }
nav a:hover { color: var(--nm-turquoise); }
.nav-cta { border: 1px solid var(--gold); padding: 5px 15px; border-radius: 20px; color: var(--gold) !important; font-size: 0.9rem; }
.nav-cta:hover { background: var(--gold); color: var(--black) !important; }

/* Mobile Menu Toggle */
.mobile-toggle { display: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 5px; }

/* --- HERO SECTION (Home) --- */
#hero {
    min-height: 90vh;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.5)), url('header.jpg');
    background-size: cover; background-position: center;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; color: var(--white); padding: 80px 20px 40px;
}
#hero h1 { margin-bottom: 1rem; line-height: 1.1; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
#hero p { font-size: clamp(1rem, 3vw, 1.25rem); margin-bottom: 2rem; max-width: 600px; color: var(--gold-light); }
.hero-decoration { font-size: 2rem; color: var(--nm-turquoise); margin-bottom: 1rem; }

/* --- PAGE HEADER (Sub-pages) --- */
.page-header { background-color: var(--charro-red); color: var(--white); padding: 3rem 0; text-align: center; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.5rem; }
.breadcrumb { color: var(--gold); font-size: 0.9rem; margin-top: 1rem; }
.breadcrumb a { color: var(--white); text-decoration: none; }

/* --- ABOUT SECTION --- */
#about { padding: 4rem 0; text-align: center; background-color: var(--white); background-image: radial-gradient(var(--gold-light) 1px, transparent 1px); background-size: 20px 20px; }
.about-content { max-width: 800px; margin: 0 auto; padding: 0 1rem; }
.about-text { font-size: 1.1rem; color: #444; margin-bottom: 2rem; }

/* --- SERVICES SECTION --- */
#services { padding: 4rem 0; background-color: var(--off-white); }
.services-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }

.service-card {
    background: var(--white); padding: 2.5rem; border-radius: 8px; text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: var(--transition);
    border-top: 4px solid var(--gold); height: 100%; display: flex; flex-direction: column; justify-content: flex-start;
}
.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.service-icon { font-size: 2.5rem; color: var(--charro-red); margin-bottom: 1.5rem; }
.service-card h3 { margin-bottom: 1rem; color: var(--black); }
.service-card p { color: #666; font-size: 0.95rem; }

/* --- CONTENT SECTION (Instructional) --- */
.content-section { padding: 4rem 0; }
.info-block {
    background: var(--white); padding: 2.5rem; border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); margin-bottom: 2rem;
    border-left: 5px solid var(--gold); overflow: hidden;
}
.info-block h2 { color: var(--charro-red); margin-bottom: 1.5rem; border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }
.info-block h3 { color: var(--black); margin-top: 1.5rem; margin-bottom: 1rem; font-size: 1.3rem; }
.info-block ul { list-style-position: inside; margin-left: 1rem; margin-bottom: 1.5rem; }
.info-block li { margin-bottom: 0.5rem; color: #444; }
.nested-list { margin-left: 2rem !important; list-style-type: circle !important; margin-top: 0.5rem; }

/* Instructional Images & Profiles */
.curriculum-banner { width: 100%; height: auto; max-height: 400px; object-fit: cover; border-radius: 6px; margin-bottom: 2rem; border-bottom: 4px solid var(--gold); }
.instructor-profile {
    float: right; width: 250px; margin-left: 2rem; margin-bottom: 1rem;
    text-align: center; background: var(--off-white); padding: 1rem;
    border-radius: 8px; border: 1px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.instructor-headshot { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; border: 3px solid var(--gold); margin-bottom: 0.5rem; }
.instructor-label { font-size: 0.9rem; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.2rem; }
.instructor-name { font-family: var(--font-heading); font-weight: 700; color: var(--charro-red); font-size: 1.2rem; margin-bottom: 0.2rem; }

/* --- VIDEO SECTION --- */
#videos { padding: 4rem 0; background-color: var(--white); text-align: center; }
.video-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; max-width: 1000px; margin: 0 auto; }
@media (min-width: 768px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border: 2px solid var(--gold); }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* --- GALLERY SECTION --- */
#gallery { padding: 5rem 0; background-color: var(--black); color: var(--white); }
#gallery .section-title { color: var(--white); }
#gallery .section-title::after { background: linear-gradient(90deg, var(--gold), var(--nm-turquoise), var(--gold)); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0; }
.gallery-item { position: relative; overflow: hidden; height: 300px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 20px; opacity: 0; transition: 0.3s ease; display: flex; align-items: flex-end;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* --- CONTACT SECTION --- */
#contact, #contact-info-section { padding: 4rem 0; background-color: var(--white); border-top: 5px solid var(--nm-turquoise); }
#contact-info-section { background-color: var(--off-white); }

.contact-box-centered {
    background-color: var(--charro-red); color: var(--white); max-width: 700px; width: 100%;
    margin: 0 auto; padding: 3rem 2rem; border-radius: 10px; border: 2px solid var(--gold);
    text-align: center; box-shadow: 0 10px 30px rgba(138, 28, 28, 0.2);
}
.phone-link {
    display: block; font-family: var(--font-heading); font-size: clamp(1.5rem, 5vw, 3rem);
    color: var(--white); text-decoration: none; margin: 1.5rem 0; transition: var(--transition);
    font-weight: 700; line-height: 1.2;
}
.phone-link:hover { color: var(--gold); transform: scale(1.05); }
.email-btn {
    display: inline-block; background-color: var(--white); color: var(--charro-red);
    font-size: 1.2rem; font-weight: 700; padding: 15px 30px; border-radius: 50px;
    text-decoration: none; transition: var(--transition); margin-top: 1rem;
    border: 2px solid transparent;
}
.email-btn:hover { background-color: var(--gold); color: var(--black); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.contact-divider { height: 1px; background-color: rgba(255,255,255,0.3); width: 60%; margin: 2rem auto; }

/* --- FOOTER --- */
footer { background-color: var(--black); color: #888; text-align: center; padding: 2rem 5%; border-top: 1px solid #333; }
.social-icons { margin-bottom: 1rem; }
.social-icons a { color: var(--white); font-size: 1.5rem; margin: 0 15px; transition: var(--transition); display: inline-block; }
.social-icons a:hover { color: var(--nm-turquoise); transform: translateY(-3px); }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (min-width: 1200px) {
    #hero { background-attachment: fixed; }
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .header-inner { position: relative; }
    nav ul {
        position: fixed; top: 60px; left: -100%; width: 100%; background-color: var(--black);
        flex-direction: column; text-align: center; padding: 2rem 0; transition: 0.3s ease-in-out;
        border-bottom: 3px solid var(--charro-red); box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    }
    nav ul.active { left: 0; }
    nav a { display: block; padding: 15px; font-size: 1.2rem; }
    .btn-lang { margin: 1rem auto 0; display: inline-block; }
    .nav-cta { display: inline-block; margin-top: 10px; }
    .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(50%, 1fr)); }
    .gallery-item { height: 250px; }
    /* Instructor Profile Mobile */
    .instructor-profile { float: none; width: 100%; max-width: 300px; margin: 2rem auto; }
}

/* SMALL DEVICE FIXES */
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .container { padding: 0 1rem; }
    .contact-box-centered { padding: 2rem 1rem; }
    .phone-link { font-size: 1.8rem; }
    .email-btn { width: 100%; box-sizing: border-box; font-size: 1rem; padding: 12px 20px; }
}