/* ============================================================
   FOOTER (Oct 2026 restyle) — the site-wide footer.

   Loaded from includes/header.php after the page's main sheet (style.css or
   style-v3.css) and nav.css, the same arrangement as NAV-002: one sheet styles the
   footer on every page, so there is no second copy to forget. The old rules for
   .footer-shell / .footer-links etc. still sit in those sheets; everything here is
   prefixed with .site-footer so it outranks them (including the homepage's
   .page-home overrides) without !important.

   Layout (owner's mock-up): open on the page background, no card. One row — brand
   with socials on the left, the main links in a single line in the middle, Portugal
   and the UK on the right — then a hairline and the utility bar: copyright and the
   operator left, legal links and the language switch right.

   The shell's WIDTH is deliberately not set here — each page context already lines
   the footer up with its own navbar (1180 / 1280 / 1392), and that stays theirs.
   ============================================================ */

.site-footer {
  --ft-blue: #1f4fe0;
  --ft-blue-soft: rgba(47, 95, 216, 0.09);
  --ft-tile: #eef1fc;
  --ft-ink: #141c3a;
  --ft-link: #3f4a6e;
  --ft-text: #4f5a7c;
  --ft-muted: #6f7898;
  --ft-line: rgba(214, 220, 238, 0.95);
}

/* ── Width + spacing (owner's mock-up) ─────────────────────────
   The footer is as wide as the page content — the closing call-to-action card
   above lines up with it exactly (1232px, 1244px on wide screens). Its type and
   spacing follow the mock-up's proportions: compact, not page-sized. Selectors carry extra weight on purpose: style-v3.css
   and pages.css load after this sheet on the marketing pages and set their own
   footer width and top margin. */
html body .site-footer.site-footer,
html body .wrap:has(> .mp-page) > .site-footer {
  width: min(calc(100% - 48px), max(1232px, min(1244px, 82vw)));
  margin-inline: auto;
  margin-top: 0;
}
@media (max-width: 768px) {
  html body .site-footer.site-footer,
  html body .wrap:has(> .mp-page) > .site-footer { width: calc(100% - 32px); }
}
.site-footer .footer-shell { width: 100%; max-width: none; }

/* ── Shell: open layout, no card ───────────────────────────── */
.site-footer .footer-shell {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none; /* the old card blurred the page behind it */
  overflow: visible; /* the language menu opens above the bar */
}
.site-footer .footer-shell::before { display: none; }

/* ── Top row ───────────────────────────────────────────────── */
.site-footer .footer-top {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  padding: 44px 0 34px;
}

.site-footer .footer-panel { display: flex; flex-direction: column; gap: 14px; }
.site-footer .footer-panel .brand { display: inline-flex; align-self: flex-start; margin: 0; }
.site-footer .footer-panel .logo-image { height: 36px; max-height: none; width: auto; }

.site-footer .footer-desc {
  margin: 0;
  max-width: 30em;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ft-text);
}

.site-footer .footer-socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.site-footer .footer-social {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ft-blue);
  background: var(--ft-tile);
  border: 0;
  box-shadow: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.site-footer .footer-social svg { width: 14px; height: 14px; }
.site-footer .footer-social:hover { transform: translateY(-2px); background: #e2e8fb; }

/* Main links, one line, centred in the middle column. */
.site-footer .footer-nav { justify-self: center; }
.site-footer .footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row; /* the base sheets stack .footer-links in a column */
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 38px;
}
.site-footer .footer-links a {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ft-link);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.site-footer .footer-links a:hover { color: var(--ft-blue); }

/* Where we are */
.site-footer .footer-places { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.site-footer .footer-places li { display: flex; align-items: flex-start; gap: 12px; }
.site-footer .footer-flag {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background-size: cover;
  box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(31, 45, 96, 0.16);
}
.site-footer .footer-places strong { display: block; margin-bottom: 2px; font-size: 12.5px; color: var(--ft-ink); }
.site-footer .footer-places span:not(.fi) { font-size: 12px; line-height: 1.5; color: var(--ft-text); max-width: 12em; display: block; }

/* ── Utility bar ───────────────────────────────────────────── */
.site-footer .footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--ft-line);
}

.site-footer .footer-meta { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.site-footer .footer-copy { margin: 0; font-size: 11.5px; color: var(--ft-link); white-space: nowrap; }
.site-footer .footer-operator { margin: 0; font-size: 10.5px; color: var(--ft-muted); }
.site-footer .footer-operator a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
.site-footer .footer-operator a:hover { color: var(--ft-blue); }
.site-footer .footer-operator-uk { display: block; margin-top: 2px; }

.site-footer .footer-utils { display: flex; align-items: center; justify-content: flex-end; gap: 22px; flex: 1 1 auto; min-width: 0; }
.site-footer .footer-legal { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 24px; }
.site-footer .footer-legal a {
  font-size: 11px;
  color: var(--ft-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.site-footer .footer-legal a:hover { color: var(--ft-blue); }

/* Language: a native <details>, so it opens without script and from the keyboard. */
.site-footer .footer-lang { position: relative; }
.site-footer .footer-lang-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px 0 11px;
  border-radius: 999px;
  border: 1px solid var(--ft-line);
  background: #fff;
  color: var(--ft-link);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.site-footer .footer-lang-toggle::-webkit-details-marker { display: none; }
.site-footer .footer-lang-toggle svg:first-child { color: var(--ft-link); width: 15px; height: 15px; }
/* Flags in the language menu and on its button. Sized explicitly: the footer's own rules
   made them blocks, and an empty block has no height — so every flag was drawn 0px tall. */
.site-footer .footer-lang .fi { display: inline-block; flex: none; width: 18px; height: 13.5px; line-height: 13.5px;
  border-radius: 2px; background-size: cover; background-position: center; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08); }
.site-footer .footer-lang-toggle:hover { border-color: rgba(47, 95, 216, 0.35); color: var(--ft-blue); }
.site-footer .footer-lang-arrow { transition: transform 0.15s ease; }
.site-footer .footer-lang[open] .footer-lang-arrow { transform: rotate(180deg); }

.site-footer .footer-lang-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--ft-line);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(80, 92, 140, 0.16);
}
.site-footer .footer-lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ft-link);
  text-decoration: none;
}
.site-footer .footer-lang-option:hover { background: #f3f5fd; color: var(--ft-blue); }
.site-footer .footer-lang-option.active { color: var(--ft-blue); background: var(--ft-blue-soft); }

/* Keyboard focus, everywhere in the footer. */
.site-footer a:focus-visible,
.site-footer .footer-lang-toggle:focus-visible {
  outline: 2px solid var(--ft-blue);
  outline-offset: 3px;
  border-radius: 6px;
}
.site-footer .footer-social:focus-visible { border-radius: 10px; }
.site-footer .footer-lang-toggle:focus-visible { border-radius: 999px; }

/* ── Responsive ────────────────────────────────────────────── */

/* Narrow desktop: the links get a little closer together. */
@media (max-width: 1240px) {
  .site-footer .footer-top { grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto; gap: 28px; }
  .site-footer .footer-links { gap: 10px 22px; }
  .site-footer .footer-links a { font-size: 15px; }
}

/* Tablet: brand and places side by side, the links as their own row beneath. */
@media (max-width: 1024px) {
  .site-footer .footer-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand places" "links links";
    gap: 32px 40px;
    padding-top: 44px;
  }
  .site-footer .footer-panel { grid-area: brand; }
  .site-footer .footer-places { grid-area: places; }
  .site-footer .footer-nav { grid-area: links; justify-self: stretch; padding-top: 28px; border-top: 1px solid var(--ft-line); }
  .site-footer .footer-links { justify-content: flex-start; gap: 12px 32px; }
  .site-footer .footer-bar { flex-direction: column; align-items: flex-start; }
  .site-footer .footer-utils { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
  .site-footer .footer-legal { justify-content: flex-start; }
  .site-footer .footer-copy { white-space: normal; }
}

/* Phone: one column. */
@media (max-width: 640px) {
  .site-footer .footer-top { grid-template-columns: 1fr; grid-template-areas: "brand" "links" "places"; padding-top: 32px; gap: 28px; }
  .site-footer .footer-panel .logo-image { height: 38px; }
  .site-footer .footer-desc { font-size: 14.5px; }
  .site-footer .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
  .site-footer .footer-places { gap: 18px; }
  .site-footer .footer-legal { gap: 8px 20px; }
  .site-footer .footer-lang-menu { right: auto; left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer .footer-social,
.site-footer .footer-lang-arrow { transition: none; }
  .site-footer .footer-social:hover { transform: none; }
}
