/* Section copy follows the media edges; the project hero keeps its own layout. */
/* Compensate for the font's uppercase metrics inside the category pill. */
.project-case-modal .project-case-modal__eyebrow > span { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-height: 2rem; padding: calc(.5rem + 1px) .9rem calc(.5rem - 1px); line-height: 1; text-align: center; }
.project-case-content { --em-section-gap: var(--case-gap, 24px); }
.editor-styles-wrapper .is-root-container { --em-section-gap: var(--em-project-gap, 24px); }
/* The outer section escapes only the case-study gutter, never the viewport. */
.project-case-content > :is(.em-media-bleed,.case-study-row--bleed) { box-sizing: border-box; width: calc(100% + var(--case-gutter, 24px) * 2); max-width: none !important; margin-inline: calc(var(--case-gutter, 24px) * -1) !important; }
.project-case-content > :is(.em-media-bleed,.case-study-row--bleed) :is(img,video),
.project-case-content > :is(.em-media-bleed,.case-study-row--bleed) { border-radius: 0; }
.project-case-content > .em-media-bleed :is(.wp-block-image,.wp-block-video) { max-width: none; width: 100%; }
.project-case-content > :is(.em-media-bleed,.case-study-row--bleed) figcaption { padding-inline: var(--case-gutter,24px) !important; }
.editor-styles-wrapper .is-root-container > :is(.em-media-bleed,.case-study-row--bleed) { box-sizing: border-box; max-width: none !important; width: calc(100% + 48px); margin-inline: -24px !important; padding-inline: 0; border-inline: 0; border-radius: 0; }
.editor-styles-wrapper .is-root-container > :is(.em-media-bleed,.case-study-row--bleed) :is(.wp-block-image,.wp-block-video,.wp-block-group__inner-container) { max-width: none !important; width: 100%; margin-inline: 0 !important; }
.editor-styles-wrapper .is-root-container > :is(.em-media-bleed,.case-study-row--bleed) :is(img,video) { width: 100%; border-radius: 0; }
.project-case-content .case-study-row.case-study-row--text { width: 100%; max-width: none; margin: 0; padding: 0; text-align: left; }
/* Keep native gallery captions below the artwork instead of over the image. */
#project-case-modal .project-case-content .wp-block-gallery.has-nested-images figure.wp-block-image { display: block; align-self: start; }
#project-case-modal .project-case-content figure > figcaption { box-sizing: border-box; position: static; inset: auto; display: block; width: 100%; max-width: none; max-height: none; margin: 0; padding: .65rem 0 0; overflow: visible; background: none; color: var(--color-ink,#eee); opacity: .7; font: 400 .75rem/1.5 var(--font-mono,monospace); text-align: left; }
.editor-styles-wrapper .is-root-container .case-study-row.case-study-row--text { width: auto; max-width: 1100px; margin-block: 0; text-align: left; }
.project-case-content > * + .wp-block-group.case-study-row.case-study-row--text,
.project-case-content > .wp-block-group.case-study-row.case-study-row--text + *,
.editor-styles-wrapper .is-root-container > * + .wp-block-group.case-study-row.case-study-row--text,
.editor-styles-wrapper .is-root-container > .wp-block-group.case-study-row.case-study-row--text + * { margin-top: calc(var(--em-section-gap) * 2.5); }
/* Standalone copy uses the same native alignment choices as grouped text. */
:is(.project-case-content, .editor-styles-wrapper .is-root-container) :is(h1,h2,h3,h4,h5,h6,p,ul,ol).has-text-align-left { text-align: left; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) :is(h1,h2,h3,h4,h5,h6,p,ul,ol).has-text-align-center { text-align: center; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) :is(h1,h2,h3,h4,h5,h6,p,ul,ol).has-text-align-right { text-align: right; }
.project-case-content > :is(h1,h2,h3,h4,h5,h6,p,ul,ol).has-text-align-left { margin-inline: 0 !important; }
.project-case-content > :is(h1,h2,h3,h4,h5,h6,p,ul,ol).has-text-align-center { margin-inline: auto !important; }
.project-case-content > :is(h1,h2,h3,h4,h5,h6,p,ul,ol).has-text-align-right { margin-inline: auto 0 !important; }
/* Flat media rows keep the editor hierarchy at one level. */
:is(.project-case-content,.editor-styles-wrapper) .case-study-row:has(> :is(.wp-block-image,.wp-block-video)) { display:grid; gap:var(--em-section-gap,24px); align-items:start; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--two:has(> :is(.wp-block-image,.wp-block-video)) { grid-template-columns:repeat(2,minmax(0,1fr)); }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--three:has(> :is(.wp-block-image,.wp-block-video)) { grid-template-columns:repeat(3,minmax(0,1fr)); }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row > :is(.wp-block-image,.wp-block-video) { min-width:0; width:100%; margin:0 !important; }
:is(.project-case-content,.editor-styles-wrapper) :is(.case-study-row--stack-left,.case-study-row--stack-right) { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); grid-template-rows:repeat(2,minmax(0,1fr)); aspect-ratio:2/1; gap:var(--em-section-gap,12px); align-items:stretch; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--stack-right { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
:is(.project-case-content,.editor-styles-wrapper) :is(.case-study-row--stack-left,.case-study-row--stack-right) > :is(.wp-block-image,.wp-block-video) { display:flex; flex-direction:column; min-height:0; height:100%; overflow:hidden; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--stack-left > :nth-child(1 of :is(.wp-block-image,.wp-block-video)) { grid-area:1/1; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--stack-left > :nth-child(2 of :is(.wp-block-image,.wp-block-video)) { grid-area:2/1; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--stack-left > :nth-child(3 of :is(.wp-block-image,.wp-block-video)) { grid-area:1/2/3/3; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--stack-right > :nth-child(1 of :is(.wp-block-image,.wp-block-video)) { grid-area:1/2; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--stack-right > :nth-child(2 of :is(.wp-block-image,.wp-block-video)) { grid-area:2/2; }
:is(.project-case-content,.editor-styles-wrapper) .case-study-row--stack-right > :nth-child(3 of :is(.wp-block-image,.wp-block-video)) { grid-area:1/1/3/2; }
:is(.project-case-content,.editor-styles-wrapper) :is(.case-study-row--stack-left,.case-study-row--stack-right) > :is(.wp-block-image,.wp-block-video) > :is(img,video,a,.em-image-frame,.em-project-video-frame,.components-resizable-box__container) { flex:1; width:100%; min-height:0; height:0; object-fit:cover; border-radius:12px; overflow:hidden; }
:is(.project-case-content,.editor-styles-wrapper) :is(.case-study-row--stack-left,.case-study-row--stack-right) > figure > figcaption { flex-shrink:0; }
.em-image-frame { position:relative; display:block; width:100%; overflow:hidden; }
.project-case-content .em-image-frame img { position:absolute; width:var(--em-frame-width,100%) !important; height:var(--em-frame-width,100%) !important; max-width:none !important; left:var(--em-frame-left,0); top:var(--em-frame-top,0); object-fit:cover; }
/* Clip the transformed image back to its original box; captions keep their flow.
   Works with both the native direct image and the optional resize container. */
.editor-styles-wrapper [data-em-image-zoom] { overflow:hidden; }
.editor-styles-wrapper [data-em-image-zoom] img { transform:scale(var(--em-image-scale,1)); transform-origin:var(--em-image-x,50%) var(--em-image-y,50%); clip-path:inset(var(--em-clip-top,0%) var(--em-clip-right,0%) var(--em-clip-bottom,0%) var(--em-clip-left,0%) round 7px); }
/* Resized single images keep their native width and position, with the caption. */
:is(.project-case-content,.editor-styles-wrapper) .wp-block-image[data-em-image-align] { box-sizing:border-box; display:block; float:none; clear:both; width:var(--em-image-width,100%) !important; max-width:100%; }
:is(.project-case-content,.editor-styles-wrapper) .wp-block-image[data-em-image-align="left"] { margin-inline:0 auto !important; }
:is(.project-case-content,.editor-styles-wrapper) .wp-block-image[data-em-image-align="center"] { margin-inline:auto !important; }
:is(.project-case-content,.editor-styles-wrapper) .wp-block-image[data-em-image-align="right"] { margin-inline:auto 0 !important; }
.project-case-content .wp-block-image[data-em-image-align] > :is(img,a),
.project-case-content .wp-block-image[data-em-image-align] > a > img { width:100% !important; max-width:100%; }
:is(.project-case-content,.editor-styles-wrapper) .wp-block-image[data-em-image-align] > figcaption { display:block; width:100%; max-width:none; }
/* Keep the editor's resize surface at the full available width. Native inline
   sizes and drag deltas must remain free to update the image and its handles. */
.editor-styles-wrapper .wp-block-image[data-em-image-align] { width:100% !important; margin-inline:0 !important; }
.editor-styles-wrapper .wp-block-image[data-em-image-align] > figcaption { width:var(--em-image-width,100%); max-width:100%; }
.editor-styles-wrapper .wp-block-image[data-em-image-align="left"] > :is(img,a,figcaption,.components-resizable-box__container) { margin-inline:0 auto !important; }
.editor-styles-wrapper .wp-block-image[data-em-image-align="center"] > :is(img,a,figcaption,.components-resizable-box__container) { margin-inline:auto !important; }
.editor-styles-wrapper .wp-block-image[data-em-image-align="right"] > :is(img,a,figcaption,.components-resizable-box__container) { margin-inline:auto 0 !important; }
@media(max-width:700px) {
  :is(.project-case-content,.editor-styles-wrapper) .case-study-row:has(> :is(.wp-block-image,.wp-block-video)) { grid-template-columns:minmax(0,1fr); grid-template-rows:none; aspect-ratio:auto; }
  :is(.project-case-content,.editor-styles-wrapper) :is(.case-study-row--stack-left,.case-study-row--stack-right) > :is(.wp-block-image,.wp-block-video) { grid-area:auto !important; height:auto; }
  :is(.project-case-content,.editor-styles-wrapper) :is(.case-study-row--stack-left,.case-study-row--stack-right) > :is(.wp-block-image,.wp-block-video) > :is(img,video,a,.em-image-frame,.em-project-video-frame,.components-resizable-box__container) { height:auto; min-height:180px; flex:auto; }
}
div.project-case-content > :is(p,h2,h3,h4,ul,ol,blockquote) { margin-block: 0; }
.project-case-content > :is(p,h2,h3,h4,ul,ol,blockquote) + :is(.case-study-row,.wp-block-image,.wp-block-video,.wp-block-gallery,.wp-block-columns,.wp-block-embed,figure),
.project-case-content > :is(.case-study-row,.wp-block-image,.wp-block-video,.wp-block-gallery,.wp-block-columns,.wp-block-embed,figure) + :is(p,h2,h3,h4,ul,ol,blockquote),
.editor-styles-wrapper .is-root-container > :is(p,h2,h3,h4,ul,ol,blockquote) + .case-study-row,
.editor-styles-wrapper .is-root-container > .case-study-row + :is(p,h2,h3,h4,ul,ol,blockquote) { margin-top: calc(var(--em-section-gap) * 2.5); }
.project-case-content > :is(p,h2,h3,h4,ul,ol) + :is(p,h2,h3,h4,ul,ol) { margin-top: clamp(.75rem,1.2vw,1.25rem); }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text > :is(.wp-block-group__inner-container, .block-editor-inner-blocks),
.editor-styles-wrapper .case-study-row--text > .block-editor-inner-blocks > .block-editor-block-list__layout { width: 100%; max-width: none; margin-inline: 0 !important; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol) { box-sizing: border-box; width: 100%; margin-block: 0; margin-inline: 0 !important; text-align: inherit; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4) { max-width: 34ch; font: 500 clamp(1.65rem,2.7vw,3rem)/1.15 var(--font-sans,'EM Editor',sans-serif); letter-spacing: -.035em; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(p,ul,ol) { max-width: 70ch; font-size: clamp(1rem,1.35vw,1.3rem); line-height: 1.65; letter-spacing: -.015em; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol):not(:empty) ~ :is(h2,h3,h4,p,ul,ol):not(:empty) { margin-top: clamp(.75rem,1.2vw,1.25rem); }
.project-case-content .case-study-row--text :is(h2,h3,h4,p):empty { display: none; }
.project-case-modal .project-case-modal__intro { text-align:center; margin-inline:auto; max-width:58ch; }
.project-case-content > p.has-text-align-center,
.editor-styles-wrapper .is-root-container > p.has-text-align-center { max-width:62ch; margin-inline:auto !important; font-size:clamp(1rem,1.35vw,1.3rem); line-height:1.65; }
:is(.project-case-content,.editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p).has-text-align-center { margin-inline:auto !important; text-align:center; }
#project-case-modal .project-case-content figure > figcaption,
.editor-styles-wrapper .is-root-container figure > figcaption { text-align:center; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol).has-text-align-center,
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol)[style*="text-align:center"],
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol)[style*="text-align: center"] { margin-inline: auto !important; text-align: center; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol).has-text-align-right,
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol)[style*="text-align:right"],
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol)[style*="text-align: right"] { margin-inline: auto 0 !important; text-align: right; }
:is(.project-case-content, .editor-styles-wrapper .is-root-container) .case-study-row--text :is(h2,h3,h4,p,ul,ol).has-text-align-left { margin-inline: 0 !important; text-align: left; }
