/* ══════════════════════════════════════════════════════════════
   Footer polish — layered on top of Kadence theme footer
   ══════════════════════════════════════════════════════════════ */

/* ── Overall footer ──────────────────────────────────────────── */
.site-footer {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

/* ── Top row — main footer content ───────────────────────────── */
.site-top-footer-inner-wrap {
    padding-top: 30px !important;
}

/* Widget titles */
.site-footer .widget-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}

/* Widget body text */
.site-footer .textwidget,
.site-footer .textwidget p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
}

/* Widget links */
.site-footer .textwidget a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer .textwidget a:hover {
    color: #fff;
}

/* ── Social icons ────────────────────────────────────────────── */
.site-footer .social-button {
    transition: transform 0.15s, opacity 0.15s;
}

.site-footer .social-button:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

/* ── Middle row — hide if empty ──────────────────────────────── */
.site-middle-footer-wrap {
    display: none;
}

/* ── Bottom row — legal / copyright ──────────────────────────── */
.site-bottom-footer-wrap {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-bottom-footer-wrap .footer-html,
.site-bottom-footer-wrap .footer-html p {
    font-size: 0.75rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.45);
}

.site-bottom-footer-wrap .footer-html a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}

.site-bottom-footer-wrap .footer-html a:hover {
    color: rgba(255, 255, 255, 0.8);
}


/* ── Mobile ──────────────────────────────────────────────────── */

/*
 * Kadence renders the top footer row as CSS grid (.site-top-footer-inner-wrap /
 * .site-footer-row with .site-footer-row-columns-4). The customizer here is
 * configured with `site-footer-row-mobile-column-layout-row`, which keeps the
 * columns side-by-side on mobile — so we override grid-template-columns to
 * force a single-column stack. Side padding lives on Kadence's `.site-container`,
 * which has no enforced padding at narrow viewports; we add it explicitly.
 */

@media (max-width: 767px) {
    .site-footer {
        overflow-x: hidden;
    }

    /* The real culprit for "no side gaps": Kadence's container */
    .site-footer .site-container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Force top + middle + bottom rows to stack vertically */
    .site-footer .site-top-footer-inner-wrap,
    .site-footer .site-middle-footer-inner-wrap,
    .site-footer .site-bottom-footer-inner-wrap,
    .site-footer .site-footer-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 2rem !important;
        padding-top: 2rem !important;
        padding-bottom: 1.5rem !important;
    }

    /* Sections in a stacked row = one per line, no min-width from desktop grid */
    .site-footer .site-footer-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        grid-column: 1 / -1 !important;
    }

    /* Normalize alignment: desktop often sets some sections right-aligned */
    .site-footer .site-footer-section,
    .site-footer .footer-widget-area,
    .site-footer .footer-widget-area-inner,
    .site-footer .content-align-right,
    .site-footer .content-align-center {
        text-align: left !important;
    }

    /* Widget titles */
    .site-footer .widget-title {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    /* Readable body text (≥14px) + safe wrapping for long URLs/addresses */
    .site-footer .textwidget,
    .site-footer .textwidget p,
    .site-footer .menu a,
    .site-footer .widget a,
    .site-footer li {
        font-size: 0.9375rem;
        line-height: 1.65;
        word-wrap: break-word;
        overflow-wrap: anywhere;
    }

    /* Menu / link list tap targets */
    .site-footer .menu a,
    .site-footer .widget_nav_menu a,
    .site-footer ul li a {
        display: inline-block;
        padding: 0.35rem 0;
        min-height: 32px;
    }

    /* Social icons row: left-aligned, wrapping, comfortable tap targets */
    .site-footer .footer-social-wrap {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    .site-footer .footer-social-inner-wrap,
    .site-footer .element-social-inner-wrap {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
    }

    .site-footer .social-button {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
    }

    /* Bottom row: centered, comfortable spacing */
    .site-bottom-footer-wrap .site-bottom-footer-inner-wrap,
    .site-bottom-footer-wrap .site-footer-row {
        gap: 0.5rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        justify-items: center !important;
    }

    .site-bottom-footer-wrap .site-footer-section,
    .site-bottom-footer-wrap .footer-html,
    .site-bottom-footer-wrap .footer-html p {
        text-align: center !important;
    }

    .site-bottom-footer-wrap .footer-html,
    .site-bottom-footer-wrap .footer-html p {
        font-size: 0.75rem;
    }

    /* Never let an image blow out the viewport */
    .site-footer img {
        max-width: 100%;
        height: auto;
    }
}

/* Extra-narrow phones */
@media (max-width: 380px) {
    .site-footer .site-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/*
 * Tablet: the viewport is narrower than Kadence's container max-width, so
 * the inner .site-container hits the edges with no natural gutters.
 * Add explicit side padding until the viewport is wide enough for the
 * max-width to produce auto-margin gutters on its own.
 */
@media (min-width: 768px) and (max-width: 1199px) {
    .site-footer .site-container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        box-sizing: border-box;
    }
}
