/* ======================================================== */
/* === HOME.CSS: ESTILOS ESPECÍFICOS PARA LA PÁGINA DE INICIO === */
/* ======================================================== */

/* ============================= */
/* === 4. SECCIÓN HERO (INDEX) === */
/* ============================= */
.hero-section {
    background-image: url('../assets/images/hero-bg.jpg'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    position: relative; 
    color: var(--white-background-color);
    text-align: center; /* MODIFICADO: Centra el texto y los elementos inline como el botón */
    padding: 8rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto; /* MODIFICADO: Centra el contenedor horizontalmente */
    display: flex; /* Added for flexbox centering */
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center items horizontally */
    text-align: center; /* Ensure text within container is centered */
}

.hero-section h1 {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    color: var(--white-background-color);
    text-shadow: none;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 1.0s ease-out forwards; /* Changed animation duration to be a bit faster */
    animation-delay: 0.3s;
    text-align: center; /* Explicitly center for good measure */
}

.hero-section p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto; /* For centering the paragraph if it's narrower than the container */
    margin-right: auto;
    color: var(--white-background-color);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 1.0s ease-out forwards; /* Changed animation duration */
    animation-delay: 0.6s;
    text-align: center; /* Explicitly center for good measure */
}

.hero-section .btn {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 1.0s ease-out forwards; /* Changed animation duration */
    animation-delay: 0.9s;
    /* Already inline-block and centered by parent text-align: center */
    /* If it were a block element, you'd use margin: 0 auto; */
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================== */
/* === 5. SECCIÓN SERVICIOS (antes Proyectos) === */
/* =============================== */
.section-padding {
    padding: 5rem 0;
}

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

.project-card {
    background-color: var(--white-background-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); 
}

.project-card img {
    width: 100%;
    height: 200px; 
    object-fit: cover; 
    border-bottom: 1px solid var(--border-color);
}

.project-card h3 {
    font-size: 1.2rem;
    color: var(--dark-text-color);
    margin-bottom: 0.5rem;
    padding: 1.2rem 1.5rem 0.5rem;
}

.project-card p {
    font-size: 0.9rem;
    color: var(--light-text-color);
    padding: 0 1.5rem;
    flex-grow: 1; 
}

/* Centering the button within project cards */
.project-card .btn.secondary {
    display: block; /* Make it a block element to apply margin: auto */
    width: fit-content; /* Make it fit its content to center it */
    margin: 1.5rem auto; /* Top/Bottom padding, auto for left/right to center */
}


/* ========================== */
/* === 6. SECCIÓN FILOSOFÍA (antes Sobre Mí) === */
/* ========================== */
.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.about-image {
    flex: 1;
    max-width: 350px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    flex: 2;
    text-align: left;
}

.about-text h2 {
    margin-bottom: 1.5rem;
}

.about-text p {
    margin-bottom: 1rem;
}

/* Centering the button in the About section */
.about-text .btn.primary {
    display: block; /* Make it a block element to apply margin: auto */
    width: fit-content; /* Make it fit its content to center it */
    margin: 1rem auto 0; /* Top margin, auto for left/right to center */
}

/* ============================ */
/* === 7. SECCIÓN CONTACTO === */
/* ============================ */
.contact-form-container {
    background-color: var(--white-background-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2.5rem;
    max-width: 600px;
    margin: 3rem auto 0;
    text-align: left;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--dark-text-color);
    font-size: var(--p-font-size);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%; /* Ajustado para que ocupe todo el ancho */
    padding: 0.8rem 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: var(--p-font-size);
    color: var(--text-color);
    background-color: var(--dark-background-color);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(110, 178, 149, 0.3);
    outline: none;
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Centering the button in the Contact form */
.contact-form .btn.primary {
    width: fit-content; /* Make it fit its content to center it */
    margin: 1rem auto 0; /* Top margin, auto for left/right to center */
    display: block; /* Make it a block element for margin: auto to work */
}

#form-status {
    margin-top: 1.5rem;
    font-weight: 600;
    text-align: center;
}

/* ========================== */
/* === MEDIA QUERIES === */
/* ========================== */
@media (min-width: 769px) {
    .about-content {
        flex-direction: row; 
        text-align: left;
        gap: 4rem;
    }

    .about-text h2 {
        text-align: left;
    }

    .about-image {
        order: -1; 
    }

    /* Override button centering for larger screens if needed, otherwise inherit */
    .about-text .btn.primary {
        margin-left: unset; /* Revert to default alignment */
        margin-right: unset;
        display: inline-block; /* Revert to original display if it was block */
    }
}

@media (max-width: 1024px) {
    /* For screens up to 1024px, adjust hero font sizes */
    .hero-section h1 {
        font-size: 4rem; /* Slightly smaller for tablets */
    }

    .hero-section p {
        font-size: 1.2rem; /* Slightly smaller for tablets */
    }
}

@media (max-width: 768px) {
    /* Specific adjustments for mobile screens */
    .hero-section h1 {
        font-size: 2.5rem; /* Further reduce font size for phones */
    }

    .hero-section p {
        font-size: 1rem; /* Further reduce font size for phones */
        padding: 0 1rem; /* Add some horizontal padding to prevent cutting off */
    }
}
