/* Photography uses Featured Image, with an explicit placeholder while building. */
.mfai-photo { margin: 0; min-width: 0; }
.mfai-photo__frame { position: relative; display: block; width: 100%; min-width: 0; min-height: 0; aspect-ratio: var(--mfai-photo-ratio, 16 / 9); overflow: hidden; }
.mfai-photo__image { display: block; object-fit: cover; }
/* Only the frame sizes media; intrinsic image dimensions and placeholder text
   cannot stretch a row. The caption remains a separate figure child. */
.mfai-photo .mfai-photo__frame > .mfai-photo__image,
.mfai-photo .mfai-photo__frame > .mfai-photo-placeholder.phold {
  position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0;
  max-width: none; max-height: none; margin: 0; aspect-ratio: auto !important; object-fit: cover;
}
.mfai-photo--page { margin: 0 0 24px; }
.mfai-photo--page > .mfai-photo__frame { aspect-ratio: 8 / 3; max-height: 420px; }
.mfai-photo > .mfai-photo__caption { margin: 0; padding: 8px 0 0; font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted); }
/* The homepage banner spans the page; only its optional caption uses the text grid. */
.mfai-photo--home { width: 100%; }
.mfai-photo--home > .mfai-photo__frame { height: clamp(260px, 26vw, 440px); aspect-ratio: auto; }
.mfai-photo--home > .mfai-photo__caption { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
/* A selected homepage photograph keeps its full composition, including group portraits. */
.mfai-photo--home > .mfai-photo__frame:has(> .mfai-photo__image) { height: auto; aspect-ratio: auto; }
.mfai-photo--home .mfai-photo__frame > .mfai-photo__image { position: static; height: auto; object-fit: contain; }
.mfai-photo-placeholder.phold {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  width: 100%; min-width: 0; gap: 12px; padding: 18px; box-sizing: border-box;
  background: var(--sand, #f3efe7); border: 1px solid var(--border, #c6bdaf);
  color: var(--tapa, #715138); overflow: hidden;
}
.mfai-photo-placeholder .phold__text { gap: 5px; max-width: 100%; }
.mfai-photo-placeholder .phold__kicker { font: 400 12px/1.4 var(--sans); letter-spacing: normal; text-transform: none; }
.mfai-photo-placeholder .phold__label { font: 600 14px/1.4 var(--sans); color: var(--ink); padding: 0; overflow-wrap: anywhere; }
.mfai-photo-placeholder .phold__size { display: none; }
.person__portrait .mfai-photo,
.person__portrait .mfai-photo__frame { width: 100%; height: 100%; }
.person__portrait .mfai-photo-placeholder { padding: 10px; gap: 8px; }
.person__portrait .phold__label { font-size: 11px; }
.person__portrait .phold__size { display: none; }
.person__portrait .phold__kicker { font-size: 9px; }
.fanews-thumb__image .mfai-photo-placeholder { gap: 5px; padding: 10px; }
.fanews-thumb__image .phold__label { font-size: 11px; }
.fanews-thumb__image .phold__size { display: none; }
.media-lead__image .mfai-photo,
.media-row__thumb .mfai-photo,
.mission__image .mfai-photo { width: 100%; margin: 0; }
.media-row__thumb .mfai-photo-placeholder { gap: 6px; padding: 10px; }
.media-row__thumb .phold__label { font-size: 11px; }
.media-row__thumb .phold__size { display: none; }

/* Core block CSS is disabled: keep editor-added Image and Gallery blocks usable. */
.wp-block-image img,
.wp-block-gallery img { max-width: 100%; height: auto; vertical-align: middle; }
.wp-block-image figcaption,
.wp-block-gallery > figcaption,
.blocks-gallery-caption { margin-top: 8px; font: 400 14px/1.5 var(--sans); color: var(--muted); }
.wp-block-image.aligncenter { text-align: center; margin-left: auto; margin-right: auto; }
.wp-block-image.alignleft { float: left; margin-right: 24px; margin-bottom: 16px; }
.wp-block-image.alignright { float: right; margin-left: 24px; margin-bottom: 16px; }
.wp-block-gallery.has-nested-images {
  --mfai-gallery-columns: 3;
  display: grid; grid-template-columns: repeat(var(--mfai-gallery-columns), minmax(0, 1fr));
  gap: var(--wp--style--unstable-gallery-gap, 16px); margin-top: 24px; margin-bottom: 24px;
}
.wp-block-gallery.has-nested-images.columns-1 { --mfai-gallery-columns: 1; }
.wp-block-gallery.has-nested-images.columns-2 { --mfai-gallery-columns: 2; }
.wp-block-gallery.has-nested-images.columns-4 { --mfai-gallery-columns: 4; }
.wp-block-gallery.has-nested-images.columns-5 { --mfai-gallery-columns: 5; }
.wp-block-gallery.has-nested-images.columns-6 { --mfai-gallery-columns: 6; }
.wp-block-gallery.has-nested-images > .wp-block-image { min-width: 0; margin: 0; }
.wp-block-gallery.has-nested-images.is-cropped > .wp-block-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.wp-block-gallery.has-nested-images > figcaption { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .wp-block-gallery.has-nested-images:not(.columns-1) { --mfai-gallery-columns: 2; }
}
@media (max-width: 600px) {
  .mfai-photo--home > .mfai-photo__frame { height: auto; aspect-ratio: 16 / 9; }
  .mfai-photo--page { margin-bottom: 24px; }
  .mfai-photo-placeholder.phold { gap: 8px; padding: 14px; }
  .mfai-photo-placeholder .phold__label { font-size: 12px; }
}
@media (max-width: 440px) {
  .wp-block-gallery.has-nested-images:not(.columns-1) { --mfai-gallery-columns: 1; }
  .wp-block-image.alignleft,
  .wp-block-image.alignright { float: none; margin-left: 0; margin-right: 0; }
}
@media print {
  .mfai-photo-placeholder { display: none !important; }
  .mfai-photo:has(> .mfai-photo__frame > .mfai-photo-placeholder) { display: none !important; }
  .mfai-photo__caption { color: #333; }
}
