/* ==========================================================================
   PORTFOLIO FILTRABLE - ESTILOS GENERALES
   ========================================================================== */

.portfolio-container {
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    box-sizing: border-box;
}

/* ==========================================================================
   NAVEGACIÓN DE FILTROS
   ========================================================================== */

.portfolio-filter-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    list-style: none;
    padding: 0;
    margin: 0 0 35px 0;
    flex-wrap: wrap;
}
ul.portfolio-filter-nav {
    margin-bottom: 60px !important;
}
.home div#logo-footer {
    display: none !important;
}

.portfolio-filter-nav .filter-btn {
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    color: #111111;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
    user-select: none;
}

.portfolio-filter-nav .filter-btn.active,
.portfolio-filter-nav .filter-btn:hover {
    border-bottom: 2px solid #111111;
}

/* ==========================================================================
   CUADRÍCULA (GRID) Y TRANSICIÓN DE FILTRADO
   ========================================================================== */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.portfolio-item {
    width: 100%;
    box-sizing: border-box;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1),
                transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Estados para la animación fluida al filtrar */
.portfolio-item.filter-hide {
    opacity: 0;
    transform: scale(0.92);
}

.portfolio-item.filter-show {
    opacity: 1;
    transform: scale(1);
}

.portfolio-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.portfolio-card-link:hover,
.portfolio-card-link:focus {
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   TARJETA DEL PROYECTO Y HOVER SUAVE
   ========================================================================== */

.portfolio-card {
    position: relative;
    width: 100%;
    height: 377px;
    overflow: hidden;
    background-color: #000000;
    cursor: pointer;
}

/* Imagen con escalado progresivo y sutil */
.portfolio-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Overlay suave con transición en opacidad */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 210, 0, 0.88);
    opacity: 0;
    will-change: opacity;
    transition: opacity 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
}

/* ==========================================================================
   CONTENIDOS Y ESTRUCTURA DE TEXTO
   ========================================================================== */

.portfolio-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px 20px;
    box-sizing: border-box;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.portfolio-header {
    width: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.portfolio-title-wrapper {
    display: block;
    width: 100%;
    line-height: 1.2;
}

/* TÍTULO PRINCIPAL (Estado normal: fluido en línea si cabe) */
.portfolio-title-wrapper .title-main {
    display: inline-block;
    /* white-space: nowrap;*/
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    transition: font-size 0.4s ease, color 0.4s ease, font-weight 0.4s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* SUBTÍTULO (Estado normal: al lado si cabe) */
.portfolio-title-wrapper .portfolio-subtitle {
    display: inline-block;
    /* white-space: nowrap; */
    font-size: 13px;
    font-weight: 400;
    color: #ffffff;
    transition: font-size 0.4s ease, color 0.4s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Descripción con desplegable fluido */
.portfolio-description {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    will-change: opacity, max-height, margin-top;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                max-height 0.45s cubic-bezier(0.25, 1, 0.5, 1),
                margin-top 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    color: #111111;
    font-size: 13px;
    line-height: 1.45;
}

.portfolio-description p {
    margin: 0;
}

/* ==========================================================================
   INTERACCIONES AL HACER HOVER (SIEMPRE EN DOS LÍNEAS)
   ========================================================================== */

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

.portfolio-card:hover .portfolio-bg-img {
    transform: scale(1.06);
}

/* Al hacer Hover: forzamos que cada elemento ocupe su propia línea (display: block) */
.portfolio-card:hover .portfolio-title-wrapper .title-main {
    display: block;
    color: #000000;
    font-size: 22px;
    font-weight: 900;
    text-shadow: none;
    line-height: 1.1;
}

.portfolio-card:hover .portfolio-title-wrapper .portfolio-subtitle {
    display: block;
    color: #000000;
    font-size: 19px;
    font-weight: 400;
    text-shadow: none;
    margin-top: 2px;
}

.portfolio-card:hover .portfolio-description {
    opacity: 1;
    max-height: 160px;
    margin-top: 12px;
}

/* ==========================================================================
   RESPONSIVE / ADAPTACIÓN MÓVIL
   ========================================================================== */

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 10px;
    }

    .portfolio-filter-nav {
        gap: 15px;
    }

    .portfolio-filter-nav .filter-btn {
        font-size: 15px;
    }
}

/* Ajuste para el enlace que envuelve la tarjeta */
.portfolio-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.portfolio-card-link:hover,
.portfolio-card-link:focus {
    text-decoration: none;
    color: inherit;
}
