/* =============================================================================
 * Main Footer Navigation (acf/main-footer-navigation)
 *
 * Mobile-first layout.
 * Desktop breakpoint: 768px.
 * BEM naming: .kftheme-mfn__*
 * ========================================================================== */

/* ── Scoped reset ───────────────────────────────────────────────────────────── */

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

/* ── Root ───────────────────────────────────────────────────────────────────── */

.kftheme-mfn {
    background-color: var(--mfn-bg, #1A1A1A);
    color: var(--mfn-text, #FFFFFF);
    padding: 80px 0px;
    font-family: inherit;
    line-height: 1.5;
}

/* =============================================================================
 * CATEGORIES — nav wrapper
 * ========================================================================== */

.kftheme-mfn__categories {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* ── Category wrapper ───────────────────────────────────────────────────────── */

.kftheme-mfn__category {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.kftheme-mfn__category:first-child {
    /* border-top: 1px solid rgba(255, 255, 255, 0.12); */
}

/* =============================================================================
 * TOGGLE BUTTON — visible on mobile only
 * ========================================================================== */

.kftheme-mfn__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    margin: 0;
    background: none;
    border: none;
    color: var(--mfn-text, #FFFFFF);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.kftheme-mfn__toggle:focus-visible {
    outline: 2px solid var(--mfn-text, #FFFFFF);
    outline-offset: -2px;
    border-radius: 2px;
}

.kftheme-mfn__toggle-label {
    flex: 1;
    min-width: 0;
}

/* =============================================================================
 * ICONS — only the variant matching [data-icon] is shown
 * ========================================================================== */

.kftheme-mfn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-left: 12px;
}

/* Hide the inactive variant */
[data-icon="arrow"] .kftheme-mfn__icon--plus,
[data-icon="plus"] .kftheme-mfn__icon--arrow {
    display: none;
}

/* Arrow: rotate 180° when open */
.kftheme-mfn__icon--arrow svg {
    transition: transform 0.3s ease;
}

.kftheme-mfn__toggle[aria-expanded="true"] .kftheme-mfn__icon--arrow svg {
    transform: rotate(180deg);
}

/* Plus → Minus: hide vertical line */
.kftheme-mfn__icon-vertical {
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: center;
}

.kftheme-mfn__toggle[aria-expanded="true"] .kftheme-mfn__icon-vertical {
    opacity: 0;
    transform: scaleY(0);
}

/* =============================================================================
 * PANEL — accordion body, animated with grid-template-rows + visibility
 *
 * visibility: hidden prevents keyboard-tabbing into collapsed content
 * and hides it from assistive tech.  The transition-delay keeps visibility
 * in sync with the grid animation.
 * ========================================================================== */

.kftheme-mfn__panel {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition:
        grid-template-rows 0.3s ease,
        visibility 0s linear 0.3s;          /* flip hidden AFTER collapse ends */
}

.kftheme-mfn__toggle[aria-expanded="true"] + .kftheme-mfn__panel {
    grid-template-rows: 1fr;
    visibility: visible;
    transition:
        grid-template-rows 0.3s ease,
        visibility 0s linear 0s;            /* flip visible IMMEDIATELY */

    padding-bottom: 20px;
}

/* ── Columns wrapper — inner child that collapses via overflow ──────────────── */

.kftheme-mfn__columns {
    overflow: hidden;
    min-height: 0;
}

/* =============================================================================
 * CATEGORY TITLE — desktop only, inside first column
 * ========================================================================== */

.kftheme-mfn__cat-title {
    display: none;                          /* hidden on mobile; toggle has label */
    margin: 0 0 12px;
    padding: 0;

    font-weight: 700;
    font-size: var(--wp--preset--font-size--default);
    line-height: 120%;

    margin-bottom: 20px;

    color: var(--mfn-text, #FFFFFF);
}

/* =============================================================================
 * COLUMN
 * ========================================================================== */

.kftheme-mfn__column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 0 16px;
}

.kftheme-mfn__column:last-child {
    padding-bottom: 0;
}

/* =============================================================================
 * LINKS & HEADINGS — inside columns
 * ========================================================================== */

.kftheme-mfn__link {
    display: block;
    color: var(--mfn-link, rgba(255, 255, 255, 0.6));
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;

    text-decoration: none;
    transition: color 0.2s ease;
}

.kftheme-mfn__link:hover,
.kftheme-mfn__link:focus-visible {
    color: var(--mfn-text, #FFFFFF);
}

.kftheme-mfn__heading {
    display: block;
    color: var(--mfn-text, #FFFFFF);
    font-weight: 700;
    font-size: 16px;
    line-height: 19px;
}

/* Space above a heading when it follows a link */
.kftheme-mfn__link + .kftheme-mfn__heading {
    margin-top: 16px;
}

/* =============================================================================
 * BOTTOM BAR — logo, copyright, privacy, social
 * ========================================================================== */

.kftheme-mfn__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    text-align: center;
}

/* ── Logo ───────────────────────────────────────────────────────────────────── */

.kftheme-mfn__logo {
    display: inline-flex;
    line-height: 0;
}

.kftheme-mfn__logo-img {
    display: block;
    height: auto;
}

/* ── Copyright ──────────────────────────────────────────────────────────────── */

.kftheme-mfn__copyright {
    margin: 0;

    font-weight: 400;
    font-size: 14px;
    line-height: 17px;

    color: #FFFFFF;

    position: relative;
}



/* ── Privacy link ───────────────────────────────────────────────────────────── */

.kftheme-mfn__privacy {
    color: var(--mfn-link, rgba(255, 255, 255, 0.67));
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.kftheme-mfn__privacy:hover,
.kftheme-mfn__privacy:focus-visible {
    color: var(--mfn-text, #FFFFFF);
}

/* ── Social icons ───────────────────────────────────────────────────────────── */

.kftheme-mfn__social {
    display: flex;
    align-items: center;
    gap: 16px 40px;
    margin-top: 20px;

    width: 80%;
    justify-content: space-evenly;
}

.kftheme-mfn__social-link {
    display: inline-flex;
    line-height: 0;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.kftheme-mfn__social-link:hover,
.kftheme-mfn__social-link:focus-visible {
    opacity: 1;
}

.kftheme-mfn__social-icon {
    display: block;
    height: auto;
}

/* =============================================================================
 * DESKTOP — ≥ 768px
 * ========================================================================== */

@media (min-width: 768px) {

    .kftheme-mfn {
        padding: 80px 0px;
    }

    /* ── Hide accordion toggle ──────────────────────────────────────────── */

    .kftheme-mfn__toggle {
        display: none;
    }

    /* ── Show category heading inside first column ─────────────────────── */

    .kftheme-mfn__cat-title {
        display: block;
    }

    /* ── Flat column layout via display:contents ───────────────────────── */
    /* Category / panel / columns wrappers dissolve — every              */
    /* .kftheme-mfn__column becomes a direct flex child of categories.    */

    .kftheme-mfn__categories {
        flex-direction: row;
        gap: 32px;
    }

    .kftheme-mfn__category {
        display: contents;
        /* element has no box — borders declared earlier do not render */
    }

    .kftheme-mfn__panel {
        display: contents;
        /* Override mobile grid + visibility */
        visibility: visible;
        transition: none;
    }

    .kftheme-mfn__columns {
        display: contents;
        overflow: visible;
    }

    /* Explicitly set visibility on columns to prevent inheritance of     */
    /* visibility:hidden through display:contents ancestors.              */
    .kftheme-mfn__column {
        flex: 1;
        min-width: 0;
        padding-bottom: 0;
        visibility: visible;
    }

    /* ── Bottom bar — horizontal ───────────────────────────────────────── */

    .kftheme-mfn__copyright::after {
        content: "";
        position: absolute;
        bottom: 0;
        right: -14px;
        top: 0;
        width: 1px;
        background-color: rgba(255, 255, 255, 0.4);
    }

    .kftheme-mfn__bottom {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 24px;
    }

    .kftheme-mfn__logo {
        margin-right: 66px;
    }

    .kftheme-mfn__social {
        margin-left: auto;
        margin-top: 0px;
        gap: 16px 40px;
        width: auto;
    }
}