/* Archive Services Accordion flexible-content layout */

.archive-services-accordion::before,
.archive-services-accordion::after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    margin: 32px auto;
    background-color: var(--color-copper-600);
}

.archive-services-accordion__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Border sits on the toggle and the panel inner (not the item), so the
   silo-coloured toggle background bleeds flush to the visible edges instead
   of being inset by the item border. */
.archive-services-accordion__item {
    border: 0;
    scroll-margin-top: 120px;
}

/* Toggle bar — closed state */
.archive-services-accordion__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 27px;
    background-color: transparent;
    color: var(--color-vintage-grape-800);
    border: 1px solid var(--color-alabaster-gray-500);
    cursor: pointer;
    text-align: left;
    font-family: var(--font-family-body);
    transition: background-color var(--duration-base) var(--easing-standard),
                color var(--duration-base) var(--easing-standard),
                border-color var(--duration-base) var(--easing-standard);
}

.archive-services-accordion__toggle:focus-visible {
    outline: 2px solid var(--silo-accent-600);
    outline-offset: -2px;
}

.archive-services-accordion__title {
    margin: 0;
    flex: 1;
    text-align: center;
    font-family: var(--text-h3-family);
    font-weight: var(--text-h3-weight);
    font-size: var(--text-h3-size);
    line-height: var(--text-h3-line-height);
    letter-spacing: var(--text-h3-letter-spacing);
}

.archive-services-accordion__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.archive-services-accordion__chevron svg {
    display: block;
    width: 100%;
    height: 100%;
}

.archive-services-accordion__chevron--up {
    display: none;
}

/* Hover & open state — silo-600 background, alabaster-gray-200 text.
   Border switches to silo-accent so the colour bleeds to the visible edge. */
.archive-services-accordion__toggle:hover,
.archive-services-accordion__toggle[aria-expanded="true"] {
    background-color: var(--silo-accent-600);
    color: var(--color-alabaster-gray-200);
    border-color: var(--silo-accent-600);
}

/* Bottom border between coloured toggle and panel content stays neutral
   so it reads as the panel's top edge rather than part of the toggle. */
.archive-services-accordion__toggle[aria-expanded="true"] {
    border-bottom-color: var(--color-alabaster-gray-500);
}

.archive-services-accordion__toggle[aria-expanded="true"] .archive-services-accordion__chevron--down {
    display: none;
}

.archive-services-accordion__toggle[aria-expanded="true"] .archive-services-accordion__chevron--up {
    display: inline-flex;
}

/* Open/close animation via max-height. JS sets the inline max-height to the
   panel's scrollHeight on open (so the transition runs over the real content
   size rather than a fixed cap) and to 0 on close. After the open transition
   ends JS sets max-height to 'none' so dynamic content (e.g. images loading)
   can still grow the panel.
   visibility is delayed by the animation duration on close so descendants
   stop being focusable / accessibility-readable only once the panel is
   actually collapsed.
   clip-path (instead of overflow: hidden) clips vertically so the height
   animation still works, but lets descendants extend horizontally past the
   panel — used by the mobile articles rail to full-bleed to the viewport. */
.archive-services-accordion__panel {
    max-height: 0;
    clip-path: inset(0 -100vw);
    visibility: hidden;
    transition: max-height var(--duration-slow) var(--easing-standard),
                visibility 0s var(--duration-slow);
}

.archive-services-accordion__panel[aria-hidden="false"] {
    visibility: visible;
    transition: max-height var(--duration-slow) var(--easing-standard),
                visibility 0s 0s;
}

.archive-services-accordion__panel-inner {
    padding: 40px;
    color: var(--silo-accent-800);
    border: 1px solid var(--color-alabaster-gray-500);
    border-top: 0;
}

/* Intro and description WYSIWYG content */
.archive-services-accordion__intro,
.archive-services-accordion__description {
    max-width: 780px;
}

.archive-services-accordion__intro p,
.archive-services-accordion__description p {
    font-family: var(--text-body-family);
    font-weight: var(--text-body-weight);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line-height);
    letter-spacing: var(--text-body-letter-spacing);
    margin: 0 0 16px;
}

.archive-services-accordion__intro p:last-child,
.archive-services-accordion__description p:last-child {
    margin-bottom: 0;
}

.archive-services-accordion__intro strong,
.archive-services-accordion__description strong,
.archive-services-accordion__intro b,
.archive-services-accordion__description b {
    font-weight: 700;
    color: var(--silo-accent-600);
}

.archive-services-accordion__intro a,
.archive-services-accordion__intro a:visited,
.archive-services-accordion__description a,
.archive-services-accordion__description a:visited {
    text-decoration: underline;
    color: var(--silo-accent-600);
}

/* Numbers strip */
.archive-services-accordion__numbers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    list-style: none;
    margin: 24px 0;
    padding: 0;
}

.archive-services-accordion__number {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    background-color: var(--color-alabaster-gray-300);
    text-align: center;
}

.archive-services-accordion__number-value {
    font-family: var(--text-display-2-family);
    font-weight: var(--text-display-2-weight);
    font-size: var(--text-display-2-size);
    line-height: var(--text-display-2-line-height);
    letter-spacing: var(--text-display-2-letter-spacing);
    color: var(--silo-accent-800);
    margin-bottom: 8px;
    font-variant-numeric: proportional-nums;
}

.archive-services-accordion__number-description {
    font-family: var(--text-body-small-family);
    font-weight: var(--text-body-small-weight);
    font-size: var(--text-body-small-size);
    line-height: var(--text-body-small-line-height);
    letter-spacing: var(--text-body-small-letter-spacing);
    color: var(--silo-accent-800);
}

/* List markers inside WYSIWYG content — uses marker.svg tinted with the
   silo accent (matching the toggle button colour). */
.archive-services-accordion__intro ul,
.archive-services-accordion__description ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 16px;
}

.archive-services-accordion__intro ul li,
.archive-services-accordion__description ul li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 12px;
}

.archive-services-accordion__intro ul li::before,
.archive-services-accordion__description ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.45em;
    width: 11px;
    height: 11px;
    background-color: var(--silo-accent-600);
    -webkit-mask: url('../icons/marker.svg') no-repeat center / contain;
    mask: url('../icons/marker.svg') no-repeat center / contain;
}

/* Related articles — breaks out of the panel-inner's 40px padding AND
   covers the 1px panel-inner border (hence -41px, not -40px) so the
   articles block's alabaster-gray-400 background reads as the surrounding
   colour on the sides and bottom instead of the alabaster-gray-500 border. */
.archive-services-accordion__articles {
    margin: 32px -41px -41px;
    padding: 40px;
    background-color: var(--color-alabaster-gray-400);
}

.archive-services-accordion__articles-title {
    font-family: var(--text-h3-family);
    font-weight: var(--text-h3-weight);
    font-size: var(--text-h3-size);
    line-height: var(--text-h3-line-height);
    letter-spacing: var(--text-h3-letter-spacing);
    color: var(--silo-accent-800);
    margin: 0 0 32px;
    text-align: center;
}

.archive-services-accordion__articles-title::after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    margin: 32px auto 0;
    background-color: var(--color-copper-600);
}

.archive-services-accordion__articles-list {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.archive-services-accordion__article-link {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    align-items: stretch;
    padding: 16px;
    background-color: var(--color-alabaster-gray-200);
    border: 1px solid var(--color-alabaster-gray-500);
    border-radius: 2px;
    color: inherit;
    text-decoration: none;
}

.archive-services-accordion__article-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: var(--color-alabaster-gray-300);
}

.archive-services-accordion__article-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: sepia(0.3);
    border-radius: 2px;
}

.archive-services-accordion__article-badge {
    position: absolute;
    top: 12px;
    left: -16px;
    padding: 9.5px 12px;
    background-color: var(--silo-accent-600);
    color: #FFFFFF;
    font-family: var(--font-family-body);
    font-weight: 600;
    font-size: 12px;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 2px;
}

.archive-services-accordion__article-body {
    display: flex;
    flex-direction: column;
}

.archive-services-accordion__article-date {
    font-family: var(--text-body-small-family);
    font-weight: var(--text-body-small-weight);
    font-size: var(--text-body-small-size);
    line-height: var(--text-body-small-line-height);
    letter-spacing: var(--text-body-small-letter-spacing);
    color: var(--color-alabaster-gray-700);
    margin-bottom: 8px;
}

.archive-services-accordion__article-title {
    margin: 0;
    font-family: var(--text-body-big-family);
    font-weight: var(--text-body-big-weight);
    font-size: var(--text-body-big-size);
    line-height: var(--text-body-big-line-height);
    letter-spacing: var(--text-body-big-letter-spacing);
    color: var(--color-alabaster-gray-900);
}

.archive-services-accordion__article-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    margin-left: auto;
    padding-top: 12px;
    font-family: var(--text-body-family);
    font-weight: var(--text-body-weight);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line-height);
    letter-spacing: var(--text-body-letter-spacing);
    color: var(--color-vintage-grape-800);
}

.archive-services-accordion__article-cta svg {
    width: 10px;
    height: 10px;
}

.archive-services-accordion__article-link:hover .link::after,
.archive-services-accordion__article-link:focus-visible .link::after {
    transform: scaleX(1);
}

.archive-services-accordion__more {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    font-family: var(--text-body-small-family);
    font-weight: var(--text-body-small-weight);
    font-size: var(--text-body-small-size);
    line-height: var(--text-body-small-line-height);
    letter-spacing: var(--text-body-small-letter-spacing);
    color: var(--silo-accent-800);
}

.archive-services-accordion__more svg {
    width: 10px;
    height: 10px;
}

/* Mobile: articles become a horizontal, scroll-snapping rail (mirrors the
   home page's latest-articles pattern). The articles section keeps its
   alabaster-gray-400 background as the outer band; the list itself gets a
   lighter alabaster-gray-200 surface so the rail reads as a distinct
   scrollable strip that extends past the viewport on the right as the user
   scrolls. */
@media (max-width: 820px) {
    .archive-services-accordion__articles {
        padding: 32px 0;
    }

    .archive-services-accordion__articles-title {
        padding: 0 20px;
    }

    /* Only the rail breaks out to the viewport (not the outer articles band).
       Width spans viewport minus the 16px left inset; margin-left uses the
       full-bleed calc to position the rail's left edge at viewport-left + 16,
       so the alabaster-gray-200 strip extends to the viewport's right edge
       while keeping a 16px gutter on the left. */
    .archive-services-accordion__articles-list {
        display: flex;
        flex-direction: row;
        gap: 16px;
        margin: 0 0 24px 16px;
        width: calc(100% + 4px);
        padding: 16px 0 16px 16px;
        overflow-x: auto;
        background-color: var(--color-alabaster-gray-200);
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 16px;
        -webkit-overflow-scrolling: touch;
    }

    .archive-services-accordion__article {
        flex: 0 0 auto;
        width: 204px;
        scroll-snap-align: start;
    }

    .archive-services-accordion__article:last-child {
        margin-right: 16px;
    }

    /* Card flips to vertical (image+badge stack on top, body below) and
       loses its inset chrome so the rail reads as a flick-through gallery.
       height: 100% fills the article li (which the flex row stretches to
       match the tallest card), so the body can grow and push the CTA to
       a consistent baseline across cards. */
    .archive-services-accordion__article-link {
        display: flex;
        flex-direction: column;
        gap: 0;
        height: 100%;
        padding: 0;
        background-color: transparent;
        border: none;
    }

    .archive-services-accordion__article-body {
        flex: 1;
    }

    /* Media (image + overlaid badge) sized to the spec'd 204×221 footprint. */
    .archive-services-accordion__article-media {
        aspect-ratio: 204 / 221;
        margin-bottom: 16px;
    }

    .archive-services-accordion__article-badge {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        text-align: left;
    }

    /* CTA aligns with the body content's left edge instead of the right. */
    .archive-services-accordion__article-cta {
        margin-left: 0;
        margin-right: auto;
    }

    .archive-services-accordion__article-cta::after {
        transform: scaleX(1);
    }
}

@media (max-width: 600px) {
    .archive-services-accordion__toggle {
        padding: 14px 16px;
    }
}
