:root {
  --bg: #faf7f0;
  --bg-alt: #f1ebe1;
  --text: #111827;
  --muted: #4b5563;
  --accent: #d4a347;
  --accent-soft: rgba(212, 163, 71, 0.16);
  --accent-strong: #b07c1e;
  --nav-bg: rgba(252, 250, 246, 0.96);
  --nav-border: rgba(148, 163, 184, 0.3);
  --card-bg: rgba(255, 255, 255, 0.96);
  --card-border: rgba(148, 163, 184, 0.25);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.1);
  --radius: 22px;
  --radius-sm: 16px;
  --radius-lg: 28px;
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease-out;
  --nav-height: 64px;
}

/* Dark theme (preparado, mas desligado) */
[data-theme="dark"] {
  --bg: #040816;
  --bg-alt: #050b1f;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --accent-strong: #f59e0b;
  --nav-bg: rgba(15, 23, 42, 0.96);
  --nav-border: rgba(75, 85, 99, 0.7);
  --card-bg: rgba(15, 23, 42, 0.96);
  --card-border: rgba(55, 65, 81, 0.9);
  --shadow-soft: 0 20px 45px rgba(0, 0, 0, 0.75);
  --shadow-subtle: 0 16px 38px rgba(0, 0, 0, 0.65);
}

/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at 0% 0%, #1d4ed8 0%, #0f172a 40%, #0b1220 60%, #fef3c7 120%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

/* ===================== HEADER & NAV ===================== */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 40px;
  border-bottom: 1px solid var(--nav-border);
  background: linear-gradient(
      180deg,
      rgba(248, 250, 252, 0.9) 0%,
      rgba(248, 250, 252, 0.85) 40%,
      rgba(248, 250, 252, 0.8) 100%
    );
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .nav {
  background: linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.96) 0%,
      rgba(15, 23, 42, 0.92) 40%,
      rgba(15, 23, 42, 0.9) 100%
    );
}

.logo img {
  max-height: 44px;
  height: auto;
  width: auto;
}

/* Espaçador para empurrar os links para o meio/direita */
.spacer {
  flex: 1;
}

/* Navegação principal */
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;          /* espaço entre itens */
  flex-wrap: nowrap;  /* não deixa ir para 2ª linha */
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap; /* "Join Us" / "Links" não quebram */
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

/* Quando a janela é mais estreita, encolher menu */
@media (max-width: 1200px) {
  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    padding: 5px 10px;
    font-size: 0.86rem;
  }
}

/* Efeito de brilho / hover */
.nav-links a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 0, #fef3c7 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: -1;
}

.nav-links a:hover::before {
  opacity: 1;
}

.nav-links a:hover {
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.9);
}

/* Item ativo */
.nav-links a.active {
  background: radial-gradient(circle at 0% 0%, #fef3c7 0%, #fde68a 35%, #fefce8 100%);
  color: #111827;
  box-shadow: 0 15px 35px rgba(180, 146, 60, 0.39);
}

/* Botões à direita do nav */
.lang-toggle,
.theme-toggle,
.menu-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  padding: 6px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
  color: #111827;
}

.theme-toggle {
  display: none !important; /* por garantia */
}

.lang-toggle:hover,
.theme-toggle:hover,
.menu-btn:hover {
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.85);
}

/* Botão de login (user) */
.nav-user-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.85);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 8px;
  transition: background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
  color: #111827;
}

.nav-user-btn:hover {
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.85);
}

.nav-user-icon {
  width: 22px;
  height: 22px;
}

/* Em mobile escondemos o ícone (já existe o link no menu lateral) */
@media (max-width: 1024px) {
  .nav-user-btn {
    display: none;
  }
}

/* Menu hamburguer só em ecrãs pequenos */
.menu-btn {
  display: none;
  font-size: 1.1rem;
  padding: 6px 10px;
}

/* ===================== HERO ===================== */

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  padding: 120px 40px 80px;
  color: #f9fafb;
  overflow: hidden;
}

.hero-content {
  position: relative;
  max-width: 680px;
  z-index: 2;
}

.hero .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.8);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e5e7eb;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

.hero-title {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: clamp(2.6rem, 4vw, 3.3rem);
  margin: 18px 0 16px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-title .accent {
  color: #facc15;
}

.hero-intro {
  font-size: 1rem;
  max-width: 680px;
  color: #f9fafb;
  opacity: 0.98;
}

.hero .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero .btn {
  font-size: 0.95rem;
}

/* ===================== BOTÕES GENÉRICOS ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.btn.primary {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #111827;
  box-shadow: 0 16px 40px rgba(251, 191, 36, 0.55);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(251, 191, 36, 0.72);
}

.btn.ghost {
  border: 1px solid rgba(249, 250, 251, 0.9);
  color: #f9fafb;
  background: rgba(15, 23, 42, 0.45);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.6);
}

.btn.ghost:hover {
  background: rgba(15, 23, 42, 0.8);
  transform: translateY(-1px);
}

/* Wave hero → conteúdo */
.wave svg {
  display: block;
  width: 100%;
  height: 120px;
}

.wave path {
  fill: #f5efe4;
}

/* ===================== LAYOUT PRINCIPAL ===================== */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

.section-alt {
  background: linear-gradient(180deg, #f5efe4 0%, #f7f3ea 60%, #f1eadf 100%);
}

/* Títulos de secção */
.title {
  margin-bottom: 26px;
  text-align: left;
}

.title h2 {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 1.45rem;
  margin: 0 0 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Cartões base */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 0 0, var(--accent-soft) 0, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

/* Animação de entrada (ligada no JS) */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* nova classe usada pelo app.js */
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================== EVENTOS (versão antiga – se precisares) ===================== */

.events-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.event {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  padding-bottom: 16px;
  background: radial-gradient(circle at 10% 0%, #fefce8 0%, #fff 40%);
}

.event .badge {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.78rem;
  font-weight: 600;
}

.event h3 {
  margin: 2px 0;
  font-size: 0.98rem;
}

.event time {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Events page (cards): evitar demasiado texto e manter tudo elegante */
#events .events-grid .event p.muted.summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* mostra só ~3 linhas */
  overflow: hidden;
}

/* Recurring sessions: não ocupar a largura toda (melhor leitura) */
#events .links {
  /* mais estreito para não ficar "comprido" em desktop */
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===================== LINKS EM LISTA ===================== */

.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.96);
}

.link .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 6px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.18);
}

/* ===================== ABOUT / TEAM ===================== */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr);
  gap: 18px;
}

.about article:nth-child(3) {
  grid-column: 1 / -1;
}

/* Team cards – layout 1 + 3 + 3 */
.about-team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}

/* 1ª carta (Ingrid) ocupa a linha toda e fica centrada */
.about-team .team-card:first-child {
  grid-column: 1 / -1;
  max-width: 360px;
  margin: 0 auto 8px;
}

/* Team cards estilo */
.team-card {
  background: rgba(249, 250, 251, 0.96);
  border-radius: 22px;
  padding: 14px 12px 16px;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.16);
  text-align: center;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.team-card img {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  margin: 0 auto 10px;
  border: 3px solid rgba(250, 204, 21, 0.95);
  box-shadow: 0 14px 30px rgba(180, 83, 9, 0.45);
}

.team-name {
  font-weight: 700;
  margin-bottom: 2px;
}

.team-role {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.bio-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: #fff;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.bio-btn:hover {
  background: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

/* ===================== CONTACTOS ===================== */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 18px;
}

/* ===================== FAQ ===================== */

.faq .accordion {
  padding: 16px 18px;
}

.accordion details {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding: 10px 0;
}

.accordion summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary span {
  font-size: 1.2rem;
  opacity: 0.4;
}

.accordion .content {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ===================== FOOTER & TO-TOP ===================== */

footer {
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
}

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 20px 45px rgba(251, 191, 36, 0.75);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  font-weight: 700;
}

.to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===================== DRAWER MOBILE ===================== */

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  z-index: 50;
  display: none;              /* escondido por padrão */
  justify-content: flex-end;
}

/* Quando o JS abre o menu, adiciona a classe .open */
.drawer.open {
  display: flex;
}

/* Segurança extra: se tiver o atributo hidden, fica mesmo escondido */
.drawer[hidden] {
  display: none !important;
}

.drawer-inner {
  width: min(320px, 80%);
  background: rgba(248, 250, 252, 0.98);
  height: 100%;
  padding: 18px 16px;
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.5);
}

.drawer-item {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.95rem;
}

.drawer-item:hover {
  background: rgba(15, 23, 42, 0.03);
}


/* ===================== MODAL BIO ===================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.modal[hidden] {
  display: none;
}

.modal .bio.card {
  max-width: 620px;
  width: 92%;
  max-height: 80vh;
  overflow: hidden;
  padding: 0;
}

.bio-header {
  position: relative;
  padding: 18px 22px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: radial-gradient(circle at 0% 0%, #fefce8 0%, #ffffff 45%);
}

.bio-header-inner {
  max-width: 72%;
}

.bio-header .pill-invert {
  background: #111827;
  color: #fef9c3;
  box-shadow: none;
  border-color: transparent;
}

.bio-header h3 {
  margin: 10px 0 4px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.78rem;
}

.bio-avatar-wrap {
  position: absolute;
  right: 22px;
  bottom: -10px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 3px solid rgba(250, 204, 21, 0.9);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
}

.bio-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bio-body {
  padding: 18px 22px 20px;
  max-height: 60vh;
  overflow-y: auto;
  background: #f9fafb;
}

.bio-close {
  position: absolute;
  right: 18px;
  top: 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.9);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ===================== MAPA LEAFLET ===================== */

.map #map {
  width: 100%;
}

/* ===================== RESPONSIVO ===================== */

@media (max-width: 1024px) {
  .nav {
    padding-inline: 18px;
  }

  .nav-links {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .hero {
    padding-inline: 22px;
  }

  .about {
    grid-template-columns: 1fr;
  }

  /* mantém 3 colunas para tablets maiores; 2 colunas para tablets menores */
  .about-team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-team .team-card:first-child {
    grid-column: 1 / -1;
    max-width: none;
  }

  .events-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .hero {
    padding-top: 96px;
    padding-bottom: 56px;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: 2.1rem;
  }

  .hero-intro {
    font-size: 0.95rem;
  }

  .wrap {
    padding-inline: 18px;
  }

  .about-team {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-team .team-card:first-child {
    grid-column: 1 / -1;
  }

  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .links .card {
    padding-inline: 14px;
  }
}

@media (max-width: 480px) {
  .about-team {
    grid-template-columns: 1fr;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }
}

/* === Events: join button + calendar === */

.join-event {
  margin-top: 12px;
}

.events-calendar {
  margin-top: 40px;
}

.events-calendar h3 {
  margin-bottom: 4px;
}

.calendar-embed {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.calendar-embed iframe {
  width: 100%;
  min-height: 520px;
}

/* Melhorar contraste dos títulos nas secções com fundo escuro */
#about .title h2,
#committees .title h2,
#events .title h2,
#join .title h2,
#contacts .title h2,
#faq .title h2 {
  color: #f9fafb;
  text-shadow: 0 2px 8px rgba(15, 23, 42, 0.9);
}

/* também para subtítulos em h3 (ex.: Weekly Activities, Past events) */
#events .title h3 {
  color: #f9fafb;
  text-shadow: 0 2px 8px rgba(15, 23, 42, 0.9);
}

/* Em alguns sítios o subtítulo usa a classe .muted, que pode baixar demasiado o contraste */
#events .title p.muted {
  color: rgba(226, 232, 240, 0.92) !important;
}

#about .title p,
#committees .title p,
#events .title p,
#join .title p,
#contacts .title p,
#faq .title p {
  color: rgba(226, 232, 240, 0.92);
}

/* ===================== SAFETY: DRAWER EM DESKTOP ===================== */
/* Em ecrãs largos não usamos o menu mobile,
   por isso o drawer fica SEMPRE escondido. */

@media (min-width: 900px) {
  #drawer {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

