
:root {
  --bg: #f4f6fb;
  --surface: rgba(255,255,255,0.98);
  --surface-soft: #eff3fa;
  --ink: #172236;
  --muted: #5b6678;
  --line: rgba(20, 42, 104, 0.10);
  --brand: #203c8c;
  --brand-alt: #ea7a19;
  --brand-dark: #13285f;
  --deep: #0e1b33;
  --shadow: 0 18px 42px rgba(15, 28, 51, 0.08);
  --shadow-soft: 0 8px 22px rgba(15, 28, 51, 0.045);
}
body.apigraf-home {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.9)),
    linear-gradient(180deg, #f8f9fc 0%, #f2f5fb 52%, #f7f9fc 100%);
}
body.apigraf-home::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(32,60,140,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32,60,140,.02) 1px, transparent 1px),
    radial-gradient(circle at 10% 0%, rgba(32,60,140,.045), transparent 30%),
    radial-gradient(circle at 95% 3%, rgba(234,122,25,.04), transparent 22%);
  background-size: 32px 32px, 32px 32px, auto, auto;
  z-index: -1;
}
.site-header {
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(20,42,104,.08);
  box-shadow: 0 6px 22px rgba(15, 28, 51, .04);
}
.nav-link,
.mobile-nav a,
.social,
.mobile-toggle,
.btn,
.btn-secondary,
.btn-light,
.btn-outline,
.hero-arrow,
.action-card,
.highlight-card,
.logo-card,
.contact-card,
.section,
.institutional-media,
.institutional-media img,
.footer-shell,
.to-top {
  border-radius: 10px;
}
.nav-link:hover,
.nav > li:hover > .nav-link,
.nav-link.active,
.mobile-nav a,
.subnav a:hover {
  background: rgba(32,60,140,.07);
  color: var(--brand-dark);
}
.has-sub > .nav-link::after,
.contact-item small { color: var(--brand-alt); }
.social,
.contact-item a,
.footer-links a:hover,
.action-card h3,
.section-header h2,
.institutional-copy h3 { color: var(--brand-dark); }
.btn,
.btn-light {
  background: linear-gradient(180deg, #2a4daa, #203c8c);
  color: #fff;
  box-shadow: 0 10px 24px rgba(32,60,140,.18);
}
.btn:hover,
.btn-light:hover { background: linear-gradient(180deg, #ea7a19, #cf6712); }
.btn-secondary,
.btn-outline { border-color: rgba(32,60,140,.18); }
.hero { padding-top: 28px; }
.top-video-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: calc(100vh - 88px);
  max-height: 980px;
  overflow: hidden;
  background: #05080f;
  box-shadow: 0 18px 44px rgba(15,28,51,.10);
}
.top-video-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,8,15,.02) 0%, rgba(5,8,15,.08) 65%, rgba(5,8,15,.20) 100%), linear-gradient(90deg, rgba(32,60,140,.10) 0%, rgba(234,122,25,.04) 100%);
  pointer-events: none;
}
.top-video-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-alt) 100%);
  z-index: 2;
}
.top-video-hero-media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}
.hero-shell-lower {
  margin-top: 26px;
  min-height: min(64vh, 680px);
  border: 1px solid rgba(20,42,104,.10);
  box-shadow: var(--shadow-soft);
}
.hero-shell-lower .hero-slide::after {
  background: linear-gradient(180deg, rgba(8,15,28,.08) 0%, rgba(8,15,28,.12) 22%, rgba(8,15,28,.78) 100%), linear-gradient(90deg, rgba(14,27,51,.74) 0%, rgba(32,60,140,.28) 55%, rgba(234,122,25,.08) 100%);
}
.hero-shell-lower .hero-content {
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(14,27,51,.46), rgba(14,27,51,.84));
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
}
.hero-shell-lower h1,
.hero-shell-lower h2 { color: #fff; }
.hero-arrow,
.hero-dot.is-active {
  background: rgba(255,255,255,.96);
  color: var(--brand-dark);
}
.hero-slide-fespa .hero-content {
  max-width: 720px;
}
.action-card::before {
  background: linear-gradient(90deg, var(--brand), var(--brand-alt));
  height: 4px;
  left: 0;
  right: 0;
}
.highlight-card::before { background: var(--card-bg) center/cover no-repeat; }
.highlight-card::after { background: linear-gradient(180deg, rgba(10,16,31,.08) 0%, rgba(10,16,31,.28) 36%, rgba(10,16,31,.84) 100%), linear-gradient(90deg, rgba(32,60,140,.12) 0%, rgba(234,122,25,.08) 100%); }
.action-card:hover,
.highlight-card:hover,
.logo-card:hover { border-color: rgba(234,122,25,.28); }
.section,
.logo-card,
.contact-card,
.action-card { border-color: rgba(32,60,140,.12); }
.site-footer .footer-shell { background: linear-gradient(135deg, #203c8c 0%, #17306f 45%, #0f1c33 100%); }

.info-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1100;
}
.info-modal.is-open { display: block; }
.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 30, 0.62);
  backdrop-filter: blur(4px);
}
.info-modal__dialog {
  position: relative;
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 24px auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(20,42,104,.10);
  box-shadow: 0 28px 60px rgba(15,28,51,.22);
}
.info-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: rgba(20,42,104,.08);
  color: var(--brand-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.info-modal__media img {
  width: 100%;
  display: block;
  height: auto;
}
.info-modal__body {
  padding: 24px 28px 30px;
}
.info-modal__eyebrow {
  margin: 0 0 8px;
  color: var(--brand-alt);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .8rem;
}
.info-modal__body h2 {
  margin: 0 0 14px;
  color: var(--brand-dark);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.06;
  letter-spacing: -.03em;
}
.info-modal__body p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}
.info-modal__actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
body.modal-open {
  overflow: hidden;
}
@media (max-width: 840px) {
  .top-video-hero {
    min-height: auto;
    aspect-ratio: 16 / 9;
  }
  .hero-shell-lower { min-height: 560px; }
  .info-modal__dialog { width: min(100% - 20px, 1040px); margin: 10px auto; max-height: calc(100vh - 20px); }
}
@media (max-width: 560px) {
  .hero { padding-top: 16px; }
  .top-video-hero { aspect-ratio: 4 / 5; }
  .hero-shell-lower { min-height: 620px; }
  .info-modal__body { padding: 18px 18px 22px; }
  .info-modal__actions .btn,
  .info-modal__actions .btn-secondary,
  .hero-actions .btn,
  .hero-actions .btn-secondary { width: 100%; }
}

/* Ajustes finais: FESPA em primeiro, vídeo mais pequeno e abaixo do slider */
.top-video-hero {
  width: min(100%, 1080px);
  margin: 28px auto 0;
  min-height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid rgba(32,60,140,.12);
  box-shadow: 0 12px 28px rgba(15,28,51,.08);
}
.top-video-hero::after {
  height: 4px;
}
.hero-shell-lower {
  margin-top: 0;
  min-height: min(66vh, 690px);
}
.hero-slide-fespa::before {
  background-color: #4d6dad;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.hero-slide-fespa::after {
  background:
    linear-gradient(90deg, rgba(15,28,51,.76) 0%, rgba(15,28,51,.38) 42%, rgba(15,28,51,.10) 100%),
    linear-gradient(180deg, rgba(15,28,51,.06) 0%, rgba(15,28,51,.20) 60%, rgba(15,28,51,.58) 100%);
}
.hero-slide-fespa .hero-content {
  width: min(610px, calc(100% - 48px));
}
.hero-slide-fespa .hero-content h2 {
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: .96;
}
@media (max-width: 840px) {
  .top-video-hero {
    width: 100%;
    margin-top: 20px;
    aspect-ratio: 16 / 9;
  }
  .hero-slide-fespa::before {
    background-size: cover;
  }
}
@media (max-width: 560px) {
  .top-video-hero {
    aspect-ratio: 16 / 10;
  }
}


/* Correcção do slide FESPA: o banner é uma imagem real, não um fundo abafado pelo overlay */
.hero-slide-fespa {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: clamp(22px, 2.6vw, 42px);
  background: linear-gradient(135deg, #4869b0 0%, #d94c84 100%);
}
.hero-slide-fespa::before,
.hero-slide-fespa::after {
  display: none !important;
}
.fespa-slide-banner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(1220px, 100%);
  max-height: 62%;
  height: auto;
  object-fit: contain;
  justify-self: center;
  align-self: center;
  box-shadow: 0 18px 42px rgba(9, 16, 30, .14);
}
.hero-slide-fespa .fespa-slide-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  background: rgba(12, 24, 52, .84);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 42px rgba(9, 16, 30, .16);
}
.hero-slide-fespa .fespa-slide-content h2 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(1.75rem, 3vw, 3.25rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.hero-slide-fespa .fespa-slide-content p {
  margin: 10px 0 0;
  max-width: 820px;
  font-size: clamp(.95rem, 1.2vw, 1.08rem);
  line-height: 1.58;
}
.hero-slide-fespa .hero-actions {
  margin: 0;
  justify-content: flex-end;
  align-self: center;
}

/* Vídeo secundário: mais pequeno e mais abaixo, sem comportamento de hero total */
.top-video-hero-secondary {
  width: min(1040px, 100%);
  margin: 42px auto 0;
  min-height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid rgba(20,42,104,.10);
  box-shadow: 0 14px 34px rgba(15,28,51,.08);
}
.top-video-hero-secondary::before {
  background: linear-gradient(180deg, rgba(5,8,15,.02), rgba(5,8,15,.12));
}
.top-video-hero-secondary::after {
  height: 4px;
}
.top-video-hero-secondary .top-video-hero-media {
  object-fit: cover;
}

@media (max-width: 900px) {
  .hero-slide-fespa {
    gap: 14px;
    padding: 16px;
  }
  .fespa-slide-banner {
    max-height: 50%;
  }
  .hero-slide-fespa .fespa-slide-content {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .hero-slide-fespa .hero-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 560px) {
  .fespa-slide-banner {
    max-height: 38%;
  }
  .top-video-hero-secondary {
    margin-top: 28px;
  }
}

/* Revisão final do slide FESPA: banner à escala certa, sem caixa gigante */
.hero-shell-lower {
  min-height: clamp(500px, 44vw, 720px) !important;
  border-radius: 10px !important;
}
.hero-slide-fespa {
  display: block !important;
  padding: 0 !important;
  background: #4869b0 !important;
}
.hero-slide-fespa::before,
.hero-slide-fespa::after {
  display: none !important;
}
.fespa-slide-banner {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  box-shadow: none !important;
}
.hero-slide-fespa .fespa-slide-content {
  position: absolute !important;
  left: clamp(22px, 2.5vw, 44px) !important;
  right: clamp(22px, 2.5vw, 44px) !important;
  bottom: 72px !important;
  z-index: 3 !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 18px 20px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 20px !important;
  align-items: center !important;
  border-radius: 10px !important;
  background: rgba(11, 24, 54, .86) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 14px 34px rgba(9, 16, 30, .18) !important;
  backdrop-filter: blur(8px) !important;
}
.hero-slide-fespa .fespa-slide-content h2 {
  margin: 0 !important;
  max-width: 980px !important;
  font-size: clamp(1.45rem, 2.15vw, 2.45rem) !important;
  line-height: 1.04 !important;
  letter-spacing: -.035em !important;
}
.hero-slide-fespa .fespa-slide-content p {
  margin: 8px 0 0 !important;
  max-width: 900px !important;
  font-size: clamp(.9rem, 1vw, 1.02rem) !important;
  line-height: 1.48 !important;
  color: rgba(255,255,255,.88) !important;
}
.hero-slide-fespa .hero-actions {
  margin: 0 !important;
  justify-content: flex-end !important;
  align-self: center !important;
  flex-wrap: nowrap !important;
}
.hero-slide-fespa .btn,
.hero-slide-fespa .btn-secondary {
  min-height: 44px !important;
  white-space: nowrap !important;
}
.hero-dots {
  bottom: 24px !important;
}
.hero-nav {
  bottom: 22px !important;
}
.top-video-hero-secondary {
  width: min(900px, 100%) !important;
  margin: 58px auto 0 !important;
}
@media (max-width: 900px) {
  .hero-shell-lower {
    min-height: 620px !important;
  }
  .fespa-slide-banner {
    object-fit: contain !important;
    object-position: top center !important;
  }
  .hero-slide-fespa {
    background: linear-gradient(135deg, #4869b0 0%, #d94c84 100%) !important;
  }
  .hero-slide-fespa .fespa-slide-content {
    grid-template-columns: 1fr !important;
    bottom: 64px !important;
    padding: 16px !important;
  }
  .hero-slide-fespa .hero-actions {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}
@media (max-width: 560px) {
  .hero-shell-lower {
    min-height: 640px !important;
  }
  .hero-slide-fespa .fespa-slide-content {
    left: 14px !important;
    right: 14px !important;
    bottom: 58px !important;
  }
  .hero-slide-fespa .fespa-slide-content p {
    display: none !important;
  }
  .hero-slide-fespa .hero-actions .btn,
  .hero-slide-fespa .hero-actions .btn-secondary {
    width: 100% !important;
  }
}
