/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
html, body {
  height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
  /* Reemplazamos el color sólido por la imagen */
  background-image: url("../img/tile3.png");
  
  /* Esto hace que la imagen se repita infinitamente (Tiling) */
  background-repeat: repeat;
  
  /* Mantiene el tamaño original de la imagen para que no se deforme */
  background-size: auto;
  
  /* EVITA EL DESENFOQUE: Mantiene los píxeles definidos al escalar */
  image-rendering: pixelated;
  image-rendering: crisp-edges;

  /* Color de respaldo por si la imagen tarda en cargar */
  background-color: #38761d;
  color: #ffd966;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* ==========================================================================
   2. TIPOGRAFÍA GENERAL
   ========================================================================== */
h1, h5 {
  font-family: "Jersey 20", sans-serif;
  font-weight: 400;
  font-style: normal;
}

h4, .contacto-section {
  font-family: "Jersey 10", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.contacto-section {
  font-size: 1.5rem;
}

span.text-warning.small {
  font-size: 0.9rem;
  font-family: "Jersey 10", sans-serif;
}

/* ==========================================================================
   3. NAVBAR (RESPONSIVO) - CORREGIDO
   ========================================================================== */
.navbar {
  background-color: transparent !important;
  font-family: "Jersey 10", sans-serif;
  font-size: clamp(1.2rem, 2vw, 2rem); 
  padding: 1rem 0;
}

.navbar .container {
    padding-top: 0 !important;
}

.navbar-brand {
  color: #ffd966 !important;
  font-family: "Jersey 10", sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 2rem) !important;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

/* Enlaces generales (Blancos por defecto) */
.navbar .nav-link {
  color: white !important;
  font-size: clamp(0.9rem, 1.5vw, 1.5rem);
  white-space: nowrap;
  transition: all 0.3s ease;
  padding-top: 0;
  padding-bottom: 0;
}

/* EFECTO HOVER para los links blancos */
.navbar .nav-link:hover {
    color: #ffd966 !important;
    opacity: 0.8;
}

/* SELECTOR DE IDIOMA: Forzamos el amarillo SIEMPRE */
/* Lo ponemos al final para que sea la regla definitiva */
.navbar .nav-link.idioma-actual,
.navbar .nav-link.idioma-actual::after {
    color: #ffd966 !important;
    opacity: 1 !important;
}

.navbar .nav-link.idioma-actual:hover {
    opacity: 0.8 !important;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.4em;
    vertical-align: 0.15em;
}

.dropdown-menu-dark {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: transparent; /* Cambiado de transparent para que sea legible el menú */
}

/* Estilos específicos para el link "Sobre Mí" en mobile */
.nav-sm {
    font-size: 0.8rem !important; /* Más pequeño que el estándar */
    letter-spacing: 0px;        /* Reduce el espacio entre letras */
}

@media (max-width: 576px) {
    /* Reduce el espacio entre todos los links del navbar en móviles muy pequeños */
    .navbar-nav.gap-3 {
        gap: 0.5rem !important; 
    }
    
    .navbar .nav-link {
        font-size: 0.75rem; /* Achica un poco las categorías (Realizador, etc) */
        padding-left: 0;
        padding-right: 0;
    }

    .navbar-brand {
        font-size: 0.9rem;
    }
}


/* ==========================================================================
   4. FOOTER (RESPONSIVO)
   ========================================================================== */
footer {
  background-color: transparent !important;
  border-top: none;
  flex-shrink: 0;
  font-family: "Jersey 10", sans-serif;
  padding: 1.5rem 0;
}

footer .navbar-brand {
  color: #ffd966 !important;
  font-family: "Jersey 20", sans-serif;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem) !important;
}

footer .nav-link {
  text-transform: uppercase;
  font-size: clamp(0.9rem, 1.5vw, 1.5rem);
  letter-spacing: 0px;
}

footer .nav-link:hover {
  color: #ffd966 !important;
}

/* ==========================================================================
   5. COMPONENTES RETRO (SELECTORES Y BOTONES)
   ========================================================================== */

/* Selector de Idiomas */
.form-select-sm {
  background-color: transparent !important;
  color: #ffd966 !important;
  border: 2px solid #ffd966 !important;
  border-radius: 0 !important;
  font-family: "Jersey 10", sans-serif;
  font-size: clamp(0.8rem, 1vw, 1.1rem);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);

  /* NUEVA FLECHA AMARILLA PIXELADA */
  /* Quitamos la flecha por defecto y ponemos una amarilla con estilo de bloque */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffd966' stroke-linecap='square' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 12px 10px !important;
  padding-right: 2rem !important; /* Espacio para que el texto no pise la flecha */
  padding-left: 1rem !important;
}

.form-select-sm:focus {
  outline: none;
  box-shadow: 4px 4px 0px #2a5a16;
  background-color: transparent !important;
}

.form-select-sm option {
  /* Mantener fondo oscuro para que las letras amarillas se lean al desplegar */
  background-color: #38761d;
  color: #ffd966;
  font-family: "Jersey 10", sans-serif;
}

/* Sub-categorías (Pills) */
.custom-pills .nav-link {
  color: #ffd966;
  font-family: "Jersey 10", sans-serif;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 1.2vw, 1.4rem); 
  border-radius: 0 !important;
  border: 2px solid transparent;
  margin: 2px;
  transition: all 0.1s steps(2);
  white-space: nowrap;
}

.custom-pills .nav-link.active {
  background-color: #ffd966 !important;
  color: #38761d !important;
  border: 2px solid #ffd966;
  box-shadow: 4px 4px 0px #2a5a16; 
}


/* ==========================================================================
   6. MEDIA QUERIES 
   ========================================================================== */

@media (max-width: 768px) {
  /* --- Ajustes de Subcategorías (Pills) --- */
  .custom-pills {
    justify-content: center;
    width: 100%;
    gap: 5px; 
  }

  .custom-pills .nav-item {
    display: flex;
    justify-content: center;
  }

  /* El botón TODOS ahora ocupa todo el ancho para quedar arriba solo */
  /* Usamos una clase específica para no romper el desktop */
  .custom-pills .nav-item.w-100 {
    margin-bottom: 12px;
    flex: 0 0 100%; /* Fuerza el ancho total en móvil */
  }

  .custom-pills .nav-link {
    font-size: 0.75rem !important; 
    padding: 0.3rem 0.5rem !important;
    width: fit-content !important; 
    display: inline-block;
  }

  .custom-pills .nav-link.active {
    background-color: #ffd966 !important;
    color: black !important;
  }

  .d-flex.flex-column.flex-md-row { gap: 20px !important; }
  .btn-group-retro { justify-content: center; width: 100%; gap: 10px; }
  .navbar .container, footer .container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px;
  }
  .navbar-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    gap: 15px !important;
  }
  footer .navbar-nav { justify-content: flex-start !important; flex-wrap: wrap; }
  .idioma-actual.dropdown-toggle { padding: 10px !important; margin-right: -10px; }
}

/* --- Ajuste para ESCRITORIO --- */
@media (min-width: 769px) {
  /* ESTA REGLA ES LA CLAVE: Anula el ancho total del botón TODOS */
  .custom-pills .nav-item.w-100 {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-bottom: 0 !important;
  }

  .custom-pills .nav-link {
    width: auto !important; 
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
}


/* ==========================================================================
   7. PROYECTOS (LISTADO)
   ========================================================================== */

/* Estilo de los filtros (Pills) */
.custom-pills .nav-link {
    color: white !important;
    background-color: transparent;
    padding: 0.5rem 1rem;
    width: fit-content;
    transition: all 0.3s ease;
    font-family: "Jersey 10", sans-serif;
}

.custom-pills .nav-link.active {
    background-color: #ffd966 !important;
    color: black !important;
}

/* Tarjetas de Proyecto */
.project-card {
    cursor: pointer;
    background-color: transparent !important; 
}

.project-card img {
    transition: all 0.4s ease;
    display: block;
    z-index: 1;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent !important; /* Un poco de fondo ayuda a leer */
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.proyecto-anio {
    color: #ffffff !important; /* Blanco puro */
    font-family: 'Jersey 10', sans-serif;
    font-size: 1.2rem;
    margin: 0;
    line-height: 1;
    opacity: 1; /* Sin transparencia para que resalte */
    letter-spacing: 1px;
}

/* Ajuste para que el título amarillo y el año blanco no estén pegados */
.project-text-box h5 {
    text-align: center;      /* Centra el texto dentro de la caja */
    display: flex;
    flex-direction: column;  /* Alinea los elementos en vertical */
    align-items: center;     /* Centra los elementos hijos horizontalmente */
    margin: 0 auto;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card:hover img {
    opacity: 0; 
    transform: scale(1.05);
}

.project-overlay h5 {
    /* Aumentamos de tamaño (antes era el estándar de h5) */
    font-size: 1.8rem !important; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    margin-bottom: 15px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tagline-preview {
    font-family: "Jersey 10", sans-serif;
    /* Aumentamos el tagline (estaba en 1rem) */
    font-size: 1.3rem !important; 
    line-height: 1.3;
    color: #ffd966 !important;
    text-align: center;
    max-width: 100%; /* Evita que el texto toque los bordes de la tarjeta */
}

/* --- COMPORTAMIENTO PARA MÓVIL / TÁCTIL --- */
@media (max-width: 768px), (hover: none) {
    /* 1. Hacemos el overlay siempre visible */
    .project-overlay {
        opacity: 1 !important;
        /* Fondo semi-transparente para que el texto resalte sobre la imagen */
        background-color: rgba(0, 0, 0, 0.5) !important; 
    }

    /* 2. La imagen no desaparece, pero se queda fija */
    .project-card img {
        opacity: 0.6 !important; /* Oscurecemos la imagen para legibilidad */
        transform: scale(1) !important; /* Quitamos el zoom para no distraer */
    }

    /* 3. Ajuste de tamaño de texto para móviles (más compacto) */
    .project-overlay h5 {
        font-size: 1.3rem !important;
        margin-bottom: 8px !important;
    }

    .tagline-preview {
        font-size: 0.9rem !important;
    }
}

/* --- MANTENEMOS EL EFECTO HOVER SOLO EN PC --- */
@media (min-width: 769px) and (hover: hover) {
    .project-card:hover .project-overlay {
        opacity: 1;
    }
    
    .project-card:hover img {
        opacity: 0;
        transform: scale(1.1);
    }
}

/* --- COMPORTAMIENTO EXCLUSIVO PARA MÓVIL --- */
@media (max-width: 768px), (hover: none) {
    /* 1. Forzamos visibilidad */
    .project-overlay {
        opacity: 1 !important;
        background-color: transparent !important; /* Mantenemos el overlay general invisible */
    }

    /* 2. Creamos el rectángulo oscuro solo aquí */
    .project-text-box {
        background-color: rgba(0, 0, 0, 0.2) !important; /* El rectángulo negro */
        padding: 15px !important;
        border-radius: 2px;
        width: fit-content;
        max-width: 90%;
        margin: 0 auto;
    }

    /* 3. La imagen se mantiene visible detrás del rectángulo */
    .project-card img {
        opacity: 0.8 !important; /* Un poco atenuada para que el negro destaque */
        transform: scale(1) !important; /* Sin zoom en móvil */
    }
}

/* --- Ajuste para que en Desktop la caja no estorbe --- */
@media (min-width: 769px) {
    .project-text-box {
        background-color: transparent;
        padding: 0;
    }
}


