.tsp-sitemap-page__content {
    padding-block-start: clamp(32px, 5vw, 72px);
}

.tsp-sitemap-page__content > :not(.tsp-sitemap-contact, .alignfull) {
    width: min(var(--content-width), calc(100% - var(--page-padding) * 2));
    margin-inline: auto;
}

.tsp-html-sitemap {
    margin-block: clamp(28px, 4vw, 56px);
}

.tsp-html-sitemap > h2 {
    margin-block-end: clamp(16px, 2vw, 26px);
    padding-inline-start: 14px;
    border-inline-start: 3px solid var(--stroke-accent);
    font-size: var(--h4);
    line-height: 1.15;
}

.tsp-richtext .tsp-html-sitemap ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tsp-richtext .tsp-html-sitemap .tsp-html-sitemap__roots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 10px 16px;
}

.tsp-html-sitemap li {
    position: relative;
    min-width: 0;
}

.tsp-html-sitemap li > a {
    display: block;
    padding: 10px 12px;
    line-height: 1.45;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: .18em;
    transition: text-decoration-color 140ms ease;
}

.tsp-html-sitemap li:has(> details) > a {
    padding-inline-end: 52px;
}

.tsp-html-sitemap--pages .tsp-html-sitemap__roots > li {
    border-block-start: 1px solid var(--stroke-tertiary);
}

.tsp-html-sitemap--pages .tsp-html-sitemap__roots > li > a {
    padding-inline-start: 0;
}

.tsp-html-sitemap--catalogue .tsp-html-sitemap__roots > li {
    background: var(--background-secondary);
    border: 1px solid var(--stroke-tertiary);
}

.tsp-html-sitemap--catalogue .tsp-html-sitemap__roots > li > a {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding-block: 14px;
    padding-inline-start: clamp(12px, 1.5vw, 20px);
}

.tsp-html-sitemap--catalogue .tsp-html-sitemap__roots:not(:has(details[open])) {
    align-items: stretch;
}

.tsp-html-sitemap--catalogue .tsp-html-sitemap__roots:not(:has(details[open])) > li > a {
    height: 100%;
}

.tsp-html-sitemap li > a:hover {
    text-decoration-color: currentColor;
}

.tsp-html-sitemap summary {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    cursor: pointer;
    list-style: none;
}

.tsp-html-sitemap--catalogue .tsp-html-sitemap__roots > li > details > summary {
    inset-block-start: 10px;
    inset-inline-end: 6px;
    background: var(--background-primary);
}

.tsp-html-sitemap--catalogue .tsp-html-sitemap__roots > li > details:not([open]) > summary {
    inset-block-start: 50%;
    transform: translateY(-50%);
}

.tsp-html-sitemap summary > span {
    display: none;
}

.tsp-html-sitemap summary::-webkit-details-marker {
    display: none;
}

.tsp-html-sitemap summary::before,
.tsp-html-sitemap summary::after {
    grid-area: 1 / 1;
    width: 12px;
    height: 1px;
    background: currentColor;
    content: "";
}

.tsp-html-sitemap summary::after {
    transform: rotate(90deg);
}

.tsp-html-sitemap details[open] > summary::after {
    transform: none;
}

.tsp-html-sitemap details[open] > summary {
    color: var(--text-accent);
}

.tsp-html-sitemap summary:hover,
.tsp-html-sitemap a:hover {
    color: var(--text-accent);
}

.tsp-html-sitemap :is(summary, a):focus-visible {
    outline: 2px solid var(--stroke-accent);
    outline-offset: -2px;
}

.tsp-richtext .tsp-html-sitemap details > ul {
    margin: 0 8px 10px 14px;
    padding-inline-start: 4px;
    border-inline-start: 1px solid var(--stroke-tertiary);
}

.tsp-html-sitemap details > ul > li + li {
    border-block-start: 1px solid var(--stroke-tertiary);
}

.tsp-sitemap-contact .contact {
    row-gap: 28px;
}

.tsp-sitemap-contact .inquiry textarea {
    min-height: 84px;
}

@media (min-width: 1440px) {
    .tsp-richtext .tsp-html-sitemap .tsp-html-sitemap__roots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .tsp-richtext .tsp-html-sitemap .tsp-html-sitemap__roots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .tsp-richtext .tsp-html-sitemap .tsp-html-sitemap__roots { grid-template-columns: minmax(0, 1fr); }
    .tsp-html-sitemap--pages .tsp-html-sitemap__roots { row-gap: 0; }
    .tsp-sitemap-contact .contact > * { grid-column: 1 / -1; }
    .tsp-sitemap-contact .contact__links { margin-block-start: 24px; }
    .tsp-sitemap-contact .inquiry input:not([type="checkbox"]) { min-height: 48px; padding-block: 12px; }
    .tsp-sitemap-contact .inquiry textarea { min-height: 76px; padding-block: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .tsp-html-sitemap li > a { transition: none; }
}

.tsp-html-sitemap--tree {
    --tree-inset: clamp(16px, 3vw, 40px);
    --tree-line: clamp(10px, 2vw, 28px);
    border-block-start: 3px solid var(--stroke-accent);
    padding-block-start: 10px;
}

.tsp-richtext .tsp-html-sitemap--tree .tsp-linear__list .tsp-linear__list {
    margin: 0 0 0 14px;
    padding-inline-start: var(--tree-inset);
    border-inline-start: 1px solid var(--stroke-tertiary);
}

.tsp-html-sitemap--tree .tsp-linear__list .tsp-linear__list > .tsp-linear__node::before {
    content: "";
    position: absolute;
    inset-inline-start: calc(-1 * var(--tree-inset));
    inset-block-start: 21px;
    width: var(--tree-line);
    border-block-start: 1px solid var(--stroke-tertiary);
}

.tsp-html-sitemap--tree .tsp-linear__node > .tsp-linear__label {
    display: block;
    min-height: 42px;
    padding: 9px 0;
    line-height: 1.45;
}

.tsp-html-sitemap--tree .tsp-linear__node:has(> details) > .tsp-linear__label {
    padding-inline-start: 42px;
}

.tsp-html-sitemap--tree .tsp-linear__node > details > summary {
    inset-block-start: 2px;
    inset-inline: 0 auto;
    width: 38px;
    height: 38px;
}

.tsp-html-sitemap--tree :is(.tsp-linear__node--home, .tsp-linear__node--catalogue) > .tsp-linear__label {
    font-size: clamp(18px, 2vw, 24px);
}

.tsp-html-sitemap--tree .tsp-linear__node--catalogue > .tsp-linear__label {
    color: var(--text-accent);
}

.tsp-html-sitemap--tree .tsp-linear__node--catalogue > details .tsp-linear__node details .tsp-linear__label {
    color: var(--text-secondary);
}

.tsp-html-sitemap--tree .tsp-linear__node--catalogue > details .tsp-linear__node details .tsp-linear__label:hover {
    color: var(--text-accent);
}

.tsp-html-sitemap--tree .tsp-linear__node details > ul > li + li {
    border-block-start: 0;
}

.tsp-sitemap-page__heading {
    margin-block-end: clamp(26px, 4vw, 52px);
}

.tsp-sitemap-page__content > .tsp-sitemap-page__heading + .tsp-html-sitemap--tree {
    margin-block-start: 0;
}

.tsp-sitemap-cta-slot {
    margin-block-end: clamp(28px, 4vw, 56px);
}

.tsp-sitemap-cta {
    container-type: inline-size;
    padding: clamp(22px, 2.6vw, 36px);
}

.tsp-sitemap-cta h2 {
    font-size: clamp(22px, 9.6cqi, 36px);
    line-height: 1.12;
    white-space: pre-line;
}

.tsp-sitemap-cta p {
    margin-block-start: 16px;
    color: var(--text-tertiary);
    line-height: 1.45;
}

.tsp-sitemap-cta .button {
    width: 100%;
    justify-content: space-between;
    margin-block-start: 28px;
}

@media (min-width: 960px) {
    .tsp-sitemap-page__content:has(> .tsp-sitemap-cta-slot):has(> .tsp-html-sitemap--tree) {
        --map-width: min(var(--content-width), calc(100% - var(--page-padding) * 2));
        --map-gap: clamp(28px, 4vw, 60px);
        --cta-width: clamp(288px, 28vw, 366px);
        display: grid;
        grid-template-columns:
            [full-start] minmax(0, 1fr)
            [body-start] calc(var(--map-width) - var(--map-gap) - var(--cta-width))
            [map-end] var(--map-gap)
            [cta-start] var(--cta-width)
            [body-end] minmax(0, 1fr)
            [full-end];
    }

    .tsp-sitemap-page__content:has(> .tsp-sitemap-cta-slot):has(> .tsp-html-sitemap--tree) > * {
        grid-column: body-start / body-end;
        width: 100%;
        margin-inline: 0;
    }

    .tsp-sitemap-page__content:has(> .tsp-sitemap-cta-slot) > .tsp-html-sitemap--tree {
        grid-column: body-start / map-end;
    }

    .tsp-sitemap-page__content:has(> .tsp-html-sitemap--tree) > .tsp-sitemap-cta-slot {
        grid-column: cta-start / body-end;
    }

    .tsp-sitemap-page__content:has(> .tsp-html-sitemap--tree) > .tsp-sitemap-cta-slot > .tsp-sitemap-cta {
        position: sticky;
        inset-block-start: 24px;
        max-height: calc(100dvh - 48px);
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .tsp-sitemap-page__content:has(> .tsp-sitemap-cta-slot):has(> .tsp-html-sitemap--tree) > :is(.tsp-sitemap-contact, .alignfull) {
        grid-column: full-start / full-end;
    }
}

@media (max-width: 799px) {
    .tsp-html-sitemap--tree { --tree-inset: 14px; --tree-line: 10px; }
    .tsp-richtext .tsp-html-sitemap--tree .tsp-linear__list .tsp-linear__list { margin-inline-start: 8px; }
}
