/**
 * Melody Magic — site footer, block-native rebuild.
 *
 * Companion stylesheet for patterns/site-footer-native.php. The footer is
 * authored as real core blocks (Group / Columns / Heading / Paragraph /
 * List / Query Loop / Button) so it is fully editable in the block editor.
 * To keep that markup round-tripping cleanly through the editor without
 * "invalid content" errors, the blocks carry className hooks only — all
 * visual styling lives here, keyed on the .mm-footer namespace.
 *
 * Namespaced under .mm-footer (the legacy footer uses .mm-site-footer), so
 * both footers can coexist on disk + in the inserter during the parallel
 * test phase without colliding.
 *
 * Colors reference theme.json preset vars where a token exists; the comp's
 * light-grape accent (#C49BD9) sits between grape-300 (#B892C9) and the next
 * step, so it stays literal exactly as in site-footer.css.
 */

.mm-footer {
    background-color: var(--wp--preset--color--ink, #1F2A2E);
    color: rgba(255, 255, 255, 0.78);
    padding: 72px 0 28px;
}

.mm-footer__inner {
    max-width: var(--wp--style--global--wide-size, 1440px);
    margin-inline: auto;
    width: 100%;
    padding-inline: 32px;
}

/* ===== Column grid (overrides the Columns block flex layout) ========= */

.mm-footer__columns.wp-block-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 56px;
    align-items: start;
}

/* Neutralize the inline flex-basis the Columns block writes per column. */
.mm-footer__columns.wp-block-columns > .wp-block-column {
    flex-basis: auto;
    min-width: 0;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .mm-footer__columns.wp-block-columns {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }
}

@media (min-width: 1024px) {
    .mm-footer__columns.wp-block-columns {
        grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
        gap: 48px;
    }
}

/* ===== Brand column ================================================== */

.mm-footer__logo {
    margin: 0 0 18px 0;
}

.mm-footer__logo img {
    height: 54px;
    width: auto;
    max-width: 100%;
    /* full-color logo-mark.png shown as-is on the dark band (no invert) */
}

.mm-footer__blurb {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    max-width: 340px;
}

/* ===== Column heading + leading dot ================================== */

.mm-footer__heading {
    margin: 0 0 16px 0;
    font-family: var(--wp--preset--font-family--outfit, sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}

.mm-footer__heading::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor; /* dot tracks the heading color */
    flex: 0 0 auto;
}

.mm-footer__heading--teal   { color: var(--wp--preset--color--teal-300, #9FD6CC); }
.mm-footer__heading--butter { color: var(--wp--preset--color--butter, #F4D16A); }
.mm-footer__heading--grape  { color: #C49BD9; }

/* ===== Link lists: Studio (List block) + Programs (Query Loop) ======= */

.mm-footer__links.wp-block-list,
.mm-footer__programs .wp-block-post-template {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.mm-footer__links.wp-block-list li,
.mm-footer__programs .wp-block-post-template > li {
    margin: 0;
}

/* Program titles render as Post Title headings; flatten to link-list look. */
.mm-footer__programs .wp-block-post-title {
    margin: 0;
    font-family: var(--wp--preset--font-family--source-sans-3, sans-serif);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
}

.mm-footer a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: color var(--wp--custom--motion--duration, 220ms) var(--wp--custom--motion--ease, ease);
}

.mm-footer__links a,
.mm-footer__programs .wp-block-post-title a {
    font-size: 14px;
    line-height: 1.4;
}

.mm-footer a:hover,
.mm-footer a:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ===== Find Us contact lines (icon via CSS-masked SVG) =============== */

.mm-footer__contact {
    margin: 0 0 14px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.mm-footer__contact::before {
    content: "";
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    background-color: #C49BD9;
    -webkit-mask: var(--mm-ico) center / contain no-repeat;
    mask: var(--mm-ico) center / contain no-repeat;
}

.mm-footer__contact--pin {
    --mm-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.mm-footer__contact--phone {
    --mm-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.13.96.37 1.9.72 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.91.35 1.85.59 2.81.72A2 2 0 0122 16.92z'/%3E%3C/svg%3E");
}

.mm-footer__contact--mail {
    --mm-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='M2 7l10 6 10-6'/%3E%3C/svg%3E");
}

.mm-footer__contact a {
    color: rgba(255, 255, 255, 0.85);
}

/* ===== SMS button (core/button) ===================================== */

.mm-footer__sms { margin-top: 4px; }

.mm-footer__sms .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 999px;
    background-color: var(--wp--preset--color--teal, #42AE9A);
    color: #fff;
    font-family: var(--wp--preset--font-family--outfit, sans-serif);
    font-weight: 700;
    font-size: 18px;
    min-width: 220px;
    text-decoration: none;
    transition: background-color var(--wp--custom--motion--duration, 220ms) var(--wp--custom--motion--ease, ease),
                transform var(--wp--custom--motion--duration, 220ms) var(--wp--custom--motion--ease, ease);
}

.mm-footer__sms .wp-block-button__link::before {
    content: "";
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z'/%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='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mm-footer__sms .wp-block-button__link:hover,
.mm-footer__sms .wp-block-button__link:focus-visible {
    background-color: var(--wp--preset--color--teal-700, #1F7A70);
    transform: translateY(-1px);
    color: #fff;
}

/* ===== Bottom bar =================================================== */

.mm-footer__bottom.wp-block-group {
    padding-top: 24px;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.mm-footer__copyright {
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.mm-footer__copyright::before {
    content: "\2605"; /* ★ */
    color: #C49BD9;
}

.mm-footer__policies.wp-block-list {
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-footer__policies.wp-block-list li {
    margin: 0;
}

.mm-footer__policies a {
    color: rgba(255, 255, 255, 0.5);
}

.mm-footer__policies a:hover,
.mm-footer__policies a:focus-visible {
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Mobile ======================================================= */

@media (max-width: 767px) {
    .mm-footer {
        padding: 56px 0 24px;
    }

    .mm-footer__inner {
        padding-inline: 20px;
    }

    .mm-footer__columns.wp-block-columns {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 40px;
    }

    .mm-footer__logo img {
        height: 44px;
    }

    .mm-footer__bottom.wp-block-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ===== Reduced motion =============================================== */

@media (prefers-reduced-motion: reduce) {
    .mm-footer a,
    .mm-footer__sms .wp-block-button__link {
        transition: none;
    }

    .mm-footer__sms .wp-block-button__link:hover,
    .mm-footer__sms .wp-block-button__link:focus-visible {
        transform: none;
    }
}
