/* Direct entry to a section or story, distinct from the magazine's page turns. */
a.section-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 46px;
  padding: .65em 1.1em;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: #171816;
  color: #fff;
  font: 650 clamp(1rem, 1.3vw, 1.125rem)/1.22 "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: center;
  text-decoration: none;
}
.callout a.section-cta { background: #f6f3ea; color: #171816; }
a.section-cta:hover { text-decoration: underline; text-underline-offset: .18em; }
a.section-cta:focus-visible { outline: 3px solid #de5329; outline-offset: 2px; }

/* The cover and full-page promotion have their own mastheads. */
body:is([data-view="cover"], [data-view="launch"]) :is(.edition > header, .edition > .folio) { display: none; }
/* The flat bottom of the W sets the baseline for the coral dash. */
.brand-mark { display: block; position: relative; aspect-ratio: 465 / 83; overflow: hidden; }
.brand-mark > img, .house-art .house-lockup .brand-mark > img { display: block; width: 100%; height: auto; }
.brand-mark::after {
  content: ""; position: absolute; right: .2%; bottom: 5.1%;
  width: 12.7%; height: 12%; background: #f56d45;
}
/* Reuse the TM drawn above the coral dash. Compact marks need a larger scale. */
.brand-mark::before {
  content: ""; position: absolute; inset: 0 0 auto; aspect-ratio: 465 / 95;
  background: currentColor;
  mask: url("media/wattcar-masthead.png") left top / 100% auto no-repeat;
  clip-path: inset(0 0 70% 86%);
  transform: scale(var(--tm-scale, 1)); transform-origin: 87.3% 5.26%;
}
.jacket-name .brand-mark { --tm-scale: .5; }
.poster-signature .brand-mark { --tm-scale: .75; }
.wordmark .brand-mark { --tm-scale: 1.2; }
.house-lockup .brand-mark { --tm-scale: 1.45; }
header .wordmark { padding: 0; }
header .wordmark .brand-mark { width: clamp(115px, 12vw, 165px); height: auto; }
.front-sheet, .ad-sheet { container: cover-sheet / size; overscroll-behavior-y: none; }
.jacket, .ad-poster {
  --edge: clamp(14px, 4.15cqw, 68px);
  --ivory: #f2f0e6;
  --navy: #111b24;
  width: 100%; height: 100%; font-family: var(--sans);
}
.jacket { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--navy); color: #faf7eb; }
.jacket button, .ad-poster button { -webkit-tap-highlight-color: transparent; }
.jacket-mast, .poster-mast {
  background: var(--ivory); color: #151512;
  padding: env(safe-area-inset-top) max(var(--edge),env(safe-area-inset-right)) 0 max(var(--edge),env(safe-area-inset-left));
}
.jacket-issue { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #171714; }
.jacket-issue > span, .jacket-tag, .jacket-lines small {
  font-weight: 750; text-transform: uppercase; letter-spacing: .14em;
}
.jacket-issue > span { font-size: clamp(9px, 1.35cqh, 12px); }
.jacket-issue button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 0 0 8px; font-size: clamp(12px,1.6cqh,15px); font-weight: 700; }
.jacket-issue button span { font-size: .8em; }
.jacket-name { margin: clamp(8px,2.55cqh,24px) 0 clamp(6px,1.4cqh,14px); }
.jacket-name .brand-mark { display: block; width: min(74%,62cqh,540px); height: auto; }
.jacket-rule, .poster-label {
  font-weight: 500; font-size: clamp(10px, 1.55cqh, 14px);
  text-transform: uppercase; letter-spacing: .2em; line-height: 1.3;
}
.jacket-rule { padding: clamp(7px,1.45cqh,13px) 3px; border-top: 3px solid currentColor; }
.jacket-stage { container: cover-photo / size; position: relative; isolation: isolate; min-height: 0; }
.jacket-image { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 58% 68%; z-index: -2; }
.jacket-stage::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(150deg,#101a26cc,transparent 52%),linear-gradient(0deg,var(--navy),transparent 19%);
}
.jacket-lead {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start;
  padding: clamp(14px,6cqh,44px) max(var(--edge),env(safe-area-inset-right)) clamp(12px,4.5cqh,28px) max(var(--edge),env(safe-area-inset-left));
  text-align: left;
}
.jacket-story { display: flex; flex-direction: column; align-items: flex-start; padding: 0; text-align: left; }
.jacket-story::after { content: ""; position: absolute; inset: 0; }
.jacket-tag { display: flex; align-items: center; gap: .8em; font-size: clamp(11px,1.65cqh,16px); }
.jacket-model { text-transform: none; }
.jacket-tag i { width: 1.65em; height: 2px; background: #f56d45; }
.jacket-head { font: 750 clamp(42px,min(8.65cqw,19cqh),136px)/1 var(--sans); letter-spacing: -.067em; }
.jacket-open {
  position: relative; justify-self: end; min-height: 44px; padding: 0;
  margin: clamp(4px,1cqh,12px) max(var(--edge),env(safe-area-inset-right)) max(clamp(10px,2.6cqh,32px),env(safe-area-inset-bottom)) 0;
  min-width: 44px;
}
.jacket-open .opener-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.jacket-open, .turn small {
  display: flex;
  align-items: center;
  gap: .5em;
  font: italic 400 .9375rem/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: normal;
  text-transform: none;
}
.jacket-open::after, .turn small::after {
  content: "";
  flex: none;
  width: 1.35em;
  height: .65em;
  background: currentColor;
  clip-path: polygon(0 44%, 89% 44%, 70% 8%, 74% 0, 100% 50%, 74% 100%, 70% 92%, 89% 56%, 0 56%);
}
.jacket-lines {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(13px,3.4cqw,50px);
  padding: 0 max(var(--edge),env(safe-area-inset-right)) 0 max(var(--edge),env(safe-area-inset-left));
}
.jacket-lines button { display: grid; align-content: start; justify-items: start; gap: .4em; padding: clamp(8px,1.5cqh,15px) 0 0; border-top: 1px solid #a8ada9; text-align: left; }
.jacket-lines small { color: #c6cdcb; font-size: clamp(8px,1.25cqh,12px); letter-spacing: .085em; }
.jacket-lines button > span { font: 500 clamp(18px,3.55cqh,36px)/1.1 var(--sans); letter-spacing: -.034em; text-wrap: balance; }
.jacket-open:is(:hover,:focus-visible), .jacket-lines button:is(:hover,:focus-visible) > span { text-decoration: underline; text-underline-offset: .12em; }
.index-cover { display: grid; place-items: center; flex: 0 0 76px; height: 58px; background: #111b24; color: #f4efe4; font: 750 39px/1 var(--sans); }

.ad-poster { display: grid; grid-template-rows: auto minmax(0,1fr); color: #111; background: #b3b1b6; }
.poster-label { padding: clamp(7px,1.5cqh,14px) 0; text-align: center; }
.poster-main { position: relative; isolation: isolate; min-height: 0; }
.poster-photo { position: absolute; inset: 0 41% 0 0; }
.poster-cars { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 54% center; }
.poster-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, transparent 83%, #b3b1b6); }
.poster-copy, .poster-signature { position: absolute; left: 55%; right: 3%; text-align: center; }
.poster-copy { top: 26%; }
.poster-head { margin: 0; color: #fff; font: 750 clamp(28px,min(4.85cqw,9.4cqh),106px)/.96 var(--sans); letter-spacing: -.055em; text-transform: uppercase; }
.poster-head span { display: block; white-space: nowrap; }
.poster-enquiry {
  display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 6px 0;
  color: #111; font-size: clamp(9px,min(.97cqw,1.65cqh),14px); line-height: 1.4; font-weight: 500;
  text-transform: uppercase; text-decoration: none; letter-spacing: .16em;
}
.poster-enquiry:is(:hover,:focus-visible) { text-decoration: underline; text-underline-offset: .25em; }
.poster-signature { top: 66%; }
.poster-signature .brand-mark { display: block; margin: 0 auto; width: min(45%,255px); height: auto; }
.poster-signature p {
  margin: clamp(8px,2cqh,20px) auto 0; padding: clamp(6px,1.5cqh,14px) 0 0; width: 84%;
  border-top: 1px solid white; font-size: clamp(10px,min(1.3cqw,2cqh),18px);
  text-transform: uppercase; letter-spacing: .2em; line-height: 1.3; font-weight: 500;
}
.poster-turn { position: absolute; inset: auto max(var(--edge),env(safe-area-inset-right)) env(safe-area-inset-bottom) max(var(--edge),env(safe-area-inset-left)); display: flex; justify-content: space-between; }
.poster-turn button { min-height: 44px; font: 650 12px/1.1 var(--sans); }
.house-art .house-lockup .brand-mark { width: min(75%,96px); height: auto; }

@container cover-photo (min-aspect-ratio: 2.75/1) {
  .jacket-image {
    right: 0; width: 270cqh;
    mask-image: linear-gradient(90deg,transparent,#000 20%);
  }
}
@container cover-sheet (max-aspect-ratio: 1/1) {
  .jacket-image { height: 100%; object-position: 65% 54%; }
  .jacket-stage::after { background: linear-gradient(150deg,#101a26bf,transparent 56%),linear-gradient(0deg,var(--navy),transparent 20%); }
  .jacket-lead { --edge: 4.6cqw; }
  .jacket-head { font-size: clamp(46px,min(17.1cqw,17.5cqh),120px); }
  .jacket-lines, .jacket-open { --edge: 4.6cqw; }
  .jacket-lines button { gap: 5px; }
  .jacket-lines button > span { font-size: clamp(16px,min(5.15cqw,3.05cqh),34px); }
  .poster-photo { inset: 0 0 40% 0; }
  .poster-photo::after { background: linear-gradient(to bottom, transparent 83%, #b3b1b6); }
  .poster-copy { top: 52.2%; left: 3%; right: 3%; }
  .poster-head { font-size: clamp(29px,min(9.35cqw,6.85cqh),80px); line-height: .97; }
  .poster-enquiry { font-size: clamp(8px,min(2.05cqw,1.45cqh),14px); }
  .poster-signature { top: 74%; left: 0; right: 0; }
  .poster-signature .brand-mark { width: min(39.5cqw,30cqh,310px); }
  .poster-signature p { width: 78%; font-size: clamp(10px,min(3cqw,1.85cqh),19px); }
  .poster-turn { clip-path: inset(50%); pointer-events: none; }
  .poster-turn:focus-within { clip-path: none; pointer-events: auto; }
}
@container cover-sheet (max-height: 500px) and (min-aspect-ratio: 1/1) {
  .jacket-issue button { min-height: 32px; }
  .jacket-name { margin: 4px 0; }
  .jacket-name .brand-mark { width: min(40cqh,260px); }
  .jacket-rule, .poster-label { padding: 4px 0; }
  .jacket-head { font-size: min(9cqw,20cqh); }
  .jacket-open { margin-block: 0 max(2px,env(safe-area-inset-bottom)); }
  .jacket-lines button { padding-top: 5px; }
  .jacket-lines button > span { font-size: 16px; }
  .poster-head { font-size: min(5cqw,10cqh); }
  .poster-copy { top: 14%; }
  .poster-enquiry { min-height: 34px; font-size: 8px; }
  .poster-signature { top: 62%; }
  .poster-signature .brand-mark { width: min(36%,170px); }
  .poster-turn button { min-height: 30px; }
}

/* A two-page spread on desktop. Centre the headline and signature on the grey page. */
@media (min-width: 960px), (min-width: 651px) and (hover: hover) {
  @container cover-sheet (aspect-ratio > 1) {
    .poster-main {
      display: grid;
      grid-template-columns: 55% 45%;
      grid-template-rows: 1fr auto clamp(12px, 5cqh, 64px) auto 1fr;
      background: #959498;
    }
    .poster-photo { position: static; grid-area: 1 / 1 / -1 / 2; min-height: 0; }
    .poster-photo::after { content: none; }
    .poster-cars { object-position: 60% center; }
    .poster-copy, .poster-signature { position: static; grid-column: 2; margin-inline: 6%; }
    .poster-copy { grid-row: 2; }
    .poster-head { font-size: clamp(27px, min(3.55cqw, 8cqh), 82px); }
    .poster-signature { grid-row: 4; }
  }
}

/* Retain the sky above the rear view and the tyres below it on wide screens. */
@media (min-width: 651px) {
  [data-slug="bmw"] .cover { background: #43494d; }
  [data-slug="bmw"] .hero {
    width: min(100%, 206cqh); margin-left: auto; object-position: center 40%;
    mask-image: linear-gradient(90deg, transparent, #000 clamp(0px, calc(100cqw - 206cqh), 24%));
  }
}
