/* ============================================
   VARIÁVEIS DE TEMA
============================================ */
:root {
  --bg: #ffffff;
  --text: #333a45;
  --muted: #6b7480;
  --alt: #f6f8fa;
  --contrast: #29485a;
  --accent: #f29c1f;
  --card: #ffffff;
  --shadow: 0 10px 24px rgba(0,0,0,.06);
}

html[data-theme="dark"] {
  --bg: #10171c;
  --text: #e9eef2;
  --muted: #a8b4be;
  --alt: #14212a;
  --contrast: #1e2c36;
  --accent: #f29c1f;
  --card: #15222b;
  --shadow: 0 10px 24px rgba(0,0,0,.35);
}

/* ============================================
   BASE
============================================ */
* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .3s, color .3s;
}

.container {
  width: min(1180px, 92%);
  margin-inline: auto;
}

/* ============================================
   HEADER
============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(to bottom, var(--bg) 0, rgba(255,255,255,0) 100%);
  padding: 10px 0 0;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  position: relative;
}

.brand {
  display: flex;
  align-items: flex-start;
}

.logo-overhang {
  max-height: 80px;
  height: auto;
  object-fit: contain;
  margin-bottom: -26px; /* ficha entra no hero */
  animation: logoFloat .9s ease-out forwards;
}

@keyframes logoFloat {
  from { transform: translateY(-18px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  opacity: .9;
  transition: color .2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.toggles {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all .2s;
}

.icon-btn:hover {
  background: var(--alt);
}

/* BOTÕES GENÉRICOS */
.btn {
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
  transition: all .2s;
}

.btn-accent {
  background: var(--accent);
  color: #111;
  font-weight: 600;
}

.btn-outline {
  border: 1px solid #fff;
  color: #fff;
  padding: 10px 24px;
  border-radius: 12px;
}

/* ============================================
   HERO
============================================ */
.hero {
  position: relative;
  height: 66vh;
  min-height: 480px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-video,
.hero-image,
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-fallback {
  background: #1e2c36;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.45));
}

.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  color: #fff;
  display: grid;
  gap: 18px;
}

.video-badge {
  display: inline-block;
  background: rgba(0,0,0,.45);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .95rem;
}

.hero-title {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  margin: 0 auto;
  max-width: 900px;
}

/* ============================================
   SECÇÕES E LAYOUT
============================================ */
.section {
  padding: 64px 0;
}

.section.alt {
  background: var(--alt);
}

.section.contrast {
  background: var(--contrast);
  color: #fff;
}

.section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ÁREAS DE ATUAÇÃO – HOME GRID
============================================ */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 24px;
}

@media (max-width: 1024px) {
  .areas-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .areas-grid { grid-template-columns: 1fr; }
}

.area-card a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}

.area-card:hover a {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(0,0,0,.18);
}

.area-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.area-title {
  padding: 14px 16px 16px;
  margin: 0;
  font-size: 1rem;
}

/* ============================================
   BLOCOS DINÂMICOS INTERNOS (SOBRE / ÁREAS)
============================================ */
.bloco-area {
  margin-bottom: 40px;
}

.bloco-inner {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr;
  gap: 24px;
  align-items: center;
}

.bloco-inner.invert {
  grid-template-columns: 1.2fr 1.1fr;
}

.bloco-inner.invert .dynamic-media {
  order: 2;
}

.bloco-inner.invert .dynamic-text {
  order: 1;
}

.dynamic-media img,
.dynamic-media video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.dynamic-text {
  line-height: 1.6;
  font-size: 1rem;
}

.dynamic-text h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.section.contrast .dynamic-text {
  color: #fff;
}

/* ============================================
   CARROSSEL (SE FOR USADO)
============================================ */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  min-height: 140px;
}

.carousel-track {
  display: flex;
  align-items: center;
  height: 100%;
}

.carousel-item {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

.carousel-item img {
  max-width: 220px;
  max-height: 90px;
  object-fit: contain;
  filter: saturate(.95) contrast(1.05);
  transition: transform .2s, filter .2s;
}

.carousel-item img:hover {
  transform: scale(1.04);
  filter: saturate(1.2) contrast(1.1);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.3);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

/* ============================================
   MAPA / PLACEHOLDER
============================================ */
.map,
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,.05),
    rgba(0,0,0,.06),
    rgba(255,255,255,.05)
  );
  border-radius: 16px;
  min-height: 260px;
}

/* ============================================
   CARDS (PARCERIAS / CERTIFICAÇÕES)
============================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 28px;
}

@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 520px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* Card genérico */
.info-card {
  background: var(--card);
  border-radius: 20px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .25s, box-shadow .25s;
}

.info-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(0,0,0,.16);
}

/* Logo com moldura branca */
.logo-frame {
  background: #fff;
  padding: 18px 22px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.07);
  width: 100%;
  max-height: 80px;
}

html[data-theme="dark"] .logo-frame {
  background: #fff;
}

.logo-frame img {
  max-height: 50px;
  max-width: 100%;
  object-fit: contain;
}

/* Título e texto dos cards */
.info-card-title {
  margin: 4px 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
}

.info-card-text {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.5;
}

html[data-theme="dark"] .info-card-text {
  color: #cfd6dd;
}

/* ============================================
   CABEÇALHOS DE SECÇÃO PREMIUM
============================================ */
.page-header {
  margin-bottom: 40px;
  text-align: left;
}

.page-header h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

/* Linha gradiente animada */
.page-header-line {
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    #f7a600 0%,
    rgba(247,166,0,0.6) 40%,
    rgba(247,166,0,0.25) 70%,
    rgba(247,166,0,0) 100%
  );
  transform: scaleX(0);
  transform-origin: left;
  animation: growLine 1.4s ease-out forwards;
  opacity: 0;
  animation-delay: .25s;
}

@keyframes growLine {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Subtítulo com fade */
.page-subtitle {
  margin: 6px 0 0;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(6px);
  animation: subtitleFade .8s ease-out forwards;
  animation-delay: .5s;
}

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

html[data-theme="dark"] .page-subtitle {
  color: #dce2e7;
}

/* ============================================
   CONTACTOS – BLOCOS E FORMULÁRIO
============================================ */
#contactos {
  background: transparent;
}

#contactos .page-header {
  position: relative;
  z-index: 5;
}

#contactos .grid-2 {
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

.contacto-bloco {
  margin-bottom: 48px;
}

.contacto-inner {
  display: grid;
  grid-template-columns: 0.4fr 0.6fr;
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .contacto-inner {
    grid-template-columns: 1fr;
  }
}

.contacto-info {
  padding: 20px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.contacto-info h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.3rem;
  font-weight: 700;
}

.contacto-info p {
  margin: 4px 0;
}

.contacto-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.contacto-mapa iframe {
  width: 100%;
  height: 320px;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.contact-form-wrapper {
  margin-top: 60px;
}

.contact-form-wrapper h3 {
  margin-bottom: 16px;
}

.contact-form-wrapper input,
.contact-form-wrapper textarea {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ccc;
  background: var(--card);
  color: var(--text);
}

.contact-form-wrapper button {
  margin-top: 8px;
}

/* =========================================================
   LAYOUT ESPECIAL PARA A PÁGINA SOBRE NÓS
   ========================================================= */
#sobrenos.layout-sobrenos .bloco-inner {
  display: block !important;         /* força layout vertical */
  flex-direction: column !important;
}

#sobrenos.layout-sobrenos .dynamic-media {
  width: 100% !important;
  margin-bottom: 30px;
}

#sobrenos.layout-sobrenos .dynamic-media img,
#sobrenos.layout-sobrenos .dynamic-media video {
  width: 100%;
  height: auto;
  object-fit: contain !important;    /* mantém proporções originais */
  border-radius: 12px;
}

#sobrenos.layout-sobrenos .dynamic-text {
  width: 100% !important;
  padding: 0 10px;
}

/* remover inversões do layout normal */
#sobrenos.layout-sobrenos .bloco-inner.invert {
  flex-direction: column !important;
}

/* ============================================
   FOOTER (NOVO)
============================================ */

.site-footer {
  color: #333;
  padding: 0px 0 30px;
  text-align: center;
  background: #ffffff !important;
  color: #333 !important;
}

/* Linha fina separadora
.footer-separator {
  width: 100%;
  height: 1px;
  background: rgba(0,0,0,0.22);
  margin-bottom: 26px;
}
*/

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  flex-wrap: nowrap;
}

/* Colunas */
.footer-left,
.footer-center,
.footer-right {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Imagens com tamanho NATURAL */
.footer-img {
  height: auto;
  width: auto;
  max-height: 65px;      /* limite de segurança */
  max-width: 160px;      /* evita layout quebrado */
  object-fit: contain;
}

/* redes sociais — maior */
.footer-img-social {
  height: auto;
  width: auto;
  max-height: 40px;
  max-width: 40px;
  margin: 0 8px;
  object-fit: contain;
  transition: transform .2s, opacity .2s;
}

.footer-img-social:hover {
  transform: scale(1.12);
  opacity: .85;
}

.last-update {
  color: #777;
  font-size: .9rem;
}

.footer-social-row {
  margin-top: 18px;
}

@media (max-width: 720px) {
  .footer-grid {
    flex-direction: column;
    gap: 14px;
  }
}

.site-footer {
    position: relative;
    z-index: 10;
}

/* ============================================
   MENU MOBILE
============================================ */
.burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  z-index: 60;
}

.burger span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--text);
  border-radius: 3px;
  transition: all .3s;
}

.burger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 920px) {
  .burger { display: flex; }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 72%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg);
    box-shadow: -4px 0 12px rgba(0,0,0,.25);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 24px;
    gap: 20px;
    transition: right .3s;
    z-index: 55;
  }

  .main-nav.open { right: 0; }
  body.menu-open { overflow: hidden; }
}

/* ============================================
   ANIMAÇÃO ON-SCROLL
============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   HEADER REFINADO: LOGO LIGHT/DARK, STICKY COMPACT, MENU
   ========================================================= */

/* Logo light/dark */
.logo-dark {
  display: none;
}

html[data-theme="dark"] .logo-light {
  display: none;
}

html[data-theme="dark"] .logo-dark {
  display: block;
}

/* Alinhamento mais limpo no header */
.header-inner {
  align-items: center;
  padding-bottom: 6px;
}

/* Estado compacto ao fazer scroll */
.site-header {
  transition:
    padding .25s ease,
    box-shadow .25s ease,
    background .25s ease;
}

.site-header.header-compact {
  padding-top: 4px;
  padding-bottom: 0;
  background: var(--bg);
  box-shadow: var(--shadow);
}

/* Animação do logo ao ficar compacto */
.logo-overhang {
  transition:
    max-height .25s ease,
    margin-bottom .25s ease,
    transform .25s ease,
    opacity .25s ease;
}

.site-header.header-compact .logo-overhang {
  max-height: 60px;
  margin-bottom: -18px;
  transform: scale(0.9);
}

/* MENU: sublinhado animado premium */
.main-nav a {
  position: relative;
  padding-bottom: 3px;
  font-weight: 500;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transition: width .25s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* manter também o destaque de cor que já tinhas */
.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
}

/* ============================
   DROPDOWN DE IDIOMA (🌐)
   ============================ */

.lang-dropdown {
  position: relative;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

/* Caixa do menu */
.lang-menu {
  position: absolute;
  right: 0;
  top: 110%;
  margin-top: 6px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  padding: 6px;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity .18s ease,
    transform .18s ease;
  z-index: 80;
}

.lang-dropdown.open .lang-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Botões de idioma */
.lang-option {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .18s ease, color .18s ease;
}

.lang-option:hover {
  background: var(--alt);
}

.lang-option.active {
  font-weight: 600;
  color: var(--accent);
}

/* Pequeno ajuste em mobile: header mais respirado */
@media (max-width: 920px) {
  .header-inner {
    align-items: center;
  }

  .toggles {
    margin-left: 0;
  }
}

/* ============================================================
   FUNDO
   ============================================================ */

/* ===== TESTE FINAL — FUNDO VERMELHO ===== */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: red !important;
    z-index: -1;
    pointer-events: none;
    opacity: 1 !important;
}