/**
 * SABERES CONSULTORIA E SERVIÇOS
 * Etapa 1: Top Bar, Header, Mega Menu e Hero Fullscreen
 * Arquitetura: Vanilla CSS, BEM, Fluid Layout, Mobile-First Support
 */

/* ==========================================================================
   1. VARIÁVEIS GLOBAIS / DESIGN TOKENS
   ========================================================================== */
:root {
    /* Cores Oficiais da Marca Saberes */
    --color-primary: #2E3775;        /* Azul Institucional */
    --color-primary-dark: #1A204A;   /* Derivação: Azul Profundo (para Top Bar) */
    --color-accent: #C39F32;         /* Dourado Institucional */
    --color-accent-hover: #A38426;   /* Derivação: Dourado Escuro (Hover) */
    --color-white: #FEFEFE;          /* Branco Puro */
    --color-support: #CAC3AE;        /* Bege Claro de Apoio */
    
    /* Cores de Texto e UI */
    --color-text-main: #212529;      /* Leitura primária extrema */
    --color-text-muted: #6C757D;     /* Textos de apoio */
    --color-border: rgba(46, 55, 117, 0.1); /* Bordas corporativas subtis */
    
    /* Tipografia (Google Fonts preloaded no HTML) */
--font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-body: 'Inter', system-ui, sans-serif;
   
    /* Fluid Typography - Escala responsiva matemática */
    --text-xs: clamp(0.75rem, 0.7vw + 0.5rem, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8vw + 0.6rem, 1rem);
    --text-base: clamp(1rem, 1vw + 0.75rem, 1.125rem);
    --text-lg: clamp(1.125rem, 1.2vw + 0.8rem, 1.375rem);
    --text-xl: clamp(1.375rem, 1.5vw + 1rem, 1.75rem);
    --text-2xl: clamp(1.75rem, 2vw + 1.25rem, 2.5rem);
    --text-hero: clamp(2.5rem, 5vw + 1rem, 4.5rem); /* Título massivo do Hero */
    
    /* Espaçamento e Layout */
    --container-max: 1320px; /* Amplo, respiração internacional (estilo ALU) */
    --header-height: 90px;
    --header-height-sticky: 70px;
    --topbar-height: 40px;
    
    /* Sombras Corporativas Premium */
    --shadow-soft: 0 4px 20px rgba(46, 55, 117, 0.05);
    --shadow-mega: 0 15px 40px rgba(46, 55, 117, 0.1);
    
    /* Transições Naturais */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Z-Index Hierarchy */
    --z-topbar: 1000;
    --z-header: 990;
    --z-megamenu: 980;
    --z-hero-overlay: 10;
    --z-hero-content: 20;
    --z-hero-controls: 30;
}

/* ==========================================================================
   2. RESET E BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text-main);
    background-color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   3. TIPOGRAFIA E ELEMENTOS GLOBAIS
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em; /* Aperto de kerning para aspeto executivo */
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul, ol {
    list-style: none;
}

/* ==========================================================================
   4. UTILITÁRIOS
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* Utilitário de Acessibilidade: Invisível mas lido por Screen Readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link exigido por normas WCAG */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-accent);
    color: var(--color-white);
    padding: 1rem 1.5rem;
    z-index: 10000;
    font-weight: 700;
    transition: top var(--transition-fast);
}
.skip-link:focus {
    top: 0;
}
/* ==========================================================================
   2. TOP BAR (Sleek & Information Rich)
   ========================================================================== */
.top-bar {
    background-color: var(--color-primary-dark);
    color: var(--color-support); /* Usar o bege institucional para as letras */
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: 400;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-bar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.top-bar__left, .top-bar__right {
    display: flex;
    align-items: center;
}

.top-bar__link {
    color: var(--color-support);
    text-decoration: none;
    transition: color 0.2s;
}

.top-bar__link:hover {
    color: var(--color-white);
}

.top-bar__divider {
    margin: 0 12px;
    color: rgba(202, 195, 174, 0.3);
}

/* Detalhe Premium: Ponto Dourado Pulsante ao lado da localização */
.top-bar__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--color-accent);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(195, 159, 50, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(195, 159, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(195, 159, 50, 0); }
}
/* 
==========================================================================
   6. HEADER / NAVBAR
   ========================================================================== */
.site-header {
    background-color: rgba(254, 254, 254, 0.98);
    backdrop-filter: blur(8px); /* Efeito de vidro moderno */
    -webkit-backdrop-filter: blur(8px);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    border-bottom: 1px solid var(--color-border);
    transition: height var(--transition-smooth), box-shadow var(--transition-smooth);
}

/* Estado Sticky (ativado via JS no scroll) */
.site-header.is-sticky {
    height: var(--header-height-sticky);
    box-shadow: var(--shadow-soft);
    border-bottom-color: transparent;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo {
    display: flex;
    align-items: center;
    z-index: calc(var(--z-header) + 5); /* Mantém-se acima do menu mobile */
}

.site-logo__text {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2vw, 1.8rem);
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.03em;
}
.main-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    height: 100%;
    margin-right: 2.5rem;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    font-family: var(--font-heading);
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transition: color var(--transition-fast);
}

/* ------------------------------ */
/* SETA PARA MEGA MENU */
/* ------------------------------ */

.nav-item.has-mega-menu .nav-link {
    padding-right: 1.6rem;
}

/* seta */
.nav-item.has-mega-menu .nav-link::before {
    content: "";
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transition: transform var(--transition-fast);
}

/* animação da seta */
.nav-item.has-mega-menu:hover .nav-link::before {
    transform: translateY(-50%) rotate(225deg);
}

/* ------------------------------ */
/* Hover Effect Refinado */
/* ------------------------------ */

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--color-accent);
    transition: width var(--transition-smooth);
}

.nav-item:hover .nav-link,
.nav-link:focus {
    color: var(--color-primary);
}

.nav-item:hover .nav-link::after,
.nav-link:focus::after {
    width: calc(100% - 2.5rem);
}
/* ==========================================================================
   7. MEGA MENU
   ========================================================================== */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    box-shadow: var(--shadow-mega);
    border-top: 1px solid var(--color-border);
    
    /* Animação suave e sofisticada */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all var(--transition-smooth);
    z-index: var(--z-megamenu);
    
    /* Previne cliques acidentais quando escondido */
    pointer-events: none; 
}

/* Ativação do Mega Menu no Hover do Nav-Item */
.nav-item.has-mega-menu:hover .mega-menu,
.nav-item.has-mega-menu:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-menu__inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    padding-block: 3.5rem;
}

.mega-menu--small .mega-menu__inner {
    grid-template-columns: 1fr 1fr;
}

.mega-menu__title {
    font-size: var(--text-sm);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

.mega-menu__links ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 3rem;
}

.mega-menu--small .mega-menu__links ul {
    grid-template-columns: 1fr;
}

.mega-menu__links a {
    color: var(--color-text-main);
    font-size: var(--text-base);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.mega-menu__links a:hover,
.mega-menu__links a:focus {
    color: var(--color-accent);
    transform: translateX(6px);
}

/* Bloco Destaque Lado Direito */
.feature-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 2.5rem;
    border-radius: 4px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 4px solid var(--color-accent);
    transition: box-shadow var(--transition-smooth);
}

.feature-card:hover {
    box-shadow: var(--shadow-soft);
}

.feature-card.bg-support {
    background-color: rgba(202, 195, 174, 0.15); /* Bege super claro */
    border-color: transparent;
}

.feature-card.bg-blue {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-left-color: var(--color-accent);
}

.feature-card__title {
    font-size: var(--text-xl);
    margin-bottom: 1rem;
    color: inherit;
}

.feature-card__desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.7;
}

.feature-card.bg-blue .feature-card__desc {
    color: rgba(254, 254, 254, 0.8);
}

/* ==========================================================================
   8. HERO / SLIDER (Fullscreen)
   ========================================================================== */
.hero {
    position: relative;
    /* 100vh menos a altura do top bar e do header não-sticky para exatidão */
    height: calc(100vh - var(--header-height) - var(--topbar-height));
    min-height: 650px;
    width: 100%;
    background-color: var(--color-primary-dark);
    overflow: hidden;
}

.hero__carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    /* Efeito premium: o slide dá um leve zoom-out enquanto aparece */
    transform: scale(1.05);
    transition: opacity 1s ease-in-out, visibility 1s, transform 5s linear;
    display: flex;
    align-items: center;
}

.hero__slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

.hero__media-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ==========================================================================
   9. OVERLAY DOS SLIDES
   ========================================================================== */
.hero__overlay {
    position: absolute;
    inset: 0;
    /* Exigência: Exatamente 40% de escurecimento em todos os slides */
    background-color: rgba(0, 0, 0, 0.78); 
    z-index: var(--z-hero-overlay);
}

/* ==========================================================================
   10. CONTEÚDO TEXTUAL SOBRE OS SLIDES
   ========================================================================== */
.hero__content {
    position: relative;
    z-index: var(--z-hero-content);
    color: var(--color-white);
    max-width: 850px;
    padding-top: 2rem; /* Balanço visual acima da dobra */
}

.hero__eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 1.25rem;
    
    /* Preparação de Animação de Entrada */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.hero__title {
    font-size: var(--text-hero);
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4); /* Reforça leitura sobre overlay */
    
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.hero__desc {
    font-size: var(--text-xl);
    font-weight: 400;
    max-width: 650px;
    margin-bottom: 3rem;
    color: rgba(254, 254, 254, 0.95);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s;
}

/* Ação de entrada quando o slide fica ativo */
.hero__slide.is-active .hero__eyebrow,
.hero__slide.is-active .hero__title,
.hero__slide.is-active .hero__desc,
.hero__slide.is-active .hero__actions {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   11. BOTÕES E CTA
   ========================================================================== */
.hero__actions {
    display: flex;
    gap: 1.25rem;
    
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 2.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-sm);
    border-radius: 2px; /* Corte quase reto, altamente corporativo */
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn--gold {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.btn--outline-white {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
    backdrop-filter: blur(4px); /* Modernidade subtil */
}

/* ==========================================================================
   12. CONTROLES DO CARROSSEL (Setas, Bullets)
   ========================================================================== */
.hero__control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(254, 254, 254, 0.05);
    color: var(--color-white);
    border: 1px solid rgba(254, 254, 254, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: var(--z-hero-controls);
    font-size: 1.5rem;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__control--prev { left: 3rem; }
.hero__control--next { right: 3rem; }

.hero__indicators {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: var(--z-hero-controls);
}

.hero__indicator {
    width: 60px;
    height: 4px; /* Estilo traço moderno (em vez de bolinha comum) */
    background: rgba(254, 254, 254, 0.3);
    border: none;
    cursor: pointer;
    border-radius: 2px;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.hero__indicator.is-active {
    background: var(--color-white);
}

/* ==========================================================================
   13. ESTADOS DE HOVER, FOCUS E ACTIVE
   ========================================================================== */
.btn--gold:hover,
.btn--gold:focus-visible {
    background-color: var(--color-accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(195, 159, 50, 0.4);
}

.btn--outline-white:hover,
.btn--outline-white:focus-visible {
    background-color: var(--color-white);
    color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(254, 254, 254, 0.2);
}

.hero__control:hover,
.hero__control:focus-visible {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-50%) scale(1.1);
}

/* Melhoria Acessibilidade Global: Substitui outline feio */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ==========================================================================
   14. RESPONSIVIDADE (Mobile First Avançado & Breakpoints)
   ========================================================================== */

/* Componente: Botão Hamburger (Apenas visível abaixo de 1024px) */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: calc(var(--z-header) + 10);
}

.mobile-toggle__line {
    display: block;
    width: 28px;
    height: 2px;
    background-color: var(--color-primary);
    margin: 6px 0;
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    /* Top Bar: Esconder para simplificar foco no mobile */
    .top-bar { display: none; }
    
    /* Alturas recalculadas */
    .hero { height: calc(100vh - var(--header-height)); }
    
    /* Navbar: Hamburger ativo */
    .mobile-toggle { display: block; }
    .header-cta { display: none; } /* Deve ser movido pelo JS ou replicado dentro do menu mobile */

    /* Navbar: Estado Mobile Off-Canvas */
    .main-nav { position: static; }
    
    .nav-list {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--color-white);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem 6rem;
        margin: 0;
        transition: left var(--transition-smooth);
        overflow-y: auto;
        border-top: 1px solid var(--color-border);
    }

    /* Classe ativada via JS */
    .nav-list.is-open { left: 0; }

    .nav-item {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-link {
        width: 100%;
        padding: 1.5rem 0;
        font-size: var(--text-lg);
    }

    .nav-link::after { display: none; } /* Remove hover underline no mobile */

    /* Mega Menu: Transforma-se em Accordion no Mobile */
    .mega-menu {
        position: relative;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none; /* JS controla o display no mobile (.is-expanded) */
    }

    .nav-item.is-expanded .mega-menu { display: block; }

    .mega-menu__inner {
        grid-template-columns: 1fr;
        padding: 0 0 1.5rem 1rem;
        gap: 1.5rem;
    }
    
    .mega-menu__links ul { grid-template-columns: 1fr; gap: 1rem; }
    .mega-menu__feature { display: none; } /* Ocultar card pesado no mobile */
    
    /* Hero Controls */
    .hero__control { display: none; } /* Foco no swipe e bullets no mobile */
    .hero__indicators { bottom: 1.5rem; }
    .hero__indicator { width: 40px; }
}

@media (max-width: 768px) {
    /* Ajustes refinados para telemóveis pequenos */
    .hero__content { padding-top: 0; text-align: center; }
    .hero__desc { font-size: var(--text-base); margin-inline: auto; }
    .hero__eyebrow { transform: translateY(15px); }
    .hero__actions { 
        flex-direction: column; 
        width: 100%; 
        max-width: 350px; 
        margin-inline: auto; 
    }
    .btn { width: 100%; }
}

/* ==========================================================================
   15. MELHORIAS DE ACESSIBILIDADE VISUAIS (A11Y)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    /* Cancela as animações de entrada e transições de hover prolongadas */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero__slide { transition: opacity 0.1s ease !important; transform: none !important; }
}

/* Modo de alto contraste forçado pelo SO Windows/Mac */
@media (forced-colors: active) {
    .btn { border: 2px solid transparent; }
    .hero__overlay { display: none; } /* SO aplica as suas próprias regras de fundo */
}