/* A work item (/work/{slug}/): the intro with its facts, the before and after, the devices picture and "Other projects". Ported from
   docs/mockups/case.html. Bands carry `case-sec`, which loads this file (Xcelsior_Page_Assets). */
.case-intro { padding-bottom: 3rem; }
.case-h1 { margin: 0 0 1.5rem; max-width: 52rem; font-size: 4.5rem; }
@media (max-width: 48rem) { .case-h1 { font-size: 3.25rem; } }
@media (max-width: 22.5rem) { .case-h1 { font-size: 2.75rem; } } /* a long single word ("manufacturer") must fit a 320px screen */
.case-lede { max-width: 40rem; margin: 0; }
.case-lede p { margin: 0; }
.case-block { padding-block: 4rem; }
.heading-case { margin: 1rem 0 2.5rem; }
.heading-devices { margin: 1rem 0 1.5rem; }

/* Facts: a label above each value, an even grid with a rule above. */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.5rem 2rem; margin: 3rem 0 0; padding-top: 2rem; border-top: 1px solid var(--hairline); }
.fact .fact-label { margin: 0 0 0.375rem; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.fact .fact-value { margin: 0; }

/* A framed screenshot: the browser bar and its three dots, as on the cards. */
.compare-frame, .case-shot { position: relative; border: 1px solid var(--control-border); background: var(--wf-page); overflow: hidden; border-radius: var(--radius-xs); margin: 0; }
.compare-frame::before, .case-shot::before { content: ""; display: block; height: 1.75rem; border-bottom: 1px solid var(--hairline); background: var(--wf-block); box-sizing: border-box; }
.compare-frame::after, .case-shot::after { content: ""; position: absolute; top: 0; left: 0; width: 3.5rem; height: 1.75rem; background: radial-gradient(circle at 1rem 50%, transparent 0.1875rem, var(--wf-stroke) 0.1875rem, var(--wf-stroke) 0.25rem, transparent 0.25rem), radial-gradient(circle at 1.875rem 50%, transparent 0.1875rem, var(--wf-stroke) 0.1875rem, var(--wf-stroke) 0.25rem, transparent 0.25rem), radial-gradient(circle at 2.75rem 50%, transparent 0.1875rem, var(--wf-stroke) 0.1875rem, var(--wf-stroke) 0.25rem, transparent 0.25rem); }
.case-shot img { display: block; width: 100%; height: auto; }
/* The first picture of a portfolio item: its own device frames, no browser window, on white. */
.case-shot.shot-composite { background: #fff; }
.case-shot.shot-composite::before, .case-shot.shot-composite::after { content: none; display: none; }

/* Before and after: both pictures sit in the same grid cell under the bar, the "before" clipped to the left of the divider. The theme script
   (assets/js/case-compare.js) adds the divider and the range input; without it the two halves are static, half and half. */
.compare { user-select: none; }
.compare-frame { display: grid; }
.compare-frame::before { grid-area: 1 / 1; }
.compare-frame > figure { grid-area: 2 / 1; margin: 0; }
.compare-frame img { display: block; width: 100%; height: auto; }
.compare-frame > .top { clip-path: inset(0 var(--cmp-clip, 50%) 0 0); }
.compare-divider { position: absolute; top: 1.75rem; bottom: 0; left: var(--cmp-pos, 50%); width: 2px; background: var(--gold); pointer-events: none; }
.compare-divider::after { content: "\2194"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 2.5rem; height: 2.5rem; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); border-radius: 50%; font-size: 1.25rem; }
.compare-range { position: absolute; top: 1.75rem; right: 0; bottom: 0; left: 0; width: 100%; height: calc(100% - 1.75rem); margin: 0; opacity: 0; cursor: ew-resize; }
.compare:focus-within .compare-frame { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.compare-labels { display: flex; justify-content: space-between; margin: 0.75rem 0 0; font-family: var(--font-display); font-size: 1rem; line-height: 1.6; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }

/* Across devices. */
.case-cols { display: flex; flex-wrap: wrap; gap: 3rem; align-items: flex-start; }
.case-copy { flex: 1 1 20rem; min-width: 0; }
/* The mockup puts the padding and border on the flex item itself (28rem plus 34px), which is what gives the copy its share: the same here. */
.case-matte { flex: 1 1 calc(28rem + 34px); min-width: 0; }
.case-prose { max-width: 42rem; margin: 0 0 1.25rem; color: var(--ink-muted); text-wrap: pretty; }
.matte { margin: 0; background: #ffffff; border: 1px solid var(--control-border); border-radius: var(--radius-xs); padding: 1rem; }
.matte img { display: block; width: 100%; height: auto; }

/* Block editor canvas only: the editor centres a block that has a max-width. */
.case-sec .wp-block { margin-left: 0; margin-right: 0; }
.case-lede.wp-block, .case-prose.wp-block { max-width: 40rem; }

/* Further screenshots: a desktop inner page beside a phone view (the phone is about as tall as the desktop shot), stacked on small screens. */
.case-shots { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 48rem) { .case-shots.has-phone { grid-template-columns: minmax(0, 3.2fr) minmax(0, 1fr); } }
/* The phone view is drawn as an iPhone showing a browser: a brushed-metal rim with a specular highlight, a black glass bezel, a gold status
   bar with the dynamic island, the page, then a browser address bar and the home indicator. The address comes from --phone-url (set on
   the figure by Work::phone_address(): the client's own address only when the item is a named client with a Live site URL, otherwise
   this site's). Pseudo-elements and gradients only, so the image block stays an ordinary core image. */
.case-shots .case-shot-phone {
	--phone-url: "xcelsiordigital.com";
	display: flex; flex-direction: column; box-sizing: border-box; aspect-ratio: 71.5 / 149.6; /* an iPhone 17 body, 71.5 x 149.6 mm */
	border: 0.4375rem solid transparent; border-radius: 2.5rem;
	background:
		linear-gradient(#16161a, #16161a) 50% calc(100% - 0.4375rem) / 34% 0.25rem no-repeat padding-box,
		linear-gradient(#f2f2f7, #f2f2f7) 0 100% / 100% 3.75rem no-repeat padding-box,
		linear-gradient(#050506, #050506) padding-box,
		linear-gradient(120deg, #f4f5f7 0%, #9097a1 10%, #3a3e45 22%, #c9cdd3 36%, #5b6068 50%, #2b2e33 62%, #aeb4bc 78%, #6a6f77 90%, #e8eaed 100%) border-box;
	box-shadow: inset 0 0 0 0.125rem #0d0e10, inset 0 0.0625rem 0.1875rem 0.0625rem rgba(255, 255, 255, 0.28);
	outline: 1px solid var(--control-border); overflow: hidden;
}
/* The screenshot fills the screen between the two bars and is cropped from the bottom (a page is longer than a phone screen). */
.case-shots .case-shot-phone img { display: block; width: 100%; flex: 1 1 0; min-height: 0; object-fit: cover; object-position: top; }
@media (max-width: 47.99rem) { .case-shots .case-shot-phone { width: 100%; max-width: 19rem; margin-inline: auto; } }
.case-shots .case-shot-phone::before {
	content: "9:41"; display: block; box-sizing: border-box; height: 2.375rem; padding: 0.5rem 0 0 1.75rem; border: 0; border-radius: 2rem 2rem 0 0;
	font: 600 0.8125rem/1.3 var(--font-body, system-ui, sans-serif); color: #1b1b1b;
	background:
		radial-gradient(circle closest-side, #0a0a0a 96%, transparent) calc(50% - 2rem) 0.4375rem / 1.3125rem 1.3125rem no-repeat,
		radial-gradient(circle closest-side, #0a0a0a 96%, transparent) calc(50% + 2rem) 0.4375rem / 1.3125rem 1.3125rem no-repeat,
		linear-gradient(#0a0a0a, #0a0a0a) 50% 0.4375rem / 4rem 1.3125rem no-repeat,
		linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 55%),
		var(--gold);
}
.case-shots .case-shot-phone::after {
	content: "\1F512\FE0E\00A0" var(--phone-url); position: static; display: block; box-sizing: border-box; width: auto; height: 1.875rem; margin: 0.5rem 0.875rem 1.375rem; padding: 0 0.5rem; border-radius: 0.9375rem; background: #e4e4ea;
	font: 500 0.75rem/1.875rem var(--font-body, system-ui, sans-serif); color: #1b1b1b; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Portfolio pictures already carry their own device frames: two side by side at equal width, no browser bar drawn around them. */
@media (min-width: 48rem) { .case-shots.has-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.case-shots .case-shot-mockup::before, .case-shots .case-shot-mockup::after { content: none; display: none; }

/* An unfinished item's note (never printed on the site; the editor shows it). */
.case-draft-marker { margin: 0 0 1.5rem; padding: 0.75rem 1rem; border: 1px dashed var(--control-border); color: var(--ink-muted); }

/* The case copy: "The problem.", "What we did.", "The result." and "Also on this project.", a heading above each paragraph. */
.case-story { max-width: 46rem; }
.case-story .case-story-h { margin: 2.5rem 0 0.75rem; }
.case-story .case-story-h:first-child { margin-top: 0; }
.case-story .case-prose { margin: 0; color: var(--ink); }
/* A caption under a portfolio picture (for example "The previous design"). */
.case-shots .case-shot-mockup figcaption { margin: 0.5rem 0 0; font-size: 1rem; line-height: 1.5; color: var(--ink-muted); text-align: center; }

/* Gallery lightbox (assets/js/case-lightbox.js): a button over each picture, and a small corner button on the before and after slider so that dragging
   never opens it. The caption under the open picture is the alt text. */
.case-sec figure.wp-block-image, .case-sec .wp-block-post-featured-image { position: relative; }
.xc-lb-open { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.xc-lb-open:focus-visible { outline: 2px solid var(--gold-text); outline-offset: -4px; }
.xc-lb-open.is-corner { inset: auto; top: 2.25rem; right: 0.5rem; z-index: 3; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--gold); color: var(--on-gold); cursor: pointer; }
.xc-lb-open.is-corner:focus-visible { outline-offset: 2px; }
.pswp .pswp__xc-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0.75rem 1.25rem 1rem; text-align: center; font: 400 1rem/1.5 var(--font-body, system-ui, sans-serif); color: #fff; background: rgba(0, 0, 0, 0.6); pointer-events: none; }
.pswp .pswp__xc-caption:empty { display: none; }
/* A slider of two portfolio pictures (they carry their own device frames): no browser bar, on white. */
.compare-frame.is-composite { background: #fff; }
.compare-frame.is-composite::before, .compare-frame.is-composite::after { content: none; display: none; }
.compare-frame.is-composite > figure { grid-area: 1 / 1; }
.compare-frame.is-composite .compare-divider { top: 0; }
.compare-frame.is-composite .compare-range { top: 0; height: 100%; }
.compare-frame.is-composite .xc-lb-open.is-corner { top: 0.5rem; }
/* The parent theme paints every button grey on hover and focus; the lightbox button sits over a picture, so it stays clear (the corner one stays gold). */
.xc-lb-open:hover, .xc-lb-open:focus, .xc-lb-open:active { background: transparent; color: inherit; }
.xc-lb-open.is-corner:hover, .xc-lb-open.is-corner:focus, .xc-lb-open.is-corner:active { background: var(--gold); color: var(--on-gold); }
