/* ==========================================================================
   Banner – Autêntica Pharma
   Desenho base: 1920 × 1080. Tudo o que está dentro de .banner__stage usa
   cqw (1% da largura do palco), por isso o conteúdo escala como um todo.
   ========================================================================== */

:root {
  --ap-navy: #293c4d;
  --ap-blue: #324760;
  --ap-lime: #bed630;
  --ap-green: #a4c61a;
  --ap-cream: #f5f1ed;

  /* Ajustes do logo (do the_custom_logo). Valores medidos para um logo
     recortado sem margens; se o ficheiro tiver margens, afina aqui. */
  --logo-left: 3.5%;
  --logo-top: 15.6%;
  --logo-width: 22.9%;
}

.banner,
.banner *,
.banner-video,
.banner-video * {
  box-sizing: border-box;
}

.banner {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  container-type: size;
  background: var(--ap-cream);
  color: var(--ap-blue);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ---------- Fotos ---------- */

.banner__photos {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.banner__photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
  opacity: 0;
}

.banner__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to right,
      rgb(247 245 241 / 18%) 0%,
      rgb(247 245 241 / 12%) 34%,
      rgb(247 245 241 / 0%) 62%);
}

/* ---------- Ondas (SVG fixo por cima das fotos) ---------- */

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: url("../images/onda.svg") center / 100% 100% no-repeat;
}

/* ---------- Palco 16:9, encostado à esquerda e centrado na vertical ---------- */

.banner__stage {
  position: absolute;
  z-index: 4;
  inset: 0;
  container-type: size;
}

.banner__logo {
  position: absolute;
  top: var(--logo-top);
  left: var(--logo-left);
  width: var(--logo-width);
}

.banner__logo .custom-logo-link {
  display: block;
}

.banner__logo .custom-logo {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Headline: negrito = azul escuro, normal = verde ---------- */

.banner__headline {
  position: absolute;
  top: 42.55%;
  left: 3.5141%;
  color: var(--ap-green);
  font-size: max(14px, 1.9953cqw);
  font-weight: 400;
  line-height: 1.5662;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
}

.banner__headline p {
  margin: 0;
}

.banner__headline strong,
.banner__headline b {
  color: var(--ap-blue);
  font-weight: 700;
}

/* ---------- Botões ---------- */

.banner__actions {
  position: absolute;
  top: 62.0083%;
  left: 3.5141%;
  display: flex;
  align-items: center;
  gap: 1.8229cqw;
}

.banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5cqw;
  min-height: max(32px, 2.8125cqw);
  padding: 0 1.1cqw;
  border: 0;
  border-radius: 0.6771cqw;
  background: var(--ap-navy);
  color: var(--ap-cream);
  font: inherit;
  font-size: max(14px, 1.4063cqw);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: filter 160ms ease;
}

.banner__btn svg {
  width: max(16px, 1.3542cqw);
  height: max(16px, 1.3542cqw);
  color: var(--ap-green);
}

.banner__btn:hover,
.banner__btn:focus {
  color: var(--ap-cream);
  text-decoration: none;
  filter: none;
}

.banner__email:hover,
.banner__email:focus {
  color: var(--ap-blue);
  text-decoration: none;
}

.banner__lang a:hover {
  color: inherit;
  text-decoration: none;
}

.banner__lang a[aria-current="true"]:hover {
  text-decoration: underline;
}

/* ---------- Email ---------- */

.banner__email {
  position: absolute;
  top: 72.1759%;
  left: 3.5141%;
  display: inline-flex;
  align-items: center;
  gap: 0.42cqw;
  min-height: max(28px, 2.2917cqw);
  padding: 0 0.7cqw;
  border: 1px solid var(--ap-blue);
  border-radius: 0.52cqw;
  background: rgb(245 241 237 / 18%);
  color: var(--ap-blue);
  font-size: max(12px, 0.7292cqw);
  line-height: 1;
  text-decoration: none;
}

.banner__email img {
  display: block;
  width: max(16px, 2.3542cqw);
  height: auto;
}

.banner__btn:focus-visible,
.banner__email:focus-visible,
.banner__lang a:focus-visible {
  outline: 2px solid var(--ap-lime);
  outline-offset: 2px;
}

/* ---------- Seletor de idioma (dentro da faixa azul do topo) ---------- */

.banner__lang {
  position: absolute;
  z-index: 6;
  top: 2.7667%;
  right: 2.92%;
  display: flex;
  align-items: center;
  gap: 0.2cqw;
  min-height: max(28px, 1.9792cqw);
  padding: 0 0.8cqw;
  border: 1px solid var(--ap-blue);
  border-radius: 0.58cqw;
  background: var(--ap-lime);
  color: var(--ap-blue);
  font-size: max(12px, 0.7292cqw);
  font-weight: 500;
  line-height: 1;
}

.banner__lang img {
  display: block;
  width: max(16px, 3.43cqw);
  height: auto;
  margin-inline-end: 0.2cqw;
}

.banner__lang a {
  padding: 0.45em 0.4em;
  border-radius: 0.3em;
  color: inherit;
  text-decoration: none;
}

.banner__lang a[aria-current="true"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* ---------- Animação (CSS puro, ciclo de 12 s) ----------
   0 s    foto 1 e headline entram
   6 s    headline sai e volta a entrar, foto 2 entra por cima da foto 1
   12 s   headline sai e volta a entrar, foto 2 sai e revela a foto 1
   A foto 1 fica sempre por baixo, por isso nunca há "buraco" no crossfade. */

.banner__photo--1 {
  animation: banner-fade-in 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.banner__photo--2 {
  animation: banner-swap 12s linear 6s infinite backwards;
}

.banner__headline {
  animation: banner-headline 6s linear infinite;
}

.banner.is-loading .banner__photo,
.banner.is-loading .banner__headline {
  animation-play-state: paused;
}

@keyframes banner-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes banner-swap {
  0% {
    opacity: 0;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }

  15% {
    opacity: 1;
  }

  50% {
    opacity: 1;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }

  65% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

@keyframes banner-headline {
  0% {
    opacity: 0;
    transform: translateY(4px);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }

  30% {
    opacity: 1;
    transform: translateY(0);
  }

  90% {
    opacity: 1;
    transform: translateY(0);
    animation-timing-function: linear;
  }

  100% {
    opacity: 0;
    transform: translateY(0);
  }
}

/* ---------- Janela de vídeo ---------- */

.banner-video {
  width: min(85vw, 151.111vh);
  max-width: 85vw;
  max-height: 85vh;
  aspect-ratio: 16 / 9;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #101820;
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 42%);
}

.banner-video::backdrop {
  background: rgb(16 31 46 / 76%);
}

.banner-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.banner-video__close {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.banner-video__close::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 32px;
  height: 32px;
  border: 1px solid rgb(245 241 237 / 55%);
  border-radius: 50%;
  background: rgb(16 24 32 / 78%);
}

.banner-video__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: stroke 160ms ease;
}

.banner-video__close:hover svg {
  stroke: var(--ap-lime);
}

.banner-video__close:focus-visible {
  outline: 3px solid var(--ap-lime);
  outline-offset: 2px;
}

/* ==========================================================================
   Vertical (telemóvel / tablet em pé)
   - ondas sem deformação (cortadas ao centro em vez de esticadas)
   - conteúdo empilhado, foto por baixo com véu de cima para baixo
   ========================================================================== */

@media (max-aspect-ratio: 1 / 1) {
  .banner::after {
    background-size: auto 100%;
  }

  .banner__photo--1 {
    object-position: var(--foto1-mobile);
  }

  .banner__photo--2 {
    object-position: var(--foto2-mobile);
  }

  .banner__veil {
    background: linear-gradient(to bottom,
        rgb(245 241 237 / 96%) 0%,
        rgb(245 241 237 / 88%) 50%,
        rgb(245 241 237 / 0%) 82%);
  }

  .banner__stage {
    top: 0;
    translate: none;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15cqh 6cqw 0;
  }

  .banner__logo,
  .banner__headline,
  .banner__actions,
  .banner__email {
    position: static;
  }

  .banner__logo {
    width: 62cqw;
  }

  .banner__headline {
    margin-top: 6cqh;
    font-size: 4.8cqw;
    line-height: 1.5;
    white-space: normal;
  }

  .banner__actions {
    margin-top: 5cqh;
    gap: 3cqw;
  }

  .banner__btn {
    min-height: max(44px, 9cqw);
    padding: 0 4cqw;
    border-radius: 1.8cqw;
    font-size: max(14px, 3.6cqw);
    gap: 1.6cqw;
  }

  .banner__btn svg {
    width: max(18px, 4cqw);
    height: max(18px, 4cqw);
  }

  .banner__email {
    margin-top: 3cqh;
    min-height: max(36px, 8cqw);
    padding: 0 3cqw;
    gap: 1.6cqw;
    border-radius: 1.6cqw;
    font-size: max(12px, 2.9cqw);
  }

  .banner__email img {
    width: max(18px, 12.2cqw) !important;
  }

  .banner__lang {
    top: 2.2%;
    right: 4%;
    gap: 0.6cqw;
    min-height: max(30px, 7cqw);
    padding: 0 2cqw;
    border-radius: 1.6cqw;
    font-size: max(12px, 2.8cqw);
  }

  .banner__lang img {
    width: max(16px, 12.2cqw) !important;
  }
}

/* ---------- Movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
  .banner__photo--1 {
    animation: none;
    opacity: 1;
  }

  .banner__photo--2 {
    display: none;
  }

  .banner__headline {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .banner__btn {
    transition: none;
  }
}

.banner__actions,
.banner__email,
.banner__lang {
  direction: ltr;
}

:root {
  --foto1-mobile: 74% 50%;
  --foto2-mobile: 100% 50%;
}