
/* ==========================================================================
   Media: photos and screenshots in sections (v3.4 review)
   Rounded frame + a tile of brand artwork offset behind one corner + red accent.
   ========================================================================== */
.media { position: relative; margin: 0; isolation: isolate; --media-art: url("../img/art/night-waves.webp"); --media-ratio: 4 / 3; }
.media::before {
  content: ""; position: absolute; z-index: -1; width: 46%; height: 52%; right: -18px; bottom: -18px;
  border-radius: var(--radius-lg); background: var(--media-art) center / cover, var(--color-night);
}
.media--art-bl::before { right: auto; left: -18px; }
.media--art-tr::before { bottom: auto; top: -18px; }
.media--art-tl::before { right: auto; bottom: auto; left: -18px; top: -18px; }
.media--plain::before, .media--plain .media__frame::after { display: none; }
.media__frame { position: relative; aspect-ratio: var(--media-ratio); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-mist); box-shadow: var(--shadow-float); }
.media__frame::after { content: ""; position: absolute; left: 24px; top: 0; width: 56px; height: 4px; border-radius: 0 0 3px 3px; background: var(--color-brand); }
.media__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media--16x9 { --media-ratio: 16 / 9; } .media--21x9 { --media-ratio: 21 / 9; } .media--1x1 { --media-ratio: 1 / 1; } .media--4x5 { --media-ratio: 4 / 5; } .media--3x2 { --media-ratio: 3 / 2; }
.media figcaption { margin-top: var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }

/* Placeholder (review only): subject + size, so the layout doubles as a shot list */
.ph {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .5rem; padding: 1.25rem; text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(19, 34, 43, .035) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #EEF2F4 0%, #E2E8EB 100%);
  color: var(--color-muted);
}
.ph__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--color-action); box-shadow: var(--shadow-card); }
.ph__icon svg { width: 24px; height: 24px; }
.ph__subject { max-width: 30ch; color: var(--color-ink); font-weight: 600; font-size: .9375rem; line-height: 1.4; }
.ph__spec { font-size: .75rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.ph--shot .ph__icon { color: var(--color-brand-text); }
.card__media .ph { gap: .35rem; padding: .75rem; }
.card__media .ph__icon { width: 38px; height: 38px; } .card__media .ph__icon svg { width: 18px; height: 18px; }
.card__media .ph__subject { font-size: .8125rem; }
.person__photo .ph__subject { font-size: .8125rem; }

/* Section layouts with media */
.hyp-s.has-media { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 1000px) {
  .hyp-s.has-media { grid-template-columns: 1fr 1fr; }
  .hyp-s.has-media.media-left > .media { order: -1; }
}
/* Dark band with a photo */
.hyp-s--band.has-media .hyp-s__text { max-width: none; }
.hyp-s--band.has-media::before { background: linear-gradient(90deg, rgba(13, 26, 33, .94), rgba(13, 26, 33, .82)); }
.hyp-s--band.has-media > .media { position: relative; z-index: 1; }
.hyp-s--band.has-media .hyp-s__text { z-index: 1; }
.hyp-s--band.has-media .media::before { opacity: .55; }
/* Text section with a photo */
.hyp-s--text.has-media, .hyp-s--lead.has-media { max-width: none; }
.hyp-s--lead.has-media .media { max-width: 560px; justify-self: end; width: 100%; }
/* Benefits: photo under the heading in the left column */
.hyp-s__aside { display: grid; gap: var(--space-6); align-content: start; }
@media (min-width: 1000px) { .hyp-s--benefits .hyp-s__aside { position: sticky; top: calc(var(--sticky-top, var(--header-h)) + 2rem); grid-column: 1; grid-row: 1 / span 3; } }
.hyp-s--benefits .hyp-s__aside h2 { position: static; }
/* Checklist with photo */
.hyp-s--checklist.has-media { align-items: start; }
.hyp-s--checklist.has-media > h2 { grid-column: 1 / -1; }
.hyp-s--checklist.has-media ul.wp-block-list { grid-template-columns: 1fr; margin-top: 0; }
/* Homepage "Meet HYP ERP": photo under the text */
.meet__copy .media { width: 100%; margin-top: var(--space-4); }
/* Demo / contact: small photo in the left column */
.demo__copy .media { margin-top: var(--space-4); max-width: 520px; }
/* Customer story header with a photo */
.story-hero.has-media { grid-template-columns: 1fr; }
@media (min-width: 1000px) {
  .story-hero.has-media { grid-template-columns: 1.25fr 1fr; column-gap: var(--space-8); align-items: center; }
  .story-hero.has-media > :not(.media) { grid-column: 1; }
  .story-hero.has-media > .media { grid-column: 2; grid-row: 1 / span 6; }
}
.story-hero .media::before { display: none; }
/* Article: featured image + in-text image */
.article__feature { grid-column: 1 / -1; max-width: 1020px; width: 100%; justify-self: center; }
.article__body .media { margin-block: var(--space-6); }
/* Role / switching pages: photo under the section heading */
.split .section-head .media { margin-top: var(--space-6); max-width: 480px; }
/* City page: photo beside the local office details */
@media (min-width: 900px) {
  .local.has-media { grid-template-columns: .9fr 1.1fr; column-gap: var(--space-7); }
  .local.has-media > .media { grid-row: 1 / span 2; }
}
.local.has-media .media::before { display: none; }
/* Wide photo band between overview groups */
.photo-band { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.photo-band .media__frame { box-shadow: none; }
.photo-band__caption { position: absolute; left: var(--panel-pad); bottom: var(--panel-pad); z-index: 2; max-width: 32ch; padding: 1rem 1.25rem; border-radius: var(--radius-md); background: rgba(13, 26, 33, .88); color: #fff; font-size: 1.25rem; line-height: 1.35; }
@media (max-width: 999px) { .media::before { right: -10px; bottom: -10px; } .media--art-bl::before { left: -10px; } .media--art-tr::before, .media--art-tl::before { top: -10px; } }
[dir="rtl"] .media__frame::after { left: auto; right: 24px; }
.person__photo { position: relative; }

/* Photos placed in the frames (v4: from the approved designer review) */
.hero__visual--photo { position: relative; }
.hero__visual--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media__frame > img, .card__media > img, .person__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media__frame > img { z-index: 0; }
.media__frame::after { z-index: 1; }
/* Hero image slot without a photo yet */
.hero__visual--photo .ph { border-radius: inherit; }
/* Visitors never see a placeholder: an empty slot shows brand artwork instead */
.media__frame.is-art { background: var(--color-night) var(--media-art, url("../img/art/night-waves.webp")) center / cover no-repeat; }
.media__frame.is-art .ph-art { position: absolute; inset: 0; display: grid; place-items: center; }
.media__frame.is-art .ph-art img { position: static; width: 56px; height: auto; opacity: .9; }
.card__media.is-art { background: var(--color-night) var(--card-art, url("../img/art/night-waves.webp")) center / cover no-repeat; }
