/* ==========================================================================
   Inner page layout: Editorial  css/dm-layout-editorial.css
   Magazine feel: serif headings, square corners, hairlines between sections, numbered section labels,
   framed photos, underlined columns instead of cards, ink buttons. Structure lives in css/dm-layout.css.
   ========================================================================== */

:where(:root) {
    --ct-font-heading: Georgia, 'Times New Roman', serif;
    --ct-heading-weight: 400;
    --ct-lede-font: Georgia, 'Times New Roman', serif;
    --ct-lede-size: 21px;
    --ct-quote-font: Georgia, 'Times New Roman', serif;
    --ct-h2-size: clamp(32px, 3.4vw, 46px);
    --ct-h2-intro-size: clamp(38px, 4.6vw, 60px);
    --ct-h3-size: 23px;
    --ct-radius: 0px;
    --ct-card-radius: 0;
    --ct-media-radius: 0;
    --ct-band-radius: 0;
    --ct-btn-radius: 0;
    --ct-chip-radius: 0;
    --ct-btn-bg: var(--ct-ink);
    --ct-btn-hover-bg: var(--ct-primary);
    --ct-btn-size: 13px;
    --ct-btn-tracking: .16em;
    --ct-btn-weight: 600;
    --ct-eyebrow-rule: 40px;
    --ct-frame-color: var(--ct-primary);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
    :where(:root) {
        --ct-soft: color-mix(in srgb, var(--ct-accent) 24%, color-mix(in srgb, var(--ct-primary) 4%, #ffffff));
        --ct-frame-color: color-mix(in srgb, var(--ct-primary) 70%, #ffffff);
    }
}

.dm-layout-editorial { counter-reset: dm-section; }

/* ---------------------------------------------------------------- hairline between two plain sections */
.dm-layout-editorial .dm-service-section:not(.dm-ct) + .dm-service-section:not(.dm-ct) { padding-top: 0; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) + .dm-service-section:not(.dm-ct) .dm-flex {
    padding-top: var(--dm-pad);
    border-top: 1px solid var(--ct-line);
}

/* ---------------------------------------------------------------- type */
.dm-layout-editorial .dm-service-section:not(.dm-ct) h2 {
    letter-spacing: -.015em;
    line-height: 1.12;
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) h4 {
    font-family: var(--ct-font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ct-primary);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) a:not(.btn):not(.dm-ct-btn):not(.inline-dm-phone) {
    color: var(--ct-ink);
    text-decoration-color: var(--ct-primary);
}

/* numbered label above the first heading of every section after the intro; --dm-section-label: none turns it off */
.dm-layout-editorial .dm-service-section:not(.dm-ct):not(:nth-child(1 of .dm-service-section)) .dm-flex:not(:has(> .dm-half:not(.dm-grid-item):nth-child(3))) > :is(.dm-full, .dm-half):not(.dm-grid-item):has(> h2:first-child)::before {
    counter-increment: dm-section;
    content: var(--dm-section-label, counter(dm-section, decimal-leading-zero));
    display: block;
    width: fit-content;
    margin: 0 0 18px;
    padding-right: 54px;
    background: linear-gradient(currentColor, currentColor) right center / 40px 1px no-repeat;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2em;
    line-height: 1;
    color: var(--ct-primary);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct):not(:nth-child(1 of .dm-service-section)) .dm-flex:not(:has(> .dm-half:not(.dm-grid-item):nth-child(3))) > :is(.dm-full, .dm-half):not(.dm-grid-item):has(> h2:first-child:is([style*="center"], .has-text-align-center))::before {
    margin-inline: auto;
    padding-left: 54px;
    background:
        linear-gradient(currentColor, currentColor) left center / 40px 1px no-repeat,
        linear-gradient(currentColor, currentColor) right center / 40px 1px no-repeat;
}

/* first section on the page reads as the intro */
.dm-layout-editorial .dm-service-section:not(.dm-ct):nth-child(1 of .dm-service-section) h2 {
    font-size: var(--ct-h2-intro-size);
    line-height: 1.04;
}
.dm-layout-editorial .dm-service-section:not(.dm-ct):nth-child(1 of .dm-service-section) h2 + p {
    font-family: var(--ct-lede-font);
    font-size: var(--ct-lede-size);
    line-height: 1.6;
    color: var(--ct-ink);
}

/* ---------------------------------------------------------------- lists */
.dm-layout-editorial .dm-service-section:not(.dm-ct) :is(ul, ol):not([class]) > li { padding-left: 30px; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) ul:not([class]) > li::before {
    content: "";
    position: absolute;
    top: .86em;
    left: 0;
    width: 16px;
    height: 1px;
    background: var(--ct-primary);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) ol:not([class]) > li { padding-left: 40px; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) ol:not([class]) > li::before {
    content: counter(dm-li, decimal-leading-zero);
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--ct-font-heading);
    font-style: italic;
    color: var(--ct-primary);
}

/* ---------------------------------------------------------------- media */
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-half:not(:has(:is(h1, h2, h3, h4, h5, p, ul, ol, table))) > img {
    box-shadow: 22px 22px 0 -1px var(--ct-surface), 22px 22px 0 0 var(--ct-frame-color);
}
@media screen and (min-width: 768px) {
    .dm-layout-editorial .dm-service-section:not(.dm-ct):not(.dm-grid):nth-child(even of .dm-service-section:not(.dm-ct)) .dm-flex:not(:has(> .dm-half:nth-child(3))) > .dm-half:first-child:not(:has(:is(h1, h2, h3, h4, h5, p, ul, ol, table))) > img {
        box-shadow: -22px 22px 0 -1px var(--ct-surface), -22px 22px 0 0 var(--ct-frame-color);
    }
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) thead th {
    padding-top: 0;
    border-bottom: 2px solid var(--ct-ink);
    background: none;
    font-family: var(--ct-font-body);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) tbody td:first-child {
    font-family: var(--ct-font-heading);
    font-size: calc(var(--ct-text-size) + 2px);
    color: var(--ct-ink);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) blockquote {
    padding-left: 28px;
    border-left-width: 2px;
    font-size: calc(var(--ct-text-size) + 5px);
    line-height: 1.5;
    color: var(--ct-ink);
}

/* ---------------------------------------------------------------- columns: a rule on top instead of a card */
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex > :is(.dm-third, .dm-fourth, .dm-grid-item),
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex:has(> .dm-half:nth-child(3)) > .dm-half {
    position: relative;
    padding-top: 30px;
    border-top: 1px solid var(--ct-line);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex > :is(.dm-third, .dm-fourth, .dm-grid-item)::before,
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex:has(> .dm-half:nth-child(3)) > .dm-half::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--ct-primary);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex > :is(.dm-third, .dm-fourth, .dm-grid-item) > img:first-child { margin-bottom: 22px; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-grid-icon {
    width: 52px;
    height: 52px;
    border: 1px solid var(--ct-line);
    border-radius: 50%;
    font-size: 19px;
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex > :is(.dm-third, .dm-fourth, .dm-grid-item) h3 { margin-top: 0; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) + .dm-service-section:not(.dm-ct) .dm-flex:has(> :is(.dm-third, .dm-fourth, .dm-grid-item)) {
    padding-top: 0;
    border-top: 0;
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex:has(> :is(.dm-third, .dm-fourth, .dm-grid-item)) { row-gap: calc(var(--ct-gap) + 16px); }

/* ---------------------------------------------------------------- buttons: the calendar icon gives way to an arrow */
.dm-layout-editorial .dm-service-section:not(.dm-ct) a.btn { padding: 17px 30px; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) a.btn i { display: none; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) a.btn::after,
.dm-layout-editorial a.dm-ct-btn:not(.dm-ct-btn--ghost)::after {
    content: "\2192";
    font-size: 16px;
    letter-spacing: 0;
    transition: transform .25s ease;
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) a.btn:hover::after,
.dm-layout-editorial a.dm-ct-btn:hover::after { transform: translateX(4px); }

/* ---------------------------------------------------------------- FAQ: .faq-dmm (h3 questions) and the old .contentfaqs accordion */
.dm-layout-editorial .dm-service-section.faq-dmm:not(.dm-ct) h3 {
    margin: 0;
    padding: 26px 0 8px;
    border-top: 1px solid var(--ct-line);
}
.dm-layout-editorial .dm-service-section.faq-dmm:not(.dm-ct) h2 + h3 { border-top: 0; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) .contentfaqs { border-top: 1px solid var(--ct-ink); }
.dm-layout-editorial .dm-service-section:not(.dm-ct) .contentfaqs h4 {
    padding-top: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ct-line);
    font-family: var(--ct-font-heading);
    font-size: calc(var(--ct-h3-size) - 2px);
    font-weight: var(--ct-heading-weight);
    letter-spacing: 0;
    text-transform: none;
    color: var(--ct-heading-color);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .contentfaqs h4:has(.fa-minus) { border-bottom-color: transparent; }
.dm-layout-editorial .dm-service-section:not(.dm-ct) .contentfaqs h4 i {
    border: 1px solid var(--ct-line);
    border-radius: 50%;
    color: var(--ct-primary);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .contentfaqs h4 i.fa-minus {
    border-color: var(--ct-ink);
    background: var(--ct-ink);
    color: #ffffff;
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .contentfaqs .dm_faq_item {
    padding-bottom: 26px;
    border-bottom: 1px solid var(--ct-line);
}
.dm-layout-editorial .dm-service-section:not(.dm-ct) .contentfaqs .dm_faq_item > * { max-width: 72ch; }

/* ---------------------------------------------------------------- page title area (template-parts/page-header-editorial.php) */
.dm-layout-editorial .dm-page-head-inner { padding-top: clamp(28px, 4vw, 64px); }
.dm-layout-editorial .dm-page-head-inner::after {
    content: "";
    display: block;
    height: 1px;
    margin-top: clamp(28px, 3.6vw, 48px);
    background: var(--ct-ink);
}
.dm-layout-editorial .dm-page-head h1 {
    max-width: 16ch;
    font-size: clamp(44px, 6.4vw, 92px);
    line-height: .98;
    letter-spacing: -.025em;
}
.dm-layout-editorial .dm-page-head-inner > h1:first-child::before {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-bottom: 28px;
    background: var(--ct-primary);
}
.dm-layout-editorial .dm-page-crumbs ol { margin-bottom: 26px; }
.dm-layout-editorial .dm-page-crumbs li {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.dm-layout-editorial .dm-page-crumbs li + li::before {
    content: "";
    width: 24px;
    height: 1px;
    background: currentColor;
}
.dm-layout-editorial .dm-page-head-media { margin-top: clamp(28px, 3.6vw, 48px); }
.dm-layout-editorial .dm-page-head-media img {
    aspect-ratio: 16 / 5;
    max-height: 520px;
}
.dm-layout-editorial .dm-page-head--compact { padding-bottom: clamp(28px, 3.6vw, 48px); }
.dm-layout-editorial .dm-page-head--compact h1 { font-size: clamp(36px, 4.6vw, 64px); }

/* ---------------------------------------------------------------- CT blocks */
.dm-layout-editorial .dm-ct .dm-ct-review-text p { font-style: italic; }
.dm-layout-editorial .dm-ct .dm-ct-review-avatar {
    border-radius: 0;
    background: var(--ct-ink);
    font-family: var(--ct-font-heading);
}

/* ---------------------------------------------------------------- responsive */
@media screen and (max-width: 767px) {
    .dm-layout-editorial .dm-page-head-media img { aspect-ratio: 3 / 2; }
    .dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-half:not(:has(:is(h1, h2, h3, h4, h5, p, ul, ol, table))) > img {
        box-shadow: 12px 12px 0 -1px var(--ct-surface), 12px 12px 0 0 var(--ct-frame-color);
    }
    .dm-layout-editorial .dm-service-section:not(.dm-ct) .dm-flex:has(> .dm-half > img) { row-gap: calc(var(--ct-gap) + 12px); }
}
