/* --- Global Settings & Variables --- */
:root {
    --color-background: #FFFFFF;
    --color-text: #1a1a1a;
    --color-text-light: #666666;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.3s ease-in-out;
}

/* --- Basic Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem 3rem;
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.logo-img {
    height: 45px;
    width: auto;
    display: block;
    transition: var(--transition-smooth);
}

/* Logo changes from white to black on scroll */
.main-header.scrolled .logo-img {
    content: url('images/logo-black.png');
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.main-nav a {
    text-decoration: none;
    color: #FFFFFF; /* Color inicial sobre el Hero */
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Header cambia de color con el scroll */
.main-header.scrolled .main-nav a {
    color: var(--color-text);
}

.main-header.scrolled .main-nav a:hover {
    color: var(--color-text-light);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 3rem;
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-button {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid #FFFFFF;
    color: #FFFFFF;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: 20px;
    transition: var(--transition-smooth);
}

.hero-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--color-text);
}

/* --- General Content Styles --- */
.content-section {
    padding: 8rem 2rem; /* Más "aire" entre secciones */
}

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

.section-title {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.3;
}

.content-section p {
    font-size: 1.1rem;
    color: var(--color-text-light);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
}

.section-subtitle {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 2rem;
}

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

/* --- Portfolio Section --- */
.portfolio-section {
    padding: 2rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    display: block;
    overflow: hidden;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: transparent;
}

.portfolio-text {
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(255, 255, 255, 0.6);
}

.portfolio-item:hover img {
    transform: scale(1.03);
    filter: brightness(1.4) contrast(0.9); /* Aclara mucho más la imagen para mejor legibilidad */
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* --- Services Section --- */
.services-list {
    list-style: none;
    max-width: 500px;
    margin: 0 auto;
}

.services-list li {
    font-size: 1.1rem;
    color: var(--color-text-light);
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.services-list li:last-child {
    border-bottom: none;
}

/* --- Gallery Pages --- */
.gallery-hero {
    min-height: 60vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 2rem;
}

.gallery-hero-content h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.gallery-location {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.back-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.gallery-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.project-info {
    background: #f8f9fa;
    padding: 4rem 2rem;
}

.project-info .container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
}

.project-details h3,
.project-description h3 {
    color: var(--color-text);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.project-details p {
    margin-bottom: 0.8rem;
}

@media (max-width: 768px) {
    .gallery-hero-content h1 {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-info .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* --- Contact Section --- */
.contact-wrapper {
    max-width: 600px;
    margin: 2rem auto 0 auto;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 1rem;
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #999;
    background: #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contact-form button {
    width: 100%;
    padding: 1rem;
    border: none;
    background: var(--color-text);
    color: var(--color-background);
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.contact-form button:hover {
    background: #444;
}

.contact-info {
    text-align: center;
    margin-top: 3rem;
    color: var(--color-text-light);
}

/* --- Footer --- */
.main-footer {
    padding: 4rem 2rem 2rem;
    text-align: center;
}

.footer-social-links {
    margin-bottom: 1.5rem;
}

.footer-social-links a {
    text-decoration: none;
    color: var(--color-text-light);
    margin: 0 1rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-social-links a:hover {
    color: var(--color-text);
}

.footer-copyright {
    font-size: 0.8rem;
    color: #aaaaaa;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 1.5rem;
    }

    .main-nav {
        display: none; /* Simplificado para el ejemplo, aquí iría un menú hamburguesa */
    }

    .content-section {
        padding: 6rem 1.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .portfolio-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
     .portfolio-section {
        padding: 1rem;
    }
}