/* The desktop Stories introduction and its frames share the existing mosaic grid. */
@media (min-width: 768px) {
  #storie {
    padding-top: 47px;
  }
  #storie .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
    gap: 40px;
    align-items: end;
    margin: 0 0 22px;
    padding: 0 0 20px;
  }
  #storie .section-head .eyebrow {
    font-size: .6875rem;
    letter-spacing: .18em;
    margin: 0 0 11px;
  }
  #storie .section-head h2 {
    font-size: clamp(2.25rem, 3.4vw, 3.3125rem);
    line-height: 1.05;
    letter-spacing: -.025em;
    max-width: none;
    margin: 0;
  }
  #storie .section-note {
    width: 100%;
    max-width: 340px;
    justify-self: end;
    margin: 0;
    padding: 0 0 4px;
  }
  #storie .section-note p {
    font-size: .9375rem;
    line-height: 1.55;
    max-width: none;
    margin: 0;
  }
  #storie .stories-default-break,
  #storie .stories-default-number,
  #storie #story-count {
    display: none;
  }
  #storie #story-grid .card-image {
    padding: 3px !important;
    background: #ded7c8 !important;
  }
}

/* Keep the whole menu reachable, including on short landscape viewports. */
@media (max-width: 767px) {
  body.theme125 { --theme-header-height: 69px; }
  .theme125 .header {
    min-height: var(--theme-header-height);
    padding-block: 0;
    padding-inline: clamp(16px, 6vw, 24px);
  }
  .theme125 .header .brand {
    width: 138px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  /* The studio's original logo file has blank space above and below the mark. */
  .theme125 .header .brand img:not(.site-custom-logo) {
    width: auto !important;
    max-height: 80px !important;
  }
  .theme125 .header .brand img.site-custom-logo {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 60px !important;
    object-fit: contain;
  }
}

/* Contenuti in evidenza: didascalie allineate e fotografie nel formato originale. */
.theme125 .featured-pair125 .featured-viewfinder131:has(> .featured-single131:not([hidden])) {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.theme125 .featured-pair125 .eyebrow {
  font-size: .8125rem;
  line-height: 1.5;
  margin-block: 0 .5rem;
  margin-inline: auto;
}
.theme125 .featured-pair125 :is(.hero-copy, .secondary-copy) h2 {
  margin-block: 0 .65rem;
  font-size: clamp(1.55rem, 2.15vw, 2rem);
  line-height: 1.2;
  text-wrap: balance;
}
.theme125 .featured-pair125 .hero-caption:not(:has(> :not([hidden]))) {
  display: none;
}
@media (min-width: 768px) {
  .theme125 .featured-pair125:has(> [data-home-section][hidden]),
  .theme125 .featured-pair125:has(> [data-home-section]:only-child) {
    grid-template-columns: minmax(0, 1fr);
  }
  .theme125 .featured-pair125.one-feature131 > [data-home-section]:not([hidden]),
  .theme125 .featured-pair125:has(> [data-home-section][hidden]) > [data-home-section]:not([hidden]),
  .theme125 .featured-pair125 > [data-home-section]:only-child {
    max-width: 600px;
    justify-self: center;
  }
  @supports (grid-template-rows: subgrid) {
    .theme125 .featured-pair125 { row-gap: 0; }
    .theme125 .featured-pair125 > [data-home-section].canva-card:not([hidden]) {
      display: grid;
      grid-row: span 5;
      grid-template-rows: subgrid;
      grid-template-columns: minmax(0, 1fr);
      align-self: stretch;
      row-gap: 0;
    }
    .theme125 .featured-pair125 .featured-viewfinder131 {
      grid-column: 1 / -1;
      grid-row: 1;
      align-self: end;
    }
    .theme125 .featured-pair125 :is(.hero-copy, .secondary-copy) {
      display: grid;
      grid-column: 1 / -1;
      grid-row: 2 / span 4;
      grid-template-rows: subgrid;
      grid-template-columns: minmax(0, 1fr);
      align-items: start;
      row-gap: 0;
    }
    .theme125 .featured-pair125 .eyebrow { grid-row: 1; }
    .theme125 .featured-pair125 h2 { grid-row: 2; }
    .theme125 .featured-pair125 :is(.hero-description, .secondary-intro) { grid-row: 3; }
    .theme125 .featured-pair125 :is(.hero-caption, .secondary-copy > .text-link) { grid-row: 4; }
    .theme125 .featured-pair125 .featured-viewfinder131:not([hidden]) { margin-bottom: 1.25rem; }
  }
}
@media (max-width: 767px) {
  .theme125 .featured-pair125 { padding-block: clamp(3rem, 12vw, 4rem); }
}

/* Slideshow della homepage: la cornice contiene sempre l'intera fotografia. */
.theme125 .statement.has-panorama124:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'copy' 'panorama';
  align-items: start;
  gap: 1rem;
  width: min(calc(100% - 32px), 62rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}
.theme125 .statement.has-panorama124 .statement-text {
  grid-area: copy;
  width: 100%;
  max-width: 48ch;
  margin: 0 auto;
  padding: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
.theme125 .statement.has-panorama124 .statement-quote {
  margin-block: .5rem;
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  line-height: 1.16;
  text-wrap: balance;
}
.theme125 .statement.has-panorama124 .micro {
  display: block;
  margin-inline: auto;
}
.theme125 .statement.has-panorama124 .statement-text :is(.eyebrow, .statement-quote, .micro):empty { display: none; }
.theme125 .statement.has-panorama124 .panorama124 {
  grid-area: panorama;
  justify-self: center;
  width: 100%;
  max-width: 43rem;
  margin: 0;
}
.theme125 .statement.has-panorama124 .panorama124-controls {
  justify-content: center;
  gap: .375rem;
  margin: 0 0 .375rem;
}
.theme125 .statement.has-panorama124 .panorama124-stage { justify-items: center; }
.theme125 .statement.has-panorama124 .panorama124-frame {
  width: 100%;
  align-self: start;
  justify-self: center;
  align-items: center;
  margin: 0;
}
.theme125 .statement.has-panorama124 .panorama124-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: clamp(270px, 63svh, 510px);
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
}
.theme125 .statement.has-panorama124 .panorama124-frame :is(figcaption, .panorama124-copy) {
  position: relative;
  inset: auto;
  width: min(100%, 52ch);
  margin: .75rem auto 0;
  padding: 0;
  background: transparent;
  text-align: center;
  overflow-wrap: anywhere;
}
@media (min-width: 960px) {
  .theme125 .statement.has-panorama124:not([hidden]) {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    grid-template-areas: 'panorama copy';
    column-gap: clamp(1.75rem, 4vw, 4rem);
    width: min(calc(100% - 64px), 65rem);
  }
  .theme125 .statement.has-panorama124 .statement-text {
    align-self: center;
    margin-inline: 0;
    text-align: start;
  }
  .theme125 .statement.has-panorama124 .micro { margin-inline: 0; }
  .theme125 .statement.has-panorama124 .statement-text:has(> :not(:empty):not([hidden]))::before {
    content: '';
    display: block;
    width: 2.25rem;
    height: 1px;
    margin-bottom: 1.25rem;
    background: var(--copper);
  }
}
/* Se Ilaria lascia vuoto tutto il testo, resta la sola fotografia sull’asse della pagina. */
.theme125 .statement.has-panorama124:not([hidden]):not(:has(> .statement-text:not([hidden]) > :not(:empty):not([hidden]))) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'panorama';
  gap: 0;
}
.theme125 .statement.has-panorama124 .statement-text:not(:has(> :not(:empty):not([hidden]))) { display: none; }

/* On phones the photograph can use the outer eight pixels on each side.
   Keep the caption, playback controls and section copy on their original axis. */
@media (max-width: 767px) {
  .theme125 .statement.has-panorama124 .panorama124-stage {
    width: calc(100% + 16px);
    margin-inline: -8px;
  }
  .theme125 .statement.has-panorama124 .panorama124-frame img {
    max-height: calc(100vh - 64px);
    max-height: calc(100svh - 64px);
  }
  .theme125 .statement.has-panorama124 .panorama124-frame :is(figcaption, .panorama124-copy) {
    max-width: calc(100% - 16px);
  }
}

/* Only the desktop contact sheets change. The optically balanced cover crops
   up to one eighth from each side of a landscape; portraits remain whole. */
@media (min-width: 768px) {
  .theme125 #personal-project-grid131,
  body.theme125[data-page="home"] #storie #story-grid {
    container-type: inline-size;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    height: auto !important;
    --cover-height177: clamp(168px, 28.5cqw, 345px);
  }
  .theme125 #personal-project-grid131 { gap: 8px; }
  body.theme125[data-page="home"] #storie #story-grid { gap: 20px 12px; }
  .theme125 #personal-project-grid131 > .personal-project131,
  body.theme125[data-page="home"] #storie #story-grid > .story-card {
    position: static;
    flex: 0 1 auto;
    width: max-content !important;
    max-width: 100%;
  }
  .theme125 #personal-project-grid131 .personal-project-photo131,
  body.theme125[data-page="home"] #storie #story-grid .card-image {
    /* Panoramas wider than 9:4 also keep their full field of view. */
    --cover-window-ratio177: min(var(--photo-ratio, 1.5), max(1.33, .75 * var(--photo-ratio, 1.5), 2 * var(--photo-ratio, 1.5) - 2.25));
    --cover-width177: calc(var(--cover-height177) * var(--cover-window-ratio177));
  }
  .theme125 #personal-project-grid131 .personal-project-photo131 {
    --photo-ratio: var(--personal-cover-ratio177, 1.5);
    width: min(100cqw, var(--cover-width177));
    height: auto;
    aspect-ratio: var(--cover-window-ratio177);
    object-fit: cover;
    max-height: none;
  }
  body.theme125[data-page="home"] #storie #story-grid .card-image {
    width: min(100cqw, calc(6px + var(--cover-width177)));
  }
  body.theme125[data-page="home"] #storie #story-grid .card-image img {
    width: 100%;
    height: auto;
    aspect-ratio: var(--cover-window-ratio177);
    object-fit: cover;
    max-height: none;
  }
  .theme125 #personal-project-grid131 .personal-project-title131 {
    padding: 38px 12px 12px;
    font-size: clamp(1rem, 1.55vw, 1.4rem);
  }
  .theme125 #personal-project-grid131 .has-long-title131 .personal-project-title131,
  body.theme125[data-page="home"] #storie #story-grid .card-title {
    contain: inline-size;
  }

  /* Once a story opens, every frame shows the complete photograph. */
  body.theme125[data-page="published"] .story-cover img {
    max-height: min(60vh, 445px);
    max-height: min(60svh, 445px);
  }
  body.theme125[data-page="published"] .chapter-images.story-gallery {
    --story-print-height: clamp(200px, 17.2vw, 250px);
    position: static;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: flex-start;
    height: auto;
    gap: 12px;
  }
  body.theme125[data-page="published"] .chapter-images.story-gallery > .story-photo,
  body.theme125[data-page="published"] .chapter-images.story-gallery > .story-photo:only-child {
    position: static;
    flex: none;
    width: min(100%, calc(var(--photo-ratio, 1.5) * var(--story-print-height) + 12px));
    max-width: 100%;
  }
  body.theme125[data-page="published"] .chapter-images.story-gallery .story-photo .zoom img {
    width: 100%;
    height: auto;
    aspect-ratio: auto 3 / 2;
    object-fit: contain;
  }
}

/* Use the opening's existing canvas, veil and copy. Only the photographs travel. */
.theme125 .opening125[data-opening-slides] .opening125-art {overflow:hidden}
.opening-reel177 {position:absolute;inset:0;display:flex;width:100%;height:100%}
.opening-reel177 img {display:block;flex:0 0 100%;min-width:0}
@media(min-width:801px) {
  .theme125 .opening125-art .opening-reel177 img.opening-portrait177 {object-fit:contain;object-position:right center}
}
@media(max-width:800px) {
  .theme125 .opening125[data-opening-slides] .opening125-art {aspect-ratio:var(--opening-frame-ratio,3 / 2)}
  .theme125 .opening125-art .opening-reel177 img {height:100%;object-fit:contain;object-position:center}
}
@media(max-width:800px) and (prefers-reduced-motion:no-preference) {
  .theme125 .opening125[data-opening-slides] .opening125-art {transition:aspect-ratio 680ms ease-in-out}
}
.theme125 .opening125[data-opening-monochrome] .opening125-art img {filter:grayscale(var(--opening-monochrome))}

/* The mobile opening has one photographic canvas, followed by a stationary caption.
   A phone turned sideways can be wider than the regular mobile breakpoint. */
@media (max-width:800px), (orientation:landscape) and (max-height:520px) and (max-width:1024px) {
  .theme125 .opening125 {
    --opening-max-photo-height:78svh;
    display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start;
    min-height:0; gap:24px; padding:24px 24px 40px; overflow:visible;
  }
  .theme125.has-opening125-hero .opening125 {padding-top:0}
  .theme125 .opening125 .opening125-art {
    position:relative; inset:auto; z-index:0; flex:none; align-self:stretch;
    display:grid; place-items:center; width:calc(100% + 48px); max-width:none;
    min-height:0; margin-inline:-24px;
  }
  .theme125 .opening125[data-opening-slides] .opening125-art {
    aspect-ratio:var(--opening-frame-ratio,3 / 2);
    max-height:var(--opening-max-photo-height); overflow:hidden; transition:none;
  }
  .theme125 .opening125:not([data-opening-slides]) .opening125-art img {
    display:block; width:100%; max-width:100%; height:auto; max-height:var(--opening-max-photo-height);
    object-fit:contain; object-position:center;
  }
  .theme125 .opening125 .opening125-art .opening-reel177 img {
    display:block; flex:0 0 100%; width:100%; height:100%; max-width:100%; max-height:none;
    object-fit:contain; object-position:center;
  }
  .theme125 .opening125-copy, .theme125 .opening125-copy p {width:100%; max-width:100%; margin-inline:0}
  .theme125 .opening125-copy h1 {font-size:clamp(2rem,8vw,3rem); line-height:1.12; margin-bottom:16px}
  .theme125 .opening125-link {margin-top:24px; max-width:100%}
  .theme125 .opening125.without-image {padding:24px 24px 40px}
}
@media (orientation:landscape) and (max-height:520px) and (max-width:1024px) {
  .theme125 .opening125 {--opening-max-photo-height:100svh}
}


/* Phone photographs use the available frame, independently of their downloaded pixel density. */
@media (max-width: 767px), (orientation: landscape) and (max-width: 1024px) and (max-height: 520px) {
  .theme125 .statement.has-panorama124:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'copy' 'panorama';
    width: calc(100% - 8px);
  }
  .theme125 .statement.has-panorama124 .statement-text {
    width: min(calc(100% - 24px), 48ch);
    margin-inline: auto;
    text-align: center;
  }
  .theme125 .statement.has-panorama124 .statement-text::before {
    margin-inline: auto;
  }
  .theme125 .statement.has-panorama124 .panorama124 {
    --panorama-available-height: calc(100vh - 88px);
    max-width: none;
  }
  @supports (height: 1svh) {
    .theme125 .statement.has-panorama124 .panorama124 {
      --panorama-available-height: calc(100svh - 88px);
    }
  }
  .theme125 .statement.has-panorama124 .panorama124-stage {
    width: 100%;
    margin-inline: 0;
  }
  /* The tallest actual slide reserves space for the whole sequence, including its caption. */
  .theme125 .statement.has-panorama124 .panorama124-frame,
  .theme125 .statement.has-panorama124 .panorama124-frame.is-active {
    position: relative;
    top: auto;
    align-self: center;
  }
  .theme125 .statement.has-panorama124 .panorama124-frame img {
    box-sizing: content-box;
    /* Six physical CSS pixels form the complete frame on each axis. */
    border-width: 1px !important;
    padding: 2px !important;
    width: min(calc(100% - 6px), calc((var(--panorama-available-height) - 6px) * var(--panorama-photo-ratio)));
    max-width: calc(100% - 6px);
    max-height: none;
    height: auto;
    aspect-ratio: var(--panorama-photo-ratio);
    object-fit: contain;
  }
}

/* A fixed reading surface keeps the lettering independent of the moving print. */
@media (max-width:800px), (orientation:landscape) and (max-height:520px) and (max-width:1024px) {
  .theme125 .opening125 {
    --reading-surface:#171d1b;
    background-color:var(--reading-surface);
    color:#f5f0e9;
  }
  .theme125 .opening125[data-text-color="dark"] {
    --reading-surface:#f3eee5;
    background-color:var(--reading-surface);
    color:#172522;
  }
  .theme125 .opening125 .opening125-copy {
    position:relative;
    isolation:isolate;
    background-color:var(--reading-surface);
    color:inherit;
  }
  .theme125 .opening125 .opening125-copy :is(h1,p) {
    color:inherit;
    opacity:1;
    text-shadow:none;
    overflow-wrap:anywhere;
  }
  .theme125 .opening125 .opening125-copy p { max-width:58ch; }
  .theme125 .opening125 .opening125-link {
    --reading-surface:#245b56;
    color:#fff;
    background:var(--reading-surface);
  }
  .theme125 .statement.has-panorama124 .statement-text,
  .theme125 .statement.has-panorama124 .panorama124-frame figcaption {
    --reading-surface:#201e1b;
    color:#f5f0e9;
    background:var(--reading-surface);
    text-shadow:none;
  }
  .theme125 .statement.has-panorama124 .statement-text {
    width:fit-content;
    max-width:100%;
    padding-inline:clamp(8px,2vw,18px);
    margin-inline:auto;
  }
  .theme125 .statement.has-panorama124 .panorama124-frame figcaption {
    width:fit-content;
    max-width:100%;
    margin-inline:auto;
    padding-inline:.4em;
  }
  .theme125 :is(.opening125-copy,.statement.has-panorama124) [data-reading-backing="light"] {
    background-color:#fff;
  }
  .theme125 :is(.opening125-copy,.statement.has-panorama124) [data-reading-backing="dark"] {
    background-color:#000;
  }
  .theme125 .opening125-copy :is(h1,p)[data-reading-backing],
  .theme125 .statement.has-panorama124 [data-reading-backing] {
    width:fit-content;
    padding-inline:.16em;
    border-radius:.12em;
  }
  .theme125 .opening125 .opening125-link:has([data-reading-backing="light"]) {background:#fff;color:#172522}
  .theme125 .opening125 .opening125-link:has([data-reading-backing="dark"]) {background:#000;color:#f5f0e9}
}

/* An open spread on a sideways phone: the image retains its own proportions,
   while the first lines and the contact action stay within reach. */
@media (orientation:landscape) and (min-width:700px) and (max-width:1024px) and (max-height:520px) {
  .theme125.has-opening125-hero .header {
    height:52px; min-height:52px; padding-block:3px;
  }
  .theme125.has-opening125-hero .header .brand {
    width:auto; height:46px; max-width:155px;
  }
  .theme125.has-opening125-hero .header .brand img,
  .theme125.has-opening125-hero .header .brand img.site-custom-logo {
    width:auto !important; height:100% !important; max-width:100% !important; object-fit:contain;
  }
  .theme125 .opening125:not(.without-image) {
    display:grid;
    grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);
    align-items:center;
    width:100%;
    min-height:0;
    padding:0;
    gap:0;
    --opening-max-photo-height:100svh;
  }
  .theme125 .opening125:not(.without-image) .opening125-art {
    width:100%;
    margin:0;
    align-self:center;
  }
  .theme125 .opening125:not(.without-image) .opening125-copy {
    box-sizing:border-box;
    align-self:center;
    padding:clamp(14px,2vw,20px) clamp(16px,2.6vw,30px);
  }
  .theme125.has-opening125-hero .opening125:not(.without-image) .opening125-copy {
    padding-top:64px;
  }
  .theme125 .opening125:not(.without-image) .opening125-copy h1 {
    font-size:clamp(1.6rem,3.5vw,2.15rem);
    margin-bottom:10px;
  }
  .theme125 .opening125:not(.without-image) .opening125-copy p {
    font-size:1rem; line-height:1.5;
  }
  .theme125 .opening125:not(.without-image) .opening125-link {
    margin-top:14px;
  }
}
@media (orientation:landscape) and (max-width:699px) and (max-height:520px) {
  .theme125 .opening125 {--opening-max-photo-height:68svh}
}

/* The navigation keeps its own space. A photographed edge under the logo or
   menu would still be hidden even when the underlying image uses contain. */
.theme125.has-opening125-hero .header {
  position:relative;
  inset:auto;
}

.theme125 .opening125:not(.without-image) .opening125-art {
  min-width:0;
  min-height:0;
}
.theme125 .opening125:not(.without-image) .opening125-art img {
  object-fit:contain;
  object-position:center;
  transform:none;
}
.theme125 .opening125:not([data-opening-slides]) .opening125-art img {
  display:block;
  width:100%;
  max-width:min(100%,var(--opening-source-width,100%));
  height:auto;
  margin-inline:auto;
}
.theme125 .opening125[data-opening-slides] .opening-reel177 img {
  /* Each panel still advances by one full canvas. Its content may be narrower
     when the original is small, independently of the resource chosen by srcset. */
  box-sizing:border-box;
  padding-inline:max(0px,calc((100% - var(--opening-source-width,100%)) / 2));
}

@media (min-width:801px) {
  .theme125 .opening125:not(.without-image) {
    --opening-max-photo-height:calc(100svh - var(--theme-header-height) - 64px);
    display:grid;
    grid-template-columns:minmax(0,16fr) minmax(0,9fr);
    align-items:center;
    gap:0;
    min-height:0;
    padding:32px max(0px,calc((100% - 1600px) / 2));
    overflow:visible;
  }
  .theme125 .opening125:not(.without-image) .opening125-art {
    position:relative;
    inset:auto;
    z-index:0;
    display:grid;
    place-items:center;
    align-self:start;
    width:100%;
    max-width:none;
    margin:0;
  }
  .theme125 .opening125[data-opening-slides] .opening125-art {
    aspect-ratio:var(--opening-frame-ratio,3 / 2);
    max-height:var(--opening-max-photo-height);
    overflow:hidden;
    transition:none;
  }
  .theme125 .opening125:not([data-opening-slides]) .opening125-art img {
    max-height:var(--opening-max-photo-height);
  }
  .theme125 .opening125:not(.without-image) .opening125-copy {
    --reading-surface:#171d1b;
    box-sizing:border-box;
    position:relative;
    isolation:isolate;
    align-self:center;
    width:100%;
    max-width:none;
    margin:0;
    padding:clamp(20px,4vw,64px);
    border:0;
    background:var(--reading-surface);
    color:#f5f0e9;
  }
  .theme125 .opening125:not(.without-image)[data-text-color="dark"] .opening125-copy {
    --reading-surface:#f3eee5;
    color:#172522;
  }
  .theme125 .opening125:not(.without-image) .opening125-copy h1 {
    margin:0 0 .4em;
    font-size:clamp(2rem,3.5vw,4rem);
    line-height:1.08;
  }
  .theme125 .opening125:not(.without-image) .opening125-copy p {max-width:52ch}
  .theme125 .opening125:not(.without-image) .opening125-link {
    --reading-surface:#245b56;
    margin-top:1.5rem;
    background:var(--reading-surface);
    color:#fff;
  }
  .theme125 .opening125-copy [data-reading-backing="light"] {background-color:#fff}
  .theme125 .opening125-copy [data-reading-backing="dark"] {background-color:#000}
  .theme125 .opening125-copy :is(h1,p)[data-reading-backing] {
    width:fit-content;
    padding-inline:.16em;
    border-radius:.12em;
  }
  .theme125 .opening125:not(.without-image) .opening125-link:has([data-reading-backing="light"]) {background:#fff;color:#172522}
  .theme125 .opening125:not(.without-image) .opening125-link:has([data-reading-backing="dark"]) {background:#000;color:#f5f0e9}
}
@media (orientation:landscape) and (min-width:700px) and (max-width:1024px) and (max-height:520px) {
  .theme125 .opening125:not(.without-image) {
    --opening-max-photo-height:calc(100svh - 52px);
    grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);
    padding:0;
  }
  .theme125 .opening125:not(.without-image) .opening125-art {align-self:start}
  .theme125.has-opening125-hero .opening125:not(.without-image) .opening125-copy,
  .theme125 .opening125:not(.without-image) .opening125-copy {
    padding:clamp(14px,2vw,20px) clamp(16px,2.6vw,30px);
  }
  .theme125 .opening125:not(.without-image) .opening125-copy h1 {
    font-size:clamp(1.6rem,3.5vw,2.15rem);
  }
}

/* Place the header over the first photograph only when the Opening leads the page. */
.theme125.has-opening125-hero .header {
  position:absolute;
  inset:0 0 auto;
  background:linear-gradient(to bottom,rgba(18,23,22,.62),rgba(18,23,22,.38));
}
.theme125 .opening125:not(.without-image):not([hidden]) {
  --opening-max-photo-height:86vh;
  --opening-max-photo-height:86svh;
  display:block;
  width:100%;
  max-width:none;
  min-height:0;
  padding:0;
  overflow:visible;
}
.theme125 .opening125:not(.without-image) .opening125-art {
  position:relative;
  inset:auto;
  display:grid;
  place-items:start center;
  width:100%;
  max-width:none;
  min-height:0;
  margin:0;
}
.theme125 .opening125:not(.without-image) .opening125-art img,
.theme125 .opening125[data-opening-slides] .opening-reel177 img.opening-portrait177 {
  object-fit:contain;
  object-position:center top;
}
.theme125 .opening125:not(.without-image) .opening125-art > img {
  max-height:var(--opening-max-photo-height);
}
.theme125 .opening125:not(.without-image) .opening125-copy {
  box-sizing:border-box;
  width:100%;
  margin:0;
  padding:clamp(22px,3.5vw,48px) max(clamp(22px,5vw,80px),calc((100% - 1440px) / 2));
}
@media (orientation:landscape) and (max-height:520px) {
  .theme125 .opening125:not(.without-image):not([hidden]) {
    --opening-max-photo-height:100vh;
    --opening-max-photo-height:100svh;
  }
}

@media (max-width: 767px), (orientation: landscape) and (max-width: 1024px) and (max-height: 520px) {
  .theme125 .statement.has-panorama124:not([hidden]) {
    width: 100%;
  }

  /* The playback row uses 44px, followed by its 6px gap. The photograph
     gets the remaining height, including its full frame on all four edges. */
  .theme125 .statement.has-panorama124 .panorama124 {
    --panorama-available-height: calc(100vh - 50px);
  }
  @supports (height: 1svh) {
    .theme125 .statement.has-panorama124 .panorama124 {
      --panorama-available-height: calc(100svh - 50px);
    }
  }

  /* The tallest frame reserves the sequence height. All photos start just
     below the counter, including landscapes following a tall portrait. */
  .theme125 .statement.has-panorama124 .panorama124-frame,
  .theme125 .statement.has-panorama124 .panorama124-frame.is-active {
    align-self: start;
  }
}

/* Each page occupies the same grid cell. Captions and all hidden pages still
   participate in layout, so a change of photograph cannot move the controls. */
.theme125 .statement.has-panorama124 .panorama124-page {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity .65s ease, visibility 0s linear .65s;
}
.theme125 .statement.has-panorama124 .panorama124-page.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.theme125 .statement.has-panorama124 .panorama124-page .panorama124-frame {
  position: relative;
  top: auto;
  opacity: 1;
  visibility: inherit;
  transition: none;
}
.theme125 .statement.has-panorama124 [data-panorama-paired] .panorama124-page {
  /* Two narrow, nearly square images can make a taller pair than a classic
     portrait. In that case the sum of their two aspect ratios sets the width. */
  --page-height: var(--panorama-available-height, clamp(270px,63svh,510px));
  --frame-space: 6px;
  width: min(100%, calc(var(--page-height) * 2 / 3),
    calc((var(--page-height) - var(--frame-space)) * var(--panorama-page-ratio) + 6px));
}
.theme125 .statement.has-panorama124 [data-panorama-paired] .panorama124-page.is-pair {
  --frame-space: 16px; /* 2 × 6px of print borders + 4px between prints */
}
.theme125 .statement.has-panorama124 [data-panorama-paired] .panorama124-page img {
  display: block;
  box-sizing: content-box;
  border-width: 1px !important;
  padding: 2px !important;
  width: calc(100% - 6px);
  max-width: calc(100% - 6px);
  height: auto;
  max-height: none;
  aspect-ratio: var(--panorama-photo-ratio);
  object-fit: contain;
  margin-inline: auto;
}
@media (prefers-reduced-motion: reduce) {
  .theme125 .statement.has-panorama124 .panorama124-page { transition: none; }
}
