/* ExpatEd Smart PDF: flex photos (live page and print). The editor has its own copy in smart-pdf-editor-flex.css.
   Screen (desktop width) and print only. Phones keep the stacked layout. */
@media screen and (min-width:861px), print {

  /* Top bands: fill spare page height between a floor and a ceiling.
     Cover, tall, hero, half and mid bands keep their fixed sizes. Opt out of flex with xp-band--fixed. */
  .xp-doc .xp-sheet:not(.xp-sheet--cover):not(.xp-sheet--bleed) .xp-band:not(.xp-band--tall):not(.xp-band--hero):not(.xp-band--half):not(.xp-band--mid):not(.xp-band--fixed) {
    height: auto !important;
    min-height: 140px !important;
    max-height: 320px !important;
    flex: 1 1 210px !important;
  }

  /* Opt in to a bigger ceiling: add xp-band--grow to a top photo and it can take up to 480px of spare page height. */
  .xp-doc .xp-sheet:not(.xp-sheet--cover):not(.xp-sheet--bleed) .xp-band.xp-band--grow:not(.xp-band--tall):not(.xp-band--hero):not(.xp-band--half):not(.xp-band--mid):not(.xp-band--fixed) {
    max-height: 480px !important;
  }

  /* Wide strips (full width, short): same idea, smaller range. Opt out with xp-strip--fixed. */
  .xp-doc .xp-sheet:not(.xp-sheet--cover):not(.xp-sheet--bleed) .xp-strip--wide:not(.xp-strip--fixed) {
    height: auto !important;
    min-height: 120px !important;
    max-height: 260px !important;
    flex: 1 1 170px !important;
  }

  /* Side photo width presets. Add xp-side--narrow (200px) or xp-side--wide (300px) to the Columns block. */
  .xp-doc .xp-cols { --xp-side: 250px; }
  .xp-doc .xp-cols--strip { --xp-side: 210px; }
  .xp-doc .xp-cols--wide { --xp-side: 300px; }
  .xp-doc .xp-cols.xp-side--narrow { --xp-side: 200px; }
  .xp-doc .xp-cols.xp-side--wide { --xp-side: 300px; }
  .xp-doc .wp-block-columns.xp-cols:not(.xp-cols--even):not(.xp-cols--three):not(.xp-cols--photos) {
    grid-template-columns: minmax(0, 1fr) var(--xp-side) !important;
  }

  /* Side photos: the Columns row soaks up spare page height, and the photo stretches to match. */
  .xp-doc .xp-cols:has(> .wp-block-column > :is(.xp-photo, .xp-ph)) {
    flex: 1 1 auto !important;
    align-items: stretch !important;
  }
  .xp-doc .xp-cols > .wp-block-column:has(> :is(.xp-photo, .xp-ph)) {
    display: flex !important;
    flex-direction: column !important;
  }
  .xp-doc .xp-cols > .wp-block-column > :is(.xp-photo, .xp-ph) {
    flex: 1 1 330px !important;
    height: auto !important;
    min-height: 240px !important;
    max-height: 480px !important;
  }
}
