/* ==========================================================================
   Layout: footer  (partials/site/footer.blade.php)
   --------------------------------------------------------------------------
   Deep aqua (--footer-bg) under the CTA window (layout/cta-band.css), which
   sits on its top seam. Signature row (big white logo + the ministry licence
   seal), a seven-line rule, about block + four columns, then the bottom row
   (© · legal · HiTech credit). The white monogram, huge and faint, sits
   behind everything. Links draw an underline on hover.
   Reflows 5 → 4 (brand on its own row) → 2.
   ========================================================================== */
.site-footer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--footer-bg);
    color: var(--footer-text);
}
.site-footer > .container { position: relative; z-index: 1; }

.site-footer__mark {
    position: absolute;
    z-index: 0;
    inset-inline-start: 50%;
    bottom: -6%;
    width: min(1500px, 125%);
    max-width: none;
    opacity: 0.06;
    translate: 50% 0;                      /* RTL: inline-start is the right edge */
    pointer-events: none;
}
[dir="ltr"] .site-footer__mark { translate: -50% 0; }

/* Links: white, underline drawn from the start edge on hover */
.site-footer a { color: #fff; text-decoration: none; }
.site-footer__link {
    background: linear-gradient(currentColor, currentColor) right bottom / 0 1px no-repeat;
    transition: background-size var(--dur) var(--ease-out);
}
[dir="ltr"] .site-footer__link { background-position: left bottom; }
.site-footer__link:hover,
.site-footer__link[aria-current="page"] { color: #fff; background-size: 100% 1px; }

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr));
    gap: var(--space-10) var(--space-8);
    padding-block: var(--space-10);
}

/* ── Signature: big logo + licence seal ─────────────────────────────────── */
.site-footer__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
    padding-block: var(--space-12) var(--space-10);
}
.site-footer__logo { display: block; transition: opacity var(--dur) var(--ease-out); }
.site-footer__logo img { width: clamp(240px, 18vw + 90px, 360px); height: auto; }
.site-footer__logo:hover { opacity: 0.85; }

/* the licence: a seal in the logo's rings · who supervises | the number */
.site-footer__licence {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-3) var(--space-6) var(--space-3) var(--space-3);
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: var(--r-pill);
    background: rgb(0 0 0 / 0.12);
}
[dir="rtl"] .site-footer__licence { padding: var(--space-3) var(--space-3) var(--space-3) var(--space-6); }
.site-footer__seal {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    margin: 9px;                                   /* room for the rings */
    border-radius: 50%;
    background: #fff;
    color: var(--footer-bg);
    font-size: 1.35rem;
    box-shadow: 0 0 0 4px var(--footer-bg), 0 0 0 5px rgb(255 255 255 / 0.55),
                0 0 0 8px var(--footer-bg), 0 0 0 9px rgb(255 255 255 / 0.3);
}
.site-footer__authority,
.site-footer__licence-no { display: grid; gap: 2px; margin: 0; line-height: 1.5; }
.site-footer__authority span,
.site-footer__licence-no span { color: rgb(255 255 255 / 0.72); font-size: var(--fs-xs); }
.site-footer__authority strong { color: #fff; font-size: var(--fs-sm); font-weight: 600; }
.site-footer__licence-no { padding-inline-start: var(--space-5); border-inline-start: 1px solid rgb(255 255 255 / 0.22); }
.site-footer__licence-no strong {
    color: #fff;
    font-family: var(--font-latin);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}

/* the logo's seven lines, in white */
.site-footer__rule {
    display: block;
    height: var(--rule7-h);
    background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.24) 0 1px, transparent 1px var(--rule7-gap));
}

/* ── Brand ───────────────────────────────────────────────────────────────── */
.site-footer__about { max-width: 21rem; font-size: var(--fs-sm); line-height: 1.9; }
.site-footer__socials { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
.site-footer__socials a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgb(255 255 255 / 0.4);
    border-radius: 50%;
    font-size: 1.05rem;
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-spring);
}
.site-footer__socials a:hover { background: #fff; border-color: #fff; color: var(--footer-bg); transform: translateY(-3px); }

/* ── Columns ─────────────────────────────────────────────────────────────── */
.site-footer__heading {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid rgb(255 255 255 / 0.22);
    color: #fff;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.site-footer__col ul { display: grid; gap: var(--space-3); }
.site-footer__col li { font-size: var(--fs-sm); }

.site-footer__branches a { display: inline-flex; align-items: baseline; gap: var(--space-2); }
.site-footer__branches small { color: rgb(255 255 255 / 0.72); font-size: 0.72rem; }

.site-footer__number {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: color var(--dur) var(--ease-out);
}
.site-footer__number:hover { color: var(--aqua); }
.site-footer__hint { margin: var(--space-1) 0 var(--space-4); font-size: var(--fs-xs); color: rgb(255 255 255 / 0.75); }

.site-footer__contact li { display: flex; align-items: center; gap: var(--space-2); }
.site-footer__contact .icon { color: rgb(255 255 255 / 0.7); }

/* ── Bottom row ──────────────────────────────────────────────────────────── */
/* Bottom bar: a slightly darker pill — © with the ring icon · legal pills · HiTech credit pill */
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-block: var(--space-6) var(--space-8);
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: var(--r-pill);
    background: rgb(0 0 0 / 0.12);
    font-size: var(--fs-xs);
}

.site-footer__copy { display: inline-flex; align-items: center; gap: var(--space-3); color: rgb(255 255 255 / 0.85); }
.site-footer__copy img { width: 28px; height: 28px; border-radius: 8px; }

.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.site-footer__legal a {
    padding: 0.45em 1em;
    border-radius: var(--r-pill);
    color: rgb(255 255 255 / 0.9);
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.site-footer__legal a:hover,
.site-footer__legal a[aria-current="page"] { background: rgb(255 255 255 / 0.12); color: #fff; }

.site-footer__credit {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.5em 0.6em 0.5em 1.1em;
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: var(--r-pill);
    color: rgb(255 255 255 / 0.85);
    transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.site-footer__credit img { width: auto; height: 20px; }
.site-footer__credit:hover { background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.5); color: #fff; }
/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .site-footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .site-footer__brand {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: var(--space-4) var(--space-8);
        padding-bottom: var(--space-8);
        border-bottom: 1px solid rgb(255 255 255 / 0.15);
    }
    .site-footer__about, .site-footer__socials { margin-top: 0; }
}

@media (max-width: 767.98px) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) var(--space-5); padding-block: var(--space-10) var(--space-8); }
    .site-footer__brand { display: block; }
    .site-footer__top { flex-direction: column; text-align: center; gap: var(--space-6); padding-block: var(--space-10) var(--space-8); }
    [dir] .site-footer__licence { flex-direction: column; gap: var(--space-3); padding: var(--space-5) var(--space-5) var(--space-4); border-radius: 28px; }
    .site-footer__licence-no { padding: var(--space-3) 0 0; border-inline-start: 0; border-top: 1px solid rgb(255 255 255 / 0.22); width: 100%; }
    .site-footer__socials { margin-top: var(--space-5); }
    .site-footer__contact { grid-column: 1 / -1; }
    .site-footer__bottom { flex-direction: column; gap: var(--space-3); padding: var(--space-5) var(--space-4); border-radius: 24px; text-align: center; }
    .site-footer__copy { flex-direction: column; gap: var(--space-2); }
    .site-footer__legal { justify-content: center; }
    .site-footer__mark { width: 220%; bottom: -2%; }
}

@media (max-width: 991.98px) {
    /* The footer is the last thing on the page, so it (not <main>) leaves room for the tab bar */
    .site-footer { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }
    .site-main:has(+ .cta), .site-main:has(+ .site-footer) { padding-bottom: 0; }
}
