/*
 * Sitemap page (/sitemap). Every selector is scoped to .ft-sitemap, so no
 * global component changes. Tokens mirror the legal hub (legal-center.css)
 * so the two index pages read as one family, in light and dark mode.
 */
.ft-sitemap {
    --ft-sm-ink: #041133;
    --ft-sm-copy: #465168;
    --ft-sm-line: #dce3ee;
    --ft-sm-surface: #ffffff;
    --ft-sm-soft: #f3f6fb;
    --ft-sm-link: #0146c7;
    --ft-sm-tint: #eef3fc;
    --ft-sm-field: #465168; /* input edge: 7.9:1 on white, above the 3:1 non-text minimum */
    --ft-sm-mark: #ffe44d;
    --ft-sm-mark-ink: #041133;
    --ft-sm-focus: #0146c7;
    font-family: Nunito, Arial, sans-serif;
    color: var(--ft-sm-copy);
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 28px 72px;
    line-height: 1.6;
}

.ft-sitemap *,
.ft-sitemap *::before,
.ft-sitemap *::after {
    box-sizing: border-box;
}

.ft-sitemap [hidden] {
    display: none !important;
}

/* Read by screen readers, not shown */
.ft-sitemap .ft-sitemap__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ft-sitemap a {
    color: var(--ft-sm-link);
}

/* Links inside a sentence need more than colour to stand out (WCAG 1.4.1) */
.ft-sitemap__empty a,
.ft-sitemap__xml a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ft-sitemap a:focus-visible,
.ft-sitemap button:focus-visible,
.ft-sitemap input:focus-visible {
    outline: 3px solid var(--ft-sm-focus);
    outline-offset: 3px;
}

.ft-sitemap h1,
.ft-sitemap h2 {
    font-family: inherit;
    color: var(--ft-sm-ink);
    letter-spacing: -0.025em;
}

/* Hero: breadcrumb, headline, lead and the filter */
.ft-sitemap__hero {
    max-width: 780px;
    padding-bottom: 32px;
}

.ft-sitemap__crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: -12px 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ft-sm-copy);
}

.ft-sitemap__crumbs a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    text-decoration: none;
}

.ft-sitemap__crumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.ft-sitemap__crumbs [aria-current="page"] {
    color: var(--ft-sm-ink);
}

.ft-sitemap h1 {
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.06;
    margin: 0 0 20px;
}

.ft-sitemap__lead {
    font-size: 18px;
    max-width: 640px;
    margin: 0;
}

.ft-sitemap__search {
    margin-top: 30px;
}

.ft-sitemap__search label {
    display: block;
    margin-bottom: 8px;
    color: var(--ft-sm-ink);
    font-size: 16px;
    font-weight: 800;
}

.ft-sitemap__field {
    position: relative;
    max-width: 640px;
}

.ft-sitemap__field::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    background-color: var(--ft-sm-copy);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}

.ft-sitemap__field input {
    display: block;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--ft-sm-field);
    border-radius: 10px;
    background: var(--ft-sm-surface);
    color: var(--ft-sm-ink);
    font: inherit;
    font-size: 17px;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.ft-sitemap__field input::placeholder {
    color: var(--ft-sm-copy);
    opacity: 1;
}

.ft-sitemap__field input:focus {
    border-color: var(--ft-sm-focus);
}

.ft-sitemap__status {
    margin: 10px 0 0;
    font-size: 14px;
}

/* Topic index: one jump link per topic, with its page count */
.ft-sitemap__topics {
    border-top: 1px solid var(--ft-sm-line);
    border-bottom: 1px solid var(--ft-sm-line);
    padding: 10px 0;
}

.ft-sitemap__topics ul {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ft-sitemap__topics a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    color: var(--ft-sm-ink);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.ft-sitemap__topics a:hover {
    color: var(--ft-sm-link);
    text-decoration: underline;
    text-underline-offset: 5px;
}

.ft-sitemap__topic-count {
    min-width: 24px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--ft-sm-soft);
    color: var(--ft-sm-copy);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
    text-align: center;
}

/* Directory: topic heading on the left, its pages on the right */
.ft-sitemap__group {
    display: grid;
    grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
    gap: 16px 48px;
    padding: 36px 0;
    border-bottom: 1px solid var(--ft-sm-line);
    scroll-margin-top: 110px;
}

.ft-sitemap__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ft-sitemap__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ft-sm-tint);
    color: var(--ft-sm-link);
    font-size: 17px;
}

.ft-sitemap h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

.ft-sitemap__intro {
    margin: 12px 0 8px;
    font-size: 15px;
    line-height: 1.55;
}

.ft-sitemap__count {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.ft-sitemap__links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    align-content: start;
    column-gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ft-sitemap__links li {
    border-bottom: 1px solid var(--ft-sm-line);
}

.ft-sitemap__links a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 9px 8px;
    border-radius: 6px;
    color: var(--ft-sm-ink);
    font-size: 15.5px;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ft-sitemap__links a:hover {
    background: var(--ft-sm-soft);
    color: var(--ft-sm-link);
}

.ft-sitemap__links a:hover .ft-sitemap__label {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.ft-sitemap__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ft-sitemap__label,
.ft-sitemap__host {
    overflow-wrap: anywhere;
}

.ft-sitemap__host {
    margin-top: 2px;
    color: var(--ft-sm-copy);
    font-size: 13px;
    font-weight: 600;
}

/* Marks links that open another Faciotech site */
.ft-sitemap__ext {
    flex: 0 0 13px;
    width: 13px;
    height: 13px;
    margin-left: auto;
    background-color: currentColor;
    opacity: 0.75;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2.5h4.5V7M13.5 2.5 7 9M11.5 9.5v3.25a.75.75 0 0 1-.75.75h-7.5a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75H6.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2.5h4.5V7M13.5 2.5 7 9M11.5 9.5v3.25a.75.75 0 0 1-.75.75h-7.5a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75H6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Filter matches are highlighted in brand yellow */
.ft-sitemap mark {
    padding: 0 1px;
    border-radius: 3px;
    background: var(--ft-sm-mark);
    color: var(--ft-sm-mark-ink);
}

.ft-sitemap__empty {
    margin: 28px 0 0;
    padding: 20px 22px;
    border-radius: 10px;
    background: var(--ft-sm-soft);
    color: var(--ft-sm-ink);
}

.ft-sitemap__empty p {
    margin: 0;
}

.ft-sitemap__empty p + p {
    margin-top: 8px;
    color: var(--ft-sm-copy);
}

.ft-sitemap__button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 16px;
    padding: 10px 18px;
    border: 1px solid var(--ft-sm-link);
    border-radius: 8px;
    background: var(--ft-sm-surface);
    color: var(--ft-sm-link);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.ft-sitemap__button:hover {
    background: var(--ft-sm-tint);
}

.ft-sitemap__xml {
    margin: 28px 0 0;
    font-size: 14px;
}

/* Dark mode follows the site toggle (html.ft-dark-mode) and the legacy body class */
html.ft-dark-mode .ft-sitemap,
.lagom-dark-mode .ft-sitemap {
    --ft-sm-ink: #f3f6ff;
    --ft-sm-copy: #c4cedf;
    --ft-sm-line: #354360;
    --ft-sm-surface: #101e37;
    --ft-sm-soft: #15243e;
    --ft-sm-link: #91b8ff;
    --ft-sm-tint: #15243e;
    --ft-sm-field: #9ba9bd;
    --ft-sm-focus: #91b8ff;
}

html.ft-dark-mode .ft-sitemap__icon,
.lagom-dark-mode .ft-sitemap__icon {
    border: 1px solid var(--ft-sm-line);
}

/* Tablet: the topic heading sits above its pages */
@media (max-width: 991px) {
    .ft-sitemap__group {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 30px 0;
    }

    .ft-sitemap__intro {
        max-width: 620px;
    }
}

/* Phone */
@media (max-width: 760px) {
    .ft-sitemap {
        padding: 34px 20px 52px;
    }

    .ft-sitemap__hero {
        padding-bottom: 26px;
    }

    .ft-sitemap__lead {
        font-size: 16px;
    }

    .ft-sitemap__topics ul {
        gap: 0 20px;
    }

    .ft-sitemap__topics a {
        font-size: 14px;
    }

    .ft-sitemap__group {
        padding: 26px 0;
    }

    .ft-sitemap h2 {
        font-size: 20px;
    }

    .ft-sitemap__links a {
        min-height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ft-sitemap__links a {
        transition: none;
    }
}

@media print {
    .ft-sitemap {
        max-width: none;
        padding: 0;
    }

    .ft-sitemap__search,
    .ft-sitemap__topics,
    .ft-sitemap__empty {
        display: none !important;
    }

    .ft-sitemap__group {
        break-inside: avoid;
    }
}
