/* ==========================================================================
   fix 6 Part 1: the footer (app/footer.php render_site_footer()), on every page that has one.
   Ported from bonfium-fix6/reference/index.html. Light grey #E2E3E5 exactly (the figure was rendered on it), ink text,
   the black wordmark the full width of the content column, the glass figure peeking over it at 58 %.
   Loaded last in the head by fix3_head() (app/fix3.php). Replaces the dark v4 card (.v4-foot), the ink card (.bf-foot2)
   and the first footer (.bf-foot).
   ========================================================================== */

.bf-ft{--ft-ink:#0B0F12;--ft-ink-2:#4A535B;--ft-peek:clamp(120px,19vw,230px);
  display:block;position:relative;margin:0;background:#E2E3E5;color:var(--ft-ink);
  font-family:var(--text,"Instrument Sans",system-ui,sans-serif);font-size:0.9375rem;line-height:1.5;-webkit-font-smoothing:antialiased;
  --bf-ring:0 0 0 3px rgba(14,20,23,.18)}
.bf-ft *,.bf-ft *::before,.bf-ft *::after{box-sizing:border-box}
.bf-ft-wrap{max-width:1240px;margin:0 auto;padding:0 16px}
@media (min-width:900px){.bf-ft-wrap{padding:0 40px}}

/* the wordmark and the figure: its bottom edge on the wordmark's top edge, about 58 % across */
.bf-ft-peekzone{position:relative;padding-top:calc(var(--ft-peek) * .63 + 36px)}
.bf-ft-mark{position:relative;display:block;width:100%;margin:0 auto}
.bf-ft-logo{display:block;width:100%;height:auto}
.bf-ft-peek{position:absolute;bottom:100%;left:58%;width:var(--ft-peek);transform:translateX(-50%);pointer-events:none}
.bf-ft-peek img{display:block;width:100%;height:auto}
.bf-ft img{-webkit-user-drag:none;-webkit-user-select:none;user-select:none}

/* the columns: one row on desktop; on phones the brand block on top, then two columns */
.bf-ft-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px 24px;padding:56px 0 40px}
@media (min-width:900px){.bf-ft-cols{grid-template-columns:minmax(0,1.6fr) repeat(3,minmax(0,1fr));padding:64px 0 48px}}
.bf-ft-brand{grid-column:1/-1;min-width:0}
@media (min-width:900px){.bf-ft-brand{grid-column:auto}}
.bf-ft-brand p{margin:0 0 18px;font-size:0.9375rem;line-height:1.5;color:var(--ft-ink-2);max-width:32ch}
.bf-ft-col{min-width:0}
.bf-ft .bf-ft-h{font:500 0.8125rem/1 var(--text,"Instrument Sans",system-ui,sans-serif);letter-spacing:0;text-transform:none;color:var(--ft-ink-2);margin:4px 0 14px}
.bf-ft-col a{display:block;width:max-content;max-width:100%;color:var(--ft-ink);text-decoration:none;font-size:0.9375rem;line-height:1.9;overflow-wrap:anywhere}
.bf-ft-col a:hover{text-decoration:underline;text-underline-offset:3px}

/* "Have a code? ABC-123": the header's field (forms.js formats it: uppercase, ABC-123, the arrow waits for six) */
.bf-ft-code{display:flex;align-items:center;max-width:280px;margin:0;padding:4px 4px 4px 16px;background:#fff;border-radius:999px}
.bf-ft-code input{flex:1;min-width:0;height:38px;margin:0;padding:0;border:0;border-radius:0;outline:0;background:transparent;box-shadow:none;color:var(--ft-ink);
  font:500 0.9375rem var(--text,"Instrument Sans",system-ui,sans-serif);letter-spacing:.06em;text-transform:uppercase;--bf-ring:none}
.bf-ft-code input::placeholder{color:#5F6870;opacity:1}
.bf-ft-code button{position:relative;flex:none;display:grid;place-items:center;width:38px;height:38px;margin:0;padding:0;border:0;border-radius:50%;
  background:var(--ft-ink);color:#fff;cursor:pointer}
.bf-ft-code button::after{content:"";position:absolute;inset:-4px;border-radius:50%}   /* a 46 px target */
.bf-ft-code button svg{display:block}
.bf-ft .bf-ferr{max-width:280px}

/* the legal row above a hairline; the social buttons only when the accounts are set in config */
.bf-ft-legal{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;padding:20px 0 28px;border-top:1px solid #CBCED2;font-size:0.8125rem;line-height:1.5;color:var(--ft-ink-2)}
.bf-ft-only{margin-left:auto}
.bf-ft-social{display:flex;gap:10px}
.bf-ft-social a{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#fff;color:var(--ft-ink);text-decoration:none}
.bf-ft-social a:hover{background:#F4F5F6}

/* phones: 44 px rows to tap, 15 px text */
@media (max-width:899px){
  .bf-ft-col a{display:flex;align-items:center;min-height:44px;line-height:1.3}
  .bf-ft .bf-ft-h{margin:4px 0 6px}
  .bf-ft-code{max-width:360px}
  .bf-ft-code input{font-size:1rem}   /* 16 px: no zoom on focus in iOS Safari */
  .bf-ft-legal{flex-direction:column;align-items:flex-start;gap:6px;font-size:0.9375rem}
  .bf-ft-only{margin-left:0}
  .bf-ft-social{margin-top:8px}
}
@media (pointer:coarse) and (min-width:900px){.bf-ft-col a{display:flex;align-items:center;min-height:44px;line-height:1.3}}

/* the footer stays at the bottom of short pages, with air above it (layout_fixes_v4, was .v4-foot in layout.css) */
html,body:has(> footer.bf-ft){height:auto}
body:has(> footer.bf-ft){min-height:100dvh;display:flex;flex-direction:column}
body:has(> footer.bf-ft) > main{flex:1 0 auto;padding-bottom:clamp(64px,8vh,120px)}
body:has(> footer.bf-ft) > footer.bf-ft{flex:none}
body:has(> footer.bf-ft) > main.shell{padding-bottom:clamp(64px,8vh,120px)!important}
body.v3.v4:has(> footer.bf-ft) > main.v3-main{padding-bottom:clamp(64px,8vh,120px)}
/* phones with a bar at the bottom (the action bar, the private tab bar): the grey runs on under it, the text stays above it */
@media (max-width:760px){
  body.v3.v4.has-actbar > footer.bf-ft{padding-bottom:calc(100px + env(safe-area-inset-bottom))}
  body.v3.v4:has(.v5p-tabs) > footer.bf-ft{padding-bottom:calc(92px + env(safe-area-inset-bottom))}
  body.v4-newpage > footer.bf-ft{padding-bottom:0!important}   /* New trade keeps its bar in its own flow */
}

/* Smaller (Vilius, 13 Oct: "footer is too big wide etc, tall"): the wordmark at about half the column, left with the
   brand column, the figure scaled with it, the same width as the header pill, tighter rows. */
.bf-ft{--ft-peek:clamp(70px,8.4vw,112px)}
.bf-ft-wrap{max-width:1200px}
.bf-ft-mark{width:min(100%,560px);margin:0}
.bf-ft-peekzone{padding-top:calc(var(--ft-peek) * .63 + 24px)}
.bf-ft-cols{padding:32px 0 24px;gap:20px 24px}
@media (min-width:900px){.bf-ft-cols{padding:36px 0 28px}}
.bf-ft-col a{line-height:1.75}
.bf-ft-legal{padding:16px 0 20px}
/* The figure peeks over the footer's top edge into the page above, hands on the grey's edge (Vilius, 13 Oct: "the glass
   man extends from the grey footer part into the white one, not from the bonfium logo"). Anchored to the footer's
   inner column, so the footer itself needs no room for it; above the wordmark's 58 % point. Its image has an empty band
   under the hands (25 of 304 px): moving it down by that band puts the hands on the edge. Shorter (still "too tall"). */
.bf-ft-wrap{position:relative;--ft-pad:16px}
@media (min-width:900px){.bf-ft-wrap{--ft-pad:40px}}
.bf-ft-peekzone,.bf-ft-mark{position:static}
.bf-ft-peekzone{padding-top:36px}
.bf-ft-mark{width:min(100%,440px)}
.bf-ft-peek{z-index:1;bottom:100%;left:calc(var(--ft-pad) + min(100% - 2 * var(--ft-pad), 440px) * .58);transform:translate(-50%,8.2%)}
.bf-ft-cols{padding:24px 0 16px}
@media (min-width:900px){.bf-ft-cols{padding:28px 0 20px}}
.bf-ft-col a{line-height:1.65}
.bf-ft-legal{padding:14px 0 16px}
/* phones: the three link columns side by side under the brand block (was two + Company below: ~900 px tall) */
@media (max-width:899px){
  .bf-ft-cols{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 14px}
  .bf-ft-col a{width:auto;line-height:1.3}
}

/* fix 7 Part 2.3 (bonfi_on(), app/f7/bonfi.php): Bonfi replaces the glass figure. He rises over the grey's top edge into
   the page above, hands on the edge (the fix 6 follow-up position, 58 % across the wordmark), when the footer is 40 % in
   view, and sinks back when you scroll up (footer.js). The cut is the footer's own edge: the only deliberate cut.
   Image 150 px tall (body 90), phones 103 (body 62). Until the clips arrive he is the wave still, showing its top 70 %
   (hat, lantern, face, the waving hand); a delivered footer-peek clip is framed for the edge and shows whole.
   The footer moves down a little so the space he rises into is clear (never over the page's text above). */
.bf-ft.f7-ft{margin-top:56px}
@media (max-width:899px){.bf-ft.f7-ft{margin-top:32px}}
.bf-ft.f7-ft .f7-ft-peek{--pk:150px;--vis:.7;position:absolute;z-index:1;bottom:100%;
  left:calc(var(--ft-pad) + min(100% - 2 * var(--ft-pad), 440px) * .58);transform:translateX(-50%);
  width:max-content;height:calc(var(--pk) * var(--vis));overflow:hidden;line-height:0;pointer-events:none}
@media (max-width:899px){.bf-ft.f7-ft .f7-ft-peek{--pk:103px}}
/* fix 8 Part 7: the v2.3 footer-peek clip (600x800; its cut line is at 77.6 %, aligned below) shows whole,
   200 px (body 90), phones 138 (body 62): he looks as big as the fix 7 still did */
.bf-ft.f7-ft .f7-ft-peek:has(bonfi-clip[data-mode=clip]){--vis:1;--pk:200px}
@media (max-width:899px){.bf-ft.f7-ft .f7-ft-peek:has(bonfi-clip[data-mode=clip]){--pk:138px}}
.bf-ft.f7-ft .f7-ft-peek bonfi-clip{height:var(--pk);transform:translateY(102%);transition:transform .45s cubic-bezier(.4,0,1,1)}
.bf-ft.f7-ft .f7-ft-peek.is-up bonfi-clip{transform:none;transition:transform .9s cubic-bezier(.22,1,.36,1)}
.bf-ft.f7-ft .f7-ft-peek.is-up bonfi-clip[data-mode=clip]{transition:none}   /* the clip rises by itself */
/* fix 13: the clip's own cut line is not its bottom. He is drawn rising from behind a straight edge: fully drawn down to
   row 608 of 800, fading out by row 616. Shifted down 24 %, row 608 sits exactly on the grey's top edge (no gap; the
   fade is under it). The clip also starts and ends with his hat drawn above that edge (rows 450-616), so footer.js sinks
   him a further --f13-sink (23.5 %, out of sight) in those frames and eases it to 0 as he rises, back as he sinks. */
.bf-ft.f7-ft .f7-ft-peek.is-up bonfi-clip[data-mode=clip]{transform:translateY(calc(24% + var(--f13-sink,23.5%)))}
@keyframes f7-ft-look{0%,100%{transform:rotate(0)}30%{transform:rotate(-4deg)}65%{transform:rotate(4deg)}}
.bf-ft.f7-ft .f7-ft-peek.is-up bonfi-clip[data-mode=poster]>img{transform-origin:50% 100%;animation:f7-ft-look 1.6s ease-in-out .9s 1 both}
@media (prefers-reduced-motion:reduce){
  .bf-ft.f7-ft .f7-ft-peek bonfi-clip,.bf-ft.f7-ft .f7-ft-peek.is-up bonfi-clip{transform:none;transition:none}
  .bf-ft.f7-ft .f7-ft-peek.is-up bonfi-clip[data-mode]>img{animation:none}
  /* (bonfi3d) the 3D set's still (his risen frame, cut at row 615 as the clip): row 608 on the grey's edge, as the clip */
  .bf-ft.f7-ft .f7-ft-peek.is-up bonfi-clip[data-mode=clip][data-bonfi="3d"]{transform:translateY(24%)}
}
/* fix 8 Part 2 (FINDINGS-8 §3 Footer: "gap above the footer 120 (72 phones)"): a fix 7 page's last block is 120 / 96 / 72
   above the footer. The older rule above (main padding clamp(64px,8vh,120px)) gave 72 on a 900 px window. */
html body:has(> footer.bf-ft.f7-ft) > main.f7-main{padding-bottom:var(--f8-foot)}

/* founders / blog prompt v2.1 §9: the current page's link in the footer is 600 (aria-current="page", app/footer.php) */
.bf-ft.f7-ft .bf-ft-col a[aria-current="page"]{font-weight:600}

/* ================================================================ fix 15 P9 (PROMPT-fix15-phones.md §1): phones only
   (≤ 1023, under html.f14; the desktop footer is untouched).
   - Bonfi's peek is centred: his body (the clip's feet x, the middle of its box) on the footer's middle (it sat at 58 %
     of the wordmark: centre 222 at 390).
   - He rises once and then idles on the grey's edge without ever sinking away: footer.js keeps the clip in its risen
     stretch (see there).
   - The three link columns share one row grid (subgrid), so a link that wraps ("Badge for your listing", lt "Ženklelis
     tavo skelbimui") makes its whole row taller and every column stays aligned. */
@media (max-width:1023px){
  html.f14 .bf-ft.f7-ft .f7-ft-peek{left:50%}
  html.f14 .bf-ft.f7-ft .bf-ft-cols{row-gap:0}
  html.f14 .bf-ft.f7-ft .bf-ft-col{display:grid;grid-template-rows:subgrid;grid-row:span 6;align-content:start}
  html.f14 .bf-ft.f7-ft .bf-ft-col>.bf-ft-h{align-self:start}
}
@media (max-width:899px){
  html.f14 .bf-ft.f7-ft .bf-ft-brand{grid-row:1;margin-bottom:16px}
  html.f14 .bf-ft.f7-ft .bf-ft-col{grid-row:2 / span 6}
  /* each link's first line sits 12 px into its 44 px row in every column, so a wrapped link ("Badge for / your listing")
     starts on the same line as its neighbours and only makes its row taller (it was centred, so it started 10 px higher) */
  html.f14 .bf-ft.f7-ft .bf-ft-col a{align-items:flex-start;padding-top:12px;padding-bottom:12px}
}
@media (min-width:900px) and (max-width:1023px){
  html.f14 .bf-ft.f7-ft .bf-ft-brand{grid-row:1 / span 6}
  html.f14 .bf-ft.f7-ft .bf-ft-col{grid-row:1 / span 6}
}

/* ================================================================ founders / blog prompt v2.1 §9: the Company column
   - the current page's link is 600 (aria-current="page", app/footer.php): the rule sits with the fix 7 rules, before the
     fix 15 block;
   - once Blog is there (the first published entry) the Company column has seven rows: the phones' shared row grid (fix 15
     P9 above) spans seven, so every column stays on it. Without Blog nothing here applies and the footer is as before. */
@media (max-width:1023px){
  html.f14 .bf-ft.f7-ft .bf-ft-cols.is-r7>.bf-ft-col{grid-row:span 7}
}
@media (max-width:899px){
  html.f14 .bf-ft.f7-ft .bf-ft-cols.is-r7>.bf-ft-col{grid-row:2 / span 7}
}
@media (min-width:900px) and (max-width:1023px){
  html.f14 .bf-ft.f7-ft .bf-ft-cols.is-r7>.bf-ft-brand{grid-row:1 / span 7}
  html.f14 .bf-ft.f7-ft .bf-ft-cols.is-r7>.bf-ft-col{grid-row:1 / span 7}
}

/* ================================================================ fix 16 §4.4 (html.f16, app/footer.php): the cleaned-up
   columns. One landmark (nav.bf-ft-nav, aria-label "Footer") around the three columns; it takes no box of its own, so the
   grid, the desktop look and the fix 15 row grid stay exactly as they were. The labels are <p> (same class, same look).
   "Cookie settings" is a <button> that looks like the links next to it. Phones (≤ 759): two columns, Bonfium and Help on
   the left, Company on the right, on one shared row grid (fix 15 P9: a wrapped link makes its whole row taller). */
html.f16 .bf-ft.f7-ft .bf-ft-nav{display:contents}
html.f16 .bf-ft.f7-ft .bf-ft-link{display:block;width:max-content;max-width:100%;margin:0;padding:0;border:0;border-radius:0;background:none;color:var(--ft-ink);
  font:inherit;font-size:0.9375rem;line-height:1.65;text-align:left;cursor:pointer;-webkit-appearance:none;appearance:none;overflow-wrap:anywhere}
html.f16 .bf-ft.f7-ft .bf-ft-link:hover{text-decoration:underline;text-underline-offset:3px}
/* the current page's item (no href, aria-current="page", 600): marked, not a link */
html.f16 .bf-ft.f7-ft .bf-ft-col a:not([href]){cursor:default;text-decoration:none}
@media (pointer:coarse) and (min-width:900px){html.f16 .bf-ft.f7-ft .bf-ft-link{display:flex;align-items:center;min-height:44px;line-height:1.3}}
@media (max-width:899px){
  html.f16 .bf-ft.f7-ft .bf-ft-link{display:flex;align-items:center;min-height:44px;line-height:1.3;width:auto}
  html.f16 .bf-ft.f7-ft .bf-ft-col .bf-ft-link{align-items:flex-start;padding-top:12px;padding-bottom:12px}
}
/* with Blog (seven rows in Company) the columns span seven rows, as fix 15's is-r7 rules did (they match direct children) */
@media (max-width:1023px){html.f16 .bf-ft.f7-ft .bf-ft-cols.is-r7 .bf-ft-col{grid-row:span 7}}
@media (max-width:899px){html.f16 .bf-ft.f7-ft .bf-ft-cols.is-r7 .bf-ft-col{grid-row:2 / span 7}}
@media (min-width:900px) and (max-width:1023px){html.f16 .bf-ft.f7-ft .bf-ft-cols.is-r7 .bf-ft-col{grid-row:1 / span 7}}
@media (max-width:759px){
  html.f16 .bf-ft.f7-ft .bf-ft-cols{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px}
  html.f16 .bf-ft.f7-ft .bf-ft-col:nth-child(1){grid-column:1;grid-row:2 / span 4}
  html.f16 .bf-ft.f7-ft .bf-ft-col:nth-child(2){grid-column:1;grid-row:6 / span 4}
  html.f16 .bf-ft.f7-ft .bf-ft-col.is-co{grid-column:2;grid-row:2 / span 6}
  html.f16 .bf-ft.f7-ft .bf-ft-cols.is-r7 .bf-ft-col:nth-child(1){grid-row:2 / span 4}
  html.f16 .bf-ft.f7-ft .bf-ft-cols.is-r7 .bf-ft-col:nth-child(2){grid-row:6 / span 4}
  html.f16 .bf-ft.f7-ft .bf-ft-cols.is-r7 .bf-ft-col.is-co{grid-row:2 / span 7}
  /* Help's label opens its group at the bottom of its row, next to its first link (the row above it is the gap) */
  html.f16 .bf-ft.f7-ft .bf-ft-col:nth-child(2)>.bf-ft-h{align-self:end}
}

/* fix 16 §6 (html.f16, phones ≤ 759): the footer on the phone type scale: links 16 (body, was 15), the tagline and the
   legal row 14 (small, was 15), the labels 13 */
@media (max-width:759px){
  html.f16 .bf-ft.f7-ft :is(.bf-ft-col a,.bf-ft-link){font-size:1rem}
  html.f16 .bf-ft.f7-ft :is(.bf-ft-brand p,.bf-ft-legal){font-size:0.875rem}
}

/* 22 Oct 2026: the language switch, out of the header: a small paper-tint pill under the footer's line (it opens the
   header's language pop-up, upward) */
html.f16 .bf-ft.f7-ft .bf-ft-lang{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin:20px 0 0;padding:0 16px;border:0;border-radius:999px;
  background:rgba(14,20,23,.06);color:var(--ft-ink,#0E1417);font:500 0.875rem/1 var(--f7-text,'Instrument Sans'),system-ui,sans-serif;cursor:pointer}
html.f16 .bf-ft.f7-ft .bf-ft-lang:hover,html.f16 .bf-ft.f7-ft .bf-ft-lang[aria-expanded="true"]{background:rgba(14,20,23,.10)}
html.f16 .bf-ft.f7-ft .bf-ft-lang svg{flex:none}
@media (max-width:759px){html.f16 .bf-ft.f7-ft .bf-ft-lang{margin-top:16px}}

/* fix 87 (Vilius, 27 Nov: the social buttons "the same colour as language selector in footer and it is everywhere like that"): the
   round Facebook, Instagram and LinkedIn buttons take the language switch's paper tint instead of white, on every page; scoped as the switch's own rule is */
html.f16 .bf-ft.f7-ft .bf-ft-social a{background:rgba(14,20,23,.06)}
html.f16 .bf-ft.f7-ft .bf-ft-social a:hover{background:rgba(14,20,23,.10)}
