/* História — layout com coluna esquerda fixa e conteúdo à direita */
.pagina-historia-body {
  overflow-x: hidden;
  transition: background-color 420ms ease;
}

.pagina-interna main {
  padding-top: 50px;
}

.historia-top-banner {
  width: 100%;
  margin: 0 auto;
  background: #101317;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.historia-top-banner__inner {
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.historia-top-banner__hero {
  position: relative;
  width: 100%;
  min-height: 50vh;
  background-image: url("../img/image-homepage-1.webp");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.historia-top-banner__overlay {
  position: absolute;
  inset: 0;
}

.historia-top-banner__media-card {
  position: absolute;
  top: 18px;
  right: 18px;
  width: clamp(140px, 18vw, 220px);
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(255, 255, 255, 0.24);
  overflow: hidden;
  z-index: 2;
}

.historia-top-banner__media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.historia-top-banner__thumb {
  width: 100%;
  height: 200px;
  border-radius: 0;
  overflow: hidden;
  border-top: 1px solid rgba(244, 241, 235, 0.18);
}

.historia-top-banner__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scrollable-component__pin-wrap {
  width: 80vw;
  max-width: 80vw;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 0;
  align-items: start;
  background: transparent;
  transition: border-color 420ms ease;
}

.scrollable-component__mobile-pin-stage {
  display: contents;
}

.scrollable-component__left {
  position: sticky;
  top: 86px;
  height: calc(100vh - 90px);
  border-right: 1px solid rgba(9, 9, 9, 0.12);
  transition: border-color 420ms ease;
}

.scrollable-component__wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  padding: clamp(34px, 4.4vw, 72px) clamp(0px, 0px, 0px);
}

.scrollable-component__title {
  font-size: clamp(2.4rem, 4.8vw, 5rem);
  line-height: 0.92;
  padding: 0 50px 20px 0px;
  color: #0e0e0e;
  border-bottom: 1px solid rgba(9, 9, 9, 0.12);
  font-weight: 400;
  letter-spacing: -0.035em;
  transition: color 420ms ease, border-color 420ms ease;
}

.scrollable-component__title .title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
}

.scrollable-component__title .title-word {
  display: inline-block;
  white-space: nowrap;
  margin-right: 0.22ch;
}

.scrollable-component__title.is-animated .title-char {
  animation: titleCharIn 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--char-delay, 0ms);
}

@keyframes titleCharIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scrollable-component__date {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scrollable-component__century {
  font-size: clamp(0.72rem, 0.88vw, 0.9rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(9, 9, 9, 0.58);
  transition: color 420ms ease;
}

.scrollable-component__year {
  font-size: clamp(1.6rem, 2.6vw, 2.6rem);
  line-height: 1;
  color: #F05134;
  letter-spacing: -0.02em;
  display: inline-block;
  min-width: 8ch;
  transition: color 420ms ease;
}

.scrollable-component__year.is-growing {
  animation: historyYearGrow 420ms ease;
}

@keyframes historyYearGrow {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 1;
  }
}

.scrollable-component__scroll-indicator {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(9, 9, 9, 0.58);
}

.scrollable-component__scroll-text {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.scrollable-component__right {
  border-left: 0;
  border-top: 1px solid rgba(9, 9, 9, 0.1);
}

.scrollable-component__panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  scroll-margin-top: 150px;
  border-bottom: 1px solid rgba(9, 9, 9, 0.1);
  opacity: 1;
  transform: none;
  transition: none;
}

.historia-seculo-xxi {
  background-color: #F05134;
}

.historia-seculo-xxi .scrollable-component__pin-wrap {
  border-bottom-color: rgba(246, 241, 232, 0.2);
}

.historia-seculo-xxi .scrollable-component__left {
  border-right-color: rgba(246, 241, 232, 0.2);
}

.historia-seculo-xxi .scrollable-component__title {
  color: #f6f1e8;
  border-bottom-color: rgba(246, 241, 232, 0.2);
}

.historia-seculo-xxi .scrollable-component__century {
  color: rgba(246, 241, 232, 0.78);
}

.historia-seculo-xxi .scrollable-component__year {
  color: #ffd205;
}

.historia-seculo-xxi .scrollable-component__panel {
  border-bottom-color: rgba(246, 241, 232, 0.2);
}

.historia-seculo-xxi .scrollable-component__panel-title {
  color: #f6f1e8;
}

.historia-seculo-xxi .scrollable-component__panel-text p {
  color: rgba(246, 241, 232, 0.9);
}

.historia-seculo-xxi .scrollable-component__scroll-indicator {
  color: rgba(246, 241, 232, 0.9);
}

.historia-seculo-xxi .scrollable-component__scroll-indicator svg path {
  fill: rgba(246, 241, 232, 0.9);
  fill-opacity: 1;
}

.historia-seculo-xxi .idioma-botoes.idioma-banner {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.historia-seculo-xxi .idioma-botoes.idioma-banner .idioma-botao,
.historia-seculo-xxi .idioma-botoes.idioma-banner .idioma-botao.ativo {
  color: #f6f1e8;
}

.historia-seculo-xxi .setronix-footer {
  background: #d04930;
  color: #f6f1e8;
}

.historia-seculo-xxi .setronix-footer__top,
.historia-seculo-xxi .setronix-footer__middle {
  border-bottom-color: rgba(246, 241, 232, 0.2);
}

.historia-seculo-xxi .setronix-footer__eyebrow,
.historia-seculo-xxi .setronix-footer__list a,
.historia-seculo-xxi .setronix-footer__meta,
.historia-seculo-xxi .setronix-footer__meta a {
  color: rgba(246, 241, 232, 0.82);
}

.historia-seculo-xxi .setronix-footer__brand,
.historia-seculo-xxi .setronix-footer__newsletter {
  color: #f6f1e8;
}

.historia-seculo-xxi .setronix-footer__social a {
  color: #f6f1e8;
  border-color: rgba(246, 241, 232, 0.42);
}

.scrollable-component__panel.is-active {
  opacity: 1;
  transform: none;
}

.scrollable-component__panel-title {
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
  color: #111;
  margin-bottom: 16px;
  letter-spacing: -0.018em;
  max-width: 100%;
  box-sizing: border-box;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  -webkit-hyphens: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.scrollable-component__panel-text {
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  -webkit-hyphens: none;
}

.scrollable-component__panel-text p {
  font-size: clamp(0.92rem, 1vw, 1rem);
  line-height: 1.6;
  color: rgba(9, 9, 9, 0.68);
  max-width: 62ch;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  -webkit-hyphens: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.scrollable-component__panel-image {
  order: 2;
  border-radius: 0;
  overflow: hidden;
  background: #ece7dd;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid rgba(9, 9, 9, 0.08);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.scrollable-component__panel-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scrollable-component__panel-content {
  order: 1;
  padding: 30px clamp(18px, 3vw, 34px) 30px;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  -webkit-hyphens: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.scrollable-component__panel.is-active .scrollable-component__panel-content {
  opacity: 1;
  transform: translateY(0);
}

.scrollable-component__panel.is-active .scrollable-component__panel-image {
  opacity: 1;
  transform: translateY(0);
}

.scrollable-component__panel.is-active .scrollable-component__panel-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 70ms;
}

.scrollable-component__panel.is-active .scrollable-component__panel-text p {
  opacity: 1;
  transform: translateY(0);
}

.scrollable-component__panel.is-active .scrollable-component__panel-text p:nth-child(1) {
  transition-delay: 180ms;
}

.scrollable-component__panel.is-active .scrollable-component__panel-text p:nth-child(2) {
  transition-delay: 280ms;
}

.scrollable-component__timeline-strip {
  display: none;
}

.scrollable-component__century--strip,
.scrollable-component__year--strip {
  display: inline-block;
}

@media (max-width: 1024px) {
  /* Espaço para o header fixo; evita o título da coluna esquerda ficar por baixo do menu */
  body.pagina-historia-body #conteudo.pagina-historia {
    padding-top: max(88px, calc(env(safe-area-inset-top, 0px) + 70px));
  }

  .historia-top-banner {
    width: 100%;
    max-width: 100%;
    margin-top: 78px;
  }

  .historia-top-banner__inner {
    min-height: 0;
    padding: 0;
  }

  .historia-top-banner__hero {
    min-height: 300px;
    margin-top: 0;
  }

  .historia-top-banner__media-card {
    top: 12px;
    right: 12px;
    width: 130px;
  }

  .historia-top-banner__thumb {
    width: 100%;
    height: 200px;
  }

  .scrollable-component__pin-wrap {
    width: 92vw;
    max-width: 92vw;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .scrollable-component__left {
    position: relative;
    top: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(9, 9, 9, 0.14);
  }

  .scrollable-component__wrap {
    height: auto;
    gap: 16px;
  }

  .scrollable-component__title {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, 3rem);
    padding: 0 0 12px 0;
    line-height: 0.98;
  }

  .scrollable-component__date {
    max-width: 100%;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 14px;
    flex-wrap: wrap;
    margin-top: 6px;
  }

  .scrollable-component__century {
    font-size: clamp(0.72rem, 2.5vw, 0.88rem);
  }

  .scrollable-component__year {
    font-size: clamp(1.85rem, 6.8vw, 2.65rem);
  }

  /* Faixa século/ano: só visível quando a coluna esquerda saiu do ecrã; fixa em baixo (acima da pill de idiomas) */
  body:not(.historia-timeline-unlocked) .scrollable-component__timeline-strip {
    display: none;
  }

  body.historia-timeline-unlocked .scrollable-component__timeline-strip {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 16px;
    flex-wrap: wrap;
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: max(calc(104px + env(safe-area-inset-bottom, 0px)), 24px);
    transform: translateX(-50%);
    width: min(calc(100vw - 24px), 520px);
    z-index: 40;
    margin: 0;
    padding: 12px clamp(14px, 4vw, 22px) 14px;
    border-radius: 14px;
    border: 1px solid rgba(9, 9, 9, 0.1);
    background: rgba(246, 241, 232, 0.96);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
    box-sizing: border-box;
  }

  body.historia-seculo-xxi.historia-timeline-unlocked .scrollable-component__timeline-strip {
    background: rgba(208, 49, 30, 0.96);
    border-color: rgba(246, 241, 232, 0.22);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  }

  body.historia-seculo-xxi.historia-timeline-unlocked .scrollable-component__century--strip {
    color: rgba(246, 241, 232, 0.85);
  }

  body.historia-seculo-xxi.historia-timeline-unlocked .scrollable-component__year--strip {
    color: #ffd205;
  }

  body.historia-timeline-unlocked .scrollable-component__pin-wrap {
    padding-bottom: max(96px, calc(env(safe-area-inset-bottom, 0px) + 84px));
  }

  .scrollable-component__century--strip {
    font-size: clamp(0.68rem, 2.3vw, 0.8rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(9, 9, 9, 0.55);
    flex: 1 1 auto;
    min-width: 0;
  }

  .scrollable-component__year--strip {
    font-size: clamp(1.9rem, 7.5vw, 2.85rem);
    line-height: 1;
    color: #f05134;
    font-weight: 600;
    letter-spacing: -0.03em;
    flex: 0 0 auto;
    text-align: right;
  }

  .scrollable-component__scroll-indicator {
    display: none;
  }

  .scrollable-component__right {
    display: flex;
    flex-direction: column;
    row-gap: clamp(26px, 5.5vw, 40px);
  }

  .scrollable-component__panel {
    opacity: 1;
    transform: none;
    scroll-margin-top: min(140px, 22vh);
    border-bottom: none;
    padding-bottom: 0;
    margin: 0;
  }

  .scrollable-component__panel:not(:last-child) {
    padding-bottom: clamp(22px, 5vw, 38px);
    border-bottom: 1px solid rgba(9, 9, 9, 0.16);
  }

  .historia-seculo-xxi .scrollable-component__panel:not(:last-child) {
    border-bottom-color: rgba(246, 241, 232, 0.28);
  }

  .scrollable-component__panel-content,
  .scrollable-component__panel-image {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Coluna única: cada painel no fluxo precisa de título e texto visíveis (não só o .is-active) */
  .scrollable-component__panel-title,
  .scrollable-component__panel-text p {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scrollable-component__panel-title {
    max-width: none;
    line-height: 1.18;
  }

  /* Sobrepõe .is-active: sem transição nem delay no texto (layout empilhado) */
  .scrollable-component__panel.is-active .scrollable-component__panel-content,
  .scrollable-component__panel.is-active .scrollable-component__panel-title,
  .scrollable-component__panel.is-active .scrollable-component__panel-text p,
  .scrollable-component__panel.is-active .scrollable-component__panel-text p:nth-child(1),
  .scrollable-component__panel.is-active .scrollable-component__panel-text p:nth-child(2) {
    transition: none;
    transition-delay: 0s;
    animation: none;
    will-change: auto;
  }
}

/* Telefone: sem animação no texto dos painéis + banner */
@media (max-width: 768px) {
  .scrollable-component__panel .scrollable-component__panel-content,
  .scrollable-component__panel.is-active .scrollable-component__panel-content,
  .scrollable-component__panel .scrollable-component__panel-title,
  .scrollable-component__panel.is-active .scrollable-component__panel-title,
  .scrollable-component__panel .scrollable-component__panel-text,
  .scrollable-component__panel .scrollable-component__panel-text p,
  .scrollable-component__panel.is-active .scrollable-component__panel-text p,
  .scrollable-component__panel.is-active .scrollable-component__panel-text p:nth-child(1),
  .scrollable-component__panel.is-active .scrollable-component__panel-text p:nth-child(2) {
    opacity: 1;
    transform: none;
    transition: none !important;
    transition-delay: 0s !important;
    padding: 0;
    animation: none !important;
    will-change: auto;
  }

  .historia-top-banner {
    margin-top: 0;
  }

  .historia-top-banner__hero {
    margin-top: 0;
    min-height: 42vh;
  }

  /* Mais espaço entre tópicos + traço central (gradiente) como separador */
  .scrollable-component__right {
    row-gap: clamp(40px, 11vw, 64px);
  }

  .scrollable-component__panel:not(:last-child) {
    padding-bottom: clamp(32px, 8vw, 52px);
    border-bottom: none;
    padding-top: 50px;
    background-image: linear-gradient(
      90deg,
      transparent 0%,
      rgba(240, 81, 52, 0.22) 18%,
      rgba(240, 81, 52, 0.38) 50%,
      rgba(240, 81, 52, 0.22) 82%,
      transparent 100%
    );
    background-size: min(220px, 72%) 2px;
    background-position: bottom center;
    background-repeat: no-repeat;
  }

  .historia-seculo-xxi .scrollable-component__panel:not(:last-child) {
    background-image: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.2) 20%,
      rgba(255, 255, 255, 0.45) 50%,
      rgba(255, 255, 255, 0.2) 80%,
      transparent 100%
    );
  }
}

/* Página Equipa (conteúdo WordPress sob o banner partilhado) */
.pagina-equipa {
  min-height: 40vh;
  padding-bottom: clamp(2rem, 6vw, 4rem);
}

.pagina-equipa__entry {
  padding-top: 1rem;
  padding-bottom: 2rem;
}
