/* --- GLOBAIS, RESET E VARIÁVEIS --- */
:root {
    --primary-color: #0d47a1; --secondary-color: #1976d2; --accent-color: #ffc107;
    --text-color-light: #333; --text-color-dark: #f0f0f0; --background-light: #ffffff;
    --background-dark: #121212; --surface-light: #f8f9fa; --surface-dark: #1e1e1e;
    --border-color-light: #e0e0e0; --border-color-dark: #3a3a3a;
    --font-primary: 'Montserrat', sans-serif; --font-headings: 'Playfair Display', serif;
    --header-height: 80px; --border-radius: 8px; --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.1); --transition-speed: 0.3s ease;
}
body.dark-mode {
    --primary-color: #1976d2; --secondary-color: #0d47a1; --text-color-light: #f0f0f0;
    --text-color-dark: #333; --background-light: #121212; --background-dark: #ffffff;
    --surface-light: #1e1e1e; --surface-dark: #f8f9fa; --border-color-light: #3a3a3a;
    --border-color-dark: #e0e0e0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-primary); background-color: var(--background-light);
    color: var(--text-color-light); line-height: 1.7;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}
body.mobile-menu-open { overflow: hidden; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 1400px) { .container { max-width: 1300px; } }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-headings); color: var(--text-color-light); }

/* --- CABEÇALHO E NAVEGAÇÃO --- */
.main-header {
    height: var(--header-height); display: flex; align-items: center;
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    background-color: rgba(30, 30, 30, 0.85); backdrop-filter: blur(10px);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}
.main-header.scrolled { background-color: var(--background-light); box-shadow: var(--shadow-md); }
.main-header .container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo img { height: 45px; }
.main-header.scrolled .logo img { content: url('about:blank'); /* Truque para o JS funcionar */ }
body.dark-mode .main-header.scrolled .logo img { content: url('about:blank'); }
.header-actions { display: flex; align-items: center; gap: 15px; }
#dark-mode-toggle { background: none; border: none; cursor: pointer; font-size: 1.5rem; color: #fff; transition: color var(--transition-speed); }
.main-header.scrolled #dark-mode-toggle { color: var(--text-color-light); }
.main-nav ul { list-style: none; display: flex; gap: 30px; }
.main-nav a { text-decoration: none; color: #fff; font-weight: 600; position: relative; padding-bottom: 5px; }
.main-header.scrolled .main-nav a { color: var(--text-color-light); }
.main-nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-color); transition: width var(--transition-speed); }
.main-nav a:hover::after { width: 100%; }
.mobile-menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.8rem; cursor: pointer; z-index: 1002; }
.main-header.scrolled .mobile-menu-toggle { color: var(--text-color-light); }
.mobile-menu-toggle .fa-times { display: none; }
.mobile-menu-toggle.active .fa-bars { display: none; }
.mobile-menu-toggle.active .fa-times { display: block; }

/* --- SECÇÕES GERAIS E BOTÕES --- */
.btn { padding: 12px 25px; text-decoration: none; border-radius: 50px; font-weight: 700; transition: all var(--transition-speed); border: none; cursor: pointer; }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: var(--secondary-color); transform: translateY(-3px); }
.btn-secondary { background-color: var(--accent-color); color: var(--text-color-dark); }
.btn-secondary:hover { background-color: #ffca28; transform: translateY(-3px); }
main > section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-tag { display: inline-block; margin-bottom: 10px; font-weight: 600; color: var(--primary-color); }
.section-title { font-size: 2.8rem; line-height: 1.2; margin-bottom: 15px; }

/* --- SECÇÕES DA PÁGINA PRINCIPAL --- */
.hero-section { padding: 0; height: 100vh; width: 100%; color: #fff; position: relative; display: flex; align-items: center; justify-content: center; }
.hero-video-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; }
.hero-video-wrapper video { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); }
.hero-content { position: relative; z-index: 2; text-align: center; }
.hero-title { font-size: 4rem; font-family: var(--font-headings); color: #fff; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.hero-subtitle { font-size: 1.2rem; max-width: 700px; margin: 1rem auto 2rem; }
.featured-services-section, .portfolio-section { background-color: var(--surface-light); }
.services-grid-visual { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; }
.service-card-visual { position: relative; border-radius: var(--border-radius); overflow: hidden; height: 400px; }
.service-card-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.service-card-visual:hover img { transform: scale(1.1); }
.service-card-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 30px; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); color: #fff; }
.service-card-overlay h3 { color: #fff; font-size: 1.8rem; margin-bottom: 5px; }
.service-link { color: var(--accent-color); text-decoration: none; font-weight: 600; opacity: 0; transform: translateY(10px); transition: all var(--transition-speed); }
.service-card-visual:hover .service-link { opacity: 1; transform: translateY(0); }
.about-us-container { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; align-items: center; }
.about-us-image img { border-radius: var(--border-radius); box-shadow: var(--shadow-md); }
.about-us-content .section-title { text-align: left; }
.portfolio-filters { text-align: center; margin-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.filter-btn { background: none; border: 1px solid var(--border-color-light); padding: 8px 20px; cursor: pointer; border-radius: 20px; color: var(--text-color-light); transition: all var(--transition-speed); }
.filter-btn.active, .filter-btn:hover { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.portfolio-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; }
.portfolio-item { border-radius: var(--border-radius); overflow: hidden; }
.portfolio-item img { transition: transform 0.4s ease, filter 0.4s ease; }
.portfolio-item:hover img { transform: scale(1.05); filter: brightness(0.8); }
.post-card { background: var(--background-light); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: all var(--transition-speed); display: flex; flex-direction: column; height: 100%; }
.post-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.post-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; flex-grow: 1; }
.post-card-image { height: 200px; overflow: hidden; flex-shrink: 0; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-content { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.post-card-content h3 { font-size: 1.3rem; margin: 5px 0 10px; }
.post-card-content p { flex-grow: 1; margin-bottom: 1rem; }
.post-card-readmore { font-weight: 600; color: var(--primary-color); margin-top: auto; }

/* --- SLIDER DE BLOG NA HOME (ESTRUTURA CORRIGIDA) --- */
.posts-grid .blog-slider .swiper-wrapper {
    /* No desktop, o wrapper do Swiper comporta-se como um grid */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.posts-grid .blog-slider .swiper-slide { width: 90%; height: auto; }
.posts-grid .blog-slider .swiper-pagination { display: none; }

/* --- RODAPÉ --- */
.main-footer { background-color: #1a1a1a; color: #ccc; padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.5fr 1.5fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { max-width: 150px; margin-bottom: 15px; }
.footer-column h4 { font-family: var(--font-primary); font-size: 1.2rem; color: #fff; margin-bottom: 20px; }
.footer-column ul { list-style: none; }
.footer-column ul li { margin-bottom: 10px; }
.footer-column ul a { color: #ccc; text-decoration: none; transition: color var(--transition-speed); }
.footer-column ul a:hover { color: var(--accent-color); }
.social-links { display: flex; gap: 15px; margin-top: 20px; }
.social-links a { color: #ccc; font-size: 1.2rem; transition: color var(--transition-speed); }
.social-links a:hover { color: #fff; }
.contact-info i { margin-right: 10px; width: 20px; }
.newsletter-form { display: flex; }
.newsletter-form input { flex-grow: 1; border: 1px solid var(--border-color-dark); background: #333; color: #fff; padding: 10px; border-radius: 5px 0 0 5px; }
.newsletter-form button { background: var(--primary-color); border: none; color: #fff; padding: 0 15px; border-radius: 0 5px 5px 0; cursor: pointer; }
.footer-bottom { text-align: center; border-top: 1px solid var(--border-color-dark); padding-top: 20px; font-size: 0.9rem; color: #aaa; }

/* --- ESTILOS PARA PÁGINAS INTERNAS (SOBRE, SERVIÇOS, BLOG, ETC) --- */
.page-main-content { margin-top: var(--header-height); }
.page-hero { background-color: var(--primary-color); color: #fff; padding: 60px 20px; text-align: center; }
.page-hero h1 { color: #fff; font-size: 3rem; }
.page-hero p { font-size: 1.2rem; opacity: 0.9; }
.page-intro { max-width: 800px; margin: 0 auto; }
.page-container { display: grid; grid-template-columns: 1fr; gap: 40px; padding-top: 60px; padding-bottom: 60px; align-items: start; }
.main-column { width: 100%; }
.page-title { font-size: 2.5rem; margin-bottom: 30px; border-bottom: 2px solid var(--border-color-light); padding-bottom: 10px; }
.blog-post-item { background: var(--background-light); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); margin-bottom: 30px; overflow: hidden; transition: box-shadow var(--transition-speed); display: flex; flex-direction: column; }
.blog-post-item:hover { box-shadow: var(--shadow-md); }
.post-item-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%;}
.post-item-image-wrapper { width: 100%; flex-shrink: 0; }
.post-item-image { width: 100%; height: 250px; object-fit: cover; display: block; }
.post-item-content { padding: 25px; }
.post-item-content h2 { font-size: 1.8rem; margin-bottom: 10px; }
.post-item-meta { color: #777; font-size: 0.9rem; margin-bottom: 15px; }
.post-item-content p { margin-bottom: 15px; }
.post-item-readmore { font-weight: 600; color: var(--primary-color); }
.article-content h1 { font-size: 3rem; line-height: 1.2; }
.article-featured-image { width: 100%; border-radius: var(--border-radius); margin: 20px 0; }
.article-body { font-size: 1.1rem; line-height: 1.8; }
.article-body p, .article-body ul, .article-body ol { margin-bottom: 1.5rem; }
.article-body h2, .article-body h3 { margin-top: 2rem; margin-bottom: 1rem; }
.article-body a { color: var(--primary-color); text-decoration: underline; }
.article-body img { max-width: 100%; height: auto; border-radius: 5px; }
.article-body blockquote { border-left: 4px solid var(--primary-color); padding-left: 15px; font-style: italic; color: #555; }
body.dark-mode .article-body blockquote { color: #ccc; }
.article-share { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-color-light); }
.article-share h3 { margin-bottom: 15px; font-size: 1.3rem; }
.share-buttons-container { display: flex; flex-wrap: wrap; gap: 10px; }
.share-btn { text-decoration: none; color: #fff; padding: 10px 15px; border-radius: 5px; font-size: 0.9rem; font-weight: 600; display: inline-flex; align-items: center; transition: opacity 0.3s; }
.share-btn:hover { opacity: 0.9; }
.share-btn i { margin-right: 8px; font-size: 1.1rem; }
.share-facebook { background-color: #1877F2; }
.share-twitter { background-color: #1DA1F2; }
.share-linkedin { background-color: #0A66C2; }
.share-whatsapp { background-color: #25D366; }
.sidebar-column .widget { background: var(--surface-light); padding: 20px; border-radius: var(--border-radius); margin-bottom: 30px; }
.widget-title { font-size: 1.3rem; margin-bottom: 15px; border-bottom: 1px solid var(--border-color-light); padding-bottom: 10px; }
.widget-list-rich { list-style: none; padding: 0; }
.widget-list-rich li { margin-bottom: 15px; }
.widget-list-rich li a { text-decoration: none; color: var(--text-color-light); display: flex; align-items: center; gap: 15px; transition: color var(--transition-speed); }
.widget-list-rich li a:hover { color: var(--primary-color); }
.widget-list-rich .widget-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.widget-list-rich span { font-weight: 600; }
.widget-portfolio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.widget-portfolio-item { position: relative; }
.widget-portfolio-item img { width: 100%; height: 100px; object-fit: cover; border-radius: 5px; display: block; }
.widget-portfolio-title { font-size: 0.8rem; font-weight: 600; text-align: center; margin-top: 5px; color: #555; }
body.dark-mode .widget-portfolio-title { color: #ccc; }
.service-page-section, .about-page-section { display: grid; grid-template-columns: 1fr; gap: 30px; align-items: center; padding: 60px 0; border-bottom: 1px solid var(--border-color-light); }
.service-page-image img, .about-page-image img { width: 100%; height: auto; border-radius: var(--border-radius); box-shadow: var(--shadow-md); }
.service-page-content h2, .about-page-content h2 { font-size: 2.5rem; margin-bottom: 20px; }
.service-details-text, .about-page-content p { margin-bottom: 30px; line-height: 1.8; }
.service-details-text ul { list-style: none; padding-left: 0; }
.service-details-text li { padding-left: 25px; position: relative; margin-bottom: 10px; }
.service-details-text li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--primary-color); position: absolute; left: 0; }
.contact-page-container { display: grid; grid-template-columns: 1fr; gap: 40px; padding: 60px 0; }
.contact-form-wrapper, .contact-info-wrapper { background: var(--surface-light); padding: 30px; border-radius: var(--border-radius); }
.contact-form-wrapper h3, .contact-info-wrapper h3 { font-size: 1.8rem; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 20px; }
.contact-form-wrapper .input-group { margin-bottom: 20px; }
.contact-form-wrapper .input-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: #555; }
body.dark-mode .contact-form-wrapper .input-group label { color: #ccc; }
.contact-form-wrapper .input-group input, .contact-form-wrapper .input-group textarea { width: 100%; padding: 15px; border: 1px solid var(--border-color-light); border-radius: var(--border-radius); background-color: var(--background-light); font-size: 1rem; font-family: var(--font-primary); color: var(--text-color-light); transition: border-color 0.3s, box-shadow 0.3s; }
.contact-form-wrapper .input-group input:focus, .contact-form-wrapper .input-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1); }
body.dark-mode .contact-form-wrapper .input-group input:focus, body.dark-mode .contact-form-wrapper .input-group textarea:focus { box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2); }
.contact-form-wrapper .btn-submit { width: 100%; padding: 15px; font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; transition: transform 0.3s, box-shadow 0.3s; }
.contact-form-wrapper .btn-submit:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
.legal-page-container { padding: 60px 0; max-width: 800px; }
.legal-content { line-height: 1.8; }
.legal-content h2 { font-size: 1.8rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.map-wrapper { position: relative; width: 100%; height: 300px; border-radius: var(--border-radius); overflow: hidden; }
.map-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* --- RESPONSIVIDADE --- */
@media (min-width: 992px) {
    .page-container { grid-template-columns: 2.5fr 1fr; }
    .sidebar-column { position: sticky; top: calc(var(--header-height) + 40px); }
    .contact-page-container { grid-template-columns: 1.5fr 1fr; }
}
@media (min-width: 768px) {
    .post-item-link { flex-direction: row; }
    .post-item-image-wrapper { width: 300px; }
    .service-page-section, .about-page-section { grid-template-columns: 1fr 1fr; gap: 50px; }
    .service-page-section:nth-child(even) .service-page-image, .about-page-section:nth-child(even) .about-page-image { grid-column: 2; }
    .service-page-section:nth-child(even) .service-page-content, .about-page-section:nth-child(even) .about-page-content { grid-column: 1; grid-row: 1; }
    .form-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
    .services-grid-visual, .posts-grid .blog-slider .swiper-wrapper { grid-template-columns: repeat(2, 1fr); }
    .about-us-container { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 767px) {
    .main-nav { display: none; }
    .main-nav.nav-active { 
        display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; 
        background-color: rgba(13, 71, 161, 0.95); backdrop-filter: blur(10px); 
        justify-content: center; align-items: center;
    }
    body.dark-mode .main-nav.nav-active { background-color: rgba(18, 18, 18, 0.95); }
    .main-nav ul { flex-direction: column; text-align: center; gap: 30px; }
    .main-nav a { font-size: 1.8rem; color: #fff; }
    .header-actions .btn-primary { display: none; }
    .mobile-menu-toggle { display: block; }

    /* Slider do Blog para Mobile */
    .posts-grid .blog-slider .swiper-wrapper { display: flex; gap: 0; }
    .posts-grid .blog-slider .swiper-slide { width: 80%; flex-shrink: 0; margin-right: 15px; }
    .blog-slider { overflow: visible; }
    .posts-grid .blog-slider .swiper-pagination { display: block; position: absolute; bottom: -40px; }
    .swiper-pagination-bullet { background-color: var(--primary-color); opacity: 0.5; }
    .swiper-pagination-bullet-active { opacity: 1; }
    .latest-posts-section { padding-bottom: 120px; }

    /* Outras regras mobile */
    main > section { padding: 60px 0; }
    .section-title { font-size: 2.2rem; }
    .hero-title { font-size: 2.5rem; }
    .services-grid-visual { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-logo, .social-links, .newsletter-form, .contact-info li { margin: 0 auto; justify-content: center; }
    .article-content h1 { font-size: 2.2rem; }
    .page-hero h1 { font-size: 2.5rem; }
}