/* ============================================================================
   Joy Group — THE FOOTER. One file, loaded by every page.

   The footer renders on the dc homepage (template markup + its own <style>) and
   on the plain-HTML subpages (markup injected by chrome.js, styled by site.css).
   Keeping the design in both places did not work: an audit on 2026-08-19 found
   13 of 27 footer selectors rendering differently between the two, because every
   phone fix made that day had landed on the homepage only — link padding 11 vs
   8px, nav gap 32 vs 48, copyright centred vs left, socials wrapped vs not,
   newsletter button 44 vs 42.

   So the design lives HERE and nowhere else. The homepage links this file; site.css
   @imports it for the subpages. Do not restate any of these rules in either place —
   that is precisely how they drifted. If a footer rule seems not to apply on the
   homepage, the cause is almost always an inline style on the element, which beats
   any stylesheet: fix it by removing the inline style, not by adding !important here.
   ========================================================================== */

/* ---------- Ground ---------- */
/* The bottom padding carries the home-indicator inset so the ink ground reaches the
   real bottom edge under viewport-fit=cover. --sa-b is 0 on phones without one. */
#footer { background: var(--bg-inverse); color: var(--text-inverse);
  padding: var(--space-5) 0 calc(var(--space-4) + var(--sa-b)); }
#footer .shell { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter-lg); }
#footer a:hover, #footer a:focus-visible { color: var(--crisp-white) !important; }

/* ---------- Top row: wordmark + newsletter ---------- */
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding-bottom: var(--space-3); border-bottom: var(--hairline) solid var(--rule-inverse); }
.footer-top .wordmark { width: 184px; height: auto; display: block; flex: 0 0 auto; }   /* height: auto - the img carries width/height attributes so it has a box before the file arrives; without this the attribute height would hold */
.footer-su { margin: 0; font-family: var(--font-ui); font-weight: var(--fw-light); font-size: 24px;
  line-height: 1.15; letter-spacing: 0.02em; text-transform: uppercase; color: var(--crisp-white);
  flex: 0 0 auto; white-space: nowrap; }
.footer-nl { display: flex; align-items: center; gap: var(--space-5); }
.footer-nl-col { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); flex: 0 1 auto; min-width: 0; }
/* Out of flow so its reserved height cannot pull the pill off the wordmark's centre. */
.footer-nl-col #dc-nl-status { position: absolute; top: calc(100% + 4px); right: 0; margin: 0; min-height: 1.1em; font-family: var(--font-ui); font-size: var(--text-caption-size); line-height: 1.4; color: var(--text-inverse-secondary); }
/* Size via width/height, NOT flex-basis: the phone block flips this row to a column,
   and a flex-basis would then be read as the pill's HEIGHT. */
.nl-pill { display: flex; align-items: center; gap: var(--space-1); flex: 0 1 auto;
  width: 390px; max-width: 100%; min-width: 260px; height: 54px;
  padding: 0 6px 0 var(--space-3); border-radius: 999px; background: var(--crisp-white);
  transition: box-shadow var(--dur-base) var(--ease-standard); }
.nl-pill.nl-err { box-shadow: inset 0 0 0 2px var(--ink-black); }
.nl-pill:focus-within { box-shadow: inset 0 0 0 2px var(--ink-black) !important; }
/* The pill's ring above IS the field's focus mark: the site-wide :focus-visible outline drew a
   second, white box around the input inside it (owner saw it, 2026-10-15). Off for this field only. */
.nl-pill input:focus, .nl-pill input:focus-visible { outline: none; }
.nl-pill input { flex: 1 1 auto; min-width: 0; appearance: none; background: none; border: none;
  align-self: stretch; color: var(--ink-black); font-family: var(--font-ui); font-size: var(--text-body-size); }
.nl-pill input::placeholder { color: var(--graphite); }
.nl-pill button { flex: 0 0 auto; height: 42px; padding: 0 var(--space-3); border-radius: 999px; border: none;
  background: var(--ink-black); color: var(--crisp-white); font-family: var(--font-ui); font-weight: var(--fw-medium);
  font-size: var(--text-btn-size); letter-spacing: var(--text-btn-ls); text-transform: uppercase; cursor: pointer;
  transition: opacity var(--dur-base) var(--ease-standard); }
.nl-pill button:hover { opacity: 0.8; }

/* ---------- Columns ---------- */
.footer-cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--grid-gap); padding: var(--space-5) 0; }
.footer-tagline-col { grid-column: 1 / span 4; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-3); }
/* align-self, or nothing. .footer-tagline-col is a flex column and a flex child
   stretches by default, so the pill ran the full width of the column and stopped
   reading as a button. Everything else it needs is .joy-btn's already. */
.footer-agents { align-self: flex-start; }
/* Not on /contact/ (owner, 2026-10-15): that page closes on its own agent-portal section, so
   the footer's pill would be the same link twice on one screen. Every width. */
body[data-page="contact"] .footer-agents { display: none; }
.footer-tagline { margin: 0; max-width: 32ch; font-family: var(--font-ui); font-size: var(--text-body-sm-size); line-height: var(--text-body-sm-lh); color: var(--text-inverse-secondary); text-wrap: pretty; }
.footer-nav-col { grid-column: 5 / span 4; display: flex; flex-direction: column; gap: var(--space-4); }
.footer-colhead { margin: 0; font-family: var(--font-ui); font-weight: var(--fw-medium); font-size: var(--text-label-size); letter-spacing: var(--text-label-ls); text-transform: uppercase; color: var(--white-a62); }
/* 9 links: 5 rows over two columns. At 4 they overflowed into a third column. */
.footer-navgrid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, auto);
  grid-auto-flow: column; gap: 0 var(--space-6); }
.footer-navgrid a { font-family: var(--font-ui); font-size: var(--text-body-sm-size); color: var(--text-inverse-secondary); text-decoration: none; border: none; padding: 8px 0; }
.footer-contact-col { position: relative; grid-column: 9 / span 4; display: flex; flex-direction: column; gap: var(--space-4); }
.footer-contact { display: flex; flex-direction: column; }
.footer-contact a, .footer-contact span { font-family: var(--font-ui); font-size: var(--text-body-sm-size); color: var(--text-inverse-secondary); text-decoration: none; border: none; padding: 8px 0; }

/* ---------- Language toggle ---------- */
/* .footer-lang positions; .lang-pill is the control. Keeping those separate is what
   lets the homepage and the subpages share one definition. */
.footer-lang { position: absolute; right: 0; bottom: 0; }
.lang-pill { display: flex; align-items: center; gap: var(--space-1); border: var(--hairline) solid var(--rule-inverse); border-radius: 999px; padding: 6px 8px; flex: 0 0 auto; }
.lang-pill button { appearance: none; background: transparent; border: none; border-radius: 999px; cursor: pointer;
  padding: 4px 14px; font-family: var(--font-ui); font-weight: var(--fw-medium);
  font-size: var(--text-label-size); letter-spacing: var(--text-label-ls);
  /* a62, not a40: at 11px the inactive label is interactive text, and white-a40 on ink
     measures 3.78:1 — under the 4.5:1 minimum. a62 is 7.18:1. */
  color: var(--white-a62); }
.lang-pill button[aria-pressed="true"] { background: var(--crisp-white); color: var(--ink-black); }

/* ---------- Bottom utility bar ---------- */
.footer-bottom { border-top: var(--hairline) solid var(--rule-inverse); padding-top: var(--space-3); display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.footer-copy { font-family: var(--font-ui); font-size: var(--text-caption-size); color: var(--white-a62); }
.footer-copy a { color: var(--text-inverse-secondary); text-decoration: none; border: none; }

/* A tablet is a touch device that takes the DESKTOP footer, and there the AL/EN
   buttons are 46x21 and the Privacy Policy link 70x12 — both under the 24px
   minimum, fine for a mouse and awkward for a thumb. The phone block already
   fixes this by growing them, but that comes bundled with the phone's pill
   redesign (square ends, no gap), which has no business on an iPad. So here the
   hit area grows and nothing visual moves: an absolutely-positioned ::after
   costs no layout, exactly the trick .gal-dot uses. Scoped to hover:none so a
   desktop pointer is untouched; the two ::after boxes extend only vertically,
   so AL and EN cannot swallow each other's taps. */
@media (min-width: 769px) and (hover: none) {
  .lang-pill button { position: relative; }
  .lang-pill button::after { content: ""; position: absolute; inset: -12px 0; }
  .footer-copy a { position: relative; display: inline-block; }
  .footer-copy a::after { content: ""; position: absolute; inset: -16px -6px; }
}
.footer-socials { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.footer-socials a { width: 40px; height: 40px; border-radius: 999px; border: var(--hairline) solid var(--rule-inverse); display: flex; align-items: center; justify-content: center; color: var(--crisp-white); text-decoration: none; transition: background-color var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard); }
.footer-socials a:hover, .footer-socials a:focus-visible { background: var(--crisp-white); color: var(--ink-black) !important; }

/* ---- Where the signup label is dropped, and why ----------------------------
   .footer-top is a row of wordmark | "Stay informed" | pill. The label's left
   edge crosses the wordmark's right through a band of widths. The phone block
   drops it, for the same reason plus the stacked layout - the signup itself
   stays, and the input's placeholder says what the field is for.

   769-1059 WIDE, ANY ORIENTATION (owner saw the overlap, 2026-10-15). It used to be
   tablet portrait only, 769-880, measured against an older, shorter label; the
   Albanian "QËNDRONI TË INFORMUAR" overlaps the wordmark at EVERY width under ~975
   (193px at 769, 67 at 900 - landscape or portrait alike, so a narrowed desktop
   window or a landscape tablet showed it) and sits only 29px off it at 1000. From
   1060 it clears by 77+ with the pill 35 away. One band for both languages, so the
   two footers stay the same shape (the English would fit from ~900). Landscape
   PHONES are under 769 or caught by the height rule below either way.

   A PHONE IN LANDSCAPE takes it because it is still a phone. Keying that off
   width fails: a 430x932 handset is 932 wide once turned, past any sane tablet
   cut-off, so the label reappeared on the same device that hides it in portrait
   — one phone, two different footers. Height is what actually separates a
   handset on its side from a tablet on its side: no tablet is under 700px tall
   in landscape, and no phone is over 500. */
@media (min-width: 769px) and (max-width: 1059px) {
  .footer-su { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .footer-su { display: none; }
}

/* ============================================================================
   PHONE
   ========================================================================== */
@media (max-width: 768px), (max-width: 900px) and (orientation: portrait) {
  /* "Stay informed" goes; the signup itself stays. The label is a 24px uppercase line
     that, stacked above a full-width pill, read as a section heading in a footer with
     no other headings — and the input's placeholder already says what the field is. */
  .footer-su { display: none; }
  /* The wordmark is CENTRED here, deliberately: it caps the footer above a full-width
     signup pill while every block below keeps the left margin. Centring the ROW would
     shrink the pill with it, so only the wordmark is centred. */
  .footer-top { flex-direction: column; align-items: stretch; gap: var(--space-6); }
  /* No newsletter signup on a phone (owner, 2026-10-15): the top row is the wordmark alone.
     The whole COLUMN goes, not just the pill: hiding .footer-nl left its column and the empty
     status line in it (13px) behind the row's 44px gap, 57px of blank between the wordmark and
     the hairline (owner caught it). Now the hairline sits the row's own padding under the
     wordmark - 22px at 390, the --space-3 it pays on desktop. */
  .footer-nl-col { display: none; }
  .footer-top .wordmark { align-self: center; }
  .footer-nl-col { align-items: flex-start; width: 100%; }
  .footer-nl { flex-direction: column; align-items: flex-start; gap: var(--space-3); width: 100%; }
  .footer-nl-col #dc-nl-status { position: static; }
  .nl-pill { flex: 1 1 auto; width: 100%; }
  .nl-pill button { height: 44px; }

  .footer-cols { grid-template-columns: 1fr; }
  .footer-tagline-col, .footer-nav-col, .footer-contact-col { grid-column: auto; }
  /* THE AGENTS PILL MOVES UNDER THE HAIRLINE, full width, at the user's ask.
     Stacked, it had been sitting 28% of the way down a 1170px footer, wedged
     between the tagline and NAVIGIM — which is the bottom of column one on
     desktop, but in the middle of everything once the columns become one.
     It is a CSS move, not a markup one. The pill exists twice — in chrome.js
     and in the homepage's template — and doing this in the stylesheet keeps the
     two copies in step for free.
     display: contents dissolves .footer-tagline-col so its two children become
     grid items of .footer-cols itself; without that, `order` could only shuffle
     the pill inside its own parent, where it is the second of two. Then order:-1
     puts it first, directly under .footer-top's border-bottom.
     54px, matching .nl-pill exactly: two full-width pills stacked read as a pair
     when they share a height and as a mistake when they miss it by ten. The
     weights still differ where it matters — subscribe is a filled white pill,
     this is an outline — so the hierarchy survives the matching geometry. */
  /* UPDATE (owner, 2026-10-15): the pill now sits UNDER THE TAGLINE ("Themeluar në 1999...")
     rather than first under the hairline - the order: -1 is gone, so it follows the tagline as
     it does in the markup. Still full width and 54px, matching the signup pill. */
  .footer-tagline-col { display: contents; }
  .footer-agents { justify-self: stretch; align-self: start;
    width: 100%; box-sizing: border-box; height: 54px;
    margin: 0 0 var(--space-2); }
  /* A section label and the list under it are ONE block: 32px was the value this footer
     spends BETWEEN blocks, so both labels floated free of their own lists. */
  .footer-nav-col, .footer-contact-col { gap: var(--space-2); }
  .footer-navgrid { gap: 0 var(--space-4); }
  /* 8px padding gives a 39px row — under the 44px touch floor. 11px clears it. */
  .footer-navgrid a, .footer-contact a, .footer-contact span { padding: 11px 0; }

  /* Sized off the social icons, not off the touch minimum. 44px buttons made the pill
     58px tall — 14px taller than the icons below it — and it read as bulky. The ring
     hugs them now, so the control is 44px overall with each half a 42px target: past
     the 24px WCAG 2.5.8 floor, and the same inner height the icons have inside their
     own 1px ring. */
  .lang-pill { padding: 0; gap: 0; overflow: hidden; }
  .lang-pill button { min-height: 42px; padding: 0 14px; border-radius: 0; }
  /* Right edge lines up with the WhatsApp icon, not the page margin — the social row is
     CENTRED, so its last icon stops short of the margin. Derived from the row's own
     geometry, but it depends on the icon COUNT: update the 4 (and the 3 gaps) if a social link
     changes. It was 5 until YouTube left on 2026-10-15. */
  .footer-lang { right: calc((100% - (4 * 44px + 3 * var(--space-2))) / 2); }

  /* THE OVERFLOW FIX: this bar never wrapped, so the social circles ran off the right
     edge of the screen and the whole page scrolled sideways. */
  .footer-bottom { flex-wrap: wrap; justify-content: center; gap: var(--space-4); }
  .footer-copy { flex: 1 1 100%; text-align: center; }
  .footer-copy a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-socials { flex: 1 1 100%; flex-wrap: wrap; justify-content: center; }
  .footer-socials a { width: 44px; height: 44px; }
}

/* ---- Tablet portrait (owner, 2026-10-16) ----
   A portrait iPad up to 900px wide takes the PHONE footer above, all but one thing: the
   newsletter signup STAYS on a tablet (owner, 2026-10-15: "keep it on tablet") - it was
   only ever removed from phones. Stacked under the centred wordmark, full width, as the
   phone footer carried it before that removal. */
@media (min-width: 769px) and (max-width: 900px) and (orientation: portrait) {
  .footer-nl-col { display: flex; }
  /* ...and the top row is the desktop's (owner, 2026-10-16): the wordmark left and a SMALLER signup
     pill right, on one line and one level; the agent-portal pill at its own size, on the left -
     not the phone's full-width pills */
  .footer-top { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-5); }
  .footer-nl-col { align-items: flex-end; width: auto; flex: 0 1 auto; }
  .footer-nl { flex-direction: row; align-items: center; width: auto; }
  .footer-nl-col #dc-nl-status { position: absolute; }
  .nl-pill { flex: 0 1 auto; width: 340px; height: 46px; }
  .nl-pill button { height: 36px; }
  .footer-agents { justify-self: start; width: auto; height: auto; }
}
