/* =========================================================
   LYF Footer (v2 — refined brand design)
   Letras y Fuentes — violet / pink, matches the header
   ---------------------------------------------------------
   1. Footer layout
   2. Back to top button
   3. Share button
   4. Responsive
   5. Dark theme
   6. Reduced motion
   Same class names, same HTML, same JS hooks.
   ========================================================= */


/* =========================================================
   1. FOOTER
   ========================================================= */

.site-footer {
    --lyf-ft-a: #6d5dfc;
    --lyf-ft-b: #ec4899;
    --lyf-ft-c: #f59e0b;
    --lyf-ft-tint: rgba(109, 93, 252, 0.08);
    --lyf-ft-tint-strong: rgba(109, 93, 252, 0.18);
    --lyf-ft-glow: rgba(109, 93, 252, 0.55);

    position: relative;
    margin-top: 72px;

    border-top: 0;
    background-color: var(--lyf-color-surface, #ffffff);
    background-image:
        radial-gradient(
            90% 80% at 0% 0%,
            var(--lyf-ft-tint) 0%,
            transparent 60%
        ),
        radial-gradient(
            70% 70% at 100% 100%,
            rgba(236, 72, 153, 0.07) 0%,
            transparent 60%
        );
}


/* Brand colour strip (matches the header) */
.site-footer::before {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--lyf-ft-a) 0%,
        var(--lyf-ft-b) 55%,
        var(--lyf-ft-c) 100%
    );
}


/* Two columns on desktop: brand | navigation. Bottom bar spans both. */
.site-footer__inner {
    width: min(
        calc(100% - 32px),
        var(--lyf-container-page, 1200px)
    );
    margin-inline: auto;
    padding: 52px 0 24px;

    display: grid;
    grid-template-columns: minmax(240px, 5fr) 7fr;
    column-gap: 56px;
    row-gap: 32px;
    align-items: start;
}


/* ---------- Brand ---------- */

.site-footer__brand {
    max-width: 440px;
    margin: 0;
}

.site-footer__logo {
    display: inline-block;
    margin-bottom: 14px;

    color: var(--lyf-ft-a);
    font-size: 1.5rem;
    font-weight: var(--lyf-font-weight-extrabold, 800);
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-decoration: none;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {

    .site-footer__logo {
        background: linear-gradient(
            90deg,
            var(--lyf-ft-a) 0%,
            var(--lyf-ft-b) 100%
        );
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }

}

.site-footer__logo:hover {
    filter: brightness(1.1);
}

.site-footer__logo:focus-visible {
    outline: 2px solid var(--lyf-ft-a);
    outline-offset: 4px;
    border-radius: var(--lyf-radius-md, 12px);
}

.site-footer__description {
    max-width: 420px;
    margin: 0;
    padding-left: 14px;

    border-left: 3px solid transparent;
    border-image: linear-gradient(
        180deg,
        var(--lyf-ft-a),
        var(--lyf-ft-b)
    ) 1;

    color: var(--lyf-color-text-muted, #4b5563);
    font-size: 0.94rem;
    line-height: 1.75;
}


/* ---------- Navigation — soft pills ---------- */

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    border: 0;
}

.site-footer__nav a {
    display: inline-flex;
    align-items: center;

    min-height: 38px;
    padding: 0 15px;

    border: 1px solid var(--lyf-ft-tint-strong);
    border-radius: 999px;
    background: var(--lyf-ft-tint);

    color: var(--lyf-color-text-muted, #4b5563);
    font-size: 0.88rem;
    font-weight: var(--lyf-font-weight-medium, 500);
    line-height: 1.4;
    text-decoration: none;

    transition:
        color var(--lyf-transition-fast, 0.15s ease),
        background var(--lyf-transition-fast, 0.15s ease),
        border-color var(--lyf-transition-fast, 0.15s ease),
        transform var(--lyf-transition-fast, 0.15s ease),
        box-shadow var(--lyf-transition-fast, 0.15s ease);
}

.site-footer__nav a:hover {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--lyf-ft-a),
        var(--lyf-ft-b)
    );
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -8px var(--lyf-ft-glow);
}

.site-footer__nav a:focus-visible {
    outline: 2px solid var(--lyf-ft-a);
    outline-offset: 2px;
}


/* ---------- Bottom bar ---------- */

.site-footer__bottom {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 4px;
    padding-top: 22px;

    border-top: 1px dashed var(--lyf-ft-tint-strong);

    color: var(--lyf-color-text-soft, #6b7280);
    font-size: 0.82rem;
    line-height: 1.6;
}

.site-footer__bottom p {
    margin: 0;
    color: inherit;
}


/* =========================================================
   2. BACK TO TOP
   ========================================================= */

#lyf-back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--lyf-ft-a), var(--lyf-ft-b));
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px -8px var(--lyf-ft-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s, visibility .25s, filter .2s, box-shadow .2s;
}

#lyf-back-to-top.lyf-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#lyf-back-to-top:hover {
    filter: brightness(1.1);
    box-shadow: 0 14px 26px -8px var(--lyf-ft-glow);
}

#lyf-back-to-top:active {
    transform: translateY(0) scale(0.95);
}

#lyf-back-to-top:focus-visible {
    outline: 3px solid var(--lyf-ft-a);
    outline-offset: 3px;
}


/* =========================================================
   3. SHARE
   ========================================================= */

.lyf-share {
    position: fixed;
    right: 20px;
    bottom: 78px;
    z-index: 999;
}


/* ---------- Toggle button ---------- */

#lyf-share-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--lyf-ft-tint-strong);
    border-radius: 16px;
    background: var(--lyf-color-surface, #ffffff);
    color: var(--lyf-ft-a);
    cursor: pointer;
    box-shadow: 0 10px 22px -10px var(--lyf-ft-glow);
    transition:
        transform .2s,
        background .2s,
        border-color .2s,
        color .2s;
}

#lyf-share-toggle:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--lyf-ft-a), var(--lyf-ft-b));
    border-color: transparent;
    color: #ffffff;
}

#lyf-share-toggle[aria-expanded="true"] {
    background: var(--lyf-ft-tint-strong);
    border-color: var(--lyf-ft-a);
}

#lyf-share-toggle:focus-visible {
    outline: 3px solid var(--lyf-ft-a);
    outline-offset: 3px;
}


/* ---------- Menu ---------- */

.lyf-share__menu {
    position: absolute;
    right: 0;
    bottom: 58px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
    padding: 8px;
    border: 1px solid var(--lyf-ft-tint-strong);
    border-radius: 18px;
    background: var(--lyf-color-surface, #ffffff);
    box-shadow: 0 20px 40px -14px var(--lyf-ft-glow);
    transform-origin: bottom right;
    animation: lyf-ft-pop 0.16s ease-out;
}

.lyf-share__menu[hidden] {
    display: none;
}

.lyf-share__item {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--lyf-color-text, #222222);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.lyf-share__item:hover,
.lyf-share__item:focus-visible {
    background: var(--lyf-ft-tint-strong);
    color: var(--lyf-ft-a);
    outline: none;
}

/* "Copiar enlace" separated as the last action */
.lyf-share__item:last-child {
    margin-top: 4px;
    border-top: 1px dashed var(--lyf-ft-tint-strong);
    border-radius: 0 0 12px 12px;
    padding-top: 13px;
}

@keyframes lyf-ft-pop {

    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =========================================================
   4. RESPONSIVE
   ========================================================= */

@media (max-width: 860px) {

    .site-footer__inner {
        grid-template-columns: 1fr;
        row-gap: 26px;
    }

    .site-footer__brand {
        max-width: 520px;
    }

    .site-footer__description {
        max-width: 480px;
    }

}

@media (max-width: 640px) {

    .site-footer {
        margin-top: 52px;
    }

    .site-footer__inner {
        padding-top: 38px;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    #lyf-back-to-top {
        right: 14px;
        bottom: 14px;
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .lyf-share {
        right: 14px;
        bottom: 66px;
    }

    #lyf-share-toggle {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .lyf-share__menu {
        bottom: 54px;
    }
}

@media (max-width: 400px) {

    .site-footer__inner {
        width: calc(100% - 20px);
    }

    .site-footer__nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .site-footer__nav a {
        justify-content: flex-start;
        font-size: 0.84rem;
        padding: 0 12px;
    }
}


/* =========================================================
   5. DARK THEME
   Lighter brand colours for contrast.
   ========================================================= */

[data-theme="dark"] .site-footer,
.dark .site-footer {
    --lyf-ft-a: #9b8cff;
    --lyf-ft-b: #f472b6;
    --lyf-ft-c: #fbbf24;
    --lyf-ft-tint: rgba(155, 140, 255, 0.10);
    --lyf-ft-tint-strong: rgba(155, 140, 255, 0.22);
    --lyf-ft-glow: rgba(0, 0, 0, 0.7);

    background-color: var(--lyf-color-surface, #111827);
}

[data-theme="dark"] .site-footer__nav a:hover,
.dark .site-footer__nav a:hover,
[data-theme="dark"] #lyf-share-toggle:hover,
.dark #lyf-share-toggle:hover,
[data-theme="dark"] #lyf-back-to-top,
.dark #lyf-back-to-top {
    color: #111827;
}


/* =========================================================
   6. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .site-footer__nav a,
    .lyf-share__item,
    #lyf-back-to-top,
    #lyf-share-toggle {
        transition: none;
    }

    .lyf-share__menu {
        animation: none;
    }

    .site-footer__nav a:hover,
    #lyf-share-toggle:hover {
        transform: none;
    }
}