/* core/css/site-footer.css - the public site footer (pages/includes/footer.html).
   A deep-navy band in both light and dark mode: it closes every page with the same brand surface, and its own
   text tokens keep contrast above WCAG AA (the theme's --bs-secondary-color is near-white, see theme-css notes).
   Logical properties only (margin-inline, inset-inline), so RTL (fa, ar) needs no overrides. */

.site-footer {
    --sf-bg: #0b1626;
    --sf-bg-2: #0f1e33;
    --sf-line: rgba(255, 255, 255, .09);
    --sf-text: #b7c2d0;          /* 9.6:1 on --sf-bg */
    --sf-muted: #8e9aab;         /* 6.2:1 on --sf-bg */
    --sf-heading: #ffffff;
    --sf-link-hover: #ffffff;
    --sf-accent: #5aa7f5;        /* brand blue lifted for dark surfaces */
    --sf-primary: var(--bs-primary, #066ac9);

    position: relative;
    margin-top: 5rem;            /* room for the CTA card that overlaps the top edge */
    padding-bottom: env(safe-area-inset-bottom, 0);
    background:
        radial-gradient(1200px 400px at 85% -10%, rgba(6, 106, 201, .18), transparent 60%),
        linear-gradient(180deg, var(--sf-bg-2) 0%, var(--sf-bg) 40%);
    color: var(--sf-text);
    font-size: .9375rem;
    line-height: 1.6;
}

[data-bs-theme=dark] .site-footer {
    --sf-bg: #080f1b;
    --sf-bg-2: #0b1626;
    border-top: 1px solid var(--sf-line);
}

.site-footer a {
    color: var(--sf-text);
    text-decoration: none;
    transition: color .15s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--sf-link-hover);
}

.site-footer a:focus-visible,
.site-footer button:focus-visible {
    outline: 2px solid var(--sf-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== CTA card (overlaps the top edge) ===== */
.site-footer-cta {
    position: relative;
    top: -3rem;
    margin-bottom: -1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 1.75rem 2rem;
    border-radius: 1.25rem;
    background: linear-gradient(120deg, var(--sf-primary) 0%, #0a4f98 55%, #0c2f5c 100%);
    box-shadow: 0 20px 40px -18px rgba(6, 40, 90, .55);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.site-footer-cta::after {          /* soft glow, decorative */
    content: "";
    position: absolute;
    inset-inline-end: -80px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.site-footer-cta-text { flex: 1 1 22rem; min-width: 0; }

.site-footer-cta-title {
    margin: 0 0 .35rem;
    font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem);
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

.site-footer-cta-lead {
    margin: 0;
    color: rgba(255, 255, 255, .85);
    font-size: .95rem;
}

.site-footer-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.site-footer .site-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: .65rem 1.25rem;
    border-radius: .65rem;
    font-weight: 600;
    white-space: nowrap;
}

.site-footer .btn-light.site-footer-btn { color: #0a3d75; background: #fff; border-color: #fff; }  /* theme's btn-light turns grey in dark mode */
.site-footer .btn-light.site-footer-btn:hover { color: #062a52; background: #eef4fb; }
.site-footer .btn-outline-light.site-footer-btn { color: #fff; border-color: rgba(255, 255, 255, .55); }
.site-footer .btn-outline-light.site-footer-btn:hover { color: #0a3d75; background: #fff; }

/* ===== Main grid ===== */
.site-footer-main { padding-bottom: 2.5rem; }

.site-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1rem;
}

.site-footer-logo { height: 40px; width: auto; }

.site-footer-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sf-heading);
}

.site-footer-about {
    max-width: 26rem;
    margin-bottom: 1.25rem;
    color: var(--sf-text);
}

.site-footer-contact {
    display: grid;
    gap: .55rem;
    margin-bottom: 1.25rem;
    font-style: normal;
}

.site-footer-contact > a,
.site-footer-contact > span {
    display: inline-flex;
    align-items: flex-start;
    gap: .6rem;
    color: var(--sf-text);
    overflow-wrap: anywhere;
}

.site-footer-contact .bi {
    flex: 0 0 auto;
    margin-top: .2rem;
    color: var(--sf-accent);
}

.site-footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.site-footer-social a {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--sf-line);
    background: rgba(255, 255, 255, .04);
    font-size: 1.05rem;
}

.site-footer-social a:hover {
    background: var(--sf-primary);
    border-color: var(--sf-primary);
}

.site-footer-trust { display: flex; flex-wrap: wrap; gap: .75rem; }

.site-footer-badge {
    display: inline-flex;
    padding: .35rem;
    border-radius: .75rem;
    background: #fff;           /* trust seals are drawn for a white background */
}

.site-footer-badge img { display: block; max-height: 88px; width: auto; height: auto; aspect-ratio: 125 / 136; }
.site-footer-badge a { cursor: pointer; color: #333; font-size: .75rem; }  /* alt text when the seal is blocked */

/* ===== Link columns ===== */
.site-footer-heading {
    margin: 0 0 1rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sf-heading);
}

:lang(fa) .site-footer-heading,
:lang(ar) .site-footer-heading {
    font-size: .95rem;
    letter-spacing: 0;
}

.site-footer-links {
    display: grid;
    gap: .55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer-links a {
    display: inline-block;
    padding-block: .1rem;      /* 24px+ tap target with the line height */
}

.site-footer-more {
    display: inline-flex !important;
    align-items: center;
    gap: .35rem;
    color: var(--sf-accent) !important;
    font-weight: 600;
}

.site-footer-more:hover { color: #fff !important; }

/* RTL: the arrow's glyph (::before) is mirrored by core/css/l10n.css; the element itself must never be flipped too. */
[dir=rtl] .site-footer-arrow { transform: none !important; }

/* ===== Bottom bar ===== */
.site-footer-bottom {
    border-top: 1px solid var(--sf-line);
    background: rgba(0, 0, 0, .18);
}

.site-footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    padding-block: 1.1rem;
    font-size: .875rem;
}

.site-footer-copy {
    margin: 0;
    color: var(--sf-muted);
}

.site-footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer-legal a { color: var(--sf-muted); }
.site-footer-legal a:hover { color: #fff; }

.site-footer .site-footer-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    padding: .35rem .8rem;
    border: 1px solid var(--sf-line);
    border-radius: 2rem;
    background: rgba(255, 255, 255, .04);
    color: var(--sf-text);
}

.site-footer .site-footer-lang-btn:hover,
.site-footer .site-footer-lang-btn[aria-expanded=true] {
    color: #fff;
    border-color: rgba(255, 255, 255, .3);
}

/* Language menu: a light panel on the dark footer, same look as the header's language menu
   (core/css/site-header.css). Scoped under .site-footer so it outranks ".site-footer a:hover",
   which turns links near-white for the dark background (unreadable on the panel). */
.site-footer .site-footer-lang .dropdown-menu {
    min-width: 11rem;
    margin: 0;
    padding: .4rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .85rem;
    background: var(--bs-body-bg);
    box-shadow: 0 24px 48px -16px rgba(15, 23, 42, .35);
    text-align: start;
}

.site-footer .site-footer-lang .dropdown-item {
    gap: .65rem !important;
    margin: 0;
    padding: .5rem .75rem;
    border-radius: .6rem;
    background: transparent;
    color: var(--bs-body-color);
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.site-footer .site-footer-lang .dropdown-item:hover,
.site-footer .site-footer-lang .dropdown-item:focus-visible {
    background: rgba(var(--bs-primary-rgb), .07);
    color: var(--bs-primary);
}

.site-footer .site-footer-lang .dropdown-item.active,
.site-footer .site-footer-lang .dropdown-item:active {
    background: rgba(var(--bs-primary-rgb), .1);
    color: var(--bs-primary);
    font-weight: 600;
}

.site-footer .site-footer-lang .dropdown-item:focus-visible {
    outline-offset: -2px;
}

/* ===== Phones & tablets ===== */
@media (max-width: 991.98px) {
    /* the plans page's fixed bottom CTA (subscriptions/catalog.js) must not cover the legal row */
    .cx-has-sticky .site-footer-bottom { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    .site-footer-bottom-inner { justify-content: center; text-align: center; }
    .site-footer-legal { justify-content: center; }
}

@media (max-width: 575.98px) {
    .site-footer { margin-top: 4rem; }
    .site-footer-cta { padding: 1.5rem 1.25rem; border-radius: 1rem; }
    .site-footer-cta-actions { width: 100%; }
    .site-footer .site-footer-btn { flex: 1 1 auto; justify-content: center; }
    .site-footer-main { padding-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .site-footer a { transition: none; }
}

@media print {
    .site-footer-cta, .site-footer-social, .site-footer-lang, .site-footer-trust { display: none !important; }
    .site-footer { background: none; color: #000; margin-top: 1rem; }
}
