/* ==========================================================================
   JPIRES – SOCIEDADE DE ADVOGADOS, RL
   ESTILOS GERAIS & INTEGRAÇÃO COM CANVAS DE SCROLL MOTION
   ========================================================================== */

:root {
  --color-sky: #3BB4F2;
  --color-sky-light: #8DD6FA;
  --color-sky-bg: #EAF6FD;
  --color-sky-dark: #1B8FD0;
  --color-brown-darkest: #1F120B;
  --color-brown-dark: #2E1B12;
  --color-brown-medium: #4A2C1B;
  --color-brown-soft: #D9C3B0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #1F120B;
  color: #FFFFFF;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Esconder barra de scroll mas manter funcional */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #1F120B;
  color: #FFFFFF;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ==========================================================================
   CANVAS DE FUNDO FIXO E OVERLAYS AMBIENTAIS
   ========================================================================== */

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Overlay subtil para garantir contraste de leitura impecável em todas as sections */
#ambient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(31, 18, 11, 0.45) 0%, rgba(31, 18, 11, 0.78) 100%);
}

/* Conteúdo principal em primeiro plano sobre o canvas */
#site-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
}

/* ==========================================================================
   TIPOGRAFIA
   ========================================================================== */

.font-syne {
  font-family: 'Syne', sans-serif;
}

.font-inter {
  font-family: 'Inter', sans-serif;
}

/* ==========================================================================
   EFEITOS DE VIDRO E TRANSLUCIDEZ ELEGANTE (GLASSMORPHISM)
   ========================================================================== */

.glass-card {
  background: rgba(74, 44, 27, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.glass-card-dark {
  background: rgba(46, 27, 18, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-card-light {
  background: rgba(234, 246, 253, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Seleção de texto */
::selection {
  background: rgba(59, 180, 242, 0.35);
  color: #FFFFFF;
}

#world-map { background: #1F120B; z-index: 0; }
.leaflet-container { font-family: 'Inter', sans-serif; }
#aliancas .glass-card-dark { isolation: isolate; } /* evita o mapa sobrepor a navbar */

.luanda-marker { position: relative; }
.luanda-marker .dot {
  position: absolute; inset: 4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px #3BB4F2;
}
.luanda-marker .pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #3BB4F2; animation: luanda-pulse 2.4s ease-out infinite;
}
@keyframes luanda-pulse {
  0%   { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.6); opacity: 0; }
}

.luanda-label {
  background: #2E1B12; color: #fff; border: 1px solid #3BB4F2;
  font-weight: 700; border-radius: 9999px; padding: 4px 10px;
}
.luanda-label::before { display: none; }

/* ==========================================================================
   MODAL DAS ÁREAS DE PRÁTICA
   ========================================================================== */

#sectores-lista > div { cursor: pointer; }
#sectores-lista > div:focus-visible {
  outline: 2px solid #1B8FD0;
  outline-offset: 3px;
}

.area-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 8, 4, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.area-modal.is-open { opacity: 1; visibility: visible; }

.area-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 24px;
  background: rgba(46, 27, 18, 0.97);
  border: 1px solid rgba(59, 180, 242, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 40px 36px 32px;
  transform: translateY(16px) scale(.97);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  scrollbar-width: thin;
  scrollbar-color: #4A2C1B transparent;
}
.area-modal.is-open .area-modal__dialog { transform: translateY(0) scale(1); }

.area-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  transition: all .2s ease;
}
.area-modal__close:hover { background: #3BB4F2; color: #1F120B; border-color: #3BB4F2; }
.area-modal__close:focus-visible { outline: 2px solid #8DD6FA; outline-offset: 2px; }

.area-modal__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #3BB4F2;
  padding-right: 48px;
}
.area-modal__title {
  font-family: 'Times New Roman', serif;
  font-weight: 800;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  color: #fff;
  margin-top: 10px;
  padding-right: 48px;
}
.area-modal__subtitle {
  font-size: 15px;
  color: #8DD6FA;
  margin-top: 8px;
  font-weight: 500;
}
.area-modal__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 22px 0;
}
.area-modal__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #D9C3B0;
  margin-bottom: 14px;
}
.area-modal__list { list-style: none; display: grid; gap: 12px; }
.area-modal__list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}
.area-modal__list svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: #3BB4F2; }

.area-modal__objective {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(59, 180, 242, 0.08);
  border-left: 3px solid #3BB4F2;
  font-size: 14px;
  line-height: 1.6;
  color: #D9C3B0;
}
.area-modal__objective strong { color: #fff; }

.area-modal__cta {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 9999px;
  background: #3BB4F2;
  color: #1F120B;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all .2s ease;
}
.area-modal__cta:hover { background: #8DD6FA; transform: translateY(-1px); }

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .area-modal { align-items: flex-end; padding: 0; }
  .area-modal__dialog {
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding: 36px 22px 26px;
  }
}

/* ==========================================================================
   LOGÓTIPO NA NAVBAR
   ========================================================================== */
.navbar-logo {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
  transition: transform .25s ease, filter .25s ease;
}
.group:hover .navbar-logo { transform: scale(1.03); }

@media (min-width: 640px) {
  .navbar-logo { height: 52px; max-width: 220px; }
}

/* ==========================================================================
   NAVBAR: FUNDO BRANCO + LETRAS DOURADAS
   ========================================================================== */
:root {
  --gold: #9C7A1E;
  --gold-light: #C9A24B;
  --gold-dark: #7A5F12;
}

#navbar {
  background: #001b39 !important;
  border-bottom: 1px solid rgba(201, 162, 75, 0.5) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

/* Subtítulo "Sociedade de Advogados, RL" */
#navbar a[href="#inicio"] span { color: var(--gold) !important; }

/* Pílula central de links */
#navbar nav {
  background: #001b39 !important;
  border: 1px solid var(--gold-light) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
#navbar nav a { color: var(--gold) !important; }
#navbar nav a:hover {
  color: var(--gold-dark) !important;
  background: rgba(201, 162, 75, 0.14) !important;
}

/* Botão CTA (desktop e mobile) */
#navbar a[href^="mailto"] {
  background: var(--gold) !important;
  color: #FFFFFF !important;
}
#navbar a[href^="mailto"]:hover { background: var(--gold-dark) !important; }
#navbar a[href^="mailto"] svg { color: var(--gold) !important; }

/* Botão hambúrguer */
#mobile-menu-btn {
  background: #FFFFFF !important;
  color: var(--gold) !important;
  border: 1px solid var(--gold-light) !important;
}

/* Menu mobile */
#mobile-menu {
  background: #001b39 !important;
  border-bottom: 1px solid rgba(201, 162, 75, 0.5) !important;
}
#mobile-menu a.mobile-link { color: var(--gold) !important; }
#mobile-menu a.mobile-link:hover { color: var(--gold-dark) !important; }

/* ==========================================================================
   MODAL "O QUE FAZEMOS" + CHIPS DE ALIADOS
   ========================================================================== */
#areas > .grid > div { cursor: pointer; }
#areas > .grid > div:focus-visible {
  outline: 2px solid #3BB4F2;
  outline-offset: 3px;
}

.area-modal__intro {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
}

.aliado-chip {
  list-style: none;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(242, 193, 78, 0.12);
  border: 1px solid rgba(242, 193, 78, 0.55);
  color: #F2C14E;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
/* ==========================================================================
   GRADIENTE DOURADO EM TODO O TEXTO DA NAVBAR
   ========================================================================== */
#navbar a[href="#inicio"] #legend,
#navbar nav a,
#mobile-menu a.mobile-link {
  background-image: linear-gradient(
    100deg,
    #8A6B1E 0%,
    #D4AF37 25%,
    #F7E7A1 50%,
    #D4AF37 75%,
    #8A6B1E 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent !important;
}

#navbar a[href="#inicio"] #legend { display: inline-block; }
#mobile-menu a.mobile-link { width: fit-content; }

/* Hover dos links da pílula: fundo dourado com texto preto (legível) */
#navbar nav a:hover {
  -webkit-text-fill-color: #0B0B0B !important;
}

/* Hover do menu mobile: brilho mais claro */
#mobile-menu a.mobile-link:hover {
  filter: brightness(1.25);
}

/* ==========================================================================
   MARCADORES DOS PAÍSES ALIADOS (PONTO DOURADO A PULSAR)
   ========================================================================== */
.aliado-marker { position: relative; }
.aliado-marker .dot {
  position: absolute; inset: 4px; border-radius: 50%;
  background: #F2C14E; box-shadow: 0 0 12px #D4AF37;
}
.aliado-marker .pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #D4AF37; animation: luanda-pulse 2.4s ease-out infinite;
}

.aliado-label {
  background: #0B0B0B; color: #F2C14E; border: 1px solid #D4AF37;
  font-weight: 600; font-size: 12px; border-radius: 9999px; padding: 3px 10px;
  box-shadow: none;
}
.aliado-label::before { display: none; }

@media (max-width: 640px) {
  .aliado-label { font-size: 10px; padding: 2px 8px; }
}

/* ==========================================================================
   SELETOR DE IDIOMA
   ========================================================================== */
.lang-switcher { position: relative; }

.lang-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 9999px;
  background: #141414; color: #D4AF37;
  border: 1px solid rgba(212, 175, 55, 0.5);
  cursor: pointer; transition: all .2s ease;
}
.lang-btn:hover { border-color: #D4AF37; background: #1c1c1c; }
.lang-btn:focus-visible { outline: 2px solid #E8C766; outline-offset: 2px; }
.lang-btn svg { width: 14px; height: 14px; transition: transform .2s ease; }
.lang-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.lang-btn img, .lang-menu img {
  width: 24px; height: 16px; object-fit: cover;
  border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.lang-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  min-width: 180px; list-style: none; margin: 0; padding: 6px;
  border-radius: 16px; background: #0B0B0B;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 70;
}
.lang-menu[hidden] { display: none; }
.lang-menu button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  background: transparent; border: 0; color: #D4AF37;
  font-size: 14px; font-weight: 600; text-align: start; cursor: pointer;
}
.lang-menu button:hover,
.lang-menu button[aria-selected="true"] { background: rgba(212, 175, 55, 0.14); }

/* ==========================================================================
   ÁRABE (RTL)
   ========================================================================== */
html[lang="ar"] body,
html[lang="ar"] .font-tnr,
html[lang="ar"] .font-inter { font-family: 'Cairo', 'Inter', sans-serif !important; }
html[lang="ar"] * { letter-spacing: 0 !important; }
[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] #world-map { direction: ltr; }   /* o mapa não deve inverter */
[dir="rtl"] .area-modal__list li { text-align: right; }

/* Navbar com textos mais longos (FR/DE) em ecrãs médios */
@media (min-width: 1280px) and (max-width: 1535px) {
  #navbar nav a { padding-inline: 10px; font-size: 13px; }
}

html[lang="zh"] body,
html[lang="zh"] .font-tnr,
html[lang="zh"] .font-inter {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
}
html[lang="zh"] * { letter-spacing: 0 !important; }

.lang-menu { max-height: 70vh; overflow-y: auto; }

/* ===== Espaço reservado para a navbar fixa ===== */
:root { --nav-h: 180px; } /* valor inicial; o JS ajusta ao valor real */

/* Hero começa sempre abaixo da navbar */
#inicio {
  padding-top: calc(var(--nav-h) + 12px) !important;
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
}

/* Links âncora (#sobre, #areas, etc.) param abaixo da navbar */
section[id],
#areas,
#equipa {
  scroll-margin-top: var(--nav-h) !important;
}