/* ===== VARIÁVEIS CSS ===== */
:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #4cc9f0;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --gray-bg: rgba(245, 245, 245, 0.95);
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 15px rgba(0,0,0,0.2);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 1rem;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Container responsivo */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== LAYOUT PRINCIPAL ===== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

/* Container do header */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 1rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.icon-small {
    width: 24px;
    height: 24px;
    filter: invert(1);
    opacity: 0.9;
    display: none;
}

/* ===== MENU HAMBURGUER (MOBILE) ===== */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: var(--accent-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--white);
    margin: 2px 0;
    transition: var(--transition);
    display: block;
}

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

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== MENU DE NAVEGAÇÃO (ABAIXO DO HEADER NO DESKTOP) ===== */
.main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--gray-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    padding: 80px 1.5rem 2rem;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.main-nav.mobile-open {
    right: 0;
}

/* Links do menu mobile (vertical) */
.main-nav a {
    color: var(--text-color) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0,0,0,0.1);
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.main-nav a.active {
    background: rgba(76, 201, 240, 0.2);
    border-left: 4px solid var(--accent-color);
    color: var(--primary-color) !important;
}

.nav-icon {
    width: 24px;
    height: 24px;
    filter: invert(0.3);
}

/* Overlay quando menu aberto (mobile) */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
    flex: 1;
    padding-top: 80px; /* Espaço para header fixo no mobile */
    padding-bottom: 2rem;
    width: 100%;
}

.main-content h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    font-size: 2rem;
    line-height: 1.3;
    border-bottom: 2px solid var(--accent-color);
}

.main-content h2 {
    color: var(--secondary-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.75rem;
    line-height: 1.3;
}

.main-content h3 {
    color: var(--secondary-color);
    margin: 1.25rem 0 0.75rem 0;
    font-size: 1.5rem;
    line-height: 1.3;
}

.main-content p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 100%;
    overflow-wrap: break-word;
}

.main-content ul, .main-content ol {
    margin: 1rem 0 1rem 1.5rem;
    max-width: 100%;
}

.main-content li {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.main-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
    transition: var(--transition);
    word-break: break-word;
}

.main-content a:hover {
    color: #3a56d4;
    border-bottom: 1px solid #3a56d4;
}

/* ===== ÍCONES INLINE ===== */
.icon-inline {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* ===== IMAGENS ===== */
.content-image {
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
    display: block;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ===== GALERIA ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.gallery-info {
    padding: 1rem;
}

.gallery-info h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
}

.gallery-info p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-light);
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 2rem 0;
    margin-top: auto; /* Empurra o footer para baixo */
    text-align: center;
    width: 100%;
}

.site-footer p {
    margin-bottom: 1rem;
    opacity: 0.9;
    font-size: 1rem;
}

/* ÍCONES DO FOOTER CORRIGIDOS */
.footer-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.footer-icons img {
    width: 32px !important; /* Tamanho fixo e correto */
    height: 32px !important;
    filter: invert(1);
    opacity: 0.8;
    transition: var(--transition);
}

.footer-icons img:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* ===== BOTÃO VOLTAR AO TOPO ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 900;
    box-shadow: var(--shadow);
}

.back-to-top.visible {
    opacity: 0.9;
    visibility: visible;
}

.back-to-top:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* ===== MEDIA QUERIES PARA DESKTOP (768px+) ===== */
@media (min-width: 768px) {
    /* HEADER DESKTOP */
    .site-header {
        position: relative; /* Não fixo no desktop */
        height: auto;
        padding: 1rem 0;
    }
    
    .header-container {
        height: auto;
        padding: 0;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    /* Logo desktop */
    .logo {
        gap: 1rem;
    }
    
    .logo h1 a {
        font-size: 2.5rem;
    }
    
    .icon-small {
        display: block;
        width: 40px;
        height: 40px;
    }
    
    /* Esconder hamburguer no desktop */
    .mobile-menu-toggle {
        display: none;
    }
    
    /* MENU DESKTOP - ABAIXO DO HEADER */
    .main-nav {
        position: static !important;
        width: 100%;
        height: auto;
        max-height: none;
        background: var(--gray-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: var(--shadow);
        border-radius: var(--border-radius);
        padding: 0.75rem 1.5rem;
        transform: none;
        right: 0;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        overflow: visible;
        margin-top: 1rem;
        border: 1px solid rgba(0,0,0,0.1);
    }
    
    /* Links do menu desktop (horizontal) */
    .main-nav a {
        color: var(--text-color) !important;
        flex-direction: column;
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        text-align: center;
        min-width: 100px;
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(0,0,0,0.1);
    }
    
    .main-nav a:hover {
        background: rgba(255, 255, 255, 0.95);
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }
    
    .main-nav a.active {
        background: rgba(76, 201, 240, 0.2);
        border-left: none;
        border-bottom: 3px solid var(--accent-color);
        color: var(--primary-color) !important;
    }
    
    /* Ícones do menu desktop (tamanho correto) */
    .nav-icon {
        width: 20px;
        height: 20px;
        margin-bottom: 0.25rem;
        filter: invert(0.3);
    }
    
    /* Conteúdo principal no desktop */
    .main-content {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }
    
    .main-content h1 {
        font-size: 2.5rem;
    }
    
    /* Galeria desktop */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    /* Imagens flutuantes no desktop */
    .content-image.left {
        float: left;
        margin: 0 1.5rem 1rem 0;
        max-width: 50%;
    }
    
    .content-image.right {
        float: right;
        margin: 0 0 1rem 1.5rem;
        max-width: 50%;
    }
    
    /* Esconder overlay no desktop */
    .menu-overlay {
        display: none;
    }
}

/* Desktops grandes (1024px+) */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
    
    .main-nav {
        gap: 1.5rem;
        padding: 0.75rem 2rem;
    }
    
    .main-nav a {
        padding: 0.75rem 1.5rem;
        min-width: 110px;
    }
    
    .logo h1 a {
        font-size: 3rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

/* Telas muito pequenas (menos de 360px) */
@media (max-width: 359px) {
    .main-nav {
        width: 250px;
    }
    
    .main-nav a {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
    
    .logo h1 a {
        font-size: 1.1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Impressão */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .mobile-menu-toggle,
    .main-nav {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}
