/* projeto-detalhe.css — Estilos modernos e dinâmicos da página de detalhe */

:root {
    --primary: #260047;
    --secondary: #1e90ff;
    --accent: #10b981;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f8fafc;
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-primary: #ffffff;
}

html.dark-mode {
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --bg-primary: #0f0f0f;
}

/* ===== HERO SECTION ===== */
.page-hero {
    position: relative;
    min-height: 420px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(38, 0, 71, 0.7) 0%, rgba(15, 23, 42, 0.6) 100%);
    z-index: 1;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 100px 24px 60px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero-content .subtitle {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    animation: slideInLeft 0.8s ease-out;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
    animation: slideInUp 0.8s ease-out 0.2s backwards;
}

/* ===== PROJECT SECTION ===== */
.project-section {
    padding: 80px 24px;
    background: var(--bg-primary);
}

.project-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

/* ===== PROJECT MEDIA (CAROUSEL) ===== */
.project-media {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

#mainImage {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2),
        0 15px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    cursor: pointer;
}

#mainImage:hover {
    transform: translateY(-8px);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ===== INTERACTIVE GALLERY ===== */
.project-gallery {
    position: relative;
}

.interactive-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ig-item {
    position: relative;
    display: block;
    aspect-ratio: 16/10;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.ig-item .img {
    position: absolute;
    inset: 0;
    background: var(--img);
    background-size: cover;
    background-position: center;
}

.ig-item .hover-zone {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-item:hover .hover-zone {
    opacity: 1;
}

.ig-item:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.hover-zone i {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0.6;
}

/* ===== PROJECT INFO ===== */
.project-info {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-primary), rgba(16, 185, 129, 0.02));
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.1);
    position: sticky;
    top: 100px;
}

.project-info h2 {
    font-family: "Oswald", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.project-location {
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.04));
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.project-location strong {
    color: var(--accent);
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.project-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #64748b;
    margin: 0;
    font-style: normal;
    font-weight: 200;
}

/* ===== ACTIONS ===== */
.project-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-elegant {
    padding: 14px 32px;
    border-radius: 12px;
    background: #f5f7fa;
    color: #1a202c;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-elegant::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-elegant:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background: #eef2f7;
    border-color: #cbd5e1;
}

.btn-elegant:hover::before {
    opacity: 1;
}

.btn-elegant.primary {
    background: linear-gradient(135deg, #1e90ff 0%, #1873e8 100%);
    color: #ffffff;
    border-color: #1873e8;
    font-weight: 600;
}

.btn-elegant.primary:hover {
    background: linear-gradient(135deg, #1873e8 0%, #155fc7 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(30, 144, 255, 0.25);
    border-color: #155fc7;
    transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== MODAL ===== */
.obra-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.obra-modal.active {
    display: flex;
}

.obra-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.obra-modal-content {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    height: auto;
    background: #000;
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 50px 80px rgba(0, 0, 0, 0.5);
}

.obra-modal-close,
.obra-modal-prev,
.obra-modal-next {
    position: absolute;
    z-index: 11;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.obra-modal-prev:hover,
.obra-modal-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.obra-modal-close:hover {
    background: transparent;
    transform: none;
}

.obra-modal-close {
    /* positioned at bottom-right corner as shown in figure */
    position: absolute;
    right: 8px;
    bottom: -495px;
    left: auto;
    transform: none;
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    transition: none;
    box-shadow: none;
}

.obra-modal-close-label {
    display: inline-block;
    background: #ffffff;
    color: #111827;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1;
}

.obra-modal-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.obra-modal-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    .project-layout {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .project-info {
        position: static;
        top: auto;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .project-section {
        padding: 60px 16px;
    }

    .project-layout {
        gap: 48px;
    }

    .project-info {
        padding: 32px 24px;
    }

    .project-info h2 {
        font-size: 1.8rem;
    }

    .hero-content {
        padding: 80px 16px 40px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .interactive-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Ajustes do modal em telas menores para garantir que o botão fechar fique visível */
    .obra-modal-content {
        max-width: 80%;
        max-height: 80vh;
        aspect-ratio: auto;
        border-radius: 10px;
        overflow: visible;
    }

    .obra-modal-close {
        /* keep bottom-right placement on small screens, as shown in figure */
        position: absolute;
        right: 6px;
        bottom: -8px;
        top: auto;
        left: auto;
        width: auto;
        height: auto;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .project-section {
        padding: 40px 12px;
    }

    .project-layout {
        gap: 40px;
    }

    .project-info {
        padding: 24px 16px;
    }

    .project-info h2 {
        font-size: 1.5rem;
    }

    .project-description {
        font-size: 1rem;
    }

    .hero-content {
        padding: 60px 12px 30px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .interactive-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .btn-elegant {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .project-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-elegant {
        width: 100%;
    }
}