.film-section {
  --history-top: max(var(--site-header-clearance, 128px), 18svh);
  --history-bottom: max(14svh, 76px);
  --history-title-row: clamp(48px, 8svh, 80px);
  --history-gap: clamp(10px, 1.5svh, 18px);
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  max-height: 100svh;
  padding: 0;
  overflow: clip;
  isolation: isolate;
  background: #f2d7a3;
  color: #40523b;
}
.history-environment { position: absolute; inset: 0; z-index: 0; display: block; pointer-events: none; }
.history-environment img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.history-composition {
  position: absolute;
  z-index: 1;
  top: var(--history-top);
  bottom: var(--history-bottom);
  left: clamp(28px, 14vw, 260px);
  right: clamp(28px, 9vw, 172px);
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(0, 1.75fr);
  grid-template-rows: var(--history-title-row) minmax(0, 1fr);
  grid-template-areas: "title title" "book video";
  gap: var(--history-gap);
  column-gap: clamp(24px, 3vw, 64px);
  align-items: center;
  width: auto;
  min-width: 0;
  min-height: 0;
}
.history-heading {
  grid-area: title;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .22em;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: .08em .12em .12em;
  font: 400 min(calc(var(--history-title-row) * .72), 15vw)/1.12 "Capela Assinatura", Georgia, serif;
  color: #40523b;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 18px #fff1ce66;
}
.history-heading span { display: inline-block; }
.history-player-space { grid-area: video; display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; min-height: 0; container-type: size; }
.history-book {
  grid-area: book;
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 360px;
  max-height: 100%;
  min-height: 0;
  padding: clamp(24px, 2.2vw, 34px) clamp(22px, 2.2vw, 34px) clamp(24px, 2.2vw, 34px) clamp(30px, 3vw, 44px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #baa070 #f7e9cd;
  border: 1px solid #b2945f66;
  border-left: 4px solid #aa874f;
  border-radius: 2px 5px 5px 2px;
  background: linear-gradient(90deg, #e3cda6, #f6e7c9 12px, #fff5df 36px);
  box-shadow: 3px 3px 0 #f5e5c5, 4px 4px 0 #b99b6470, 0 10px 30px #694b2426;
  color: #51412e;
}
.history-book-copy { font: 400 clamp(1rem, 1.05vw, 1.125rem)/1.55 Georgia, "Times New Roman", serif; text-align: left; hyphens: auto; overflow-wrap: break-word; }
.history-book-copy p + p { margin-top: 1em; }
.history-book-copy p:first-child::first-letter { float: left; margin: .06em .1em 0 0; color: #716d3b; font-size: 3.1em; line-height: .84; }
.history-book:focus-visible { outline: 2px solid #746d3b; outline-offset: 6px; }
.history-book[data-lenis-prevent] { overscroll-behavior-y: auto; }
.film-section .film-frame {
  width: min(100cqw, calc(100cqh * 1.7777778), 1120px);
  height: auto;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  container: history-player / inline-size;
  overflow: hidden;
  border: 1px solid #72553355;
  border-radius: 5px;
  background: #111d16;
  box-shadow: 0 0 0 4px #f9e8c18c, 0 14px 40px #4c3d2433;
}
.history-ready .history-heading span { opacity: 0; transform: translateY(75%); transition: opacity .8s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.history-ready .history-heading span + span { transition-delay: .1s; }
.history-ready .film-frame { opacity: 0; transform: scale(.985); transition: opacity .85s ease .1s, transform 1.05s cubic-bezier(.2,.7,.2,1) .1s; }
.history-ready .history-book { opacity: 0; transform: translateX(-14px); transition: opacity .9s ease .15s, transform 1.1s cubic-bezier(.2,.7,.2,1) .15s; }
.history-ready.is-in-view .history-heading span,
.history-ready.is-in-view .film-frame,
.history-ready.is-in-view .history-book { opacity: 1; transform: none; }
.film-section .film-frame video { object-fit: contain; }
.film-section .film-frame::after { inset: auto 0 0; height: min(45%, 110px); background: linear-gradient(transparent, #07170ee6); }
.film-section .film-bottomline { bottom: 10px; left: 18px; right: 18px; }
.film-section .film-controls { width: auto; gap: clamp(12px, 2vw, 28px); }
.film-section .media-button { min-width: 44px; min-height: 44px; padding: 8px 6px; font-size: .875rem; }
.film-section .film-progress { height: 3px; }
.film-section .film-progress i { background: #e0bc7d; }
.film-section .film-frame:fullscreen { width: 100vw; height: 100vh; max-width: none; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; transform: none; opacity: 1; }
.film-section .film-frame:fullscreen .film-bottomline { bottom: max(24px, env(safe-area-inset-bottom)); }
body[data-section="filme"] .site-sound,
body[data-section="filme"] .floating-whatsapp { bottom: max(1rem, env(safe-area-inset-bottom)); }
@container history-player (max-width: 460px) {
  .film-section .film-bottomline { left: 10px; right: 10px; bottom: 7px; }
  .film-section .film-controls { width: 100%; gap: 4px; justify-content: space-between; }
  .film-section .media-button { padding-right: 4px; padding-left: 4px; gap: 4px; }
  .media-button:last-child span { display: none; }
}
@container history-player (max-width: 360px) { .media-button:first-child span { display: none; } }
@container history-player (max-width: 220px) { .media-button span { display: none; } }
@container history-player (max-width: 180px) {
  .film-section .film-bottomline { left: 4px; right: 4px; bottom: 3px; }
  .film-section .media-button { min-width: 32px; min-height: 36px; padding: 6px 2px; }
  .film-section .film-controls { gap: 2px; }
}
@media (orientation: portrait) {
  .film-section { --history-top: max(calc(var(--site-header-clearance, 111px) + 12px), 16svh); --history-bottom: max(8svh, 76px); --history-title-row: clamp(40px, 6svh, 56px); }
  .history-environment img { object-position: right bottom; }
  .history-composition { left: 6%; right: 6%; grid-template-columns: minmax(0,1fr); grid-template-rows: var(--history-title-row) min(49.5vw, 24svh) minmax(0,1fr); grid-template-areas: "title" "video" "book"; }
  .history-book { align-self: stretch; justify-self: center; max-width: 640px; height: 100%; padding: 20px 22px 22px 30px; }
  .history-book-copy { font-size: 1rem; line-height: 1.5; }
}
@media (max-width: 800px) and (orientation: landscape) {
  .history-composition { left: 5%; right: 5%; grid-template-columns: minmax(210px, 1fr) minmax(0, 1.3fr); column-gap: 20px; }
  .history-book { padding: 18px 20px 20px 26px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .film-section { --history-top: var(--site-header-clearance, 92px); --history-bottom: 76px; --history-title-row: 32px; --history-gap: 8px; }
  .film-section { height: auto; min-height: 100svh; max-height: none; padding: calc(var(--site-header-clearance, 94px) + 14px) 5% 80px; }
  .history-composition { position: relative; inset: auto; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.4fr); grid-template-rows: 40px auto; column-gap: 24px; }
  .history-book { max-height: none; height: auto; overflow: visible; }
  .history-player-space { height: auto; container-type: inline-size; }
  .film-section .film-frame { width: min(100%, 1120px); }
}
@media (max-height: 400px) and (orientation: portrait) {
  .film-section { --history-top: 80px; --history-bottom: 72px; --history-title-row: 28px; --history-gap: 6px; }
}
@media (max-width: 700px) and (max-height: 500px) and (orientation: landscape) {
  .history-composition { grid-template-columns: minmax(0, 1fr); grid-template-rows: 40px auto auto; grid-template-areas: "title" "video" "book"; row-gap: 20px; }
  .history-book { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .history-ready .history-heading span,
  .history-ready .film-frame,
  .history-ready .history-book { opacity: 1; transform: none; transition: none; }
}
