/* Only the two editorial page templates use these rules. Gutenberg stays intact. */
.editorial-page {
    --editorial-gap: clamp(2.5rem, 7vw, 7rem);
    --editorial-space: clamp(3rem, 6vw, 6rem);
}
.editorial-page__header { padding-block: clamp(10rem, 17vw, 16rem) var(--editorial-space); }
.editorial-page__header .eyebrow { margin-bottom: 2rem; }
.editorial-page__header h1 {
    max-width: 15ch;
    margin: 0;
    font-size: clamp(3rem, 7.5vw, 7.5rem);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -.055em;
    text-wrap: balance;
    overflow-wrap: break-word;
}
.editorial-page__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem var(--editorial-gap);
    align-items: start;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.8;
    overflow-wrap: anywhere;
}
.editorial-page__content > * { min-width: 0; margin: 0; grid-column: 2; }
.editorial-page__content p { max-width: 60ch; }
.editorial-page__content :is(h2, h3, h4) { scroll-margin-top: 7rem; text-wrap: balance; }
.editorial-page__content > :is(.alignwide, .alignfull, .wp-block-group, .wp-block-columns) {
    grid-column: 1 / -1;
    max-width: 100%;
}
.editorial-page__content :is(iframe, video) { max-width: 100%; }

/* Each existing H2 starts a service; any further paragraphs keep their DOM order.
   Counters follow editorial additions/removals without a fixed list of seven. */
.editorial-page--services .editorial-page__content { counter-reset: service; }
.editorial-page--services .editorial-page__content > h2 {
    position: relative;
    grid-column: 1;
    counter-increment: service;
    padding-left: clamp(2.4rem, 5vw, 4.5rem);
    font-size: clamp(1.75rem, 2.7vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -.035em;
}
.editorial-page--services .editorial-page__content > h2,
.editorial-page--services .editorial-page__content > h2 + * {
    margin-top: 2rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--dv-line);
}
.editorial-page--services .editorial-page__content > h2::before {
    content: counter(service, decimal-leading-zero);
    content: counter(service, decimal-leading-zero) / "";
    position: absolute;
    top: 2.8rem;
    left: 0;
    color: var(--dv-muted);
    font-size: .72rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
}
.editorial-page--services .editorial-page__content > h2::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 100%;
    width: var(--editorial-gap);
    border-top: 1px solid var(--dv-line);
}

/* The saved lead and H2 provide the studio's hierarchy, without matching text. */
.editorial-page--studio .editorial-page__content > :is(.is-style-lead, p:first-child) {
    grid-column: 1 / -1;
    max-width: 38ch;
    margin-bottom: var(--editorial-space);
    font-size: clamp(1.65rem, 3.15vw, 3rem);
    line-height: 1.4;
    letter-spacing: -.025em;
}
.editorial-page--studio .editorial-page__content > h2 {
    grid-column: 1 / -1;
    margin-top: var(--editorial-space);
    padding-block: var(--editorial-space) 1.5rem;
    border-top: 1px solid var(--dv-line);
    font-size: clamp(2.5rem, 5.5vw, 5.5rem);
    line-height: 1.1;
    letter-spacing: -.045em;
    text-wrap: initial;
    /* Preserve the full-width rule with a restrained heading measure. */
    padding-right: 24%;
}
.editorial-page--studio .editorial-page__content > h2 + p {
    font-size: clamp(1.2rem, 1.7vw, 1.5rem);
    line-height: 1.6;
}
.editorial-page__footer { padding-block: calc(var(--editorial-space) * 1.5) var(--editorial-space); }
.editorial-page__link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 1.5rem;
    border-top: 1px solid var(--dv-line);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.3;
    letter-spacing: -.025em;
}
.editorial-page__link:hover > span:first-child { text-decoration: underline; text-underline-offset: .2em; }

@media (max-width: 760px) {
    .editorial-page__content { display: block; }
    .editorial-page__content > * + * { margin-top: 1.5rem; }
    .editorial-page--services .editorial-page__content > h2 { margin-top: 3rem; padding-top: 1.75rem; }
    .editorial-page--services .editorial-page__content > h2:first-child { margin-top: 0; }
    .editorial-page--services .editorial-page__content > h2::before { top: 2rem; }
    .editorial-page--services .editorial-page__content > h2::after { display: none; }
    .editorial-page--services .editorial-page__content > h2 + * { margin-top: 1.25rem; padding-top: 0; border-top: 0; }
    .editorial-page--studio .editorial-page__content > h2 { padding-right: 0; }
    .editorial-page__footer { padding-top: 4.5rem; }
}

/* Content needs no animation/JS; inherit the site's focus and reduced-motion rules. */
