/* --- SITE FOOTER --- */
.site-footer {
    padding: var(--footer-padding, 80px 5% 40px 5%);
    border-top: var(--footer-top-border, none);
    position: relative;
    max-width: var(--content-max-width, var(--footer-max-width, 1200px));
    margin: 0 auto;
}

.footer-container {
    margin: 0 auto;
}

.footer-logo-wrapper {
    text-align: center;
    margin-bottom: var(--footer-logo-margin-bottom, 60px);
}

.footer-logo {
    height: var(--footer-logo-height, 50px);
    width: auto;
    object-fit: contain;
    /* the global img reset makes this display:block, so the wrapper's
       text-align:center has no effect on it — center it directly instead. */
    margin: 0 auto;
}

/* flex, not a fixed grid-template-columns: the number of columns varies per
   brand (data.columns length, plus the optional about/signup columns), and a
   fixed column count leaves dead space whenever fewer columns are present
   than the template expects. Flex always fills the row exactly. */
.footer-grid {
    /* Default: the six-column grid. --footer-grid-display: flex switches to a
       wrapping row of flexible columns (about / links / signup layouts, with
       --footer-grid-wrap: wrap and --footer-col-flex); the flex-only properties
       below default to their initial values, so the grid is unchanged. */
    display: var(--footer-grid-display, grid);
    grid-template-columns: repeat(6, 1fr);
    flex-wrap: var(--footer-grid-wrap, nowrap);
    justify-content: var(--footer-grid-justify, normal);
    gap: var(--footer-grid-gap, 30px);
    margin-bottom: var(--footer-grid-margin-bottom, 60px);
}

.footer-col {
    flex: var(--footer-col-flex, 0 1 auto);
    min-width: var(--footer-col-min-width, auto);
}

.footer-col-title {
    font-size: var(--footer-col-title-size, 13px);
    font-weight: var(--footer-col-title-weight, 800);
    color: var(--footer-text-color, var(--color-text-light));
    margin-bottom: 20px;
    text-transform: var(--footer-col-title-transform, uppercase);
    letter-spacing: 0.5px;
    white-space: var(--footer-col-title-white-space, nowrap);
}

/* .footer-links: the earlier name of this list, kept as an alias. */
.footer-links,
.footer-col-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--footer-links-gap, 12px);
}

.footer-link {
    font-size: var(--footer-link-size, 13px);
    line-height: var(--footer-link-line-height, normal);
    color: var(--footer-text-color, var(--color-text-light));
    text-decoration: none;
    opacity: var(--footer-link-opacity, 0.75);
    transition: opacity 0.2s;
}

.footer-link:hover {
    color: var(--color-footer-link-hover, var(--color-primary));
    opacity: 1;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: var(--footer-socials-gap, 30px);
    margin-bottom: 40px;
    border-top: 1px solid var(--footer-text-color, var(--color-text-light));
    padding-top: 40px;
}

/* Nested in the signup column (see footer.html.twig): a short row under the
   form, not a full-width divided section, so the standalone rule's border/
   spacing/centering don't apply here. */
.footer-col--signup .footer-socials {
    justify-content: flex-start;
    gap: var(--footer-signup-socials-gap, 16px);
    margin-bottom: 0;
    border-top: none;
    padding-top: 0;
    margin-top: var(--footer-signup-socials-margin-top, 20px);
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: bold;
    color: var(--footer-text-color, var(--color-text-light));
    text-decoration: none;
    opacity: var(--footer-social-opacity, 0.8);
    transition: opacity 0.2s;
    /* Also used on a <button> (the search toggle) alongside the usual <a>
       social links — resets browser button chrome; harmless on an <a>. */
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

.footer-social-link:hover {
    opacity: 1;
}

.social-icon {
    width: var(--footer-social-icon-size, 26px);
    height: var(--footer-social-icon-size, 26px);
    vertical-align: middle;
}

.footer-separator-row {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.footer-separator-line {
    flex: 1;
    height: 1px;
    background-color: var(--footer-separator-color, var(--footer-text-color, var(--color-text-light)));
    opacity: 0.35;
}

.footer-back-to-top-link {
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 1px;
}

.footer-bottom {
    border-top: var(--footer-bottom-border-top, 1px solid var(--footer-text-color, var(--color-text-light)));
    padding-top: var(--footer-bottom-padding-top, 30px);
    display: flex;
    flex-direction: column;
    align-items: var(--footer-bottom-align, center);
    gap: 20px;
}

.footer-legal-links {
    display: flex;
    gap: 35px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-legal-link {
    font-size: 12px;
    color: var(--footer-text-color, var(--color-text-light));
    text-decoration: none;
    opacity: 0.55;
    transition: opacity 0.2s;
}

.footer-legal-link:hover {
    color: var(--color-footer-link-hover, var(--color-primary));
    opacity: 0.9;
}

.footer-copyright,
.footer-copyright p {
    font-size: var(--footer-copyright-size, 12px);
    color: var(--footer-copyright-color, var(--footer-text-color, var(--color-text-light)));
    text-align: var(--footer-copyright-align, center);
}

/* --- ABOUT / SIGNUP COLUMNS (opt-in, see footer.html.twig) --- */
.footer-col--about,
.footer-col--signup {
    flex: var(--footer-col-wide-flex, 2 1 0);
}

.footer-col-text {
    font-family: var(--font-family-body, inherit);
    font-size: var(--footer-col-text-size, 13px);
    font-weight: var(--footer-col-text-weight, normal);
    color: var(--footer-text-color, var(--color-text-light));
    opacity: var(--footer-col-text-opacity, 0.75);
    line-height: var(--footer-col-text-line-height, 1.5);
}

.footer-signup-form {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid var(--footer-text-color, var(--color-text-light));
    border-radius: var(--footer-signup-border-radius, 100px);
    padding: var(--footer-signup-padding, 12px 18px);
}

.footer-signup-form input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1 1 auto;
    /* An input's automatic min width is its ~20-character intrinsic size,
       which would push a narrow signup column past the page edge. */
    min-width: 0;
    color: var(--footer-text-color, var(--color-text-light));
    font-size: var(--footer-signup-input-size, 14px);
    font-family: inherit;
    text-transform: var(--footer-signup-input-transform, none);
}

.footer-signup-form input::placeholder {
    color: var(--footer-text-color, var(--color-text-light));
    opacity: var(--footer-signup-placeholder-opacity, 0.6);
}

/* Visually hidden, not display:none: stays focusable and announced by screen
   readers (Enter also submits the form) for brands whose design shows no
   visible submit control, without dropping real accessibility/keyboard use. */
.footer-signup-form button {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- MOBILE-CONDENSED (opt-in, see footer.html.twig data.mobileCondensed) ---
   Both hidden by default (desktop and non-condensed brands never show them);
   the media query below reveals them only on mobile, only for a condensed
   footer. */
.footer-socials--top,
.footer-contact {
    display: none;
}

.footer-contact-title,
.footer-contact-phone {
    font-family: var(--font-family-body, inherit);
    font-size: var(--footer-link-size, 24px);
    font-weight: var(--footer-col-title-weight, 800);
    text-transform: uppercase;
    color: var(--footer-text-color, var(--color-text-light));
}

.footer-contact-phone {
    display: block;
    margin-top: 14px;
    text-decoration: none;
}

/* --- RESPONSIVE MOBILE STYLES (max-width: 768px) --- */
/* Narrow tablets: a long column title can be wider than its column. */
@media (min-width: 769px) and (max-width: 1024px) {
    .footer-col-title {
        white-space: var(--footer-col-title-white-space-tablet, var(--footer-col-title-white-space, nowrap));
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        flex-direction: var(--footer-grid-direction-mobile, row);
        gap: 30px;
        margin-bottom: 40px;
    }
    .footer-col,
    .footer-col--about,
    .footer-col--signup {
        flex-basis: auto;
        text-align: left !important;
    }
    .footer-logo-wrapper {
        margin-bottom: 40px !important;
    }
    .footer-socials {
        flex-wrap: wrap !important;
        gap: 15px 25px !important;
        justify-content: center !important;
    }
    .footer-legal-links {
        /* Stack the legal links one per line (matches live mobile), rather than
           wrapping several onto a row. */
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    /* mobileCondensed brands only (Lindahls today): about/signup columns
       drop out entirely on mobile instead of just stacking, replaced by the
       standalone socials row + optional contact block placed right under
       the logo (see footer.html.twig), and the remaining link column +
       copyright switch from left- to center-aligned. */
    .site-footer--mobile-condensed .footer-col--about,
    .site-footer--mobile-condensed .footer-col--signup {
        display: none;
    }
    /* Sizing/spacing of the condensed layout. Every value is a -mobile token
       falling back to what this block rendered before, so a brand that sets
       none of them is unchanged. The !important on the gaps/margins only
       matches the generic mobile rules above, which carry it themselves. */
    .site-footer--mobile-condensed {
        padding: var(--footer-padding-mobile, var(--footer-padding, 80px 5% 40px 5%));
    }
    .site-footer--mobile-condensed .footer-logo-wrapper {
        margin-bottom: var(--footer-block-gap-mobile, 40px) !important;
    }
    .site-footer--mobile-condensed .footer-logo {
        width: var(--footer-logo-width-mobile, auto);
        height: var(--footer-logo-height-mobile, var(--footer-logo-height, 50px));
    }
    .site-footer--mobile-condensed .footer-socials--top {
        display: flex;
        gap: var(--footer-mobile-socials-gap, 15px 25px) !important;
        margin-bottom: var(--footer-block-gap-mobile, 0px);
        border-top: none;
        padding: var(--footer-mobile-socials-padding, 0);
    }
    .site-footer--mobile-condensed .footer-socials--top .social-icon {
        width: var(--footer-social-icon-size-mobile, var(--footer-social-icon-size, 26px));
        height: var(--footer-social-icon-size-mobile, var(--footer-social-icon-size, 26px));
    }
    .site-footer--mobile-condensed .footer-grid {
        gap: var(--footer-grid-gap-mobile, 30px);
        margin-bottom: var(--footer-block-gap-mobile, 40px);
    }
    .site-footer--mobile-condensed .footer-col-links {
        gap: var(--footer-links-gap-mobile, var(--footer-links-gap, 12px));
    }
    .site-footer--mobile-condensed .footer-link {
        display: var(--footer-link-display-mobile, inline);
        font-weight: var(--footer-link-weight-mobile, inherit);
        font-size: var(--footer-link-size-mobile, var(--footer-link-size, 13px));
        line-height: var(--footer-link-line-height-mobile, var(--footer-link-line-height, normal));
    }
    .site-footer--mobile-condensed .footer-copyright,
    .site-footer--mobile-condensed .footer-copyright p {
        font-size: var(--footer-copyright-size-mobile, var(--footer-copyright-size, 12px));
        line-height: var(--footer-copyright-line-height-mobile, inherit);
    }
    .site-footer--mobile-condensed .footer-contact {
        display: block;
        text-align: center;
    }
    .site-footer--mobile-condensed .footer-col {
        text-align: center !important;
    }
    .site-footer--mobile-condensed .footer-col-links {
        align-items: center;
    }
    .site-footer--mobile-condensed .footer-link {
        font-family: var(--font-family-body, inherit);
        text-transform: uppercase;
    }
    .site-footer--mobile-condensed .footer-bottom {
        align-items: center;
    }
    .site-footer--mobile-condensed .footer-copyright,
    .site-footer--mobile-condensed .footer-copyright p {
        text-align: center;
    }
}
