/* Native editorial profiles use the same materials and spacing as Code Blocks.
   Only the guarded profile adapter loads this sheet. Source text/media stay intact. */
html[data-match-design="v1"] #siteWrapper main [data-match-profile="alex"] {
  --profile-inset: clamp(24px, 3vw, 40px);
  display: flex !important;
  flex-direction: column;
  gap: var(--match-section-space) !important;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-inline: 0 !important;
  max-width: none !important;
  grid-template: none !important;
  color: var(--match-text);
  font-family: var(--match-font-body);
}

html[data-match-design="v1"] #siteWrapper main [data-match-profile] :is([data-match-profile-section],[data-match-profile-heading],[data-match-profile-cover-grid],[data-match-profile-steps],[data-match-profile-contact-details],[data-match-profile-disclaimer]) {
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-section] {
  width: min(var(--match-content-max), calc(100% - 8vw));
  margin-inline: auto !important;
  margin-block: 0 !important;
  display: flex;
  flex-direction: column;
  gap: var(--match-block-space);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile] :where(.mps-shell) {
  padding: var(--profile-inset);
  background: var(--match-shell-bg);
  border: 1px solid var(--match-shell-line);
  border-radius: var(--match-shell-radius);
  box-shadow: var(--match-shell-shadow);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile] .mps-card {
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  background: var(--match-card-bg);
  border: 1px solid var(--match-card-line);
  border-radius: var(--match-card-radius);
  box-shadow: var(--match-card-shadow);
}

/* Remove only the old absolute FE tracks; nested native controllers still own
   the image internals. Each spacing interval is owned by its nearest group. */
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item] {
  grid-area: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  align-self: stretch !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item] > .sqs-block {
  width: 100%;
  height: auto !important;
  padding: 0 !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item] :is(.sqs-html-content,.sqs-html-content > *) {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item] .sqs-html-content > * + * {
  margin-top: var(--match-space-2) !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="decoration"] {
  display: none !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-heading] {
  display: flex;
  flex-direction: column;
  gap: var(--match-heading-space);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="title"] h1 {
  max-width: 16ch;
  font-size: clamp(40px, 5vw, 68px) !important;
  font-weight: 500 !important;
  line-height: 1.06 !important;
  letter-spacing: -.04em !important;
  text-wrap: balance;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="section-title"] h2 {
  max-width: 27ch;
  font-size: clamp(28px, 3.2vw, 44px) !important;
  font-weight: 500 !important;
  line-height: 1.16 !important;
  letter-spacing: -.035em !important;
  text-wrap: balance;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="lead"] :is(h3,p) {
  max-width: 58ch;
  font-family: var(--match-font-body) !important;
  font-size: clamp(19px, 1.7vw, 23px) !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  letter-spacing: -.01em !important;
  color: var(--match-muted);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="prose"] :is(h4,p),
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="step-copy"] p {
  font-family: var(--match-font-body) !important;
  font-size: 18px !important;
  line-height: 1.6 !important;
  letter-spacing: 0 !important;
  font-weight: 400 !important;
  color: var(--match-muted);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="prose"] {
  max-width: 68ch;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="kicker"] p,
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="credits"] p,
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="step-title"] p {
  font-size: 13px !important;
  line-height: 1.55 !important;
  font-weight: 500 !important;
  letter-spacing: .09em !important;
  color: var(--match-muted);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="credits"] {
  padding-top: var(--match-heading-space) !important;
  border-top: 1px solid var(--match-card-line);
}

/* Full-width editorial photographs and the ten complete cover artworks. */
html[data-match-design="v1"] #siteWrapper main [data-match-profile-section]:is([data-match-profile-section="hero"],[data-match-profile-section="portrait"]) {
  width: 100%;
  gap: var(--match-space-2);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="hero-image"] {
  aspect-ratio: var(--match-profile-image-ratio);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item]:is([data-match-profile-item="hero-image"],[data-match-profile-item="cover-image"]) > .sqs-block {
  height: 100% !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="caption"] {
  width: min(var(--match-content-max), calc(100% - 8vw)) !important;
  margin-inline: auto !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item]:is([data-match-profile-item="caption"],[data-match-profile-item="cover-caption"],[data-match-profile-item="disclaimer"]) p {
  font-size: 13px !important;
  line-height: 1.55 !important;
  letter-spacing: 0 !important;
  color: var(--match-muted);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-section="covers"] {
  padding: 24px;
  gap: var(--match-heading-space);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-cover-grid] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 18px;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-cover] {
  display: flex;
  flex-direction: column;
  gap: var(--match-space-2);
  padding: 12px 12px 20px;
  order: var(--match-profile-cover-order-desktop);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-cover="6"] {
  grid-column: 2;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="cover-image"] {
  width: 100% !important;
  aspect-ratio: 4 / 5.25;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="cover-caption"] {
  padding-inline: 8px !important;
}

html[data-match-design="v1"] #siteWrapper main [data-match-profile-steps] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-step] {
  display: grid;
  grid-template-rows: auto 1fr;
  row-gap: var(--match-space-2);
  padding: 24px;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="step-title"] { grid-row: 1 !important; }
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="step-copy"] { grid-row: 2 !important; }
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="step-title"] p { color: var(--match-text); }

html[data-match-design="v1"] #siteWrapper main [data-match-profile-section="contact"] {
  gap: var(--match-heading-space);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-section="contact"] [data-match-profile-item="section-title"] h2 {
  max-width: 42ch;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-contact-details] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: flex-start;
  width: 100%;
  max-width: 620px;
  padding: 24px;
  margin-top: calc(var(--match-block-space) - var(--match-heading-space)) !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="contact-name"] p {
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="contact-email"] :is(h3,p) {
  font-family: var(--match-font-body) !important;
  color: #fff;
  font-size: clamp(18px, 2.3vw, 28px) !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  letter-spacing: -.02em !important;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="contact-email"] a {
  text-decoration: underline;
  text-decoration-color: var(--match-card-line-strong);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="contact-email"] a:hover { text-decoration-color: currentColor; }
html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="contact-phone"] p {
  font-size: 18px !important;
  line-height: 1.5 !important;
  color: var(--match-muted);
}
html[data-match-design="v1"] #siteWrapper main [data-match-profile-disclaimer] {
  margin-top: calc(var(--match-block-space) - var(--match-heading-space)) !important;
  padding-top: var(--match-block-space);
  border-top: 1px solid var(--match-card-line);
}

/* The original description is long prose, even where it uses heading tags.
   Pair introduction and narrative on wide screens without reordering the DOM. */
@media (min-width: 1100px) {
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-section="intro"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: var(--match-group-space);
  }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-section="intro"] > [data-match-profile-item="prose"] {
    padding-top: calc(20px + var(--match-heading-space)) !important;
  }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-heading="commission"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: var(--match-group-space);
  }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-heading="commission"] [data-match-profile-item="kicker"] { grid-area: 1 / 1 !important; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-heading="commission"] [data-match-profile-item="section-title"] { grid-area: 2 / 1 !important; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-heading="commission"] [data-match-profile-item="prose"] { grid-area: 2 / 2 !important; }
}

@media (max-width: 767px) {
  html[data-match-design="v1"] #siteWrapper main [data-match-profile="alex"] { --profile-inset: 20px; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-section],
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="caption"] {
    width: calc(100% - 12vw) !important;
  }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-section]:is([data-match-profile-section="hero"],[data-match-profile-section="portrait"]) { width: 100% !important; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-section="covers"] { padding: 20px 0 0; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-heading="covers"] { padding-inline: 20px; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-cover-grid],
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-steps] { grid-template-columns: minmax(0, 1fr); gap: var(--match-block-space); }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-cover] {
    order: 0;
    grid-column: 1 !important;
    padding: 0 0 20px;
    overflow: hidden;
  }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="cover-caption"] { padding-inline: 20px !important; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-step],
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-contact-details] { padding: 20px; }
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="prose"] :is(h4,p),
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="step-copy"] p { font-size: 17px !important; }
}
@media (max-width: 360px) {
  html[data-match-design="v1"] #siteWrapper main [data-match-profile-item="title"] h1 { font-size: 32px !important; }
}
