.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    transition: background-color 0.4s ease;
    padding: 5% 0;
}

.portfolio-item {
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    align-items: stretch;
    justify-content: center;
}
.portfolio-item:hover {
    transform: scale(1.03);
    z-index: 10;
    filter: contrast(1)!important;
}

.portfolio-item-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
}

.portfolio-item .video-thumbnail,
.portfolio-item .vimeo-player-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.portfolio-item .video-thumbnail {
    z-index: 2;
    opacity: 1;
    object-fit: cover;
    transform: scale(1);
    transition: opacity 0.5s ease-in-out, transform 1.2s ease;
}

.portfolio-item .vimeo-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out;
}

.portfolio-item.is-playing .video-thumbnail {
    opacity: 0;
}

.portfolio-item.is-playing .vimeo-player-container iframe {
    opacity: 1;
    visibility: visible;
}

.portfolio-item.is-loading .video-thumbnail {
    opacity: 0.7;
    transform: scale(1.05);
}

.portfolio-item-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 4;
    pointer-events: none;
    transform: translateY(0);
    transition: opacity 0.4s ease-in-out 0.2s, transform 0.4s ease-in-out 0.2s;
}

.portfolio-item:hover .portfolio-item-caption {
    opacity: 0;
    transform: translateY(20px);
}

.portfolio-title {
    font-size: 1.2em;
    margin: 0;
    padding: 0;
    font-weight: 600;
    letter-spacing: inherit;
}

.portfolio-specialty {
    margin: 0;
    font-size: 18px;
    line-height: 20px;
    letter-spacing: 0;
    font-weight: 500;
    opacity: 0.5;
}
.portfolio-specialty:hover {

    opacity: 1;
}

.portfolio-item-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    animation: spin 1s linear infinite;
}

.portfolio-item.is-loading .loading-spinner {
    opacity: 1;
    visibility: visible;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.portfolio-grid--negro {
    background-color: #000;
}

.portfolio-grid--negro .portfolio-title,
.portfolio-grid--negro .portfolio-specialty {
    color: #fff;
}

.portfolio-grid--blanco {
    background-color: #f5f5f5;
}

.portfolio-grid--blanco .portfolio-title,
.portfolio-grid--blanco .portfolio-specialty {
    color: #000;
}

.portfolio-grid--blanco .loading-spinner {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #000;
}




/* --- ESTILOS FINALES Y CORREGIDOS PARA POLAROID --- */

.portfolio-item {
    display: flex;
    flex-direction: column; 
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid #1f1f1f;
}

.portfolio-item:hover {
    transform: scale(1.03);
    z-index: 10;
}

.portfolio-item-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
}
.portfolio-item.portfolio-item--polaroid .portfolio-item-media {
  border-radius: 10px 10px 0 0;
}

/* El texto SIEMPRE serÃ¡ absoluto por defecto */
.portfolio-item-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 4;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out 0.2s, transform 0.4s ease-in-out 0.2s;
}

.portfolio-item:hover .portfolio-item-caption {
    opacity: 0;
    transform: translateY(20px);
}

/* --- ESTILOS SOLO PARA POLAROID --- */

/* La clase polaroid solo se encarga de cambiar la posiciÃ³n del texto */
.portfolio-item--polaroid .portfolio-item-caption {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding: 2rem;
    transition: none;
}

.portfolio-item--polaroid:hover .portfolio-item-caption {
    opacity: 1;
    transform: none;
}



/* --- FIN DE ESTILOS PARA POLAROID --- */


.project-single .project-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
gap:1em;
}

.project-single .project-title-area {
    flex-basis: 50%;
    flex-grow: 1;
}

.project-single .entry-title {
    text-transform: uppercase;
    font-weight: bold;
    font-size: 3rem;
    line-height: 50px;
    margin: 0 0 30px;
    color: #000;
    padding-top: 5%;
}

.project-single .project-short-description {
    line-height: 34px;
    font-size: 23px;
    font-weight: 500;
    color: gray;
    letter-spacing: 0.4px;
    margin: 0;
    max-width: 580px;
}

.project-single .project-details-area {
    flex-basis: 41%;
    min-width: 250px;
}
.project-single .project-details-list .project-detail-item:last-child{
    margin-bottom:0;
}
.project-single .project-details-list .project-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
    letter-spacing: 0px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(38, 38, 38, 0.16);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.project-single .project-details-list dt {
    font-weight: bold;
    text-transform: uppercase;
    color: #555;
    padding-right: 1rem;
}

.project-single .project-details-list dd {
    margin: 0;
    text-align: right;
}

.project-single .project-video-area .video-responsive-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 1em;
}

.project-single .project-video-area .video-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

body.single-proyectos .single-project-mode--blanco,
body.single-proyectos .single-project-mode--blanco #primary {
    background-color: #ffffff !important;
}
body.single-proyectos .single-project-mode--blanco .entry-title {
    color: #000000 !important;
}
body.single-proyectos .single-project-mode--blanco .project-short-description {
    color: #555555 !important;
}
body.single-proyectos .single-project-mode--blanco .project-details-list dt {
    color: #333333 !important;
}
body.single-proyectos .single-project-mode--blanco .project-details-list dd {
    color: #555555 !important;
}
body.single-proyectos .single-project-mode--blanco .project-details-list .project-detail-item {
    border-bottom-color: #e0e0e0 !important;
}
body.single-proyectos .single-project-mode--negro, body.single-proyectos .single-project-mode--negro #primary {
    background-color: #000 !important;
}
body.single-proyectos .single-project-mode--negro .entry-title {
    color: #ffffff !important;
}
body.single-proyectos .single-project-mode--negro .project-short-description {
    color: #cccccc !important;
}
body.single-proyectos .single-project-mode--negro .project-details-list dt {
    color: #ffffff !important;
}
body.single-proyectos .single-project-mode--negro .project-details-list dd {
    color: #aaaaaa !important;
}
body.single-proyectos .single-project-mode--negro .project-details-list .project-detail-item {
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.project-video-area {
    padding: 2rem;

}

.fancy-heading {
    overflow: hidden;
}

.fancy-heading .main-head,
.fancy-heading .sub-head {
    display: block;
    will-change: transform, opacity;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.5s;
}

.fancy-heading.is-out-of-view .main-head,
.fancy-heading.is-out-of-view .sub-head {
    transform: translateY(110%);
    opacity: 0;
}

.fancy-heading.is-in-view .main-head,
.fancy-heading.is-in-view .sub-head {
    transform: translateY(0);
    opacity: 1;
}

.fancy-heading.is-out-of-view .main-head {
    transition-delay: 0.1s;
}

.fancy-heading.is-out-of-view .sub-head {
    transition-delay: 0s;
}

.fancy-heading.is-in-view .main-head {
    transition-delay: 0s;
}

.fancy-heading.is-in-view .sub-head {
    transition-delay: 0.1s;
}

.project-gallery-area {
    padding: 2rem;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32%, 1fr));
    gap: 1em;
}

.project-gallery .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}




body.single-proyectos .single-project-mode--blanco {
    border-top: 1px solid #e0e0e0;
}



.mpg-breadcrumb-wrapper .mpg-breadcrumb {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mpg-breadcrumb-wrapper a {
    text-decoration: none;
    transition: opacity 0.2s;
}

.mpg-breadcrumb-wrapper a:hover {
    opacity: 0.7;
}

.mpg-breadcrumb-wrapper .separator {
    margin: 0 0.75em;
}

.mpg-breadcrumb-wrapper .current-item {
    opacity: 0.6;
}

body.single-project-mode--blanco .mpg-breadcrumb-wrapper a,
body.single-project-mode--blanco .mpg-breadcrumb-wrapper .separator,
body.single-project-mode--blanco .mpg-breadcrumb-wrapper .current-item {
    color: #000;
}

body.single-project-mode--negro .mpg-breadcrumb-wrapper a,
body.single-project-mode--negro .mpg-breadcrumb-wrapper .separator,
body.single-project-mode--negro .mpg-breadcrumb-wrapper .current-item {
    color: #fff;
}

/* === ESTILOS DEFINITIVOS PARA EL BREADCRUMB === */



body.single-proyectos .single-project-mode--blanco {
    border-top: 1px solid #e0e0e0;
}



.mpg-breadcrumb-wrapper .mpg-breadcrumb {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mpg-breadcrumb-wrapper a {
    text-decoration: none;
    transition: opacity 0.2s;
}

.mpg-breadcrumb-wrapper a:hover {
    opacity: 0.7;
}

.mpg-breadcrumb-wrapper .separator {
    margin: 0 0.75em;
}

.mpg-breadcrumb-wrapper .current-item {
    opacity: 0.6;
}

/* --- Colores adaptables --- */

/* 1. Estilo base para modo oscuro (usando tu selector) */
.mpg-breadcrumb-wrapper a,
.mpg-breadcrumb-wrapper .separator,
.mpg-breadcrumb-wrapper .current-item {
    color: #fff;
}

/* 2. Anulación específica para el modo blanco */
body.single-project-mode--blanco .mpg-breadcrumb-wrapper a,
body.single-project-mode--blanco .mpg-breadcrumb-wrapper .separator,
body.single-project-mode--blanco .mpg-breadcrumb-wrapper .current-item {
    color: #000;
}

/* --- Ajustes de Padding para Single y Archive --- */

/* Padding para el grid en la página de archivo */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
    transition: background-color 0.4s ease;
    padding: 3rem;
}

/* Padding para el header en la página de archivo */
.archive-header {
    padding: 0 0 3rem 0; /* Ajusta el padding del header del archivo */
}



/* Padding para el vídeo en la página de proyecto individual */
.project-video-area {
    padding: 3rem;
}

/* Padding para la galería en la página de proyecto individual */
.project-gallery-area {
    padding: 3rem;
}

.mpg-template-wrapper {
    padding: 3rem;
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
.project-single .project-details-area {
    flex-basis: 100%;
    margin-bottom: 2em;
}

.project-single .project-details-list .project-detail-item {
    font-size: 16px;
    line-height: 1em;
    padding-bottom: 12px;
    margin-bottom: 21px;
}
.project-video-area {
    padding: 0em;
    margin-bottom: 1em;
}
.project-single .project-short-description {
    margin-bottom: 1em;
}

.project-gallery-area {
    padding: 0rem;
}
}