/* Ahern Property Management case study (staging page 1877): page-level rules only, from the approved page design
   "Ahern Property Management — Case Study" 1794436391-6599 (its ap.css) and the media manifest. Everything else is the
   design system (system.css, 1794426544-5fad) and the theme's WordPress glue (site.css, inc/case-study.php,
   inc/ahern.php). Nothing here restyles a shared component. Rules are the design's, with selectors mapped onto the
   published markup; the design's inline span and ratio properties are set here by class:
   ap-orig (original page, fill frame), ap-new (redesigned page or wireframe, reference frame), ap-sitemap. */

/* 1 · Spans of the 5 + 7 rows (the design's inline --pf-s8 / --pf-s12). On 4 columns every item is full width, original
   first. Fill frames on 4 columns take their own ratio (the attachment's, written as --pf-ratio by the theme); the
   sitemap a square. */
.ap-orig, .ap-sitemap { --pf-s8: span 3; --pf-s12: span 5; }
.ap-new { --pf-s8: span 5; --pf-s12: span 7; }
.ap-orig > .pf-frame { --pf-ratio-4: var(--pf-ratio); }
.ap-sitemap > .pf-frame { --pf-ratio-4: 1 / 1; }

/* 2 · Label + text captions (the design's .ap-meta): label and caption text share one line where they fit and wrap
   together where they don't; the space between them is in the markup for assistive technology. Approved page-specific
   treatment (11 Nov 2026), not a shared Label rule: a label may wrap inside its pill, only when it cannot fit its
   column (200% text below about 360px). */
.ap-match .pf-caption { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pf-space-2xs); }
.ap-match .pf-caption .pf-label { max-width: 100%; white-space: normal; }

/* 3 · Equal-height 5 + 7 rows (Gallery match preset) with a caption under each frame: frames share one height, set
   by the right-hand frame's declared ratio; captions sit in their own row beneath, so frame bottoms align (the
   technique of the approved 30 Story Coffee digital row). */
@container pf-section (min-width: 600px) {
  .ap-match .pf-gallery-grid { grid-template-rows: auto auto; row-gap: var(--pf-space-2xs); }
  .ap-match .pf-gallery-item { grid-row: span 2; display: grid; grid-template-rows: subgrid; }
  .ap-match .pf-gallery-grid--match > .pf-fill { contain: none; }
  .ap-match .pf-gallery-grid--match > .pf-fill > .pf-frame { contain: size; height: 100%; aspect-ratio: auto; }
}
/* The system's 4-column fill rule is a (max-width: 599px) query and its 8-column grid starts at (min-width: 600px), so
   a section frame between 599 and 600px wide (a 651px viewport) gets neither and the fill frames collapse to zero
   height. The system's own 4-column rule, repeated for that gap only (an observation in tools/ds-register.md). */
@container pf-section (599px < width < 600px) {
  .ap-match .pf-gallery-grid--match > .pf-fill { contain: none; }
  .ap-match .pf-gallery-grid--match > .pf-fill > .pf-frame { aspect-ratio: var(--pf-ratio-4, 3 / 2); height: auto; }
}
/* Consecutive pairs in one section are a group apart. */
.pf-sub.ap-pairs { row-gap: var(--pf-space-group); }

/* 4 · Sitemap: Rachelle's privacy-safe export, covering its frame, anchored near the top so the Services and Properties
   headers stay in view at every width. No zoom. */
.ap-sitemap img { object-position: 50% 12%; }
