/* The case pages: /us/work/<case>/ (the brand's cover, the business, the idea beside the live site, the city's night
   plate) and /dubai/work/<brand>/ (the photograph where it ran, the brand, the artwork flat, a second
   photograph). One message per section, separated by space; no rules. */

.cs-top { padding-top: var(--sp-104); }
.cs-top h1 { grid-column: 1 / span 10; }
.cs-hero { margin-top: var(--sp-64); }
.cs-hero .cap { margin-top: 16px; }
@media (max-width: 767px) { .cs-top { padding-top: var(--sp-64); } .cs-hero { margin-top: 40px; } .cs-top h1.is-long { font-size: 12vw; } }
/* phones: a US case's cover is square, as on the home page and /work/, and its phone stands at the bottom right at a set
   height (62 of the cover's 100, 58 of them in view), as wide as its shot needs (--pr from corp-parts usCover), so no
   first screen is mostly empty field; the city line keeps its distance from the phone down to a 320 px cover */
@media (max-width: 767px) {
  .cs-hero .cover.ar-hero:has(> .uc) { --ar: 1 / 1; }
  .cs-hero .uc-phone { right: 6cqw; bottom: -4cqw; height: 62cqw; width: calc((62cqw - 20px) * var(--pr, .4623) + 20px); }
  .cs-hero .uc-phone img { height: 100%; object-fit: cover; object-position: top center; }
  .cs-hero .uc-city { font-size: clamp(12px, 4cqw, 14px); }
}
.cs-top h1 { overflow-wrap: break-word; }

/* Dubai: the photograph in eight columns at the right, its caption under it (photographs stay within 8 columns) */
.cs-photo { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); }
.cs-photo > figure { grid-column: 5 / -1; margin: 0; }
.cs-photo .cover { aspect-ratio: 16 / 10; }
.cs-photo picture, .cs-photo picture img { display: block; width: 100%; height: 100%; }
.cs-photo picture img { object-fit: cover; }
.cs-photo .cs-credit { margin-top: 8px; font-size: var(--t-micro); line-height: 1.45; color: var(--ink-2); }
@media (max-width: 767px) { .cs-photo > figure { grid-column: 1 / -1; } .cs-photo .cover { aspect-ratio: 4 / 5; } }
/* a hero whose photograph cannot fill eight columns at 1.5x on a retina screen takes seven (cols in
   data/dubai/portfolio.public.json), or the 5/7 split: five columns at 4:5, cut tall from the same photograph; always at
   the right edge, never enlarged */
@media (min-width: 768px) { .cs-photo.c7 > figure { grid-column: 6 / -1; } .cs-photo.c5 > figure { grid-column: 7 / -1; } .cs-photo.tall .cover { aspect-ratio: 4 / 5; } }
@media (min-width: 1024px) { .cs-photo.c5 > figure { grid-column: 8 / -1; } } /* on tablets the tall hero takes six columns */
/* the hero's caption: the brand and the business on one line where the figure is wide enough, else a clean stacked pair
   (the five-column split hero at 1024 px is 359 px wide), never the business wrapped under itself at the right */
.cs-photo > figure { container-type: inline-size; }
@container (max-width: 459px) { .cs-photo .cap { display: grid; gap: 2px; } .cs-photo .cap-w { text-align: left; } }
/* the tall hero from 1024 px: an editorial split, the title at the top and the brand at the foot of the seven columns
   beside the photograph, so the first screen is full; below 1024 px the same blocks stack as on every case page */
.cs-split .cs-brand { padding-top: var(--sec); }
.cs-split .cs-brand .cs-text { margin-top: var(--title-gap); }
@media (min-width: 1024px) {
  .cs-split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: var(--g); }
  .cs-split > h1 { grid-column: 1 / span 7; grid-row: 1; font-size: min(var(--t-display), 7.6vw); }
  .cs-split > .cs-hero { grid-column: 8 / -1; grid-row: 1 / span 2; margin-top: 0; display: block; }
  .cs-split > .cs-brand { grid-column: 1 / span 6; grid-row: 2; align-self: end; padding-top: var(--sp-64); }
  .cs-split .cs-brand .cs-text { max-width: 52ch; }
}

/* a section: its title at statement size over 9 columns, then its content */
.cs-sec { padding-top: var(--sec); }
.cs-sec > .grid > h2 { grid-column: 1 / span 9; }
.cs-text { grid-column: 1 / span 7; max-width: var(--measure); margin-top: var(--title-gap); }
.cs-text p + p { margin-top: 1em; }
.cs-text .t-lead { color: var(--ink); }
.cs-link { margin-top: 24px; }

/* the idea beside the live site (US) */
.cs-idea { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 40px; align-items: start; margin-top: var(--title-gap); }
.cs-idea > .cs-text { grid-column: 1 / span 5; margin-top: 0; }
.cs-idea > figure { grid-column: 6 / -1; margin: 0; }
.cs-site { background: var(--paper-2); padding: 0; overflow: hidden; } /* its ratio is the shot's own (inline), nothing cut */
.cs-site img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cs-idea.is-tall > .cs-text { grid-column: 1 / span 6; }
.cs-idea.is-tall > figure { grid-column: 8 / -1; }
.cs-idea figcaption, .cs-art figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--ink-2); }
@media (max-width: 767px) { .cs-idea > .cs-text, .cs-idea > figure, .cs-idea.is-tall > .cs-text, .cs-idea.is-tall > figure { grid-column: 1 / -1; } }

/* the place: the city's night plate across the page, alone (the cover is the first thing on the page already) */
.cs-plate { margin-top: var(--sp-64); }
.cs-plate .plate-fig { margin: 0; }
.cs-plate .plate { aspect-ratio: 21 / 9 !important; }
@media (max-width: 767px) { .cs-plate { margin-top: 40px; } .cs-plate .plate { aspect-ratio: 4 / 3 !important; } }

/* the artwork, flat at its true ratio on the screen ground */
.cs-arts { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: var(--sp-64); margin-top: var(--title-gap); }
.cs-art { grid-column: 1 / span 7; margin: 0; } /* seven columns: the 1024 px artwork at 1.5x on a retina screen */
.cs-arts.two .cs-art { grid-column: span 6; }
.cs-art .screen { background: var(--screen); padding: clamp(16px, 3.2vw, 48px); }
.cs-art .screen img { width: 100%; height: auto; }
@media (max-width: 767px) { .cs-arts.two .cs-art { grid-column: 1 / -1; } .cs-arts { row-gap: 40px; } }

/* the second photograph: seven columns by day or at dusk, six after dark */
.cs-second { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); padding-top: var(--sec); }
.cs-second > figure { grid-column: 1 / span 7; margin: 0; }
.cs-second.six > figure { grid-column: 1 / span 6; }
.cs-second .cover { aspect-ratio: 3 / 2; }
.cs-second .cs-credit { margin-top: 12px; font-size: var(--t-small); color: var(--ink-2); }
@media (max-width: 767px) { .cs-second > figure, .cs-second.six > figure { grid-column: 1 / -1; } }

/* more work: two covers, the United States first; on phones a US cover is square with its phone larger, as on the home
   page and /work/, so the tile is not mostly an empty field */
.cs-more .sec-head { margin-bottom: var(--title-gap); }
@media (max-width: 767px) {
  .cs-more .cover:has(> .uc) { --ar: 1 / 1; }
  .cs-more .uc-phone { width: 30cqw; bottom: -10%; }
}
.cs-desk { padding-bottom: var(--sp-104); }
.cs-desk .desk { padding-top: var(--sec); }
@media (max-width: 767px) { .cs-desk { padding-bottom: var(--sp-64); } }

/* phones: one column for every block */
@media (max-width: 767px) {
  .cs-sec > .grid > h2, .cs-text, .cs-art, .cs-arts.two .cs-art { grid-column: 1 / -1; }
}
