/* =============================================================
   CT Footer — new global footer (isolated).
   Implemented from Figma: desktop node 4677-7583, mobile node 4677-7979.
   Namespaced under .ctf so it never collides with the existing footer.
   Tokens: Union Blue #1C2136, Body shade #242A42, CT White #FFFFFF,
   Petit Serif (eyebrow/headings), Lato (body).
   ============================================================= */

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

.ctf {
    background-color: #1c2136;
    color: rgba(255, 255, 255, 1);
    font-family: "Lato", sans-serif;
}

/* ---------- Shaded body ---------- */
.ctf__body {
    background-color: #242a42;
    /* Full-width background, but inner content aligned to the SAME 1340px
       centred grid as the header (.cth__main) so it lines up with the logo.
       The horizontal padding equals the header's auto side-margin; floors at
       20px on narrow screens. */
    padding-top: 88px;
    padding-bottom: 56px;
    padding-inline: max(20px, calc((100% - 1340px) / 2));
    display: flex;
    flex-direction: column;
    gap: 56px;
}

/* ---------- Desktop link columns ---------- */
.ctf__columns--desktop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
}

.ctf__col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ctf__col-heading {
    margin: 0;
    font-family: "Petit Serif", "Petit", Georgia, serif;
    font-weight: 500;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 1);
}

.ctf__col-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ctf__col-links li {
    margin: 0;
}

.ctf__col-links a,
.ctf__col-links span {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.15;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.ctf__col-links a:hover {
    opacity: 0.75;
}

/* ---------- Social icons ---------- */
.ctf__socials {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ctf__social {
    display: inline-flex;
    width: 32px;
    height: 32px;
    transition: opacity 0.15s ease;
}

.ctf__social:hover {
    opacity: 0.8;
}

.ctf__social img {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------- Newsletter (desktop column) ---------- */
.ctf__col--newsletter {
    max-width: 470px;
}

.ctf__news-body {
    margin: 0;
    font-family: "Lato", sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.15;
    color: rgba(255, 255, 255, 0.75);
}

.ctf__news-form {
    width: 100%;
}

.ctf__news-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* Three interaction states (Figma 5071:187):
       Rest  -> border 60% white
       Hover -> border 80% white
       Focus -> border 100% white */
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    padding: 10px 0 15px;
    transition: border-color 0.15s ease;
}

.ctf__news-field:hover {
    border-bottom-color: rgba(255, 255, 255, 0.8);
}

.ctf__news-field:focus-within {
    border-bottom-color: #ffffff;
}

.ctf__news-input {
    flex: 1 1 auto;
    background: transparent;
    border: 0;
    outline: none;
    font-family: "Lato", sans-serif;
    font-size: 20px;
    line-height: 1.15;
    color: #ffffff;
    /* Native caret colour matches the Figma white caret on focus. */
    caret-color: #ffffff;
    padding: 0;
}

/* Rest: placeholder at 60% white. */
.ctf__news-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
    transition: color 0.15s ease;
}

/* Hover: placeholder brightens to 80%. */
.ctf__news-field:hover .ctf__news-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

/* Focus: typed text is solid white; placeholder (if shown) stays at 60%. */
.ctf__news-field:focus-within .ctf__news-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ctf__news-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.15s ease;
}

/* Standard site arrow (resources/images/arrow-right.svg) — inherits `color`. */
.ctf__news-submit svg {
    display: block;
    width: 22px;
    height: 11px;
}

/* Arrow tracks the field state: brighter on hover, full white on focus/arrow hover. */
.ctf__news-field:hover .ctf__news-submit {
    color: rgba(255, 255, 255, 0.8);
}

.ctf__news-field:focus-within .ctf__news-submit,
.ctf__news-submit:hover {
    color: #ffffff;
}

.ctf__news-message {
    margin-top: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 1);
}

/* ---------- Loading state (while the AJAX subscribe is in flight) ---------- */
.ctf__news-form.is-loading {
    cursor: progress;
}

.ctf__news-form.is-loading .ctf__news-input {
    pointer-events: none;
    opacity: 0.7;
}

/* Desktop: hide the arrow glyph and show a spinner in the submit button. */
.ctf__news-form.is-loading .ctf__news-submit {
    cursor: progress;
}

.ctf__news-form.is-loading .ctf__news-submit svg {
    display: none;
}

.ctf__news-form.is-loading .ctf__news-submit::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ctf-news-spin 0.6s linear infinite;
}

/* Mobile subscribe button loading state (flex centering is set in the mobile
   media query below where the button is shown). */
.ctf__news-button--mobile:disabled {
    opacity: 0.7;
    cursor: progress;
}

.ctf__news-form.is-loading .ctf__news-button--mobile::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(28, 33, 54, 0.35);
    border-top-color: #1c2136;
    border-radius: 50%;
    animation: ctf-news-spin 0.6s linear infinite;
    flex: 0 0 auto;
}

@keyframes ctf-news-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Divider ---------- */
.ctf__divider {
    height: 1px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.3);
}

/* ---------- Trust row ---------- */
.ctf__trust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 45px;
    width: 100%;
}

.ctf__logo {
    display: inline-flex;
    flex: 0 0 auto;
}

.ctf__logo img {
    height: 65px;
    width: auto;
    display: block;
    object-fit: contain;
}

.ctf__badges {
    display: flex;
    align-items: center;
    gap: 45px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ctf__badge {
    display: inline-flex;
    align-items: center;
}

.ctf__badge img {
    height: 60px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* SVG badges that are complete artwork (with their own background) render as-is. */
.ctf__badge--asis img {
    filter: none;
}

/* ---------- Legal bar ---------- */
.ctf__legal {
    background-color: #1c2136;
    /* Same 1340px centred grid as the body/header (see .ctf__body). */
    padding-top: 28px;
    padding-bottom: 32px;
    padding-inline: max(20px, calc((100% - 1340px) / 2));
    /* Desktop: legal links and copyright on one line (links left, copyright right).
       Mobile stacks them vertically (overridden in the media query). */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px 40px;
    flex-wrap: wrap;
}

.ctf__legal-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.ctf__legal-links a,
.ctf__legal-links span,
.ctf__copyright {
    font-family: "Lato", sans-serif;
    font-size: 15px;
    line-height: 1.15;
    color: #ffffff;
    opacity: 1;
    text-decoration: none;
}

.ctf__legal-links a:hover {
    opacity: 1;
}

.ctf__copyright {
    margin: 0;
}

/* ---------- Mobile pieces hidden on desktop ---------- */
.ctf__columns--mobile {
    display: none;
}

/* =============================================================
   MOBILE (<= 767px)
   ============================================================= */
@media screen and (max-width: 767px) {
    .ctf__body {
        padding: 40px 20px 48px;
        gap: 40px;
    }

    /* Hide the desktop column row, show the mobile accordions. */
    .ctf__columns--desktop {
        display: none;
    }

    .ctf__columns--mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* Accordions */
    .ctf__accordions>.ctf__acc {
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }

    .ctf__acc-header {
        width: 100%;
        background: transparent;
        border: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 0;
        color: rgba(255, 255, 255, 1);
    }

    .ctf__acc-title {
        font-family: "Petit Serif", "Petit", Georgia, serif;
        font-weight: 500;
        font-size: 16px;
        line-height: 1.1;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 1);
    }

    /* Plus / minus toggle icon — same glyph treatment as the mobile header. */
    .ctf__acc-icon {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        font-family: "Lato", sans-serif;
        font-weight: 500;
        font-size: 22px;
        line-height: 1;
        color: #ffffff;
    }

    .ctf__acc-icon::before {
        content: "+";
    }

    .ctf__acc-icon::after {
        display: none;
    }

    /* Expanded state changes plus to an en dash/minus. */
    .ctf__acc.is-open .ctf__acc-icon::before {
        content: "\2013";
    }

    .ctf__acc-panel {
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
    }

    .ctf__acc.is-open .ctf__acc-panel {
        max-height: 600px;
    }

    .ctf__acc-panel-inner {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 0 0 20px;
    }

    .ctf__acc-panel .ctf__col-links a,
    .ctf__acc-panel .ctf__col-links span {
        font-size: 15px;
        font-weight: 500;
    }

    /* Mobile newsletter */
    .ctf__news--mobile {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        /* Separate the newsletter from the accordion group above (the last
           accordion's bottom border otherwise sits flush against this heading). */
        margin-top: 40px;
    }

    .ctf__news-eyebrow {
        margin: 0;
        font-family: "Petit Serif", "Petit", Georgia, serif;
        font-weight: 500;
        font-size: 16px;
        line-height: 1.1;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 1);
    }

    .ctf__news--mobile .ctf__news-body {
        font-size: 15px;
        font-weight: 500;
    }

    .ctf__news--mobile .ctf__news-field {
        padding: 10px 0 12px;
    }

    .ctf__news--mobile .ctf__news-input {
        font-size: 15px;
    }

    /* White Subscribe button (mobile only) */
    .ctf__news-button--mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        /* Clear separation from the email field above (matches Figma spacing). */
        margin-top: 24px;
        background: #ffffff;
        color: #1c2136;
        border: 0;
        border-radius: 5px;
        padding: 10px 20px 12px;
        font-family: "Lato", sans-serif;
        font-weight: 600;
        font-size: 14px;
        line-height: 1;
        cursor: pointer;
        transition: opacity 0.15s ease;
    }

    .ctf__news-button--mobile:hover,
    .ctf__news-button--mobile:active,
    .ctf__news-button--mobile.is-touch-hover {
        opacity: 0.5;
    }

    /* Trust row stacks on mobile */
    .ctf__trust {
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
    }

    .ctf__logo img {
        height: 48px;
    }

    .ctf__badges {
        gap: 0;
        justify-content: space-between;
        width: 100%;
    }

    .ctf__badge img {
        height: 32px;
    }

    /* Legal bar — stack links above the copyright on mobile (matches Figma). */
    .ctf__legal {
        padding: 28px 20px 32px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 20px;
    }

    .ctf__legal-links {
        gap: 12px 20px;
    }
}

/* Desktop-only hide the mobile newsletter subscribe button if it leaks */
@media screen and (min-width: 768px) {
    .ctf__news-button--mobile {
        display: none;
    }
}