/**
 * NARPO — Site Footer.
 * Matches the Figma design: navy background, white links in 4 columns,
 * crest + copyright pinned right.
 */
footer.wp-block-template-part,
.wp-site-blocks > footer.wp-block-template-part {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

.narpo-site-footer {
    background: var(--narpo-navy-deep, #081f47);
    color: #fff;
    border-top: 8px solid var(--narpo-band, #3C7DE5);
    padding-block: clamp(2.5rem, 5vw, 4rem);
}

.narpo-site-footer__inner {
    width: var(--narpo-container, min(1200px, 92vw));
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: clamp(2rem, 5vw, 4rem);
    row-gap: 2rem;
    align-items: center;
}

.narpo-site-footer--brand-only .narpo-site-footer__inner {
    grid-template-columns: 1fr;
    justify-items: center;
}

/* Columns ------------------------------------------------------------ */
.narpo-site-footer__cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1.25rem, 3vw, 2.5rem);
}

.narpo-site-footer__col {
    min-width: 0;
}

.narpo-site-footer__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.narpo-site-footer__menu li {
    margin: 0;
    padding: 0;
}

.narpo-site-footer__menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
    transition: color var(--narpo-dur-state) var(--narpo-ease-state);
    display: inline-block;
    position: relative;
}

.narpo-site-footer__menu a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.15rem;
    height: 2px;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s var(--narpo-ease, ease);
    border-radius: 2px;
}

.narpo-site-footer__menu a:hover,
.narpo-site-footer__menu a:focus-visible {
    color: #fff;
}

.narpo-site-footer__menu a:hover::after,
.narpo-site-footer__menu a:focus-visible::after {
    transform: scaleX(1);
}
.narpo-site-footer__menu a:focus-visible {
    outline: 2px solid var(--narpo-accent, #4169e1);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Highlighted link (Official NARPO Website) */
.narpo-site-footer__menu li.is-highlight a {
    color: #6fa8ff;
}
.narpo-site-footer__menu li.is-highlight a:hover {
    color: #a9c8ff;
}
/* The WP nav menu walker doesn't get our .is-highlight class — also flag by
   target=_blank for the official site link (heuristic that's safe here). */
.narpo-site-footer__menu a[target="_blank"] {
    color: #6fa8ff;
}
.narpo-site-footer__menu a[target="_blank"]:hover {
    color: #a9c8ff;
}

/* Brand block — sits in the right column on desktop. */
.narpo-site-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
    flex-shrink: 0;
    min-width: 200px;
}
.narpo-site-footer__crest-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s var(--narpo-ease, ease);
}
.narpo-site-footer__crest-link:hover,
.narpo-site-footer__crest-link:focus-visible {
    transform: translateY(-1px);
}
.narpo-site-footer__crest-link:focus-visible {
    outline: 2px solid var(--narpo-accent, #4169e1);
    outline-offset: 6px;
    border-radius: 50%;
}
.narpo-site-footer__crest {
    width: clamp(72px, 7vw, 110px);
    height: auto;
}
.narpo-site-footer__copyright {
    font-size: 0.8rem;
    color: #fff;
    line-height: 1.5;
    margin: 0;
    max-width: 36rem;
    text-align: center;
}

/* ----------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .narpo-site-footer__cols { gap: 1.25rem; }
}

@media (max-width: 820px) {
    .narpo-site-footer__inner {
        grid-template-columns: 1fr;
    }
    .narpo-site-footer__cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
    }
    .narpo-site-footer__brand {
        padding-top: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 350px) {
    .narpo-site-footer {
        padding-block: 2rem 2.5rem;
    }
    .narpo-site-footer__cols {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        text-align: center;
    }
    .narpo-site-footer__menu {
        gap: 0.6rem;
        align-items: center;
    }
}

/* ----------------------------------------------------------------------
   Build credit — deliberately the quietest thing in the footer. Sits on
   its own hairline-separated line beneath everything, spanning the full
   container in both the two-column and stacked layouts.
   ---------------------------------------------------------------------- */
.narpo-site-footer__credit {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.narpo-site-footer__credit-link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.42);
    text-decoration: none;
    transition: color var(--narpo-dur-state) var(--narpo-ease-state);
}

.narpo-site-footer__credit-link:hover,
.narpo-site-footer__credit-link:focus-visible {
    color: rgba(255, 255, 255, 0.9);
}

/* The studio name is the only part that reacts: an underline wipes in from
   the left and the word warms to the site accent. */
.narpo-site-footer__credit-name {
    position: relative;
    font-weight: 600;
    white-space: nowrap;
    transition: color var(--narpo-dur-state) var(--narpo-ease-state);
}

.narpo-site-footer__credit-name::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--narpo-dur, 0.28s) var(--narpo-ease, ease);
}

.narpo-site-footer__credit-link:hover .narpo-site-footer__credit-name,
.narpo-site-footer__credit-link:focus-visible .narpo-site-footer__credit-name {
    color: var(--narpo-accent, #4169e1);
}

.narpo-site-footer__credit-link:hover .narpo-site-footer__credit-name::after,
.narpo-site-footer__credit-link:focus-visible .narpo-site-footer__credit-name::after {
    transform: scaleX(1);
}

.narpo-site-footer__credit-link:focus-visible {
    outline: 2px solid var(--narpo-accent, #4169e1);
    outline-offset: 4px;
    border-radius: 3px;
}

/* Touch devices get no hover state, so show the underline resting. */
@media (hover: none) {
    .narpo-site-footer__credit-name::after {
        transform: scaleX(1);
        opacity: 0.4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .narpo-site-footer__credit-link,
    .narpo-site-footer__credit-name,
    .narpo-site-footer__credit-name::after {
        transition: none;
    }
}

/* ==========================================================================
   MANCHESTER · Ft4 dense colophon
   The the previous build footer was four columns of links + a crest + a copyright
   line: the standard SaaS footer shape. This one closes the page like a
   colophon — the chequer band across the top, the branch mark and the motto
   holding the left, and the link columns set small and tight beside it.
   ========================================================================== */

.narpo-site-footer {
    background: var(--mn-slate-deep, #0a1423);
    color: var(--mn-on-slate, #f1eee9);
    border-top: 0;
    padding-block: clamp(3rem, 5.5vw, 4.5rem) clamp(2rem, 3.5vw, 2.75rem);
    position: relative;
}

/* The Sillitoe chequer closes the page — the second and last time it appears. */
.narpo-site-footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: var(--mn-chequer-band, 16px);
    background-color: var(--mn-slate-deep, #0a1423);
    background-image: repeating-conic-gradient(
        var(--mn-chequer-a, #0a1423) 0% 25%,
        var(--mn-chequer-b, #f9f6f1) 0% 50%
    );
    background-size: var(--mn-chequer-band, 16px) var(--mn-chequer-band, 16px);
    pointer-events: none;
}

/* Brand block leads, columns follow — reversed from the SaaS order. */
.narpo-site-footer__inner {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: clamp(2rem, 6vw, 5rem);
    row-gap: 2.5rem;
}
.narpo-site-footer__brand {
    order: -1;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    gap: 1rem;
}
.narpo-site-footer__crest {
    width: clamp(64px, 6vw, 92px);
}
.narpo-site-footer__crest-link:focus-visible {
    outline-color: var(--mn-brass, #d99e3f);
    border-radius: var(--narpo-radius, 3px);
}

.narpo-site-footer__copyright {
    text-align: left;
    color: var(--mn-on-slate-mute, #bbb7af);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

/* NARPO's own words, set once where the page ends. Real markup, not CSS
   content — the language toggle and assistive tech both need to reach it. */
.narpo-site-footer__motto {
    margin: 0;
    font-family: var(--narpo-font-display, Georgia, serif);
    font-size: 1.02rem;
    font-style: normal;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.005em;
    color: var(--mn-brass, #d99e3f);
    max-width: 22ch;
    text-wrap: balance;
}

/* --- Link columns: small, tight, colophon-set --------------------------- */
.narpo-site-footer__cols {
    gap: clamp(1rem, 2.5vw, 2rem) clamp(1.25rem, 3vw, 2.5rem);
}
.narpo-site-footer__menu {
    gap: 0.6rem;
}
.narpo-site-footer__menu a {
    color: var(--mn-on-slate-mute, #bbb7af);
    font-size: 0.86rem;
    font-weight: 400;
}
.narpo-site-footer__menu a::after {
    background: var(--mn-brass, #d99e3f);
    height: 1px;
    border-radius: 0;
}
.narpo-site-footer__menu a:hover,
.narpo-site-footer__menu a:focus-visible {
    color: var(--mn-on-slate, #f1eee9);
}
.narpo-site-footer__menu a:focus-visible {
    outline-color: var(--mn-brass, #d99e3f);
    border-radius: var(--narpo-radius-sm, 2px);
}

/* The one outbound link keeps the accent. */
.narpo-site-footer__menu li.is-highlight a,
.narpo-site-footer__menu a[target="_blank"] {
    color: var(--mn-brass, #d99e3f);
}
.narpo-site-footer__menu li.is-highlight a:hover,
.narpo-site-footer__menu a[target="_blank"]:hover {
    color: var(--mn-brass-bright, #e9bd68);
}

/* --- Coming soon: the brand-only footer ----------------------------------
   With the link columns gone, the base rule's justify-items:center sizes each
   grid item to fit-content, which squeezed the crest, motto and copyright into
   one narrow centred stack and left the credit's rule as a short stub under it.
   Let the brand run as a row across the container instead, so the page still
   closes on a full-width band. */
.narpo-site-footer--brand-only .narpo-site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    row-gap: clamp(1.5rem, 3vw, 2.25rem);
}

.narpo-site-footer--brand-only .narpo-site-footer__brand {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.75rem;
}

.narpo-site-footer--brand-only .narpo-site-footer__motto {
    margin-right: auto;   /* carries the copyright out to the far edge */
    max-width: 26ch;
}

.narpo-site-footer--brand-only .narpo-site-footer__copyright {
    text-align: right;
    max-width: 30ch;
}

@media (max-width: 820px) {
    .narpo-site-footer--brand-only .narpo-site-footer__brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .narpo-site-footer--brand-only .narpo-site-footer__motto {
        margin-right: 0;
    }

    .narpo-site-footer--brand-only .narpo-site-footer__copyright {
        text-align: left;
    }
}

/* --- Build credit -------------------------------------------------------- */
.narpo-site-footer__credit {
    border-top-color: var(--mn-slate-line, #374353);
    font-family: var(--narpo-font-mono, ui-monospace, monospace);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    margin-top: 0.5rem;
}
.narpo-site-footer__credit-link:hover .narpo-site-footer__credit-name,
.narpo-site-footer__credit-link:focus-visible .narpo-site-footer__credit-name {
    color: var(--mn-brass, #d99e3f);
}
.narpo-site-footer__credit-link:focus-visible {
    outline-color: var(--mn-brass, #d99e3f);
}

@media (max-width: 820px) {
    .narpo-site-footer__inner {
        grid-template-columns: minmax(0, 1fr);
    }
    .narpo-site-footer__brand {
        padding-top: 0;
        border-top: 0;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .narpo-site-footer::before {
        --mn-chequer-band: 12px;
        height: 12px;
        background-size: 12px 12px;
    }
}

@media (max-width: 350px) {
    .narpo-site-footer__cols { text-align: left; }
    .narpo-site-footer__menu { align-items: flex-start; }
}

/* --- Target sizes --------------------------------------------------------
   Footer links are a list, not prose, so the WCAG 2.2 inline-link exception
   does not apply to them. Padding gives each row a real target without
   changing the colophon's density. */
.narpo-site-footer__menu a {
    padding-block: 0.42rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}
.narpo-site-footer__menu a::after {
    bottom: 0.3rem;
}
.narpo-site-footer__menu {
    gap: 0.15rem;
}
.narpo-site-footer__credit-link {
    padding-block: 0.75rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

/* inline-flex collapses the whitespace text node before the studio name. */
.narpo-site-footer__credit-link {
    gap: 0.35em;
}
