/**
 * 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 0.2s var(--narpo-ease, ease);
    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;
    }
}

@media (max-width: 380px) {
    html[data-narpo-language="cy"] .narpo-site-footer {
        padding-block: 2rem 2.5rem;
    }

    html[data-narpo-language="cy"] .narpo-site-footer__cols {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        text-align: center;
    }

    html[data-narpo-language="cy"] .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, 0.28s) var(--narpo-ease, ease);
}

.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, 0.28s) var(--narpo-ease, ease);
}

.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;
    }
}
