/* ================================
   BASE RESET
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #ffffff;
}

/* ================================
   LAYOUT CONTAINERS
================================ */
.container {
    max-width: 1200px;
}

/* ================================
   HERO SECTION
================================ */
.hero {
    background: linear-gradient(135deg, #0b4393 0%, #1565c0 100%);
    color: #ffffff;
    padding: 5rem 1rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    color: #ffffff;
    max-width: 700px;
    margin: 0 auto;
}

/* ================================
   PROJECTS SECTION
================================ */
.projects-section {
    padding: 4rem 1rem;
}

.projects-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.projects-empty h4 {
    color: #0b4393;
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.projects-empty p {
    color: #666;
}

/* ================================
   PROJECT CARD
================================ */
.project-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 320px;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* ================================
   PROJECT IMAGE + OVERLAY
================================ */
.project-image {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    overflow: hidden;
}

/* Overlay oscuro en hover */
.project-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: all 0.35s ease;
    z-index: 1;
}

.project-card:hover .project-image::after {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

/* Título en la imagen */
.project-image-title {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.35s ease;
    z-index: 2;
    pointer-events: none;
}

.project-card:hover .project-image-title {
    opacity: 1;
    transform: scale(1);
}

/* ================================
   PROJECT CONTENT (HIDDEN)
================================ */
.project-content {
    display: none;
}

.project-type {
    display: inline-block;
    background: #f0f0f0;
    color: #0b4393;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.project-title {
    color: #0b4393;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.project-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.project-meta i {
    color: #f7941d;
    font-size: 0.8rem;
}

.project-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.project-tag {
    display: inline-block;
    background: #f9f9f9;
    color: #0b4393;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    border: 1px solid #eee;
    font-weight: 500;
}

.project-link {
    font-weight: 600;
    color: #f7941d;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.project-link:hover {
    color: #e67e0d;
    gap: 0.5rem;
}

/* ================================
   LINK WRAPPER (remove text-decoration)
================================ */
a.text-decoration-none {
    text-decoration: none !important;
    color: inherit;
}

a.text-decoration-none:hover {
    color: inherit;
}

/* ================================
   RESPONSIVE - TABLET
================================ */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.4rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    /* En tablet, mostrar el título siempre en el centro */
    .project-image-title {
        opacity: 1;
        transform: scale(1);
        font-size: 1.2rem;
    }

    .project-image::after {
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
    }

    .project-card:hover .project-image::after {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* ================================
   RESPONSIVE - MOBILE
================================ */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .projects-section {
        padding: 2rem 1rem;
    }

    .project-card {
        height: 280px;
        position: relative;
    }

    .project-image {
        height: 100%;
    }

    /* Título al fondo de la imagen como overlay */
    .project-image-title {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        inset: auto;
        font-size: 1.1rem;
        opacity: 1;
        transform: scale(1);
        padding: 1.5rem;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        min-height: 80px;
    }

    .project-image::after {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }

    .project-card:hover {
        transform: translateY(-4px);
    }

    .project-card:hover .project-image::after {
        background: rgba(0, 0, 0, 0);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .projects-section {
        padding: 1.5rem 0;
    }

    .project-card {
        height: 240px;
        position: relative;
    }

    .project-image {
        height: 100%;
    }

    /* Título al fondo */
    .project-image-title {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        inset: auto;
        font-size: 1rem;
        padding: 1rem;
        background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        min-height: 70px;
    }
}

/* ================================
   FADE-IN ANIMATION
================================ */
.project-card {
    opacity: 0;
    transform: translateY(24px);
    animation: projectFadeIn 0.6s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.2s; }
.project-card:nth-child(5) { animation-delay: 0.25s; }
.project-card:nth-child(6) { animation-delay: 0.3s; }
.project-card:nth-child(n+7) { animation-delay: 0.35s; }

@keyframes projectFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}