/* Fixed footer bar (2026-11-21). Loaded after every other stylesheet.
   The footer is a slim bar pinned to the bottom edge, in front of the feed: "© year brand" on the left, the links on the right.
   The newsletter invitation is not part of it any more (it is an ordinary block, shown by fixed-footer.js for an empty feed and at the feed's end).

   Contract for everything that sits at the bottom of the window, from the bottom edge upwards:
     1. the footer bar          height --app-footer-h (measured by fixed-footer.js, an estimate before the first measurement)
     2. the news ticker         height --app-ticker-h (set by the ticker itself on :root; 0 while it is absent), bottom: var(--app-footer-h)
     3. the audio dock          bottom: var(--app-stack-h) + 20px; its own height is published as --app-dock-h (dock height + 20px, 0 while closed)
   --app-stack-h = --app-footer-h + --app-ticker-h is the free edge: back-to-top button, toast, pin rails, avatar stage and the end of the page sit above it. */
:root{
 --app-footer-h:44px;
 --app-ticker-h:0px;
 --app-dock-h:0px;
 --app-stack-h:calc(var(--app-footer-h) + var(--app-ticker-h));
 --footer-pad:56px;
 --footer-max:1512px;
 scroll-padding-bottom:calc(var(--app-stack-h) + 12px);
}

/* ---------- the bar ---------- */
.app-footer{position:fixed;inset-inline:0;bottom:0;z-index:7;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:0 24px;
 padding:6px max(var(--footer-pad),calc((100% - var(--footer-max))/2 + var(--footer-pad))) calc(6px + env(safe-area-inset-bottom,0px));
 background:color-mix(in srgb,var(--bg) 94%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid var(--line)}
.app-footer>p,.app-footer .footer-copy{width:auto;margin:0;font-size:11px;line-height:1.2;color:var(--metadata,var(--muted));white-space:nowrap}
.app-footer .footer-links{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:0 18px;min-width:0;margin-inline-start:auto}
.app-footer .footer-links button,.app-footer .footer-links>a{display:inline-flex;align-items:center;min-height:28px;padding:4px 0;font-size:11px;line-height:1.2;color:var(--muted);text-decoration:none;white-space:nowrap;cursor:pointer}
.app-footer .footer-links button:hover,.app-footer .footer-links>a:hover{color:var(--accent-text,var(--accent))}
.app-footer a:focus-visible,.app-footer button:focus-visible{outline:2px solid var(--accent-text,var(--accent));outline-offset:2px;border-radius:3px}
.app-footer .footer-links [hidden]{display:none}

/* The content ends above everything that is pinned to the bottom. */
.page-shell{padding-bottom:calc(var(--app-stack-h) + var(--app-dock-h) + 20px)}

/* Probe of fixed-footer.js: as high as the free edge, so reserve() can read --app-stack-h as pixels. */
.app-stack-probe{position:fixed;left:0;bottom:0;width:0;height:var(--app-stack-h);visibility:hidden;pointer-events:none}

/* ---------- newsletter invitation: an ordinary block, hidden until fixed-footer.js shows it ---------- */
.newsletter-invitation[hidden]{display:none}

/* ---------- the other bottom elements sit above the bar ---------- */
.back-to-top{bottom:calc(var(--app-stack-h) + 26px)}
.toast{bottom:calc(var(--app-stack-h) + var(--app-dock-h) + 28px)}
.audio-dock{bottom:calc(var(--app-stack-h) + 20px)}
.pin-rail{bottom:calc(var(--pin-bottom,84px) + var(--app-stack-h))}
.avatar-stage{bottom:calc(var(--app-stack-h) + max(12px,env(safe-area-inset-bottom)))}

/* ---------- styles: the bar takes the frame of the style's header and footer rules (their border-top rules in styles.css still apply) ---------- */
:root[data-style=magazine] .app-footer{border-top:1px solid var(--line)}
:root:is([data-style=glass],[data-style=clear]) .app-footer{background:color-mix(in srgb,var(--bg) 62%,transparent);-webkit-backdrop-filter:blur(28px) saturate(1.6);backdrop-filter:blur(28px) saturate(1.6);border-top-color:var(--glass-line)}
:root[data-style=brutal] .app-footer,:root[data-style=comic] .app-footer{background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none}
:root[data-style=press] .app-footer,:root[data-style=minimal] .app-footer,:root[data-style=sketch] .app-footer,:root[data-style=terminal] .app-footer{background:var(--bg);-webkit-backdrop-filter:none;backdrop-filter:none}
:root[data-style=terminal] .app-footer .footer-links button,:root[data-style=terminal] .app-footer .footer-links>a,:root[data-style=terminal] .app-footer>p{text-transform:uppercase;letter-spacing:.04em}
@media(prefers-reduced-transparency:reduce){
 :root:is([data-style=glass],[data-style=clear]) .app-footer{background:var(--bg);-webkit-backdrop-filter:none;backdrop-filter:none}
}

/* ---------- widths, the same side gutters as the page ---------- */
@media(min-width:1700px){:root{--footer-max:1656px}}
@media(max-width:1150px){:root{--footer-pad:32px}}
@media(max-width:760px){
 :root{--footer-pad:22px}
 .back-to-top{bottom:calc(var(--app-stack-h) + 17px)}
 .toast{bottom:calc(var(--app-stack-h) + var(--app-dock-h) + 20px)}
 /* phone: the copyright on top, the links in one row that scrolls sideways (no scrollbar, a fade at the end), so the bar stays about 52 px high */
 .app-footer{flex-direction:column;align-items:stretch;flex-wrap:nowrap;gap:0;padding-block:5px calc(3px + env(safe-area-inset-bottom,0px))}
 .app-footer>p,.app-footer .footer-copy{font-size:10px;padding-top:1px}
 .app-footer .footer-links{flex-wrap:nowrap;justify-content:flex-start;gap:0 16px;margin:0 calc(-1*var(--footer-pad));padding-inline:var(--footer-pad);overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;
  -webkit-mask-image:linear-gradient(to right,#000 calc(100% - 26px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 26px),transparent)}
 :root[dir=rtl] .app-footer .footer-links{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 26px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 26px),transparent)}
 .app-footer .footer-links::-webkit-scrollbar{display:none}
 .app-footer .footer-links>*{flex:0 0 auto}
}
@media(max-width:420px){:root{--footer-pad:17px}}

@media print{.app-footer{position:static;backdrop-filter:none;-webkit-backdrop-filter:none}.page-shell{padding-bottom:0}}
