/* =============================================================================
 * Regilyze — FOOTER STYLES
 * =============================================================================
 * EXTRACTED FROM includes/footer.php ON 2026-08-18 (SXO fix S1).
 *
 * WHY. 18 KB of identical CSS was inlined on every page and could never be
 * cached. See css/rgz-shell.css for the full reasoning.
 *
 * WHY THE <link> IS IN <body> AND NOT IN <head>. The footer's <style> sat
 * AFTER each page's own inline <style>, so footer rules won any tie on equal
 * specificity. Hoisting the <link> into <head> would silently reverse that and
 * hand the win to page CSS instead. A stylesheet <link> in the body is valid
 * HTML5 and supported everywhere, so keeping it exactly where the <style> was
 * preserves the cascade byte for byte. Do not move it.
 * =============================================================================
 */
/* ============================================================
       FOOTER v3.1 — landing-page-grade with full center axis
       ============================================================ */

    /* ============================================================
       DESKTOP-SITE-MODE GRACEFUL DEGRADATION
       Same approach as landing/about/contact pages: when mobile/tablet
       users toggle "Desktop site" in their browser, the browser forces
       a wide viewport (~980-1024px) regardless of physical screen size.
       These styles ensure footer still renders cleanly:

       1. No section can exceed its parent's width (prevents h-scroll)
       2. Container always has at minimum 16px side padding (safe-area aware)
       3. Long text breaks naturally instead of pushing the layout wider
       4. Footer-grid auto-adjusts based on viewport width
       ============================================================ */
    .cta-section-footer, footer.footer {
        max-width: 100%;
        overflow-x: clip;
        box-sizing: border-box;
    }
    @supports not (overflow-x: clip) {
        .cta-section-footer, footer.footer { overflow-x: hidden; }
    }

    /* Container — always respects viewport width with safe-area padding */
    .cta-section-footer .container, footer.footer .container {
        max-width: 100%;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    /* Long URLs / words break instead of overflowing */
    .cta-section-footer h2, .cta-section-footer p,
    footer.footer h4, footer.footer .footer-link,
    footer.footer .footer-legal,
    footer.footer .footer-brand p {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Images never push wider than container */
    footer.footer img,
    .cta-section-footer img {
        max-width: 100%;
        height: auto;
    }

    /* ============================================================
       CTA BOX (above footer)
       ============================================================ */
    .cta-section-footer {
        padding: 60px 0;
        background: var(--bg-white, #FFFFFF);
    }
    .cta-box {
        background: var(--bg-dark, #1A1A1A);
        border-radius: 24px;
        padding: 48px;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 40px;
        align-items: center;
        position: relative;
        overflow: hidden;
    }
    .cta-box::before {
        content: '';
        position: absolute;
        top: -100px;
        right: -100px;
        width: 400px;
        height: 400px;
        background: radial-gradient(circle, rgba(255,107,53,0.2) 0%, transparent 60%);
        pointer-events: none;
    }
    .cta-box-content { position: relative; z-index: 1; }
    .cta-box-content h2 {
        font-size: 1.75rem;
        color: white;
        margin-bottom: 12px;
        font-family: var(--font-display, 'Sora', sans-serif);
        letter-spacing: -0.01em;
    }
    .cta-box-content p {
        color: rgba(255,255,255,0.6);
        margin-bottom: 24px;
        font-size: 1rem;
        line-height: 1.6;
    }
    .cta-box-actions { display: flex; gap: 12px; flex-wrap: wrap; }
    .cta-box-price {
        text-align: center;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 20px;
        padding: 24px 32px;
        position: relative;
        z-index: 1;
        flex-shrink: 0;
    }
    .cta-box-price .price-label {
        font-size: 14px;
        color: rgba(255,255,255,0.6);
        margin-bottom: 4px;
    }
    .cta-box-price .price-value {
        font-size: 2.5rem;
        font-weight: 800;
        color: var(--accent-orange, #FF6B35);
        font-family: var(--font-display, 'Sora', sans-serif);
        letter-spacing: -0.02em;
    }
    .cta-box-price .price-note {
        font-size: 13px;
        color: rgba(255,255,255,0.5);
    }

    @media (max-width: 1024px) {
        .cta-box { grid-template-columns: 1fr; gap: 32px; padding: 40px; }
        .cta-box-content { text-align: center; }
        .cta-box-actions { justify-content: center; }
        .cta-box-price { max-width: 280px; margin: 0 auto; }
    }
    @media (max-width: 768px) {
        .cta-section-footer { padding: 40px 0; }
        .cta-box { padding: 32px 24px; border-radius: 20px; }
        .cta-box-content h2 { font-size: 1.5rem; }
        .cta-box-content p { font-size: 0.9375rem; }
        .cta-box-actions { flex-direction: column; width: 100%; }
        .cta-box-actions .btn { width: 100%; justify-content: center; padding: 14px 24px; }
        .cta-box-price { padding: 20px 24px; max-width: 100%; }
        .cta-box-price .price-value { font-size: 2rem; }
    }
    @media (max-width: 480px) {
        .cta-section-footer { padding: 32px 0; }
        .cta-box { padding: 26px 20px; }
        .cta-box-content h2 { font-size: 1.375rem; }
        .cta-box-content p { font-size: 0.875rem; margin-bottom: 20px; }
        .cta-box-actions .btn { font-size: 14px; padding: 12px 20px; }
        .cta-box-price .price-value { font-size: 1.75rem; }
    }
    @media (max-width: 360px) {
        .cta-box { padding: 22px 16px; }
        .cta-box-content h2 { font-size: 1.25rem; }
        .cta-box-price { padding: 18px 20px; }
    }

    /* ============================================================
       FOOTER MAIN
       ============================================================ */
    footer.footer {
        background: #0A0A0A;
        color: white;
        padding: 60px 0 32px;
    }
    footer.footer .footer-grid {
        display: grid;
        /* SERVICES COLUMN REMOVED (2026-08-17): was a fixed
           "1.5fr repeat(4, 1fr)" for brand + exactly four columns. The column
           count is no longer fixed — it is 3 normally and 4 when the "From the
           Blog" widget has posts to show — so a hardcoded count would leave a
           dead gap. auto-fit adapts to whatever is actually rendered. */
        grid-template-columns: 1.5fr repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 48px !important;
        margin-bottom: 48px !important;
    }
    footer.footer .footer-brand .logo { margin-bottom: 16px; min-height: auto !important; }
    footer.footer .footer-brand .logo-text { color: white; }
    footer.footer .footer-brand p {
        font-size: 14px;
        color: rgba(255,255,255,0.5);
        margin-top: 16px;
        line-height: 1.7;
        max-width: 280px;
    }
    footer.footer .footer-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
    footer.footer .footer-badge {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        background: rgba(255,255,255,0.08);
        border-radius: 8px;
        font-size: 11px;
        color: rgba(255,255,255,0.7);
    }
    footer.footer .footer-badge svg { width: 14px; height: 14px; stroke: var(--accent-green, #22C55E); fill: none; }

    footer.footer .footer-column h4 {
        font-size: 14px !important;
        font-weight: 700 !important;
        margin-bottom: 20px !important;
        color: white !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
    }
    footer.footer .footer-links { display: flex; flex-direction: column; gap: 12px !important; }
    footer.footer .footer-link {
        font-size: 14px !important;
        color: rgba(255,255,255,0.5) !important;
        transition: color 0.2s;
        padding: 0 !important;
        min-height: auto !important;
        line-height: 1.5 !important;
        text-decoration: none;
    }
    footer.footer .footer-link:hover { color: white; }

    /* ============================================================
       SOCIAL ICONS (6 platforms)
       ============================================================ */
    footer.footer .footer-social {
        display: flex;
        gap: 10px;
        margin-top: 24px;
        flex-wrap: wrap;
    }
    footer.footer .social-link {
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.08);
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s ease;
        min-height: auto !important;
        position: relative;
        overflow: hidden;
    }
    footer.footer .social-link::before {
        content: '';
        position: absolute;
        inset: 0;
        background: var(--social-bg, var(--accent-orange, #FF6B35));
        opacity: 0;
        transition: opacity 0.25s ease;
    }
    footer.footer .social-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    footer.footer .social-link:hover::before { opacity: 1; }
    footer.footer .social-link svg {
        width: 18px;
        height: 18px;
        fill: white;
        position: relative;
        z-index: 1;
        transition: transform 0.25s ease;
    }
    footer.footer .social-link:hover svg { transform: scale(1.1); }

    /* Brand colors on hover */
    footer.footer .social-link.sl-facebook  { --social-bg: #1877F2; }
    footer.footer .social-link.sl-instagram { --social-bg: linear-gradient(135deg, #F58529 0%, #DD2A7B 50%, #8134AF 100%); }
    footer.footer .social-link.sl-tiktok    { --social-bg: #000; }
    footer.footer .social-link.sl-linkedin  { --social-bg: #0A66C2; }
    footer.footer .social-link.sl-youtube   { --social-bg: #FF0000; }
    footer.footer .social-link.sl-x         { --social-bg: #000; }
    footer.footer .social-link.sl-whatsapp  { --social-bg: #25D366; }

    /* ============================================================
       FOOTER BOTTOM
       ============================================================ */
    footer.footer .footer-bottom {
        padding-top: 32px;
        border-top: 1px solid rgba(255,255,255,0.1);
        display: flex !important;
        justify-content: space-between !important;
        flex-wrap: wrap;
        gap: 24px;
        align-items: center !important;
    }
    footer.footer .footer-legal {
        font-size: 13px !important;
        color: rgba(255,255,255,0.4) !important;
        line-height: 1.7;
        display: block !important;
    }
    footer.footer .footer-legal strong { color: rgba(255,255,255,0.7); font-weight: 600; }
    footer.footer .footer-legal-links { display: flex; gap: 24px; flex-wrap: wrap; }
    footer.footer .footer-legal-links a {
        font-size: 13px;
        color: rgba(255,255,255,0.4);
        transition: color 0.2s;
        min-height: auto !important;
        text-decoration: none;
    }
    footer.footer .footer-legal-links a:hover { color: white; }

    /* ============================================================
       RESPONSIVE — landing-page-grade coverage
       ============================================================ */
    @media (max-width: 1280px) {
        footer.footer .footer-grid { gap: 36px !important; }
    }
    @media (max-width: 1024px) {
        footer.footer { padding: 48px 0 28px; }
        footer.footer .footer-grid {
            /* Was repeat(4, 1fr) for the old fixed four columns. */
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
            gap: 32px !important;
        }
        /* Brand spans full width on first row */
        footer.footer .footer-brand {
            grid-column: 1 / -1;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        footer.footer .footer-brand .logo { justify-content: center; }
        footer.footer .footer-brand p {
            text-align: center;
            max-width: 540px;
            margin-left: auto;
            margin-right: auto;
        }
        footer.footer .footer-social { justify-content: center; }
    }

    /* ============================================================
       MOBILE — SINGLE COLUMN, EVERYTHING CENTERED
       Below 768px we collapse to 1-col so columns don't squeeze.
       ============================================================ */
    @media (max-width: 768px) {
        footer.footer { padding: 40px 0 24px; }
        footer.footer .footer-grid {
            grid-template-columns: 1fr !important;
            gap: 32px !important;
            margin-bottom: 36px !important;
            text-align: center;
            justify-items: center;
            align-items: start;
        }

        /* Brand */
        footer.footer .footer-brand {
            grid-column: auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        footer.footer .footer-brand .logo { justify-content: center; }
        footer.footer .footer-brand p {
            text-align: center;
            max-width: 360px;
            margin-left: auto;
            margin-right: auto;
        }
        footer.footer .footer-badges { justify-content: center; }
        footer.footer .footer-social { justify-content: center; }

        /* Each column — heading centered, links arranged per-section */
        footer.footer .footer-column {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            width: 100%;
            margin: 0 auto;
        }
        footer.footer .footer-column h4 {
            text-align: center !important;
        }

        /* Default: links as inline-grid auto-sized, centered as a unit.
           Each section overrides grid-template-columns for its own count. */
        footer.footer .footer-links {
            display: inline-grid !important;
            gap: 12px 28px !important;
            text-align: center;
            justify-items: center;
            align-items: center;
            width: auto !important;
            margin: 0 auto;
        }
        footer.footer .footer-link {
            text-align: center;
            display: inline-block;
            line-height: 1.4 !important;
            white-space: nowrap;
        }

        /* Per-section column counts on mobile.
           .fc-services removed 2026-08-17 along with its column. */
        footer.footer .fc-blog .footer-links {
            grid-template-columns: auto;               /* post titles need full width */
        }
        footer.footer .fc-company .footer-links {
            grid-template-columns: auto auto auto auto; /* 4 links → 1 row × 4 cols */
            gap: 12px 20px !important;
        }
        footer.footer .fc-legal .footer-links {
            grid-template-columns: auto auto auto;      /* 3 links → 1 row × 3 cols */
            gap: 12px 22px !important;
        }
        footer.footer .fc-contact .footer-links {
            grid-template-columns: auto auto;           /* 2 links → 1 row × 2 cols */
            gap: 12px 24px !important;
        }

        /* Footer bottom */
        footer.footer .footer-bottom {
            flex-direction: column !important;
            text-align: center;
            align-items: center !important;
            gap: 14px;
            padding-top: 24px;
        }
        footer.footer .footer-legal { text-align: center; }
        footer.footer .footer-legal-links {
            justify-content: center;
            width: 100%;
            gap: 18px;
        }
    }

    @media (max-width: 640px) {
        footer.footer { padding: 36px 0 20px; }
        footer.footer .footer-grid { gap: 28px !important; }
        footer.footer .social-link { width: 40px; height: 40px; }
        footer.footer .footer-column h4 { margin-bottom: 16px !important; }
    }

    @media (max-width: 480px) {
        footer.footer { padding: 32px 0 18px; }
        footer.footer .footer-grid { gap: 26px !important; margin-bottom: 28px !important; }
        footer.footer .footer-social { gap: 8px; }
        footer.footer .social-link { width: 38px; height: 38px; }
        footer.footer .social-link svg { width: 16px; height: 16px; }
        footer.footer .footer-link { font-size: 13px !important; }
        footer.footer .footer-brand p { font-size: 13px; line-height: 1.65; }
        footer.footer .footer-legal { font-size: 12px !important; }
        footer.footer .footer-legal-links a { font-size: 12px; }
        /* Tighter column gaps on smaller screens */
        footer.footer .fc-blog .footer-links { gap: 10px 0 !important; }
        footer.footer .fc-company .footer-links { gap: 10px 14px !important; }
        footer.footer .fc-legal .footer-links { gap: 10px 16px !important; }
        footer.footer .fc-contact .footer-links { gap: 10px 18px !important; }
    }

    @media (max-width: 380px) {
        /* Company has 4 links — at very narrow widths, drop to 2 rows × 2 cols */
        footer.footer .fc-company .footer-links {
            grid-template-columns: auto auto !important;
            gap: 10px 20px !important;
        }
        /* Legal has 3 long labels — drop to 1 col stacked */
        footer.footer .fc-legal .footer-links {
            grid-template-columns: auto !important;
            gap: 10px !important;
        }
    }

    @media (max-width: 360px) {
        footer.footer .footer-social { gap: 6px; }
        footer.footer .social-link { width: 36px; height: 36px; border-radius: 8px; }
        footer.footer .social-link svg { width: 15px; height: 15px; }
        footer.footer .footer-column h4 { font-size: 13px !important; margin-bottom: 14px !important; }
        footer.footer .footer-brand p { font-size: 12.5px; }
        footer.footer .footer-legal-links { gap: 14px; }
        footer.footer .footer-link { font-size: 12px !important; white-space: normal; }
        footer.footer .fc-blog .footer-links { gap: 8px 0 !important; }
        footer.footer .fc-company .footer-links { gap: 8px 14px !important; }
        footer.footer .fc-contact .footer-links { gap: 8px 14px !important; }
    }

    /* Touch device hover guards */
    @media (hover: none) and (pointer: coarse) {
        footer.footer .social-link:hover { transform: none; box-shadow: none; }
        footer.footer .social-link:hover svg { transform: none; }
    }
