/* ==========================================
   RESET & BASE STYLES
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #000000;
    --border-color: #e0e0e0;
    --hover-color: #f5f5f5;
    --nav-bg: #000000;
    --nav-text: #888888;
    --nav-text-active: #ffffff;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}


/* ==========================================
   IMAGENS - SEM FILTROS
   ========================================== */

img {
    display: block;
    max-width: 100%;
    height: auto;
}


/* ==========================================
   MOBILE MENU TOGGLE
   ========================================== */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    width: 44px;
    height: 44px;
    background: var(--nav-bg);
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--nav-text-active);
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* ==========================================
   SIDE NAVIGATION
   ========================================== */

.sidenav {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--nav-bg);
    border-right: 1px solid #333333;
    display: flex;
    flex-direction: column;
    padding: 3rem 2rem;
    z-index: 1000;
    transition: var(--transition);
}

.nav-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
    color: var(--nav-text-active);
}

.nav-subtitle {
    font-size: 1.2rem;
    color: var(--nav-text);
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 3.5rem;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 1.2rem;
}

.nav-link {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--nav-text);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--nav-text-active);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--nav-text-active);
    border-radius: 50%;
}

.nav-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid #333333;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-links a {
    font-size: 0.875rem;
    color: var(--nav-text);
}

.social-links a:hover {
    color: var(--nav-text-active);
}

.location {
    font-size: 0.875rem;
    color: #666666;
    margin-bottom: 0.5rem;
}

.email {
    font-size: 0.875rem;
    color: var(--nav-text);
    word-break: break-word;
}

.email:hover {
    color: var(--nav-text-active);
}


/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: var(--transition);
}

.section {
    min-height: 100vh;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 4rem;
}


/* ==========================================
   HOME SECTION - SUBLINHADOS NAS PALAVRAS A NEGRITO
   ========================================== */

#home .section-inner {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding-top: 8rem;
}

.home-content {
    max-width: 900px;
}

.title-large {
    font-size: 3.2rem;
    font-weight: 200;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.title-large b {
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 0.3rem;
}

.title-large b::after {
    content: '';
    position: absolute;
    left: -4px;
    right: -4px;
    bottom: 0;
    height: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 6' preserveAspectRatio='none'%3E%3Cpath d='M2,3 Q15,2.5 30,3.3 T60,3 T90,3.3 T120,3 T150,3.3 T180,3 T210,3.3 T240,3 T270,3.3 L298,3' stroke='%23000000' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    background-size: 100% 100%;
    opacity: 0;
}


/* Animação suave das linhas - aparecem gradualmente */

.title-large .line {
    opacity: 0;
    display: inline-block;
    animation: fadeInLine 0.6s ease forwards;
}

.title-large .line:nth-child(1) {
    animation-delay: 0s;
}

.title-large .line:nth-child(2) {
    animation-delay: 0.6s;
}

.title-large .line:nth-child(3) {
    animation-delay: 1.2s;
}

.title-large .line:nth-child(4) {
    animation-delay: 1.8s;
}


/* Animação para "TOMÁS OLIVEIRA" - linha 2 */

.title-large .line:nth-child(2) b::after {
    animation: drawUnderline 0.6s ease-out 2.1s forwards;
}


/* Animação para "CROSS-MEDIA DESIGNER" - linha 3 */

.title-large .line:nth-child(3) b::after {
    animation: drawUnderline 0.8s ease-out 2.5s forwards;
}


/* Intro text também aparece suavemente */

.intro-text {
    opacity: 0;
    animation: fadeInLine 0.6s ease forwards;
    animation-delay: 1.8s;
    font-size: 1.5rem;
    color: #666;
    line-height: 1.8;
    margin-top: 1rem;
}

@keyframes fadeInLine {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes drawUnderline {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}


/* ==========================================
   SECTION TITLE
   ========================================== */

.section-title {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 3rem;
    /*letter-spacing: -0.02em;*/
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    bottom: 0.2rem;
    height: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'%3E%3Cpath d='M2,4 Q15,3 30,4.5 T60,4 T90,4.5 T120,4 T150,4.5 T180,4 T210,4.5 T240,4 T270,4.5 L298,4' stroke='%23000000' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    background-size: 100% 100%;
    opacity: 0;
    animation: drawUnderline 0.8s ease-out 0.3s forwards;
}

@keyframes drawUnderline {
    from {
        opacity: 1;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}


/* ==========================================
   WORK GRID
   ========================================== */

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 3rem;
}

.project-item {
    cursor: pointer;
    transition: var(--transition);
}

.project-item:hover {
    transform: translateY(-4px);
}

.project-image {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--hover-color);
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 2px;
    position: relative;
    border-radius: 6px;
}

.project-image.has-image {
    background: transparent;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: var(--transition);
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.875rem;
}

.project-info h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.project-meta {
    font-size: 0.875rem;
    color: #666;
}


/* ==========================================
   ACADEMIC WORK TRIGGER (Estilo Rabisco)
   ========================================== */

.academic-trigger-container {
    grid-column: 1 / -1;
    /* Ocupa toda a largura do grid */
    display: flex;
    justify-content: center;
    /* REDUZIDO: Diminui a margem vertical total (de 4rem para 2rem/1rem) */
    margin: 2rem 0 1rem 0;
}

.academic-trigger {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--color-text-primary);
    text-decoration: none;
    /* AJUSTADO: Aumenta padding-top para centrar o texto */
    padding: 1.8rem 1.7rem 1.2rem 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: all 0.3s ease;
}


/* O Círculo Rabiscado que envolve o texto */

.academic-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid currentColor;
    /* Para simular o aspeto irregular */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    opacity: 0.7;
    pointer-events: none;
    transition: all 0.3s ease;
}

.academic-trigger:hover::before {
    /* Movimento subtil ao passar o rato */
    border-radius: 40% 60% 70% 30% / 40% 60% 30% 70%;
    opacity: 1;
}

.academic-text {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
}

.academic-arrow {
    width: 35px;
    height: 10px;
    stroke-width: 4;
}


/* ==========================================
   ABOUT SECTION
   ========================================== */

.about-content {
    max-width: 900px;
}

.about-intro {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    align-items: start;
}

.about-photo {
    width: 250px;
    height: 250px;
    border-radius: 0;
    overflow: hidden;
    border: 3px solid #000000;
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover-color);
    color: #999;
    font-size: 0.875rem;
}

.about-text .lead {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-text p {
    color: #666;
    line-height: 1.8;
}

.timeline-section {
    margin-bottom: 4rem;
}

.timeline-section h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2.5rem;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.experience-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.education-column h4,
.experience-column h4 {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    height: calc(100% - 1rem);
    width: 1px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
    padding-left: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 9px;
    height: 9px;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    transform: translateX(-4px);
}

.timeline-year {
    font-size: 0.875rem;
    font-weight: 600;
    color: #999;
    margin-bottom: 0.5rem;
    /*letter-spacing: 0.05em;*/
}

.timeline-content p {
    color: #666;
    font-size: 0.938rem;
    line-height: 1.6;
}


/* ==========================================
   PROJECT MODAL
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--bg-color);
    border-radius: 2px;
    overflow: hidden;
    z-index: 2001;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2002;
    transition: var(--transition);
    color: var(--text-color);
}

.modal-close:hover {
    background: var(--hover-color);
    transform: rotate(90deg);
}

.modal-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-images {
    padding: 1rem;
    /* REDUZIDO de 2rem para 1rem */
    background: var(--hover-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0.04, 0.04, 0.04, 0.08);
}

.modal-images img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 8px rgba(0.04, 0.04, 0.04, 0.08);
}

.modal-info {
    padding: 3rem;
    overflow-y: auto;
}

.modal-title {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    /*letter-spacing: -0.02em;*/
}

.modal-year {
    font-size: 1rem;
    color: #999;
    margin-bottom: 1.5rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 0.813rem;
    color: #666;
    transition: var(--transition);
}

.tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.modal-description {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-description p {
    line-height: 1.8;
    color: #666;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-action-button {
    display: inline-block;
    margin-top: 0;
    margin-bottom: 2rem;
    padding: 0.75em 1.5em 1em 1em;
    background-color: var(--accent-color);
    color: var(--bg-color);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    border: 1px solid var(--accent-color);
    border-radius: 3px;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
}

.project-action-button:hover {
    background-color: transparent;
    color: var(--accent-color);
    /* Inverte as cores no hover */
}

.detail-item strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    /*letter-spacing: 0.05em;*/
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.detail-item p {
    color: #666;
    line-height: 1.6;
}


/* ==========================================
   CAROUSEL
   ========================================== */

.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--hover-color);
    border-radius: 2px;
}

.carousel-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover-color);
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.20em;
    z-index: 100;
    transition: all 0.2s ease;
    color: #000;
    font-weight: 300;
    user-select: none;
}

.carousel-btn:hover {
    background: white;
    border-color: #000;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.carousel-indicator:hover {
    border-color: #666;
}

.carousel-indicator.active {
    background: #000;
    border-color: #000;
}


/* ==========================================
   VIDEO EMBED
   ========================================== */

.modal-video {
    margin-top: 0;
    width: 100%;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 2px;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}


/* ==========================================
   RESPONSIVE DESIGN - TABLET
   ========================================== */

@media (max-width: 1024px) {
    .sidenav {
        width: 240px;
        padding: 2rem 1.5rem;
    }
    .main-content {
        margin-left: 240px;
    }
    .section-inner {
        padding: 4rem 2rem;
    }
    .title-large {
        font-size: 2.5rem;
    }
    .work-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
    .experience-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .education-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}


/* ==========================================
   RESPONSIVE DESIGN - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    .sidenav {
        width: 280px;
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidenav.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }
    .nav-header h1 {
        font-size: 1.75rem;
    }
    .nav-subtitle {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }
    .main-content {
        margin-left: 0;
    }
    .section-inner {
        padding: 5rem 1.5rem 3rem;
    }
    #home .section-inner {
        padding: 6rem 1.5rem 3rem;
    }
    .title-large {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    .intro-text {
        font-size: 1.125rem;
    }
    .intro-text br {
        display: none;
    }
    .section-title {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }
    .work-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .about-intro {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 3rem;
    }
    .about-photo {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }
    .about-text .lead {
        font-size: 1rem;
    }
    .timeline {
        padding-left: 1.5rem;
    }
    .timeline-item {
        padding-left: 1.5rem;
        padding-bottom: 2rem;
    }
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
    .modal-inner {
        grid-template-columns: 1fr;
    }
    .modal-images {
        padding: 1.5rem;
    }
    .modal-info {
        padding: 2rem 1.5rem;
    }
    .modal-title {
        font-size: 1.5rem;
    }
    .modal-tags {
        gap: 0.4rem;
        margin-bottom: 1.5rem;
    }
    .tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    .carousel-prev {
        left: 0.5rem;
    }
    .carousel-next {
        right: 0.5rem;
    }
}


/* ==========================================
   RESPONSIVE DESIGN - SMALL MOBILE
   ========================================== */

@media (max-width: 480px) {
    .mobile-menu-toggle {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    .mobile-menu-toggle span {
        width: 20px;
    }
    .sidenav {
        width: 260px;
        padding: 2rem 1.25rem;
    }
    .nav-header h1 {
        font-size: 1.5rem;
    }
    .nav-subtitle {
        font-size: 0.9rem;
    }
    .nav-links li {
        margin-bottom: 1rem;
    }
    .nav-link {
        font-size: 0.938rem;
    }
    .section-inner {
        padding: 4.5rem 1.25rem 2.5rem;
    }
    #home .section-inner {
        padding: 5rem 1.25rem 2.5rem;
    }
    .title-large {
        font-size: 1.75rem;
    }
    .intro-text {
        font-size: 1rem;
    }
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    .work-grid {
        gap: 1.5rem;
    }
    .project-info h3 {
        font-size: 1.125rem;
    }
    .about-photo {
        width: 120px;
        height: 120px;
    }
    .about-text .lead {
        font-size: 1rem;
    }
    .timeline-section h3 {
        font-size: 1.25rem;
        margin-bottom: 2rem;
    }
    .modal-images {
        padding: 1rem;
    }
    .modal-info {
        padding: 1.5rem 1.25rem;
    }
    .modal-title {
        font-size: 1.25rem;
    }
    .modal-description {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }
}


/* ==========================================
   UTILITY CLASSES
   ========================================== */

body.modal-open,
body.menu-open {
    overflow: hidden;
}

html {
    scroll-behavior: smooth;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@media print {
    .sidenav,
    .mobile-menu-toggle,
    .modal {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
    .section {
        display: block !important;
        opacity: 1 !important;
        page-break-after: always;
    }
}


/* ==========================================
   SVG DRAWING ANIMATION - ADICIONAR NO FINAL DO STYLES.CSS
   ========================================== */

.home-svg-container {
    position: absolute;
    right: -38%;
    top: 5%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 900px;
    opacity: 0;
    animation: fadeInSVG 1.2s ease forwards;
    animation-delay: 2.6s;
    z-index: 0;
    pointer-events: none;
}

@keyframes fadeInSVG {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* Animação de desenho para os paths do SVG */

.home-svg-container svg path {
    fill: none;
    stroke: #000000;
    stroke-width: 2;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawSVG 12s ease-out forwards;
    animation-delay: 0s;
}


/* Animação personalizada para múltiplos paths */

.home-svg-container svg path:nth-child(1) {
    animation-delay: 2.6s;
}

.home-svg-container svg path:nth-child(2) {
    animation-delay: 2.8s;
}

.home-svg-container svg path:nth-child(3) {
    animation-delay: 3s;
}

.home-svg-container svg path:nth-child(4) {
    animation-delay: 3.2s;
}

.home-svg-container svg path:nth-child(5) {
    animation-delay: 3.4s;
}

@keyframes drawSVG {
    to {
        stroke-dashoffset: 0;
    }
}


/* Ajuste do layout da home para acomodar o SVG */

#home .section-inner {
    position: relative;
}

.home-content {
    max-width: 80%;
    position: relative;
    z-index: 10;
}


/* Responsive - Tablet */

@media (max-width: 1024px) {
    .home-svg-container {
        width: 40%;
        right: 3%;
    }
    .home-content {
        max-width: 55%;
    }
}


/* Responsive - Mobile */

@media (max-width: 768px) {
    .home-svg-container {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 80%;
        max-width: 400px;
        margin: 3rem auto 0;
        opacity: 0;
        animation: fadeInSVG 0.8s ease forwards;
        animation-delay: 2.4s;
    }
    .home-content {
        max-width: 100%;
    }
    #home .section-inner {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .home-svg-container {
        width: 90%;
        margin: 2rem auto 0;
    }
}


/* ==========================================
   IMAGE LIGHTBOX (Ecrã Inteiro)
   ========================================== */

.lightbox {
    display: none;
    /* Escondido por defeito */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    /* Mais alto que o modal do projeto (que é 2000) */
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
    /* Mostra quando ativo */
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    /* Fundo mais escuro */
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 3003;
    /* Alterado para 3003 (acima dos nav) */
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-image {
    position: relative;
    z-index: 3001;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Para a imagem caber sem cortar */
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
    /* Reutiliza a animação do modal */
}


/* ==========================================
   IMAGE LIGHTBOX (Ecrã Inteiro) - Botões de Navegação (ADICIONADO)
   ========================================== */

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    /* Mais largo para ser fácil de clicar */
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    font-size: 3rem;
    /* Símbolo maior */
    display: flex;
    /* Para centralizar o símbolo */
    align-items: center;
    justify-content: center;
    padding-bottom: 0.20em;
    cursor: pointer;
    z-index: 3002;
    transition: var(--transition);
    user-select: none;
    /* Não permite selecionar o texto do botão */
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 2rem;
    /* Mais afastado da borda */
}

.lightbox-next {
    right: 2rem;
    /* Mais afastado da borda */
}


/* Ocultar botões se houver apenas uma imagem */

.lightbox:not(.has-multiple-images) .lightbox-nav {
    display: none;
}