/* Posts do LinkedIn (Bradesco > LinkedIn Institucional e Executivos).
   Layout do feed: texto à esquerda, mídia à direita, sem espaço entre as colunas;
   contagem de reações e comentários abaixo. */

.lpost-list {
  display: grid;
  gap: 28px;
  padding: 8px 0 24px;
}

.lpost {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  background: #fff;
  color: #191919;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.lpost__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 20px 14px;
}

.lpost__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lpost__avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #c8102e;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
}

.lpost__head > div {
  min-width: 0;
}

.lpost__head strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #191919;
}

.lpost__head > div span {
  display: block;
  font-size: 12px;
  color: #666;
}

.lpost__ext {
  margin-left: auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: #0a66c2;
  text-decoration: none;
}

.lpost__ext:hover {
  text-decoration: underline;
}

.lpost__body {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #191919;
  overflow-wrap: anywhere;
}

.lpost__body p {
  margin: 0 0 10px;
}

.lpost__body h4 {
  margin: 0 0 10px;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.lpost__body p:last-child {
  margin-bottom: 0;
}

.lpost__tag {
  color: #0a66c2;
  font-weight: 600;
}

.lpost__credits {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid #ececec;
  font-size: 12px;
  color: #666;
}

.lpost__credits strong {
  font-weight: 600;
  color: #444;
}

/* Mídia: ocupa a altura da coluna de texto, colada na coluna da esquerda. */
.lpost__media {
  position: relative;
  min-height: 300px;
  background: #0d1117;
  overflow: hidden;
}

.lpost__media--img {
  background: #e8edf3;
}

.lpost__media--img > a {
  position: absolute;
  inset: 0;
}

.lpost__media--img > a:focus-visible {
  z-index: 1;
  outline: 2px solid #0a66c2;
  outline-offset: -2px;
}

.lpost__media video,
.lpost__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lpost__media--none {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f3f2ef;
  color: #444;
  text-align: center;
}

.lpost__bar {
  grid-column: 1 / -1;
  border-top: 1px solid #e0e0e0;
  padding: 10px 16px;
}

.lpost__counts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #666;
}

.lpost__counts span:only-child {
  margin-left: auto;
}

/* Febraban Tech 2026 */
.febraban {
  margin: 40px 0 16px;
  padding-top: 8px;
}

.febraban__head {
  max-width: 760px;
  margin-bottom: 24px;
}

.febraban__head h3 {
  margin: 4px 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--text);
}

.febraban__head p:last-child {
  color: var(--muted);
}

.mosaic__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.mosaic__tile {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: #151515;
  border: 1px solid rgba(255, 255, 255, .07);
  transition: border-color .25s ease, transform .25s ease;
}

.mosaic__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease-out, ease);
}

.mosaic__tile:hover {
  border-color: rgba(255, 255, 255, .24);
}

.mosaic__tile:hover img {
  transform: scale(1.04);
}

/* Foto do painel no Auditório Febraban, abaixo do mosaico. Clique amplia no popup. */
.febraban__foto {
  max-width: 440px;
  margin: 28px auto 0;
}

.febraban__foto-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  overflow: hidden;
  background: #151515;
  cursor: zoom-in;
  line-height: 0;
}

.febraban__foto-btn img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .4s var(--ease-out, ease);
}

.febraban__foto-btn:hover img {
  transform: scale(1.03);
}

.febraban__foto-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.febraban__foto figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.febraban__posts {
  margin-top: 32px;
}

.febraban__posts > h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--text);
}

.lpost__media--carousel {
  display: grid;
  align-content: center;
  min-width: 0;
}

.lpost__slides {
  display: flex;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  list-style: none;
}

@media (min-width: 761px) {
  .lpost__slides {
    max-height: 69svh;
  }
}

.lpost__slides::-webkit-scrollbar { display: none; }

.lpost__slides:focus-visible {
  outline: 2px solid #80bcff;
  outline-offset: -2px;
}

.lpost__slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.lpost__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 8px;
  background: #0d1117;
}

.lpost__nav button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #303842;
  color: #fff;
  font: 400 26px/1 system-ui, sans-serif;
  cursor: pointer;
}

.lpost__nav button:hover { background: #465361; }

.lpost__nav button[aria-disabled="true"] {
  background: #20262d;
  color: #a8adb3;
  cursor: default;
}

.lpost__count {
  min-width: 48px;
  color: #fff;
  font: 600 12px/1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@media (max-width: 1024px) {
  .mosaic__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .lpost {
    grid-template-columns: minmax(0, 1fr);
  }

  .lpost__media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .lpost__media--img {
    aspect-ratio: 4 / 5;
  }

  .lpost__media--wide {
    aspect-ratio: 2 / 1;
  }

  .lpost__media--carousel,
  .lpost__media--none {
    aspect-ratio: auto;
  }

  .lpost__media--none {
    min-height: 120px;
  }

  .lpost__text {
    padding: 14px 16px 12px;
  }

  .mosaic__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .mosaic__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Carrossel dos posts em sequência horizontal (tiras lado a lado) ----------
   Os slides ficam numa fileira só, na mesma altura, rolando para os lados (arrastar,
   trackpad, shift + roda ou a barra abaixo). Clique em um slide abre a foto no site. */
.lpost__media--strips {
  position: relative;
  min-height: 0;
  aspect-ratio: auto;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  height: clamp(340px, 58svh, 620px);
  background: #0d1117;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #465361 #0d1117;
}

.lpost__media--strips:focus-visible {
  outline: 2px solid #80bcff;
  outline-offset: -2px;
}

.lpost__media--strips .lpost__strip {
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  scroll-snap-align: start;
}

.lpost__media--strips .lpost__strip img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lpost__strip {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #151515;
  cursor: zoom-in;
  line-height: 0;
}

.lpost__strip:focus-visible {
  outline: 2px solid #0a66c2;
  outline-offset: 2px;
}

/* ---------- Fotos que abrem no próprio site (popup), sem ir para outra página ---------- */
.lpost__media--img > .lpost__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.lpost__photo:focus-visible {
  outline: 2px solid #0a66c2;
  outline-offset: -2px;
}

button.mosaic__tile {
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
}

button.mosaic__tile:focus-visible,
button.front-child__photo:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

button.front-child__photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

button.front-child__photo img {
  display: block;
  width: 100%;
  height: auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(0, 0, 0, .86);
}

.lightbox.is-open {
  display: flex;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox__box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  max-height: 100%;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__cap {
  margin: 12px 0 0;
  color: #f2f2f2;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__close:focus-visible {
  outline: 2px solid #0a66c2;
  outline-offset: 2px;
}

/* ---------- Vídeos no formato real ----------
   A caixa assume a proporção do arquivo (definida em js/pages/projeto.js ao carregar os metadados).
   Vertical: coluna estreita e centralizada, sem faixas pretas nas laterais.
   Horizontal: a caixa segue a proporção, sem faixas. */
.lpost__media--video {
  min-height: 0;
  background: #000;
  aspect-ratio: var(--vr, 16 / 9);
  align-self: center;
}

@media (min-width: 761px) {
  /* Vertical: o card segue a largura do conteúdo (texto de largura fixa + vídeo estreito),
     em vez de esticar o texto por toda a linha. Mesma largura de texto dos posts de imagem. */
  .lpost--portrait {
    grid-template-columns: minmax(0, 530px) auto;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
  }

  .lpost--portrait .lpost__media--video {
    aspect-ratio: auto;
    height: min(560px, 72vh);
    width: calc(min(560px, 72vh) * var(--vr, 0.5625));
  }
}

@media (max-width: 760px) {
  .lpost--portrait .lpost__media--video {
    aspect-ratio: auto;
    width: min(100%, calc(72vh * var(--vr, 0.5625)));
    height: auto;
    margin-inline: auto;
  }
}

/* ---------- Coluna centralizada (01/12) ----------
   Os posts e o bloco Febraban ficam numa coluna única, centralizada na página.
   Todos os cards têm a mesma largura: nos vídeos verticais o texto ocupa o resto da linha. */
.lpost-list,
.febraban {
  max-width: 1040px;
  margin-inline: auto;
}

.febraban__posts .lpost-list {
  max-width: none;
}

@media (min-width: 761px) {
  .lpost--portrait {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-self: stretch;
    width: auto;
  }
}

/* ---------- Carrosséis sem foto cortada (01/12) ----------
   A área mostra fotos inteiras: 2 por vez no computador, 1 por vez no celular.
   A altura sai da largura (4:5), então a última foto visível nunca fica pela metade;
   o encaixe da rolagem para sempre no início de uma foto. */
.lpost__media--strips {
  height: auto;
  align-self: center;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6px;
}

.lpost__media--strips .lpost__strip {
  width: calc((100% - 6px) / 2);
  height: auto;
  aspect-ratio: 4 / 5;
}

.lpost__media--strips .lpost__strip img {
  height: 100%;
}

@media (max-width: 760px) {
  .lpost__media--strips .lpost__strip {
    width: 100%;
  }
}

/* ---------- Celular: posts centralizados (01/12) ----------
   As páginas de projeto reservam 58px à direita para os botões flutuantes de contato.
   Nos blocos de posts as margens ficam iguais; em troca, os botões somem enquanto os posts
   passam por baixo deles (classe fcontact-off, ligada em js/pages/projeto.js). */
@media (max-width: 760px) and (min-height: 471px) {
  .front-catalogue > .wrap:has(> .lpost-list),
  .front-catalogue > .wrap:has(> .febraban) {
    padding-inline-end: var(--gutter);
  }

  html.fcontact-off .fcontact {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(24px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  }
}

/* ---------- Texto e mídia na mesma altura (01/12) ----------
   js/pages/projeto.js (fitPost) escolhe a largura do texto nos vídeos verticais e corta o
   texto longo com "…ver mais". Aqui: card de vídeo centralizado na largura que sobrar,
   texto centralizado na vertical quando é mais curto que a mídia, e o corte com degradê. */
.lpost__more {
  display: block;
  align-self: flex-start;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #666;
  font: 600 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
}

.lpost__more[hidden] {
  display: none;
}

.lpost__more:hover,
.lpost__more:focus-visible {
  color: #0a66c2;
  text-decoration: underline;
}

@media (min-width: 761px) {
  .lpost--portrait {
    justify-self: center;
  }

  .lpost__text {
    justify-content: center;
  }

  .lpost__credits {
    margin-top: 16px;
  }

  .lpost.is-clamped .lpost__body {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(#000 calc(100% - 56px), transparent);
  }
}

/* Tela média (761–1000px): carrossel lado a lado ficaria espremido (fotos pequenas e texto em
   coluna fina). Aqui o card empilha: texto em cima e fotos embaixo, na largura do card. */
@media (min-width: 761px) and (max-width: 1000px) {
  .lpost:has(> .lpost__media--strips) {
    grid-template-columns: minmax(0, 1fr);
  }
}
