/* ================================================================
   MarketFlow Footer Manager — footer.css
   All colours are resolved through CSS custom properties set by
   the dynamic inline style block in assets.php.
================================================================ */

/* ---- Reset & base ------------------------------------------- */
#mff-footer,
#mff-footer * {
    box-sizing: border-box;
}

#mff-footer {
    background: var(--mff-bg);
    color: var(--mff-text);
    font-size: var(--mff-fs);
    line-height: 1.7;
    font-family: inherit;
    width: 100%;
    box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
}

#mff-footer a {
    color: var(--mff-link);
    text-decoration: none;
    transition: all 0.3s ease;
}

#mff-footer a:hover,
#mff-footer a:focus {
    color: var(--mff-link-hover);
}

/* ---- Container ---------------------------------------------- */
.mff-container {
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.mff-boxed  { max-width: 1280px; }
.mff-full-width { max-width: 100%; }

/* ---- Top section -------------------------------------------- */
.mff-footer-top {
    padding: var(--mff-pt) 0;
    border-bottom: 1px solid var(--mff-border);
}

/* ---- Columns grid ------------------------------------------- */
.mff-columns {
    display: grid;
    gap: var(--mff-gap);
    align-items: start;
}

.mff-cols-1 { grid-template-columns: 1fr; }
.mff-cols-2 { grid-template-columns: 1.5fr 1fr; }
.mff-cols-3 { grid-template-columns: 1.5fr 1fr 1fr; }
.mff-cols-4 { grid-template-columns: 1.8fr 1fr 1fr 1.2fr; }

/* ---- Column headings ---------------------------------------- */
.mff-col-title,
#mff-footer .mff-widget-title {
    color: var(--mff-heading);
    font-size: var(--mff-fs-h);
    font-weight: var(--mff-fw-h);
    margin: 0 0 20px;
    padding: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---- Brand column ------------------------------------------- */
.mff-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--mff-heading) !important;
}

.mff-brand-link:hover { opacity: 0.85; }

/* WP custom logo rendered via the_custom_logo() */
#mff-footer .custom-logo-link {
    display: inline-block;
    margin-bottom: 14px;
    line-height: 0;
}

#mff-footer .custom-logo-link:hover { opacity: 0.85; }

#mff-footer .custom-logo {
    max-width: 160px; /* overridden by inline style from logo_width setting */
    height: auto;
    display: block;
}

.mff-site-name-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--mff-heading) !important;
}

.mff-logo {
    height: auto;
    display: block;
}

.mff-site-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--mff-accent);
    border-radius: 10px;
    color: #fff;
}

.mff-site-name {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--mff-heading);
}

.mff-tagline {
    color: var(--mff-text);
    margin: 0 0 20px;
    max-width: 320px;
    font-size: var(--mff-fs);
}

/* ---- Social icons ------------------------------------------- */
.mff-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.mff-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mff-icon-bg);
    color: var(--mff-text) !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mff-social-icon:hover,
.mff-social-icon:focus {
    background: var(--mff-icon-hover-bg);
    color: #fff !important;
    transform: translateY(-2px);
}

.mff-social-icon svg {
    pointer-events: none;
}

/* ---- Footer nav menus --------------------------------------- */
.mff-footer-menu,
.mff-footer-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mff-footer-menu li {
    margin-bottom: 10px;
}

.mff-footer-menu li:last-child {
    margin-bottom: 0;
}

.mff-footer-menu a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding-left: 0;
    transition: padding-left 0.2s ease, color 0.2s ease;
}

.mff-footer-menu a::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 1px;
    background: var(--mff-accent);
    transition: width 0.2s ease;
    vertical-align: middle;
    margin-right: 0;
}

.mff-footer-menu a:hover::before,
.mff-footer-menu a:focus::before {
    width: 12px;
    margin-right: 4px;
}

/* ---- Contact block ------------------------------------------ */
.mff-contact-block { }

.mff-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    color: var(--mff-text);
}

.mff-contact-item svg {
    flex-shrink: 0;
    color: var(--mff-accent);
}

.mff-contact-item a {
    color: var(--mff-text);
}

.mff-contact-item a:hover {
    color: var(--mff-link-hover);
}

/* ---- Widget column extra ------------------------------------ */
.mff-col1-widgets { margin-top: 16px; }

.mff-widget { margin-bottom: 24px; }
.mff-widget:last-child { margin-bottom: 0; }

/* ---- Empty column (Customizer preview only) ---------------- */
.mff-empty-col {
    border: 2px dashed var(--mff-border);
    padding: 16px;
    border-radius: 6px;
    color: var(--mff-text);
    opacity: 0.6;
    font-size: 0.85em;
    text-align: center;
}

/* ---- Bottom bar -------------------------------------------- */
.mff-footer-bottom {
    background: var(--mff-bottom-bg);
    padding: 18px 0;
}

.mff-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* When payment icons are hidden, center the copyright text in the bar */
.mff-footer-bottom .mff-bottom-inner.mff-no-payment {
    justify-content: center !important;
}

.mff-footer-bottom .mff-bottom-inner.mff-no-payment .mff-copyright {
    width: 100% !important;
    text-align: center !important;
}

.mff-copyright {
    margin: 0;
    color: var(--mff-copyright);
    font-size: 0.9em;
}

/* ---- Bottom nav menu --------------------------------------- */
.mff-bottom-menu,
.mff-bottom-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.mff-bottom-menu li { margin: 0; }

.mff-bottom-menu a {
    color: var(--mff-copyright);
    font-size: 0.88em;
    transition: color 0.2s ease;
}

.mff-bottom-menu a:hover,
.mff-bottom-menu a:focus {
    color: var(--mff-link-hover);
}

/* ---- Bottom bar social icons (right side, next to payment) -- */
.mff-bottom-social {
    display: flex;
    align-items: center;
}

.mff-bottom-social .mff-social-icons {
    margin-top: 0;
    gap: 8px;
}

.mff-bottom-social .mff-social-icon {
    width: 30px;
    height: 30px;
}

.mff-bottom-social .mff-social-icon svg {
    width: 15px;
    height: 15px;
}

/* ---- Payment icons ----------------------------------------- */
.mff-payment-icons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.mff-pay-badge {
    display: inline-block;
    background: var(--mff-payment-bg);
    border: 1px solid var(--mff-border);
    color: var(--mff-text);
    font-size: 0.7em;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ---- Newsletter bar ------------------------------------------ */
.mff-newsletter-bar {
    background: var(--mff-nl-bg);
    border-bottom: 1px solid var(--mff-border);
}

.mff-newsletter-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 36px 24px;
}

.mff-newsletter-copy {
    flex: 1 1 380px;
    min-width: 0;
}

.mff-newsletter-heading {
    margin: 0 0 6px;
    color: var(--mff-nl-heading);
    font-size: 1.15em;
    font-weight: 700;
}

.mff-newsletter-text {
    margin: 0;
    color: var(--mff-nl-text);
    font-size: var(--mff-fs);
    line-height: 1.6;
}

.mff-newsletter-form {
    flex: 0 1 420px;
    min-width: 260px;
}

.mff-newsletter-field-wrap {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.mff-newsletter-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 13px 16px;
    font-size: 0.95em;
    font-family: inherit;
    color: var(--mff-nl-input-text);
    background: var(--mff-nl-input-bg);
    border: 1px solid var(--mff-nl-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mff-newsletter-input::placeholder {
    color: color-mix(in srgb, var(--mff-nl-input-text) 45%, transparent);
}

.mff-newsletter-input:focus {
    border-color: var(--mff-nl-btn-bg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mff-nl-btn-bg) 20%, transparent);
}

.mff-newsletter-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    font-size: 0.95em;
    font-weight: 600;
    font-family: inherit;
    color: var(--mff-nl-btn-text);
    background: var(--mff-nl-btn-bg);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 11px 18px -8px var(--primary);
}

.mff-newsletter-btn:hover,
.mff-newsletter-btn:focus {
    background: var(--mff-nl-btn-hover);
}

.mff-newsletter-form.is-loading .mff-newsletter-btn {
    opacity: 0.7;
    cursor: default;
}

/* Honeypot field — must stay invisible to humans but present in the DOM for bots */
.mff-newsletter-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mff-newsletter-msg {
    margin: 10px 0 0;
    font-size: 0.85em;
    min-height: 1.2em;
}

.mff-newsletter-msg.is-success { color: #22c55e; }
.mff-newsletter-msg.is-error   { color: #f87171; }

/* Centered / stacked layout variant */
.mff-newsletter-centered .mff-newsletter-inner {
    flex-direction: column;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.mff-newsletter-centered .mff-newsletter-form {
    flex-basis: auto;
    width: 100%;
}

/* ---- Newsletter — compact column variant --------------------- */
.mff-newsletter-col-text {
    margin: 0 0 16px;
    max-width: 320px;
}

/* Let the column's actual rendered width (not the viewport) decide the layout */
.mff-newsletter-col {
    container-type: inline-size;
    container-name: mff-newsletter-col;
}

/* Default / fallback: stacked, full-width button (safe on browsers without container query support) */
.mff-newsletter-field-wrap-col {
    flex-direction: column;
    align-items: stretch;
}

.mff-newsletter-field-wrap-col .mff-newsletter-btn {
    width: 100%;
}

/* Enough room in the column → sit input and button side by side */
@container mff-newsletter-col (min-width: 300px) {
    .mff-newsletter-field-wrap-col {
        flex-direction: row;
        align-items: stretch;
    }

    .mff-newsletter-field-wrap-col .mff-newsletter-btn {
        width: auto;
    }
}

/* ================================================================
   RESPONSIVE
================================================================ */

@media (max-width: 1024px) {
    .mff-cols-4 { grid-template-columns: 1fr 1fr; }
    .mff-cols-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .mff-cols-4,
    .mff-cols-3,
    .mff-cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    .mff-col-brand { grid-column: 1 / -1; }

    .mff-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mff-newsletter-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding: 28px 24px;
    }

    .mff-newsletter-form { flex-basis: auto; width: 100%; }
}

@media (max-width: 480px) {
    .mff-cols-4,
    .mff-cols-3,
    .mff-cols-2 {
        grid-template-columns: 1fr;
    }

    .mff-footer-top {
        padding-top: 40px;
        padding-bottom: 40px;
    }
}
