.wrap.section.brochure-layout { width: calc(100% - 24px); padding-block: 12px; }
.brochure-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.brochure-reader { display: flex; flex-direction: column; height: calc(100dvh - var(--brochure-header-height, 82px) - 24px); min-height: 280px; }
.brochure-toolbar { display: flex; flex: 0 0 auto; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.brochure-toolbar button { display: inline-grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; background: #262c29; color: #fff; border: 1px solid #737d77; border-radius: 4px; font-size: 20px; }
.brochure-toolbar .fa-solid { font-family: "Copasso Gallery Icons"; font-weight: 900; }
.brochure-toolbar button:disabled { opacity: .4; cursor: default; }
.brochure-toolbar button:hover:enabled { border-color: var(--orange); }
.brochure-toolbar select { min-height: 48px; max-width: 190px; padding: 8px; background: var(--surface); color: var(--ink); border: 1px solid #737d77; border-radius: 4px; font: inherit; }
.brochure-counter { min-width: 70px; font-variant-numeric: tabular-nums; text-align: center; }
.brochure-downloads { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-left: auto; }
.brochure-downloads a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }
.brochure-stage { flex: 1; min-height: 0; padding: 8px; background: #101412; overflow: hidden; }
.brochure-reader.is-ready .brochure-stage { container-type: size; }
.brochure-pages { width: 100%; height: 100%; max-width: none; margin-inline: auto; transition: transform .3s ease; }
/* Keep the book frame fitted to its pages so both cover faces share one hinge. */
.brochure-reader[data-orientation="portrait"] .brochure-pages { width: min(100cqw, calc(100cqh * 210 / 297)); height: min(100cqh, calc(100cqw * 297 / 210)); }
.brochure-reader[data-orientation="landscape"] .brochure-pages { width: min(100cqw, calc(100cqh * 420 / 297)); height: min(100cqh, calc(100cqw * 297 / 420)); }
.brochure-pages .stf__wrapper { height: 100%; }
.brochure-reader[data-orientation="landscape"][data-current-page="1"] .brochure-pages { transform: translateX(calc(-1 * var(--brochure-cover-offset, 0px))); }
.brochure-reader[data-orientation="landscape"][data-current-page="6"] .brochure-pages { transform: translateX(var(--brochure-cover-offset, 0px)); }
.brochure-page { background: #fff; overflow: hidden; }
.brochure-page img { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0; }
.brochure-reader:not(.is-ready) { height: auto; }
.brochure-reader:not(.is-ready) .brochure-stage { overflow: visible; }
.brochure-reader:not(.is-ready) .brochure-pages { height: auto; }
.brochure-reader:not(.is-ready) .brochure-page { width: min(100%, 540px); aspect-ratio: 210 / 297; margin: 0 auto 24px; }
.brochure-reader:not(.is-ready) [data-brochure-control] { display: none; }
.brochure-text { max-width: 85ch; margin-top: 32px; }
.brochure-text summary { font-size: 20px; padding-block: 14px; }
.brochure-text section { margin-top: 30px; }
.brochure-text h2 { font-size: 24px; }
.brochure-zoom-sources[hidden] { display: none; }
.brochure-reader:fullscreen { height: 100dvh; padding: 10px; background: var(--surface); overflow: hidden; }
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .brochure-pages { max-width: 479px; }
}
@media (max-width: 767px) {
  .wrap.section.brochure-layout { width: calc(100% - 16px); padding-block: 8px; }
  .brochure-reader { height: calc(100dvh - var(--brochure-header-height, 82px) - 16px); }
  .brochure-toolbar { display: grid; grid-template-columns: 48px 56px 48px minmax(0, 1fr); }
  .brochure-toolbar select { width: 100%; min-width: 0; max-width: none; }
  .brochure-downloads { grid-column: 3 / 5; justify-self: end; margin-left: 0; }
  .brochure-stage { padding: 4px; }
  .brochure-counter { min-width: 56px; }
}
@media (prefers-reduced-motion: reduce) { .brochure-reader * { scroll-behavior: auto; transition: none; } }
