/* Shared site footer.
 * Markup is written into each page by svashasan-deploy/footer/apply-footer.py.
 * Plain CSS (no Tailwind) so it renders the same on every page, whatever the
 * page itself is built with. Values mirror the Tailwind design approved on the homepage.
 */

.site-footer,
.site-footer * {
    box-sizing: border-box;
}

.site-footer {
    margin-top: auto;
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    color: #374151;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    overflow: hidden;
}

.site-footer .sf-container {
    width: 100%;
    margin: 0 auto;
    padding: 56px 16px 0;
}
@media (min-width: 640px)  { .site-footer .sf-container { max-width: 640px; } }
@media (min-width: 768px)  { .site-footer .sf-container { max-width: 768px; padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) { .site-footer .sf-container { max-width: 1024px; } }
@media (min-width: 1280px) { .site-footer .sf-container { max-width: 1280px; } }
@media (min-width: 1536px) { .site-footer .sf-container { max-width: 1536px; } }

/* Columns: one under another until desktop, then six across */
.site-footer .sf-grid {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 40px;
    column-gap: 32px;
}
@media (min-width: 1024px) {
    .site-footer .sf-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.site-footer .sf-brand img {
    display: block;
    height: 40px;
    width: auto;
    object-fit: contain;
}
.site-footer .sf-brand p {
    margin: 16px 0 0;
    max-width: 20rem;
    color: #6B7280;
    font-size: 14px;
    line-height: 1.625;
}
/* Registered office address under the tagline. Colours come from the tagline rule
   above (and its dark-mode rule), so only the size and spacing are set here. */
.site-footer .sf-brand .sf-address {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.6;
}
.site-footer .sf-address-label {
    display: block;
    font-weight: 600;
}

.site-footer .sf-heading {
    margin: 0 0 16px;
    padding: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: normal;
    text-transform: none;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer .sf-col li + li {
    margin-top: 12px;
}
.site-footer li {
    margin: 0;
    padding: 0;
}
.site-footer li::before,
.site-footer li::marker {
    content: none;
}

.site-footer a {
    color: #4B5563;
    text-decoration: none;
    font-weight: 400;
}
.site-footer a:hover {
    color: #111827;
    text-decoration: underline;
}
.site-footer a:focus-visible {
    outline: 2px solid #1E1A4D;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Bottom bar: copyright, legal links, social icons */
.site-footer .sf-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
@media (min-width: 1024px) {
    .site-footer .sf-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.site-footer .sf-copy {
    margin: 0;
    color: #6B7280;
}
.site-footer .sf-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
}
.site-footer .sf-social {
    display: flex;
    align-items: center;
    gap: 12px;
}
.site-footer .sf-social a {
    display: inline-flex;
    padding: 8px;
    border-radius: 9999px;
    transition: background-color 0.2s;
}
.site-footer .sf-social a:hover {
    background: #E5E7EB;
    text-decoration: none;
}
.site-footer .sf-social img {
    display: block;
    width: 20px;
    height: 20px;
}

/* Preferences in the bottom bar: language menu and the dark mode switch
   (added by lang-switch.js and /scripts/theme.js). Dark colours are in dark-mode.css. */
.site-footer .sf-prefs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.site-footer .theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    margin: 0;
    padding: 0 6px 0 10px;
    border: 1px solid #E5E7EB;
    border-radius: 9999px;
    background: #FFFFFF;
    color: #4B5563;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
.site-footer .theme-switch:hover {
    border-color: #9CA3AF;
    color: #111827;
}
.site-footer .theme-switch:focus-visible {
    outline: 2px solid #1E1A4D;
    outline-offset: 2px;
}
.site-footer .theme-switch svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}
.site-footer .theme-switch-track {
    position: relative;
    flex: none;
    width: 30px;
    height: 18px;
    border-radius: 9999px;
    background: #D1D5DB;
    transition: background-color 0.2s ease;
}
.site-footer .theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}
.site-footer .theme-switch[aria-checked="true"] .theme-switch-track {
    background: #6366F1;
}
.site-footer .theme-switch[aria-checked="true"] .theme-switch-thumb {
    transform: translateX(12px);
}
@media (prefers-reduced-motion: reduce) {
    .site-footer .theme-switch-track,
    .site-footer .theme-switch-thumb { transition: none; }
}

/* Oversized wordmark: only the upper part shows, cut off by the page bottom */
.site-footer .sf-wordmark {
    margin-top: 40px;
    user-select: none;
    pointer-events: none;
}
.site-footer .sf-wordmark svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Collapsible columns on small screens, in the style of Apple's footer.
   /scripts/site-footer.js adds .sf-js to the footer and a toggle button to each
   heading. Below 1024px (where the columns stack) each column is a row with a
   chevron and a divider, and its links open on tap. Without JavaScript nothing
   here applies and every list stays open. Desktop is unchanged. */
.site-footer .sf-toggle {
    display: none;
}
@media (max-width: 1023px) {
    .site-footer.sf-js .sf-grid {
        row-gap: 0;
    }
    .site-footer.sf-js .sf-brand {
        margin-bottom: 32px;
    }
    .site-footer.sf-js .sf-col {
        border-bottom: 1px solid #E5E7EB;
    }
    .site-footer.sf-js .sf-brand + .sf-col {
        border-top: 1px solid #E5E7EB;
    }
    .site-footer.sf-js .sf-heading {
        margin: 0;
    }
    .site-footer.sf-js .sf-heading-text {
        display: none;
    }
    .site-footer.sf-js .sf-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        margin: 0;
        padding: 12px 0;
        border: 0;
        border-radius: 0;
        background: none;
        color: #111827;
        font: inherit;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .site-footer.sf-js .sf-toggle:hover {
        color: #000000;
    }
    .site-footer.sf-js .sf-toggle:focus-visible {
        outline: 2px solid #1E1A4D;
        outline-offset: -2px;
        border-radius: 4px;
    }
    .site-footer.sf-js .sf-toggle-icon {
        flex: none;
        width: 11px;
        height: 6px;
        color: #6B7280;
        transition: transform 0.3s ease;
    }
    .site-footer.sf-js .sf-col.sf-open .sf-toggle-icon {
        transform: rotate(180deg);
    }
    .site-footer.sf-js .sf-col ul {
        display: none;
        padding: 0 0 16px;
    }
    .site-footer.sf-js .sf-col.sf-open ul {
        display: block;
        animation: sf-reveal 0.3s ease;
    }
    .site-footer.sf-js .sf-col li + li {
        margin-top: 0;
    }
    .site-footer.sf-js .sf-col a {
        display: block;
        padding: 6px 14px;
    }
}
@keyframes sf-reveal {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .site-footer.sf-js .sf-toggle-icon { transition: none; }
    .site-footer.sf-js .sf-col.sf-open ul { animation: none; }
}

/* Partner pages: the content column sits 35% from the left beside a fixed image.
   Stretch the footer back to full page width over that image on desktop. */
@media (min-width: 1025px) {
    .content-wrapper > .site-footer,
    .content > .site-footer {
        margin-left: -53.8462%;   /* 35% of the page, as a share of the 65% column */
        width: 153.8462%;         /* 100% of the page */
    }
    /* Lift the column above the fixed image (z-index 20) so the widened footer covers it.
       The column itself never overlaps the image, so nothing else changes. */
    .content-wrapper:has(> .site-footer),
    .content:has(> .site-footer) {
        z-index: 25;
    }
}
