/* =====================================================================
   UNIPBRAS · Fotografias (fotos.css)
   Faixas de foto em tela cheia e o mosaico "Produção nas aldeias".
   Fotos com licença livre (Wikimedia Commons), com crédito em cada uma.
   ===================================================================== */

/* ---------- Faixas de foto ---------- */
.ft-banda{
  position: relative; z-index: 2; min-height: 86vh; display: grid; align-items: center;
  overflow: hidden; isolation: isolate; color: var(--cream, #FBF6EC); background: var(--forest-deep);
}
.ft-banda-img{ position: absolute; inset: -10% 0; z-index: -3; overflow: hidden; }
.ft-banda-img img{
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: ft-ken 26s ease-in-out infinite alternate; will-change: transform;
}
@keyframes ft-ken{ from{ transform: scale(1.04) translate(0, 0); } to{ transform: scale(1.16) translate(-1.5%, -1%); } }
.ft-banda::before{
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(100deg, rgba(10,28,12,.94) 0%, rgba(15,51,18,.78) 38%, rgba(15,51,18,.18) 72%, rgba(15,51,18,.05) 100%),
              linear-gradient(180deg, rgba(10,28,12,.35) 0%, transparent 30%, transparent 70%, rgba(10,28,12,.55) 100%);
}
.ft-banda.dir::before{
  background: linear-gradient(260deg, rgba(10,28,12,.94) 0%, rgba(42,22,8,.78) 38%, rgba(42,22,8,.18) 72%, rgba(42,22,8,.05) 100%),
              linear-gradient(180deg, rgba(10,28,12,.35) 0%, transparent 30%, transparent 70%, rgba(10,28,12,.55) 100%);
}
/* franja de triângulos na borda inferior */
.ft-banda::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; z-index: 1; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpath d='M0 16 L8 3 L16 16 L24 3 L32 16' fill='none' stroke='%23E8A317' stroke-width='1.8'/%3E%3C/svg%3E") repeat-x;
}
.ft-banda-w{ position: relative; max-width: var(--container, 1200px); margin: 0 auto; width: 100%; padding: 120px 24px; }
.ft-banda-txt{ max-width: 620px; }
.ft-banda.dir .ft-banda-txt{ margin-left: auto; }
.ft-banda-eyb{ font-size: .8rem; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; color: var(--gold-light); margin: 0 0 16px; }
.ft-banda h2{
  font-family: var(--font-display); font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.12;
  margin: 0 0 22px; color: #fff; text-wrap: balance; text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.ft-banda h2 em{ font-style: normal; color: var(--gold-light); }
.ft-banda p{ font-size: clamp(1rem, 1.35vw, 1.15rem); line-height: 1.8; color: rgba(251,246,236,.9); max-width: 54ch; margin: 0; }
.ft-credito{
  position: absolute; right: 18px; bottom: 26px; z-index: 2; font-size: .68rem; letter-spacing: .03em;
  color: rgba(251,246,236,.62); text-decoration: none; max-width: 60vw; text-align: right;
}
.ft-credito:hover{ color: var(--gold-light); text-decoration: underline; }
/* losango vazado que gira devagar ao lado do texto */
.ft-losango{
  position: absolute; top: 50%; width: min(38vw, 420px); aspect-ratio: 1; z-index: -1; pointer-events: none;
  right: 8%; margin-top: calc(min(38vw, 420px) / -2);
  border: 2px solid rgba(245,197,66,.5); transform: rotate(45deg);
  box-shadow: inset 0 0 0 14px rgba(245,197,66,.06), 0 0 0 14px rgba(245,197,66,.06);
  animation: ft-gira 40s linear infinite;
}
.ft-banda.dir .ft-losango{ right: auto; left: 8%; }
.ft-losango::before{ content: ""; position: absolute; inset: 22%; border: 1.5px dashed rgba(245,197,66,.45); }
@keyframes ft-gira{ to{ transform: rotate(405deg); } }

@supports (animation-timeline: view()){
  .ft-banda-img{ animation: ft-paralaxe linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  @keyframes ft-paralaxe{ from{ transform: translateY(-7%); } to{ transform: translateY(7%); } }
  .ft-banda{ animation: ft-abre linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  @keyframes ft-abre{ from{ clip-path: inset(9% 6% 9% 6% round 36px); } to{ clip-path: inset(0 0 0 0 round 0); } }
}

/* ---------- Mosaico "Produção nas aldeias" ---------- */
.section-producao{ background: var(--cream, #FBF6EC); }
.ft-mosaico{
  display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 230px;
  grid-auto-flow: dense;
}
.ft-mosaico .g2{ grid-column: span 2; }
.ft-mosaico .a2{ grid-row: span 2; }
.ft-item{
  position: relative; margin: 0; overflow: hidden; border-radius: 18px; cursor: zoom-in;
  background: var(--forest-deep); outline: none;
  clip-path: polygon(50% 38%, 62% 50%, 50% 62%, 38% 50%);
  transition: clip-path 1.25s cubic-bezier(.77,0,.18,1), box-shadow .4s ease;
  transition-delay: var(--ft-d, 0s);
}
.ft-mosaico.on .ft-item{ clip-path: polygon(50% -60%, 160% 50%, 50% 160%, -60% 50%); }
.ft-item img{
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.12); transition: transform 1.6s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--ft-d, 0s);
}
.ft-mosaico.on .ft-item img{ transform: scale(1); }
.ft-mosaico.on .ft-item:hover img, .ft-mosaico.on .ft-item:focus-visible img{ transform: scale(1.07); transition-delay: 0s; transition-duration: .9s; }
.ft-item::before{ /* moldura de contas que aparece no hover */
  content: ""; position: absolute; inset: 10px; z-index: 2; border-radius: 12px; pointer-events: none;
  border: 2px dotted rgba(245,197,66,.95); opacity: 0; transform: scale(.96);
  transition: opacity .4s ease, transform .5s cubic-bezier(.16,1,.3,1);
}
.ft-item:hover::before, .ft-item:focus-visible::before, .ft-item.ft-toque::before{ opacity: 1; transform: none; }
.ft-item figcaption{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 40px 16px 14px;
  background: linear-gradient(0deg, rgba(10,28,12,.88), rgba(10,28,12,0));
  color: #fff; transform: translateY(28%); opacity: .92;
  transition: transform .5s cubic-bezier(.16,1,.3,1), opacity .4s;
}
.ft-item:hover figcaption, .ft-item:focus-visible figcaption, .ft-item.ft-toque figcaption{ transform: none; opacity: 1; }
.ft-item figcaption b{ display: block; font-family: var(--font-display); font-size: 1.02rem; line-height: 1.25; }
.ft-item figcaption small{ display: block; margin-top: 4px; font-size: .66rem; color: rgba(251,246,236,.72); }
.ft-nota{ margin-top: 22px; font-size: .78rem; color: var(--ink-soft); }
.ft-nota a{ color: inherit; }

/* ---------- Tela cheia ---------- */
.ft-lb{
  position: fixed; inset: 0; z-index: 10080; display: none; align-items: center; justify-content: center;
  background: rgba(8,20,10,.94); padding: 60px 20px 80px;
}
.ft-lb.on{ display: flex; animation: ft-lb-in .35s ease; }
@keyframes ft-lb-in{ from{ opacity: 0; } }
.ft-lb figure{ margin: 0; max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.ft-lb img{ max-width: 100%; max-height: 74vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: ft-lb-img .6s cubic-bezier(.16,1,.3,1); }
@keyframes ft-lb-img{ from{ clip-path: polygon(50% 30%, 70% 50%, 50% 70%, 30% 50%); opacity: .4; } to{ clip-path: polygon(50% -60%, 160% 50%, 50% 160%, -60% 50%); opacity: 1; } }
.ft-lb figcaption{ color: #fff; text-align: center; margin-top: 16px; }
.ft-lb figcaption b{ font-family: var(--font-display); font-size: 1.2rem; display: block; }
.ft-lb figcaption small{ color: rgba(251,246,236,.7); font-size: .75rem; }
.ft-lb figcaption a{ color: inherit; }
.ft-lb button{
  position: absolute; border: 0; background: rgba(251,246,236,.12); color: #fff; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; line-height: 1; display: grid; place-items: center;
}
.ft-lb button:hover, .ft-lb button:focus-visible{ background: var(--gold); color: var(--forest-deep); outline: none; }
.ft-lb .ft-fecha{ top: 18px; right: 18px; }
.ft-lb .ft-ant{ left: 18px; top: 50%; margin-top: -24px; }
.ft-lb .ft-prox{ right: 18px; top: 50%; margin-top: -24px; }

@media (max-width: 900px){
  .ft-mosaico{ grid-template-columns: repeat(2, 1fr); grid-auto-rows: 190px; }
}
@media (max-width: 760px){
  .ft-banda{ min-height: auto; }
  .ft-banda-w{ padding: 90px 20px 110px; }
  .ft-banda::before, .ft-banda.dir::before{ background: linear-gradient(180deg, rgba(10,28,12,.55), rgba(10,28,12,.88)); }
  .ft-losango{ width: 70vw; right: -20vw; margin-top: -35vw; opacity: .5; }
  .ft-banda.dir .ft-losango{ left: -20vw; }
  .ft-credito{ left: 20px; right: 20px; text-align: left; max-width: none; }
  .ft-item figcaption{ transform: none; }
  .ft-lb .ft-ant, .ft-lb .ft-prox{ top: auto; bottom: 18px; margin-top: 0; }
  .ft-lb .ft-ant{ left: calc(50% - 60px); } .ft-lb .ft-prox{ right: calc(50% - 60px); }
}
@media (prefers-reduced-motion: reduce){
  .ft-banda-img img, .ft-losango{ animation: none; }
  .ft-banda, .ft-banda-img{ animation: none !important; clip-path: none; }
  .ft-item{ clip-path: none !important; transition: none; }
  .ft-item img{ transform: none !important; transition: none; }
}

/* grade sem vazios no computador: posições fixas para as 8 fotos */
@media (min-width: 901px){
  .ft-mosaico{
    grid-template-areas: "a a b c" "a a d c" "e f d g" "h h h g";
    grid-template-rows: repeat(4, 230px); grid-auto-rows: 230px;
  }
  .ft-mosaico .ft-item{ grid-column: auto; grid-row: auto; }
  .ft-mosaico .ft-item:nth-child(1){ grid-area: a; }
  .ft-mosaico .ft-item:nth-child(2){ grid-area: b; }
  .ft-mosaico .ft-item:nth-child(3){ grid-area: c; }
  .ft-mosaico .ft-item:nth-child(4){ grid-area: d; }
  .ft-mosaico .ft-item:nth-child(5){ grid-area: g; }
  .ft-mosaico .ft-item:nth-child(6){ grid-area: e; }
  .ft-mosaico .ft-item:nth-child(7){ grid-area: h; }
  .ft-mosaico .ft-item:nth-child(8){ grid-area: f; }
}
/* celular: duas colunas, primeira foto em destaque, sem espaços vazios */
@media (max-width: 900px){
  .ft-mosaico .ft-item{ grid-column: auto; grid-row: auto; }
  .ft-mosaico .ft-item:nth-child(1){ grid-column: span 2; grid-row: span 2; }
}
@media (max-width: 760px){
  .ft-item figcaption{ padding: 30px 12px 10px; }
  .ft-item figcaption b{ font-size: .84rem; }
  .ft-item figcaption small{ font-size: .6rem; }
  .ft-mosaico .ft-item:nth-child(1) figcaption b{ font-size: 1rem; }
}

/* película mais leve: a foto aparece, o texto continua legível */
.ft-banda::before{
  background: linear-gradient(100deg, rgba(10,28,12,.80) 0%, rgba(15,51,18,.52) 36%, rgba(15,51,18,.08) 66%, rgba(15,51,18,0) 100%),
              linear-gradient(180deg, rgba(10,28,12,.25) 0%, transparent 25%, transparent 78%, rgba(10,28,12,.45) 100%);
}
.ft-banda.dir::before{
  background: linear-gradient(260deg, rgba(10,28,12,.80) 0%, rgba(42,22,8,.52) 36%, rgba(42,22,8,.08) 66%, rgba(42,22,8,0) 100%),
              linear-gradient(180deg, rgba(10,28,12,.25) 0%, transparent 25%, transparent 78%, rgba(10,28,12,.45) 100%);
}
.ft-banda h2, .ft-banda p, .ft-banda-eyb{ text-shadow: 0 1px 2px rgba(0,0,0,.45), 0 4px 28px rgba(0,0,0,.45); }
@media (max-width: 760px){
  .ft-banda{ min-height: 92vh; align-items: end; }
  .ft-banda::before, .ft-banda.dir::before{
    background: linear-gradient(180deg, rgba(10,28,12,.08) 0%, rgba(10,28,12,.12) 30%, rgba(10,28,12,.62) 58%, rgba(10,28,12,.9) 100%);
  }
  .ft-banda-w{ padding: 46vh 20px 96px; }
}
