:root {
    --primary: #1f6feb;
    --primary-dark: #174fb0;
    --bg: #f5f7fb;
    --text: #222;
    --muted: #666;
    --white: #ffffff;
    --border: #e0e4ee;
}

html {
    /* Garante que o deslize até à secção seja suave */
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 95%;
    max-width: 1250px;
    margin: 0 auto;
}

/* Header */

.site-header, .site-header-inner {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.site-header {
    background: rgba(59, 59, 59, 0.4);
    border-bottom: none;
}

.site-header-inner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative; /* Adicionado para posicionamento absoluto do menu mobile */
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    font-weight: 700;
    font-size: 1.2rem;
}

/* Cores para Header Transparente (Index) */
.site-header .logo a { color: var(--white); }

/* Cores para Header Sólido (Páginas e Scroll) */
.site-header-inner .logo a,
.site-header.scrolled .logo a { color: var(--primary); }

.logo-img {
    height: 50px; /* Aumentado ligeiramente para maior destaque */
    width: auto;
    display: block;
    object-fit: contain;
}

.main-nav a {
    margin-left: 1.5rem;
    font-size: 0.95rem;
}

/* Cores para Header Transparente (Index) */
.site-header .main-nav a { color: var(--white); }

/* Cores para Header Sólido (Páginas e Scroll) */
.site-header-inner .main-nav a,
.site-header.scrolled .main-nav a { color: var(--muted); }

/* Hover para o Header Transparente (Index) */
.site-header .main-nav a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Hover para o Header Sólido (Páginas Internas e Scroll) */
.site-header-inner .main-nav a:hover,
.site-header.scrolled .main-nav a:hover { color: var(--primary); }

.site-header-inner .menu-toggle .bar,
.site-header.scrolled .menu-toggle .bar {
    background-color: var(--text);
}

/* Menu Toggle (Hamburger Icon) */
.menu-toggle {
    display: none; /* Hidden by default on larger screens */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 11; /* Ensure it's above other content if header is sticky */
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--white);
    transition: all 0.3s ease-in-out;
}

.menu-toggle .bar:not(:last-child) { margin-bottom: 5px; }

/* Animação do Hamburger para X */
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero */

.hero {
    position: relative; /* Necessário para posicionar o overlay */
    padding: 10rem 0 6rem; /* Aumentado o topo para compensar o cabeçalho fixo */
    min-height: 500px; /* Garante que a seção tenha uma altura mínima */
    display: flex; /* Para centralizar o conteúdo verticalmente */
    align-items: center; /* Centraliza o conteúdo verticalmente */
    justify-content: center; /* Centraliza o conteúdo horizontalmente */
    background-image: url('../imagens/imagem_capa.jpg'); /* Caminho relativo correto: sai de /css e entra em /imagens */
    background-size: cover; /* Faz a imagem cobrir toda a área */
    background-position: center center; /* Centraliza a imagem */
    background-repeat: no-repeat; /* Evita a repetição da imagem */
    color: var(--white); /* Define a cor do texto para branco para contraste */
    margin-bottom: 2.5rem; /* Aproximadamente 2 linhas de espaço */
}

/* Overlay para melhorar a legibilidade do texto */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Overlay preto com 50% de opacidade */
    z-index: 1;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative; /* Coloca o conteúdo acima do overlay */
    z-index: 2;
}

.hero-text h1 {
    font-size: 2.5rem; /* Ajustado para ser um pouco menor */
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white); /* Garante que o título seja branco */
}

.hero-text p {
    max-width: 700px;
    color: var(--white); /* Garante que o parágrafo seja branco */
    margin: 0 auto 1.5rem; /* Adicionado auto nas laterais para centrar o bloco */
    font-size: 1.1rem;
}

/* Ajustes para o botão no hero */
.hero-text .btn-primary {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary); /* Adiciona uma borda para melhor visibilidade */
    transition: background 0.3s ease, border-color 0.3s ease;
}

.hero-text .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0; /* Ajusta o padding para telas menores */
        min-height: 400px;
    }
    .hero-text h1 {
        font-size: 1.8rem; /* Ainda menor em smartphones */
    }
}
/* Buttons */

.btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Sections */

.page-header {
    padding: 8rem 0 2rem; /* Aumentado para páginas sem Hero não ficarem tapadas */
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--muted);
}

.content-section {
    padding: 2rem 0 3rem;
    /* Evita que o header fixo tape o título da secção ao clicar no link */
    scroll-margin-top: 90px;
}

/* Layout helpers */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.two-columns {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 2rem;
}

/* Cards */

.card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.text-center {
    text-align: center;
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block; /* Garante que o ícone se comporte como um bloco para o alinhamento */
    text-align: center;
}

.card-icon-left {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block; /* Garante que o ícone se comporte como um bloco para o alinhamento */
    text-align: left;
}
.card h3 {
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--muted);
}

/* Lists */

.list {
    list-style: none;
}

.list li { margin-bottom: 0.4rem; position: relative; padding-left: 1.2rem; }

.list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Gallery */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background: var(--white);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%;
    display: block;
    height: 200px;
    object-fit: cover;
}

/* Ensure gallery-item content is readable */
.gallery-item h3 { padding: 0.8rem 1rem 0.2rem; font-size: 1.1rem; /* Adjust font size */ }

.gallery-item p { padding: 0 1rem 1rem; color: var(--muted); font-size: 0.9rem; }

/* Estilos do Carrossel de Portfólio */
#portfolioCarousel {
    padding: 0 45px; /* Espaço para as setas não ficarem em cima das imagens */
}

#portfolioCarousel .carousel-control-prev,
#portfolioCarousel .carousel-control-next {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
}

#portfolioCarousel .carousel-control-prev:hover,
#portfolioCarousel .carousel-control-next:hover {
    opacity: 1;
    background-color: var(--primary-dark);
}

#portfolioCarousel .carousel-control-prev { left: 0; }
#portfolioCarousel .carousel-control-next { right: 0; }

/* Contact form */

.contact-form {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    font: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-feedback {
    margin-top: 1rem;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
    background: #f8f8f8;
    padding: 1rem 0;
    margin-top: 2rem;
    width: 100%;
    z-index: 100;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--muted);
}
.footer-left {
    text-align: left;
    margin: 0;
}
.footer-right {
    text-align: right;
    margin: 0;
}
/* Responsivo */

@media (max-width: 991px) {
    /* Força o Header a manter os itens alinhados horizontalmente (Logo de um lado, Botão do outro) */
    .header-inner {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
    }

    /* GARANTE QUE O BOTÃO APAREÇA */
    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        background: transparent;
    }

    /* GARANTE QUE A LISTA DESAPAREÇA POR PADRÃO */
    .main-nav {
        display: none !important; 
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: auto; /* Remove o posicionamento à esquerda */
        right: 0; /* Posiciona o menu à direita */
        width: 180px; /* Reduz a largura da "janela" do menu */
        background: rgba(255, 255, 255, 0.8); /* Branco com transparência */
        padding: 1rem 5%;
        border-bottom: 1px solid var(--border);
        border-left: 1px solid var(--border); /* Adiciona uma borda lateral para definir melhor o menu */
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        z-index: 999;
    }

    /* QUANDO ATIVO PELO JS */
    .main-nav.active {
        display: flex !important; 
    }

    .main-nav a, .site-header .main-nav a {
        margin: 1rem 0 !important;
        width: 100%;
        display: block;
        font-size: 1.1rem;
        text-align: right; /* Alinha o texto dos itens à direita */
        color: var(--text) !important; /* Força a cor escura para ser visível sobre o fundo branco */
    }

    .main-nav a:hover {
        color: var(--primary);
    }
}

@media (max-width: 768px) {
    .hero-inner {
        flex-direction: column;
    }
    .grid-3, .two-columns {
        grid-template-columns: 1fr; /* As colunas empilham-se em ecrãs pequenos */
    }
}
/* Sombras azuladas para os cards dos serviços */
#servicos .card {
    box-shadow: 0 8px 24px 0 rgba(33, 150, 243, 0.18), 8px 0 24px 0 rgba(33, 150, 243, 0.10);
    border-radius: 12px;
    transition: box-shadow 0.3s;
    background: #fff;
}
#servicos .card:hover {
    box-shadow: 0 12px 32px 0 rgba(33, 150, 243, 0.28), 12px 0 32px 0 rgba(33, 150, 243, 0.18);
}

/* Estilos para links dentro de cards na secção de conteúdo */
/* Estilos para links dentro de cards na secção de conteúdo */
.content-section .card a {
    color: var(--primary); /* Cor padrão do link */
    transition: color 0.3s ease; /* Transição suave para a mudança de cor */
}

.content-section .card a:hover {
    color: var(--primary); /* Cor do link ao passar o rato (azul primário) */
}

/* Estilos para links no rodapé */
.site-footer a:hover {
    color: var(--primary); /* Cor do link ao passar o rato (azul primário) */
    transition: color 0.3s ease; /* Transição suave para a mudança de cor */
}

/* Estilos para o título "Administrador" */
.admin-title {
    font-size: 1.1rem; /* Tamanho padrão */
}
@media (max-width: 768px) {
    .admin-title { font-size: 0.9rem; } /* Tamanho menor para ecrãs pequenos */
}
