/* Portrait commission pages, "gallery" treatment: a framed portrait with a wall
   label, a large statement, a hung wall of works, a vertical line of steps and
   a dark terms band. Loaded before brand.css; scoped to body.cm-gallery. */
body.cm-gallery { --cg-night: #560A36; --cg-gold: #DCB870; --cg-rule: rgba(38, 23, 31, .14); }

/* ---------- Opening: a light stage. The portrait sits in an arched window with
   a very large headline across its lower part, ink outside the window and
   ivory inside it. commission-motion.js opens with the portrait filling the
   screen and draws it back into this window. ---------- */
/* The older opacity-only entrance is replaced by the sequence in commission-motion.js. */
body.cm-gallery [data-portrait-entrance] [data-portrait-reveal].is-portrait-entering { animation: none !important; opacity: 1 !important; }
body.commission-editorial.cm-gallery .cm-hero {
  --cg-head: 166px; --cg-gutter: clamp(1.5rem, 5.5vw, 4.5rem);
  --aw: min(30vw, 46vh); --ah: calc(var(--aw) * 1.32); --at: clamp(20px, 3.5vh, 40px);
  /* The headline starts below both faces of Bound by Grace and still ends inside the arch. */
  --cg-fs: clamp(44px, min(7.8vw, calc(var(--aw) * .25)), 128px); --cg-title-at: .61;
  position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; gap: 0;
  box-sizing: border-box; max-width: none; width: auto; margin: 0; padding: 0 var(--cg-gutter) clamp(1.5rem, 3.5vh, 2.5rem);
  min-height: calc(100vh - var(--cg-head)); min-height: max(600px, calc(100svh - var(--cg-head)));
  overflow: hidden; background: var(--hui-ivory, #FBF9F4);
}
body.commission-editorial.cm-gallery .cm-hero-art { position: static; width: auto; max-width: none; margin: 0; }
.cg-window { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  clip-path: inset(var(--ct, var(--at)) var(--cx, calc((100% - var(--aw)) / 2)) var(--cb, calc(100% - var(--at) - var(--ah))) var(--cx, calc((100% - var(--aw)) / 2)) round var(--cr, calc(var(--aw) / 2)) var(--cr, calc(var(--aw) / 2)) 0 0); }
body.commission-editorial.cm-gallery .cm-hero-picture { position: absolute; top: var(--at); left: calc((100% - var(--aw)) / 2); width: var(--aw); height: var(--ah); display: block; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
body.commission-editorial.cm-gallery .cm-hero-picture img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 80%; } /* Bound by Grace: both faces sit above the headline. */
/* The headline exists twice at exactly the same place: ink on the page, ivory inside the window. */
.cg-title { position: absolute; z-index: 1; left: var(--cg-gutter); right: var(--cg-gutter); top: calc(var(--at) + var(--ah) * var(--cg-title-at)); margin: 0; text-align: center; font: 400 var(--cg-fs)/1 var(--hui-font-heading, "Playfair Display", Georgia, serif); letter-spacing: -.03em; text-wrap: balance; }
.cg-title em { display: block; font-style: italic; }
body.commission-editorial.cm-gallery .cg-title--light { color: #FBF9F4; text-shadow: 0 2px 30px rgba(20, 17, 14, .45); }
body.commission-editorial.cm-gallery .cg-title--light em { color: #F1DDB5; }
body.commission-editorial.cm-gallery .cm-hero h1 { position: static; margin: 0; max-width: none; font-size: var(--cg-fs); line-height: 1; }
body.commission-editorial.cm-gallery .cm-hero h1 .cg-title--ink em { display: block; }
body.commission-editorial.cm-gallery .cm-hero h1 .cm-h1-kicker { position: absolute; z-index: 3; top: var(--at); left: var(--cg-gutter); max-width: calc(50% - var(--aw) / 2 - var(--cg-gutter) - 1.5rem); margin: 0; }
body.commission-editorial.cm-gallery .cm-hero-art figcaption { position: absolute; z-index: 3; left: calc(50% + var(--aw) / 2 + 1.5rem); top: calc(var(--at) + .25rem); margin: 0; font-size: .6875rem; line-height: 1.6; letter-spacing: .12em; text-transform: uppercase; color: var(--hui-stone, #67565E); }
body.commission-editorial.cm-gallery .cm-hero-copy { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "intro actions" "intro note"; column-gap: 2rem; align-items: end; box-sizing: border-box; width: 100%; max-width: none; margin: 0; padding: calc(var(--at) + var(--ah) + 1.25rem) 0 0; }
body.commission-editorial.cm-gallery .portrait-intro-copy { position: static; display: block; grid-area: intro; }
body.commission-editorial.cm-gallery .cm-hero-copy > *, body.commission-editorial.cm-gallery .portrait-intro-copy > * { width: auto; max-width: none; margin-inline: 0; }
body.commission-editorial.cm-gallery .cm-hero-lede { position: relative; z-index: 3; max-width: 27rem; margin: 0; font-size: clamp(14px, 1.1vw, 16px); line-height: 1.7; }
body.commission-editorial.cm-gallery .cm-hero-actions { position: relative; z-index: 3; grid-area: actions; display: flex; flex-flow: row wrap; align-items: center; justify-content: flex-end; gap: .75rem 1.5rem; }
body.commission-editorial.cm-gallery .cm-hero-note { position: relative; z-index: 3; grid-area: note; margin: .6rem 0 0; text-align: right; }
@media (max-width: 899px) {
  body.commission-editorial.cm-gallery .cm-hero { --cg-head: 118px; --aw: min(76vw, 40vh); --at: 3.75rem; --cg-fs: clamp(38px, 11.6vw, 58px); --cg-title-at: .6; }
  body.commission-editorial.cm-gallery .cm-hero h1 .cm-h1-kicker { top: 1rem; left: var(--cg-gutter); right: var(--cg-gutter); max-width: none; justify-content: center; text-align: center; }
  body.commission-editorial.cm-gallery .cm-hero h1 .cm-h1-kicker::before { display: none; }
  body.commission-editorial.cm-gallery .cm-hero-art figcaption { display: none; }
  body.commission-editorial.cm-gallery .cm-hero-copy { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "actions" "note"; row-gap: 1rem; text-align: center; padding-top: calc(var(--at) + var(--ah) + 1.1rem); }
  body.commission-editorial.cm-gallery .cm-hero-lede { margin-inline: auto; }
  body.commission-editorial.cm-gallery .cm-hero-actions { justify-content: center; }
  body.commission-editorial.cm-gallery .cm-hero-note { margin: 0; text-align: center; }
}

/* ---------- Kind words, directly under the opening ---------- */
/* Kind words now sit between how it works and the price, so they keep space above and below. */
.cg-kind { padding-block: clamp(3rem, 7vw, 5.5rem); }
body.commission-editorial.cm-gallery .cg-kind .cm-kind-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem clamp(2rem, 6vw, 6rem); margin: 0; padding: 0; border: 0; max-width: none; }
body.commission-editorial.cm-gallery .cg-kind .cm-kind-words > :first-child { grid-column: 1 / -1; margin: 0; }
body.commission-editorial.cm-gallery .cg-kind blockquote { margin: 0; }
body.commission-editorial.cm-gallery .cg-kind blockquote p { margin: 0 0 .9rem; font: italic 400 clamp(22px, 2.6vw, 36px)/1.3 var(--hui-font-heading, "Playfair Display", Georgia, serif); color: var(--hui-ink, #26171F); }
@media (max-width: 699px) { body.commission-editorial.cm-gallery .cg-kind .cm-kind-words { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Four promises as a ruled ledger, not a box ---------- */
body.cm-gallery .cm-assure ul { background: transparent; padding: clamp(1.5rem, 3vw, 2.5rem) 0; border-block: 1px solid var(--cg-rule); counter-reset: promise; }
body.cm-gallery .cm-assure li { counter-increment: promise; padding-inline: clamp(1rem, 2.4vw, 2.25rem); }
body.cm-gallery .cm-assure li:first-child { padding-left: 0; }
body.cm-gallery .cm-assure li::before { content: counter(promise, lower-roman) "."; display: block; margin-bottom: .6rem; font: italic 400 1.0625rem/1 var(--hui-font-heading, "Playfair Display", Georgia, serif); color: var(--hui-brass, #A6989F); }
body.cm-gallery .cm-assure strong { font-size: clamp(1.25rem, 1.7vw, 1.625rem); }

/* ---------- The statement ---------- */
body.commission-editorial.cm-gallery #photograph-start { padding-block: clamp(4.5rem, 11vw, 9rem); }
body.cm-gallery #photograph-start .cm-scope { max-width: 62rem; margin-inline: auto; text-align: center; }
body.cm-gallery #photograph-start h2 { margin: 0 0 1.75rem; font: 600 .75rem/1.4 var(--hui-font-body, "Jost", Arial, sans-serif); letter-spacing: .16em; text-transform: uppercase; }
body.cm-gallery #photograph-start h2 > span { color: var(--hui-burgundy, #66023C); }
body.cm-gallery #photograph-start p { margin: 0; font: 400 clamp(24px, 3.3vw, 46px)/1.3 var(--hui-font-heading, "Playfair Display", Georgia, serif); letter-spacing: -.012em; color: var(--hui-ink, #26171F); }

/* ---------- A hung wall of works ---------- */
body.commission-editorial.cm-gallery .cm-portfolio { padding-block: clamp(3rem, 7vw, 6rem); border-top: 1px solid var(--cg-rule); }
body.commission-editorial.cm-gallery .cm-portfolio h2, body.commission-editorial.cm-gallery .cm-process h2, body.commission-editorial.cm-gallery .cm-pricing h2, body.commission-editorial.cm-gallery .cm-inquiry h2 { font-size: clamp(34px, 4.4vw, 62px); line-height: 1.06; letter-spacing: -.02em; }
@media (min-width: 900px) {
  body.commission-editorial.cm-gallery .commission-grid { gap: clamp(3.5rem, 6vw, 6rem) clamp(2rem, 4.5vw, 4.5rem); margin-top: clamp(2.5rem, 5vw, 4.5rem); }
  body.commission-editorial.cm-gallery .commission-grid > figure:nth-child(3n+2) { margin-top: clamp(3rem, 7vw, 6.5rem); }
  body.commission-editorial.cm-gallery .commission-grid > figure:nth-child(3n) { margin-top: clamp(1rem, 2.5vw, 2.25rem); }
}
body.commission-editorial.cm-gallery .commission-work-image-stage { box-shadow: none; }  /* paintings without a shadow */
body.commission-editorial.cm-gallery .commission-work-card h3 { margin-top: 1.25rem; font-size: clamp(22px, 2vw, 28px); }
body.commission-editorial.cm-gallery .commission-work-card figcaption { padding-left: .9rem; border-left: 1px solid var(--hui-brass, #A6989F); margin-top: 1.1rem; }
body.commission-editorial.cm-gallery .commission-work-card figcaption h3 { margin-top: 0; }

/* ---------- The process: a heading that stays while the steps pass ---------- */
body.commission-editorial.cm-gallery .cm-process { background: transparent; border-top: 1px solid var(--cg-rule); padding-block: clamp(4rem, 9vw, 7.5rem); }
@media (min-width: 900px) {
  body.commission-editorial.cm-gallery .cm-process > .shell { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(3rem, 8vw, 8rem); align-items: start; }
  body.commission-editorial.cm-gallery .cm-process .cm-section-head { position: sticky; top: 7rem; display: block; margin: 0; }
  body.commission-editorial.cm-gallery .cm-process .cm-section-head .cm-section-note { margin-top: 1.5rem; max-width: 22rem; text-align: left; }
}
body.commission-editorial.cm-gallery .cm-steps { position: relative; display: block; margin: 0; padding: 0 0 0 clamp(2.25rem, 4vw, 3.5rem); list-style: none; }
body.commission-editorial.cm-gallery .cm-steps::before { content: ""; position: absolute; left: 5px; top: .5rem; bottom: .5rem; width: 1px; background: var(--hui-ink, #26171F); opacity: .35; transform-origin: center top; transform: scaleY(var(--cg-progress, 1)); }
body.commission-editorial.cm-gallery .cm-steps > li { position: relative; display: block; padding: 0 0 clamp(2.5rem, 5vw, 4.5rem); border: 0; }
body.commission-editorial.cm-gallery .cm-steps > li:last-child { padding-bottom: 0; }
body.commission-editorial.cm-gallery .cm-steps > li::before { content: ""; position: absolute; left: calc(-1 * clamp(2.25rem, 4vw, 3.5rem)); top: .9rem; width: 11px; height: 11px; border-radius: 50%; background: var(--hui-ivory, #FBF9F4); border: 1px solid var(--hui-ink, #26171F); }
body.commission-editorial.cm-gallery .cm-steps .cm-step-number { display: block; margin: 0 0 .5rem; font: italic 400 clamp(56px, 7vw, 104px)/1 var(--hui-font-heading, "Playfair Display", Georgia, serif); color: var(--hui-brass, #A6989F); opacity: .5; }
body.commission-editorial.cm-gallery .cm-steps h3 { margin: 0 0 .9rem; font-size: clamp(24px, 2.4vw, 34px); }
body.commission-editorial.cm-gallery .cm-steps p { max-width: 32rem; font-size: 15px; line-height: 1.85; }

/* ---------- Terms on a dark ground ---------- */
body.commission-editorial.cm-gallery .cm-pricing {
  --hui-ink: #FBF9F4; --hui-text: #FBF9F4; --hui-brass-text: #DCB870; --hui-stone: #D5CCBE; --hui-text-secondary: #D5CCBE; --ink: #FBF9F4; --text: #FBF9F4; --cm-gold: #DCB870; --cm-muted: #D5CCBE; --cm-line: rgba(251, 249, 244, .22);
  color: #FBF9F4; background: var(--cg-night); box-shadow: 0 0 0 100vmax var(--cg-night); clip-path: inset(0 -100vmax); padding-block: clamp(4rem, 9vw, 7.5rem); border: 0;
}
body.commission-editorial.cm-gallery .cm-pricing :is(p, dd, dt) { color: #D5CCBE; }
body.commission-editorial.cm-gallery .cm-pricing dt { color: var(--cg-gold); font: 600 .75rem/1.6 var(--hui-font-body, "Jost", Arial, sans-serif); letter-spacing: .14em; text-transform: uppercase; }
body.commission-editorial.cm-gallery .cm-pricing dd { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.6; color: #FBF9F4; }
body.commission-editorial.cm-gallery .cm-pricing .cm-pricing-details > p { font: 400 clamp(20px, 2.1vw, 28px)/1.4 var(--hui-font-heading, "Playfair Display", Georgia, serif); color: #FBF9F4; }
body.commission-editorial.cm-gallery .cm-terms > div { grid-template-columns: 10rem minmax(0, 1fr); padding-block: clamp(1.5rem, 2.6vw, 2.25rem); }
/* brand.css paints buttons from --hui-ink and --hui-ivory; swap the pair on the button itself. */
body.cm-gallery .cm-pricing .cm-button--primary { --hui-ink: #FBF9F4; --hui-ivory: #26171F; }
body.cm-gallery .cm-pricing .cm-text-link > * { color: #FBF9F4; }

/* ---------- Closing inquiry ---------- */
body.commission-editorial.cm-gallery .cm-inquiry { padding-block: clamp(4rem, 9vw, 7.5rem); }
body.commission-editorial.cm-gallery .cm-inquiry .commission-form-panel { box-shadow: 0 40px 80px -48px rgba(38, 23, 31, .5); }

/* ---------- Phones ---------- */
@media (max-width: 899px) {
  body.cm-gallery .cm-assure li, body.cm-gallery .cm-assure li:first-child { padding-inline: .25rem 1rem; }
  body.commission-editorial.cm-gallery .cm-terms > div { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  body.commission-editorial.cm-gallery .commission-grid > figure:nth-child(even) { margin-top: 2rem; }
}
@media (max-width: 479px) { body.cm-gallery .cm-assure ul { padding-block: .5rem; } }

/* ---------- One painting shown edge to edge ---------- */
.cg-fullbleed { position: relative; margin: 0; background: var(--cg-night, #560A36); }
.cg-fullbleed-stage { overflow: hidden; }
.cg-fullbleed img { display: block; width: 100%; height: min(84vh, 860px); object-fit: cover; object-position: 50% 31%; }
.cg-fullbleed figcaption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 5rem clamp(1.5rem, 5.5vw, 4.5rem) 1.5rem; color: #FBF9F4; background: linear-gradient(to top, rgba(38, 23, 31, .78), rgba(38, 23, 31, 0)); }
.cg-fullbleed figcaption span:first-child { font: italic 400 clamp(22px, 2.6vw, 36px)/1.1 var(--hui-font-heading, "Playfair Display", Georgia, serif); }
.cg-fullbleed figcaption span:last-child { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; text-align: right; }
body.commission-editorial.cm-gallery .cg-fullbleed + .cm-portfolio { border-top: 0; }
@media (max-width: 699px) { .cg-fullbleed img { height: 68vh; object-position: 46% 42%; } }

/* Even line endings: no single word left alone on a paragraph's last line. */
body.cm-gallery main :is(p, li, dd, figcaption) { text-wrap: pretty; }
body.cm-gallery main :is(h2, h3) { text-wrap: balance; }
/* Section headings stand without a label above them. */
body.cm-gallery main section > div > h2:first-child, body.cm-gallery main section h2:first-child { margin-top: 0; }
/* The process steps slide in from the right; keep that from widening the page. */
body.cm-gallery .cm-process { overflow-x: clip; }

/* Commission process: the two ways to begin sit as short labelled paragraphs, and what every
   portrait includes closes the timeline on a quiet rule. */
body.commission-editorial.cm-gallery .cm-steps p + p { margin-top: .9rem; }
body.commission-editorial.cm-gallery .cm-steps p strong { font-weight: 600; color: var(--hui-ink, #26171F); }
body.commission-editorial.cm-gallery .cm-included { max-width: 40rem; margin: clamp(2.75rem, 5vw, 4.25rem) 0 0 clamp(2.25rem, 4vw, 3.5rem); padding-top: 1.4rem; border-top: 1px solid rgba(38, 23, 31, .22); }
body.commission-editorial.cm-gallery .cm-included h3 { margin: 0 0 .7rem; font-size: clamp(20px, 1.9vw, 26px); }
body.commission-editorial.cm-gallery .cm-included p { margin: 0; font-size: var(--hui-body-size, 17px); line-height: 1.7; }
@media (min-width: 900px) {
  body.commission-editorial.cm-gallery .cm-process .cm-included { grid-column: 2; margin-top: 0; }
}
