/* ==========================================================================
   Ciência Aberta — ARDITI · Semana da Ciência e da Tecnologia 2026
   Folha de estilos principal — alinhada ao design Figma (frame 1512 px)
   ========================================================================== */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cores da marca (valores exatos do Figma) */
  --amarelo: #fbba00;
  --amarelo-hover: #ffd24d;   /* amarelo mais claro (hover dos botões) */
  --preto: #3c3c3b;
  --azul-texto: #32629b;
  --cinza: #e7e7e7;
  --branco: #ffffff;
  --linha: #d9d9d9;

  /* Gradiente do footer */
  --teal: #4cb4a2;
  --azul: #32629b;

  --sombra-card: 0px 8px 32px 0px rgba(0,0,0,0.04);
  --sombra-chip: 0px 4px 12px 0px rgba(25,25,25,0.03);

  /* Grelha: 3 cards de 400 px + 2 espaços de 8 px = 1216 px.
     --pad é a margem lateral mínima; --max é a largura máxima do conteúdo. */
  --pad: 148px;
  --max: 1216px;
  --gap: 8px;
  --hero-h: 616px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--preto);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  background: var(--cinza);
}
/* Papel amachucado claro: painel fixo atrás da página (não repete nem
   acompanha o scroll); só o conteúdo desliza por cima. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../img/bg/body-bg.jpg") center / cover no-repeat;
}

img { display: block; max-width: 100%; }
ul { list-style: none; }

.icon { display: inline-block; flex-shrink: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Largura do conteúdo, partilhada por hero, atividades e footer */
.hero-inner, .section, .footer-inner {
  width: min(100% - 2 * var(--pad), var(--max));
  margin-inline: auto;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: var(--hero-h);
  display: flex;
  overflow: hidden;
  color: var(--branco);
  /* Papel amachucado escuro */
  background: var(--preto) url("../img/bg/header-bg.jpg") center / cover no-repeat;
}

/* Palco da colagem: centrado e com a largura do frame do Figma (1512 px),
   para a colagem ficar sempre no mesmo sítio em relação ao texto. */
.hero-stage {
  position: absolute;
  inset: 0;
  width: min(100%, var(--max) + 2 * var(--pad));
  margin-inline: auto;
  pointer-events: none;
}
/* Caixa de referência da colagem: 760 x 616 px no Figma.
   Escala com a altura do hero; as camadas usam % desta caixa. */
.hero-collage {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  aspect-ratio: 760 / 616;
}
.collage-layer {
  position: absolute;
  max-width: none;
  height: auto;
  will-change: transform;
  transition: transform 0.18s ease-out;
}
.collage-elipse  { left: 21.04%; top: 18.18%; width: 58.91%; }
.collage-rabisco { left: 0.53%;  top: 49.68%; width: 78.55%; }
.collage-girl    { left: 0;      top: 0;      width: 66.18%; }

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 56px 0;
}

.hero-logo img { height: 56px; width: auto; }

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 598px;
}
.hero h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.hero h1 span { color: var(--amarelo); }
.hero-desc {
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.43px;
}
.hero-desc strong { font-weight: 700; }

/* Pills de contexto */
.hero-pills { display: flex; flex-wrap: wrap; gap: 16px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 20px;
  color: var(--branco);
  /* Recheio: transparente em cima, branco (10%) em baixo */
  background: linear-gradient(to bottom, rgba(247,246,243,0), rgba(247,246,243,0.1));
  box-shadow: var(--sombra-chip);
  white-space: nowrap;
}
/* Stroke interior de 1 px em gradiente: branco (20%) em cima, desvanece em baixo.
   A máscara deixa visível só o anel de 1 px (o padding do pseudo-elemento). */
.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(247,246,243,0.2), rgba(247,246,243,0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* ==========================================================================
   SECÇÃO ATIVIDADES
   ========================================================================== */
.section { padding: 32px 0; }

.section-header {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
/* Título com o rabisco amarelo por trás */
.section-title {
  position: relative;
  z-index: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 17px;
  padding: 0 8px;
}
.section-title::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: 171px;
  height: 46px;
  transform: translate(-50%, -50%);
  background: url("../img/hero/rabisco-amarelo.png") center / 100% 100% no-repeat;
}

/* ── GRID ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

/* ── CARD ── */
.card {
  display: flex;
  flex-direction: column;
  min-height: 758px;
  /* Branco + textura de papel */
  background: var(--branco) url("../img/bg/card-bg.jpg") center / cover no-repeat;
  box-shadow: var(--sombra-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0px 16px 40px 0px rgba(0,0,0,0.12);
}

/* Imagem (400 x 301 no Figma) com os chips por cima */
.card-img {
  position: relative;
  aspect-ratio: 400 / 301;
  overflow: hidden;
  background: var(--cinza);
  flex-shrink: 0;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-chips {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 32px;
  background: rgba(255,255,255,0.6);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  white-space: nowrap;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}
.card-text { display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 16px; font-weight: 700; line-height: 20px; }
.card-desc  { font-size: 14px; line-height: 18px; }

/* Bloco inferior: encostado ao fundo do card */
.card-info {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card-bloco { display: flex; flex-direction: column; gap: 4px; }
.card-bloco h4 { font-size: 14px; font-weight: 700; line-height: 17px; }
.card-bloco p  { font-size: 14px; line-height: 17px; }
.card-bloco:has(.card-sessoes) { gap: 8px; }

/* Sessões */
/* Grelha de 3 colunas: 1.ª sessão à esquerda, separador ao centro,
   2.ª sessão à direita. Com uma só sessão, fica à esquerda. */
.card-sessoes {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 16px;
}
.card-sessoes > .card-sessao:first-child { justify-self: start; }
.card-sessoes > .card-sessao:last-child:not(:first-child) { justify-self: end; }
.card-sessao-sep {
  width: 1px;
  height: 32px;
  background: var(--linha);
}
.card-sessao {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 17px;
  white-space: nowrap;
}
/* Traço vertical entre sessões */
.card-sessao-dia {
  padding: 8px;
  border-radius: 8px;
  background: var(--branco);
  font-size: 24px;
  font-weight: 700;
  line-height: 29px;
}
.card-sessao-mes { font-weight: 700; margin-left: -3px; }

/* Rodapé do card: local + botão */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--linha);
}
.card-local {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

/* Botão "Inscrever-se" */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 24px;
  border-radius: 28px;
  background: var(--amarelo);
  color: var(--preto);
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.btn:hover { background: var(--amarelo-hover); }
.btn-icon {
  display: flex;
  padding: 8px;
  border-radius: 24px;
  background: var(--branco);
  transition: transform 0.2s ease;
}
.btn:hover .btn-icon { transform: rotate(45deg); }
/* Sem link de inscrição: mantém o aspeto, mas não é clicável */
/* Sem link de inscrição (campo "inscricao" vazio em dados.js): botão
   acinzentado e não clicável. Ao colar o link, volta a ficar amarelo. */
.btn-disabled {
  background: var(--linha);
  color: #8a8a89;
  cursor: not-allowed;
}
.btn-disabled:hover { background: var(--linha); }
.btn-disabled:hover .btn-icon { transform: none; }
.btn-disabled .btn-icon { opacity: 0.7; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  color: var(--branco);
  background: linear-gradient(96deg, var(--teal) 0%, var(--azul) 100%);
}
.footer-inner {
  /* No Figma o footer usa 144 px de margem (4 px mais largo que a grelha) */
  width: min(100% - 2 * (var(--pad) - 4px), var(--max) + 8px);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 48px 0 32px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}
.footer-brand { display: flex; align-items: flex-start; gap: 40px; }
.footer-brand-logo img { height: 64px; width: auto; max-width: none; }
.footer-brand p {
  width: 280px;
  font-size: 13px;
  line-height: 20.15px;
  letter-spacing: -0.08px;
}

.footer-col h3 {
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-transform: uppercase;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
}
.footer-col a {
  color: var(--branco);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}
.footer-col ul a:hover { text-decoration: underline; }

.footer-col-contacto { display: flex; flex-direction: column; gap: 24px; }
.footer-col a.footer-contacto {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--cinza);
  font-weight: 500;
  white-space: nowrap;
}
.footer-phone-icon { width: 32px; height: 32px; }
.footer-col a.footer-site-btn {
  display: flex;
  justify-content: center;
  padding: 8px 24px;
  border-radius: 32px;
  background: var(--amarelo);
  color: var(--azul-texto);
  font-weight: 700;
  line-height: 17px;
  transition: background 0.2s ease;
}
.footer-col a.footer-site-btn:hover { background: var(--amarelo-hover); }

/* Organização */
.footer-logos-group h4 { font-size: 14px; font-weight: 400; line-height: 20px; }
.footer-logos-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
  padding: 40px 0;
}
.parceiro-logo { width: auto; }
.logo-arditi { height: 32px; }
.logo-cv     { height: 38px; }

/* Linha de baixo */
.footer-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--branco);
}
.footer-bottom-logo { flex-shrink: 0; }
.footer-bottom-logo img { height: 24px; width: auto; }
.footer-bottom p { font-size: 12px; line-height: 19.2px; text-align: right; }

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

/* ── Ecrãs muito grandes (≥ 1920 px): tudo um pouco maior ── */
@media (min-width: 1920px) {
  :root { --max: 1440px; --hero-h: 720px; }
  .hero h1 { font-size: 56px; }
  .hero-desc { font-size: 22px; line-height: 30px; }
  .hero-text { max-width: 700px; }
  .hero-logo img { height: 64px; }
  .card { min-height: 820px; }
  .card-title { font-size: 18px; line-height: 23px; }
  .card-desc { font-size: 15px; line-height: 20px; }
}

/* ── Portáteis pequenos ── */
@media (max-width: 1360px) {
  :root { --pad: 64px; }
}
@media (max-width: 1200px) {
  :root { --pad: 40px; }
  .hero-text { max-width: 440px; }
  .hero h1 { font-size: 38px; }
  .hero-desc { font-size: 18px; line-height: 25px; }
  /* Colagem mais pequena, encostada à base, para não tapar o texto */
  .hero-collage { top: auto; bottom: 0; height: 74%; right: -3%; }
}

/* ── Tablet: 2 colunas ── */
@media (max-width: 1040px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { min-height: 0; }
  .footer-top { flex-wrap: wrap; }
  .footer-brand { width: 100%; }
  .footer-brand p { width: auto; max-width: 420px; }
}

/* ── Tablet vertical e mobile: hero em coluna (texto em cima, colagem em baixo) ── */
@media (max-width: 1100px) {
  :root { --hero-h: 0px; }
  .hero { flex-direction: column; }
  .hero-inner { order: 1; gap: 32px; padding: 48px 0 8px; }
  .hero-stage { order: 2; position: relative; inset: auto; width: 100%; height: 360px; }
  .hero-collage { top: 0; bottom: auto; height: 100%; right: 50%; transform: translateX(58%); }
  .hero-text { max-width: 598px; }
}

/* ── Mobile ── */
@media (max-width: 760px) {
  :root { --pad: 24px; }

  .hero-inner { padding-top: 40px; }
  .hero-stage { height: 300px; }
  .hero-text { gap: 16px; }
  .hero h1 { font-size: 32px; }
  .hero-desc { font-size: 16px; line-height: 24px; }

  /* Pills empilhadas, alinhadas à esquerda */
  .hero-pills { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Cards numa coluna */
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card:hover { transform: none; }

  /* Footer alinhado à esquerda; Informação e contacto lado a lado */
  .footer-inner { width: min(100% - 2 * var(--pad), var(--max)); padding-top: 40px; }
  .footer-top { gap: 32px 16px; }
  .footer-brand { flex-direction: column; gap: 16px; }
  .footer-brand p { max-width: none; }
  .footer-logos-row { padding: 24px 0 8px; gap: 20px 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-bottom p { text-align: left; }
}

@media (max-width: 380px) {
  .card-chips { top: 16px; left: 16px; right: 16px; }
  .card-chip { padding: 6px 12px; font-size: 14px; }
  .card-body { padding: 20px 16px; }
  .btn { padding-left: 16px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, .btn-icon, .collage-layer { transition: none; }
  .card:hover { transform: none; }
}
