/* style.css */

/* ---------------------------------------------------
   1. CSS Variables (Root)
-----------------------------------------------------*/
:root {
    /* Color Palette - Pastel Brutalism */
    --primary-color: #007bff; /* YPF Blue - for accents and calls to action */
    --secondary-color: #ffc107; /* A warm yellow for contrast */
    --background-color: #f8f9fa; /* Very light, almost white pastel grey */
    --card-background-color: #ffffff;
    --text-color: #212529; /* Dark, high-contrast text */
    --text-color-light: #f0f0f0; /* Light text for dark backgrounds */
    --border-color: #dee2e6;
    --footer-background-color: #191923;
    --overlay-color: rgba(0, 0, 0, 0.5); /* Overlay for background images */

    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Work Sans', sans-serif;

    /* Transitions & Animations */
    --transition-speed: 0.3s;
    --transition-timing: ease-in-out;
    --transition-bouncy: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* ---------------------------------------------------
   2. Global Resets & Base Styles
-----------------------------------------------------*/
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) var(--transition-timing);
}

a:hover {
    color: #0056b3;
}

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

/* ---------------------------------------------------
   3. Typography
-----------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #222222;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-wrap: balance;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    max-width: 700px;
    margin: -2rem auto 3rem;
    color: #555;
}

p {
    margin-bottom: 1rem;
}

/* ---------------------------------------------------
   4. Layout & Helpers
-----------------------------------------------------*/
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0 5%;
}

.section {
    padding: 60px 0;
}

.text-page {
    padding-top: 120px; /* Offset for fixed header */
    padding-bottom: 60px;
}

/* ---------------------------------------------------
   5. UI Components (Buttons, Cards, Forms)
-----------------------------------------------------*/

/* --- Global Button Styles --- */
.btn, button, input[type="submit"] {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    border: 2px solid var(--primary-color);
    background-color: var(--primary-color);
    color: var(--card-background-color);
    padding: 12px 30px;
    border-radius: 4px; /* A slight radius for modern feel */
    transition: var(--transition-bouncy);
    letter-spacing: 1px;
}

.btn:hover, button:hover, input[type="submit"]:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
}

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

/* --- Global Card Styles --- */
.card {
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    display: flex;
    flex-direction: column;
    text-align: center;
    height: 100%; /* Ensure cards in a grid have same height */
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card-image {
    width: 100%;
    height: 250px; /* Fixed height for image container */
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
}

.card-content {
    flex-grow: 1; /* Allows content to fill space */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* --- Form Styles --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: #f1f3f5;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #6c757d;
    pointer-events: none;
    transition: all 0.2s ease-out;
}

.form-group input:focus + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:valid + label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    color: var(--primary-color);
    background-color: var(--background-color);
    padding: 0 5px;
}

/* ---------------------------------------------------
   6. Page Transitions (Barba.js)
-----------------------------------------------------*/
.barba-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background-color);
    z-index: 9999;
    transform: translateY(100%);
}

.barba-leave-active,
.barba-enter-active {
    transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1);
}

.barba-leave-from { transform: translateY(0); }
.barba-leave-to { transform: translateY(-100%); }
.barba-enter-from { transform: translateY(100%); }
.barba-enter-to { transform: translateY(0); }

/* ---------------------------------------------------
   7. Header & Navigation
-----------------------------------------------------*/
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed) ease;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.nav-links a {
    margin: 0 1rem;
    font-weight: 500;
    color: var(--text-color);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) var(--transition-timing);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.burger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all var(--transition-speed) ease-in-out;
}

/* ---------------------------------------------------
   8. Section-Specific Styles
-----------------------------------------------------*/

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-color);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: #FFFFFF;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #FFFFFF;
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- Statistics Section --- */
.stats-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 80px 0;
    color: var(--text-color);
}
.stats-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(248, 249, 250, 0.85); /* Light overlay */
}
.stats-section .container {
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}

/* --- Methodology Section --- */
.methodology-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
}
.methodology-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* --- Gallery Section --- */
.content-carousel {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.carousel-item {
    display: none;
}

.carousel-item.active {
    display: block;
    animation: fadeIn 0.8s;
}

@keyframes fadeIn {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    text-align: left;
}
.carousel-caption h4 {
    color: white;
    font-size: 1.5rem;
}

/* --- Team Section --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.team-card .card-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

/* --- External Resources Section --- */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.resource-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-background-color);
    transition: var(--transition-bouncy);
}

.resource-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.resource-card h4 {
    color: var(--text-color);
    font-size: 1.2rem;
}

.resource-card p {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.resource-card .resource-url {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* --- Contact Section --- */
.contact-section {
    background-color: #e9ecef;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: center;
}

.contact-info h3 {
    font-size: 1.8rem;
}

/* --- Success Page --- */
.success-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--background-color);
}

.success-box {
    max-width: 500px;
    padding: 3rem;
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
}

.success-box h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.success-box p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}


/* ---------------------------------------------------
   9. Footer
-----------------------------------------------------*/
.site-footer {
    background-color: var(--footer-background-color);
    color: var(--text-color-light);
    padding: 60px 0;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer-col h4,
.footer-col h5 {
    color: white;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.footer-col h5 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p {
    color: #adb5bd;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul a {
    color: #adb5bd;
    transition: color var(--transition-speed);
}

.footer-col ul a:hover {
    color: var(--card-background-color);
    text-decoration: underline;
}

.social-links a {
    font-weight: 500;
}

/* ---------------------------------------------------
   10. Responsive Media Queries
-----------------------------------------------------*/
@media (max-width: 992px) {
    .methodology-content,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .methodology-image {
        order: -1; /* Image first on mobile */
    }
}

@media (max-width: 768px) {
    .section-title { font-size: 2rem; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content p { font-size: 1.1rem; }

    /* --- Mobile Navigation --- */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--card-background-color);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        margin: 1.5rem 0;
        font-size: 1.5rem;
    }

    .burger-menu {
        display: block;
    }

    .burger-menu.active span:nth-of-type(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .burger-menu.active span:nth-of-type(2) {
        opacity: 0;
    }
    .burger-menu.active span:nth-of-type(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .footer-grid {
        text-align: center;
    }
}