/* ============================================
   PROYECTO INDIVIDUAL - PLANTILLA REUTILIZABLE
   Estilos para páginas de proyectos individuales
   ============================================ */

/* Hero Section */
.proyecto-hero {
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--white);
}

.proyecto-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
    pointer-events: none;
    z-index: 0;
}

.proyecto-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.proyecto-hero h1 {
    font-family: 'Minion Pro', serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 0;
    opacity: 0;
    color: var(--white);
}

#proyecto-title {
    opacity: 0;
}

.proyecto-hero-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 28px;
    opacity: 0;
}

.proyecto-hero-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: var(--dark);
    letter-spacing: 2px;
    font-weight: 400;
    border: 1px solid var(--white);
    padding: 12px;
    font-family: "Brandon Grotesque", sans-serif;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1;
    background-color: var(--white);
}

.proyecto-hero-button:hover {
    background-color: transparent;
    color: var(--white);
    transform: scale(0.95);
}

/* Main Content */
.proyecto-main {
    padding: 80px 60px;
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--body);
}

/* Project Description */
.proyecto-description {
    padding: 160px 25px 150px;
    background-color: var(--body);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Project Specifications */
.proyecto-specs {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.proyecto-specs p {
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #7a7a7a;
    text-align: center;
    margin: 0;
}

.proyecto-specs strong {
    font-weight: 600;
    color: #333;
}

@media (min-width: 769px) {
    .proyecto-specs {
        margin-top: 40px;
    }
    
    .proyecto-specs p {
        font-size: 16px;
    }
}

.proyecto-subtitle {
    font-family: 'Minion Pro', serif;
    font-size: 25px;
    font-weight: 400;
    color: var(--primary);
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.proyecto-text {
    max-width: 600px;
    font-family: "Minion Pro", serif;
    line-height: 1.8;
    letter-spacing: 2px;
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    color: #7a7a7a;
    margin: 0 auto;
}

.proyecto-text strong,
.disc p strong {
    font-weight: 600;
    color: #333;
}

.proyecto-text em,
.disc p em {
    font-family: "Minion Pro", serif !important;
    font-style: normal !important;
    font-weight: 700 !important;
    color: #222 !important;
}

/* Desktop: aumentar en 1px */
@media (min-width: 769px) {
    .proyecto-text {
        font-size: 17px;
    }
}

/* Gallery Grid */
.proyecto-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 80px;
    margin-top: 60px;
    align-items: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-items: center;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.65s ease;
}

.gallery-item.is-visible {
    opacity: 1;
}

/* Tamaños alternados solo en desktop */
@media (min-width: 769px) {
    .proyecto-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 130px;
        padding: 0;
        justify-items: center;
        justify-content: center;
        align-items: center !important;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Centrado vertical de cada item */
    .gallery-item {
        align-self: center !important;
    }

    /* Columna izquierda (items impares): Grande, Pequeña, Grande, Pequeña... */
    /* Items 1, 5, 9, 13... = GRANDE (460px x 630px) */
    .gallery-item:nth-child(4n+1) {
        width: 460px;
        justify-self: end;
    }

    .gallery-item:nth-child(4n+1) .gallery-image {
        height: 630px;
    }

    /* Items 3, 7, 11, 15... = pequeña (380px x 470px) */
    .gallery-item:nth-child(4n+3) {
        width: 380px;
        justify-self: end;
    }

    .gallery-item:nth-child(4n+3) .gallery-image {
        height: 470px;
    }

    /* Columna derecha (items pares): Pequeña, Grande, Pequeña, Grande... */
    /* Items 2, 6, 10, 14... = pequeña (380px x 470px) */
    .gallery-item:nth-child(4n+2) {
        width: 380px;
        justify-self: start;
    }

    .gallery-item:nth-child(4n+2) .gallery-image {
        height: 470px;
    }

    /* Items 4, 8, 12, 16... = GRANDE (460px x 630px) */
    .gallery-item:nth-child(4n+4) {
        width: 460px;
        justify-self: start;
    }

    .gallery-item:nth-child(4n+4) .gallery-image {
        height: 630px;
    }
}

/* Flip cards dentro de gallery-item */
.gallery-item .flip-card {
    width: 100%;
    height: auto;
    aspect-ratio: 0.65;
    perspective: 1000px;
    position: relative;
}

.gallery-item .flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}

.gallery-item .flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.gallery-item .flip-card-front,
.gallery-item .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
    box-shadow: 0 23px 55px rgba(0, 0, 0, 0.18);
}

.gallery-item .flip-card-front {
    background: #fff;
}

.gallery-item .flip-card-back {
    background: #2c2c2c;
    transform: rotateY(180deg);
}

.gallery-item .flip-card-front img,
.gallery-item .flip-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.94);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.gallery-item .flip-card:hover .flip-card-front img,
.gallery-item .flip-card:hover .flip-card-back img {
    transform: scale(1.04);
    filter: brightness(1);
}

/* Ocultar nombre del proyecto en flip cards de galería */
.gallery-item .flip-card-overlay h3 {
    display: none;
}

.gallery-image {
    position: relative;
    overflow: hidden;
    background-color: transparent;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 23px 55px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: brightness(0.94);
    border: none;
    outline: none;
}

.gallery-image:hover img {
    transform: scale(1.04);
    filter: brightness(1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.gallery-image:hover .gallery-overlay {
    background: rgba(0, 0, 0, 0.15);
}

.gallery-info {
    text-align: left;
}

.gallery-info h3 {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.2;
    font-style: italic;
    text-transform: none;
}

.gallery-info p {
    font-family: var(--font-tertiary);
    font-size: 13px;
    color: #7a7a7a;
    letter-spacing: 0.3px;
    text-transform: none;
    text-align: left;
    margin: 0;
    line-height: 1.5;
    font-weight: 300;
}

/* Project Navigation */
.proyecto-nav {
    margin: 140px auto 80px;
    padding: 0 25px;
    max-width: 1100px;
    text-align: center;
}

.proyecto-nav-label {
    font-family: "MinionProRegular", serif;
    font-size: 15px;
    color: var(--light-secondary);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.proyecto-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.proyecto-nav-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 50px;
    border: 1px solid var(--dark);
    color: var(--dark);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-family: "Brandon Grotesque", sans-serif;
    line-height: 1;
    min-height: 38px;
    transition: all 0.25s ease;
}

.proyecto-nav-button:hover {
    background-color: var(--dark);
    color: var(--body);
    transform: translateY(-2px);
}

.proyecto-nav-button svg {
    flex-shrink: 0;
}

/* Thank You Overlay */
.thank-you-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.thank-you-overlay.show {
    opacity: 1;
    visibility: visible;
}

.thank-you-message {
    background-color: var(--dark);
    border: 1px solid var(--light-secondary);
    padding: 60px 80px;
    border-radius: 2px;
    text-align: center;
    max-width: 500px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.thank-you-overlay.show .thank-you-message {
    transform: translateY(0);
}

.thank-you-message svg {
    margin-bottom: 30px;
    animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.thank-you-message h3 {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #f5f1eb;
    margin: 0 0 16px 0;
    font-family: "Minion Pro", serif;
    text-transform: uppercase;
}

.thank-you-message p {
    font-size: 16px;
    letter-spacing: 1px;
    color: #d7d6d7;
    margin: 0;
    line-height: 1.6;
    font-family: "Brandon Grotesque", sans-serif;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet Landscape - Solo para anchos mayores a 1024px pero menores a 1200px */
@media (min-width: 1025px) and (max-width: 1200px) {
    .proyecto-gallery {
        gap: 80px 60px;
        max-width: 1000px;
    }

    /* Remover margin-top para mantener centrado vertical */
    .gallery-item:nth-child(2n) {
        margin-top: 0 !important;
    }
}

/* iPad Pro 11" y tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .proyecto-hero {
        height: 70vh;
        min-height: 500px;
    }

    .proyecto-hero-content h1 {
        font-size: 32px;
        letter-spacing: 5px;
    }

    .proyecto-hero-button {
        padding: 14px 45px;
        font-size: 13px;
    }

    .proyecto-main {
        padding: 60px 20px 100px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .proyecto-description {
        padding: 130px 40px 110px;
    }

    .proyecto-subtitle {
        font-size: 28px;
        letter-spacing: 4px;
    }

    .proyecto-text {
        font-size: 17px;
        max-width: 700px;
    }

    .proyecto-gallery {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 40px 60px !important;
        padding: 0 40px !important;
        justify-content: center !important;
        align-items: center !important;
        max-width: 100vw !important;
        margin: 0 auto !important;
        width: 100% !important;
    }

    /* Centrado vertical de cada item */
    .proyecto-gallery .gallery-item {
        align-self: center !important;
    }

    /* Posición 1: Grande, alineado a la derecha */
    .proyecto-gallery .gallery-item.pos-1 {
        width: 100% !important;
        max-width: 280px !important;
        justify-self: end !important;
    }

    .proyecto-gallery .gallery-item.pos-1 .proyecto-gallery-item {
        height: auto !important;
        aspect-ratio: 0.75 !important;
        width: 100% !important;
    }

    /* Posición 2: Pequeño, alineado a la izquierda */
    .proyecto-gallery .gallery-item.pos-2 {
        width: 100% !important;
        max-width: 240px !important;
        justify-self: start !important;
    }

    .proyecto-gallery .gallery-item.pos-2 .proyecto-gallery-item {
        height: auto !important;
        aspect-ratio: 0.78 !important;
        width: 100% !important;
    }

    /* Posición 3: Pequeño, alineado a la derecha */
    .proyecto-gallery .gallery-item.pos-3 {
        width: 100% !important;
        max-width: 240px !important;
        justify-self: end !important;
    }

    .proyecto-gallery .gallery-item.pos-3 .proyecto-gallery-item {
        height: auto !important;
        aspect-ratio: 0.78 !important;
        width: 100% !important;
    }

    /* Posición 4: Grande, alineado a la izquierda */
    .proyecto-gallery .gallery-item.pos-4 {
        width: 100% !important;
        max-width: 280px !important;
        justify-self: start !important;
    }

    .proyecto-gallery .gallery-item.pos-4 .proyecto-gallery-item {
        height: auto !important;
        aspect-ratio: 0.75 !important;
        width: 100% !important;
    }

    .proyecto-gallery-item {
        aspect-ratio: 4/5;
    }

    /* Texto de info alineado a la izquierda */
    .gallery-info {
        text-align: left !important;
    }

    .gallery-info h3,
    .gallery-info p {
        text-align: left !important;
    }

    .proyecto-specs {
        padding: 100px 40px;
    }

    .proyecto-specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 50px;
        max-width: 650px;
    }

    .proyecto-specs-item h3 {
        font-size: 13px;
    }

    .proyecto-specs-item p {
        font-size: 22px;
    }

    .proyecto-cta {
        padding: 100px 40px;
    }

    .proyecto-cta h2 {
        font-size: 28px;
    }

    .proyecto-cta p {
        font-size: 17px;
        max-width: 650px;
    }

    .proyecto-cta-button {
        padding: 14px 45px;
        font-size: 13px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .proyecto-main {
        padding: 40px 0 80px 0;
        max-width: 100%;
    }
    
    .proyecto-description {
        padding: 120px 25px 100px;
    }
    
    .proyecto-subtitle {
        font-size: 25px;
    }
    
    .proyecto-text {
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .proyecto-gallery {
        grid-template-columns: 1fr;
        gap: 80px;
        padding: 0;
        margin: 40px 0 0;
        justify-items: center;
    }
    
    /* Mobile: alternar entre ancho completo y con márgenes */
    .gallery-item {
        margin-top: 0;
        padding: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        justify-self: center !important;
    }
    
    /* Items impares (1, 3, 5, 7...): ANCHO COMPLETO */
    .gallery-item:nth-child(2n+1) {
        width: 100% !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }
    
    .gallery-item:nth-child(2n+1) .gallery-image {
        aspect-ratio: 0.75;
    }
    
    /* Items pares (2, 4, 6, 8...): ~265px ancho × 320px alto (68% ancho, aspect 0.828) */
    .gallery-item:nth-child(2n) {
        width: 68% !important;
        max-width: 68% !important;
        justify-self: center !important;
        margin-top: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }
    
    .gallery-item:nth-child(2n) .gallery-image {
        aspect-ratio: 0.828 !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Imágenes al 100% del contenedor */
    .gallery-image {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        display: block;
        border: none !important;
        outline: none !important;
    }

    .gallery-image img {
        border: none !important;
        outline: none !important;
    }
    
    .gallery-image {
        aspect-ratio: 0.75;
        width: 100%;
        margin: 0;
    }
    
    /* Flip cards en móvil */
    .gallery-item .flip-card {
        aspect-ratio: 0.75;
        width: 100%;
        margin: 0;
    }
    
    .proyecto-nav {
        margin: 100px auto 60px;
        padding: 0 15px;
    }
}

/* Small Mobile */
@media (max-width: 540px) {
    .proyecto-hero h1 {
        font-size: 20px;
        line-height: 1.3;
        max-width: 310px;
        margin: 0 auto;
    }
    
    .proyecto-hero-buttons {
        margin-top: 15px;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .proyecto-hero-button {
        font-size: 10px;
        padding: 10px 25px;
    }
    
    .proyecto-main {
        padding: 40px 0 60px;
    }
    
    .proyecto-description {
        padding: 100px 25px;
    }
    
    .proyecto-subtitle {
        font-size: 20px;
        font-weight: 400;
        color: #555555;
        max-width: 210px;
        margin: 0 auto 40px;
    }
    
    .proyecto-text {
        font-size: 15px;
        letter-spacing: 0px;
        width: auto;
        padding: 0;
        text-align: center;
        color: #7a7a7a;
        line-height: 1.8;
    }

    /* Flip cards en móvil */
    .gallery-item .flip-card,
    .gallery-item:nth-child(2n) .flip-card {
        aspect-ratio: 0.75;
        width: 100%;
        margin: 0;
    }

    .gallery-info h3 {
        font-size: 20px;
        padding: 0 25px;
    }
    
    .gallery-info p {
        font-size: 10px;
        padding: 0 25px;
    }
    
    /* Alinea títulos de grandes con chicas (85% => 7.5% de margen) */
    .gallery-item:not(:nth-child(2n)) .gallery-info {
        padding-left: 7.5%;
        padding-right: 7.5%;
    }
    
    .proyecto-nav {
        margin: 80px auto 40px;
    }
    
    .proyecto-nav-buttons {
        justify-content: center;
    }
    
    .proyecto-nav-button {
        padding: 12px 35px;
        font-size: 11px;
    }
    
    .thank-you-message {
        padding: 40px 30px;
        margin: 0 20px;
    }
    
    .thank-you-message h3 {
        font-size: 22px;
    }
    
    .thank-you-message p {
        font-size: 14px;
    }
    
    .thank-you-message svg {
        width: 50px;
        height: 50px;
    }
}

/* Extra Small Mobile */
@media (max-width: 478px) {
    .proyecto-hero h1 {
        font-size: 20px;
        line-height: 1.3;
        width: 310px;
        text-align: center;
    }
    
    .proyecto-hero-buttons {
        margin-top: 15px;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .proyecto-hero-button {
        font-size: 10px;
        padding: 10px 25px;
        flex: 0 0 auto;
        min-width: auto;
        width: auto;
    }
    
    .proyecto-description {
        padding: 100px 25px;
    }
    
    .proyecto-subtitle {
        font-weight: 400;
        font-size: 20px;
        color: #555555;
        width: 210px;
        margin-bottom: 40px;
    }
    
    .proyecto-text {
        font-size: 15px !important;
        font-weight: 400 !important;
        letter-spacing: 0px !important;
        width: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: center !important;
        color: #7a7a7a !important;
        line-height: 1.8 !important;
    }
}
