/* =====================================================
   SITE FOOTER — curtain reveal
   Design: Figma "Portfolio articles and footer" (node 3663:4059)

   Default (no JS / reveal off): the footer is a normal block that sits
   at the end of the page, right below #page-wrapper.

   Reveal on (html.footer-reveal, set by js/footer.js): the footer is pinned
   to the bottom of the viewport *behind* the page. A spacer equal to the
   footer's height follows #page-wrapper, so scrolling to the end slides
   the page up and uncovers the footer.
   ===================================================== */

:root {
    --footer-h: 0px; /* measured by js/footer.js */
}

.reveal-footer {
    --rf-bg: #ffffff;
    --rf-fg: #000000;
    --rf-line: #eaeaea;
    --rf-hover: rgba(0, 0, 0, 0.55);

    position: relative;
    z-index: 0;
    padding: 36px 0 env(safe-area-inset-bottom, 0);
    background: var(--rf-bg);
    color: var(--rf-fg);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

html.dark .reveal-footer {
    --rf-bg: #000000;
    --rf-fg: #ffffff;
    --rf-line: #2a2a2a;
    --rf-hover: rgba(255, 255, 255, 0.6);
}

.rf-inner {
    max-width: 1664px; /* same as header / page content */
    margin: 0 auto;
    padding: 0 var(--container-padding-mobile);
}

/* ---------- Rows ---------- */
.rf-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--rf-line);
}

.rf-label {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    text-transform: uppercase;
}

.rf-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-transform: uppercase;
}

.rf-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    line-height: 22px;
}

.rf-text strong {
    font-weight: 700;
    line-height: 20px;
    text-transform: uppercase;
}

/* Links */
.reveal-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.reveal-footer a:hover {
    color: var(--rf-hover);
}

.reveal-footer a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---------- Brand + legal ---------- */
.rf-brand {
    padding: 24px 0 35px;
    border-top: 1px solid var(--rf-line);
}

.rf-brand a {
    display: inline-block;
    line-height: 0;
}

.rf-logo {
    display: block;
    width: 34px;
    height: auto;
    filter: brightness(0); /* logo is a bitmap; force it to solid black on the light footer */
}

html.dark .rf-logo {
    filter: brightness(0) invert(1);
}

.rf-legal {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 0 19px;
    border-top: 1px solid var(--rf-line);
    font-size: 13px;
    line-height: 20px;
}

.rf-legal-links {
    display: flex;
    gap: 24px;
}

/* ---------- Tablet / desktop ---------- */
@media (min-width: 768px) {
    .rf-inner {
        padding: 0 var(--container-padding-tablet);
    }

    .rf-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 24px;
        min-height: 73px;
        padding: 22px 0;
    }

    /* Navigation / Follow: label and links centered in a 73px row */
    .rf-row--center {
        align-items: center;
        padding: 0;
    }

    .rf-links {
        flex-wrap: nowrap;
        gap: 32px;
        justify-content: flex-end;
    }

    .rf-text {
        align-items: flex-end;
        text-align: right;
    }

    .rf-legal {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 1024px) {
    .rf-inner {
        padding: 0 var(--container-padding-desktop);
    }
}

/* ---------- Reveal mode ---------- */
html.footer-reveal .reveal-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1; /* behind #page-wrapper at every breakpoint */
}

/* Spacer (inserted by js/footer.js right after the page) that gives the page
   scroll room equal to the footer's height. A real element rather than a margin,
   because end-of-page margins don't count toward scroll length on every page. */
.rf-spacer {
    display: none;
}

html.footer-reveal .rf-spacer {
    display: block;
    flex: none; /* body is a flex column on the 404 page; don't let it shrink */
    height: var(--footer-h);
    pointer-events: none;
}

/* A negative bottom margin on the last section (e.g. the home page's
   -160px) would pull the spacer / footer up under the page and hide part of it. */
#page-wrapper > :last-child,
#page-content > :last-child {
    margin-bottom: 0;
}
