/* Image captions (egw-diaspora 3.28.0; Dennis approved the preview 2026-10-10 18:03). Loaded only on a page that has a caption.
   Markup: figure.egw-capfig.egw-cap-below | .egw-cap-over, holding the page's own image, then button.cap-btn and figcaption.cap
   (b.cap-title, span.cap-text, small.cap-source). The look is the kit's Salvation band caption (t-sm, 600, ink-2; title in ink;
   source small and muted). A hidden or empty caption prints no figcaption, so there is no empty gap. The doubled class raises
   the rules over a page's own figcaption rules (Welcome, Give, Salvation keep their line until someone edits it). */
.egw-capfig { position: relative; }
.egw-capfig.egw-capfig > .cap { all: unset; display: grid; gap: 2px; box-sizing: border-box; padding: var(--s-3, 12px) var(--s-2, 8px) 0; font: 600 var(--t-sm, .875rem)/1.45 var(--font, inherit); letter-spacing: .02em; color: var(--ink-2, #3a3a36); text-wrap: pretty; text-align: start; max-width: none; justify-items: start; }
.egw-capfig.egw-capfig .cap-title { display: block; font-size: var(--t-sm, .875rem); font-weight: 700; letter-spacing: 0; color: var(--ink, #11110f); }
.egw-capfig.egw-capfig .cap-text { display: block; font-weight: 600; color: inherit; font-size: inherit; }
.egw-capfig.egw-capfig .cap-source { display: block; font-size: var(--t-xs, .75rem); font-weight: 500; color: var(--muted, #6b6a63); letter-spacing: .04em; }
.egw-capfig .cap-text.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.egw-capfig .cap-more { justify-self: start; min-height: 32px; margin: 0; padding: 0; border: 0; background: none; font: 700 var(--t-xs, .75rem) var(--font, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--ink, #11110f); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.egw-capfig .cap-more:focus-visible { outline: 2px solid var(--ink, #11110f); outline-offset: 3px; }
/* overlay variant (banners, video): a bottom gradient keeps white text above 4.5:1 on any image */
.egw-cap-over.egw-cap-over > .cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 56px clamp(14px, 3vw, 28px) clamp(14px, 2.4vw, 22px); background: linear-gradient(to top, rgba(10,10,9,.88) 0%, rgba(10,10,9,.72) 45%, rgba(10,10,9,0) 100%); color: #fff; border-radius: 0 0 var(--r-xl, 24px) var(--r-xl, 24px); }
.egw-cap-over.egw-cap-over .cap-title { color: #fff; font-size: clamp(1rem, 2vw, 1.25rem); }
.egw-cap-over.egw-cap-over .cap-text { color: #f4f3ee; }
.egw-cap-over.egw-cap-over .cap-source { color: #d9d6cc; }
.egw-cap-over .cap-more { color: #fff; }
/* the quiet enlarge button: 34px (31px on phones), 60% at rest, 100% on hover or focus, 44px tap area; the right button points up-right,
   the left one is its mirror */
.egw-capfig .cap-btn { all: unset; box-sizing: border-box; position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.28); background: rgba(14,14,12,.5); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: .6; transition: opacity .2s ease, background-color .2s ease; }
.egw-capfig .cap-btn.cap-btn-l { right: auto; left: 8px; }
.egw-capfig .cap-btn::after { content: ""; position: absolute; inset: -8px; }
.egw-capfig .cap-btn .i { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.egw-capfig:hover .cap-btn, .egw-capfig .cap-btn:hover, .egw-capfig .cap-btn:focus-visible { opacity: 1; background: rgba(14,14,12,.78); }
.egw-capfig .cap-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(14,14,12,.8); }
@media (max-width: 640px) { .egw-capfig .cap-btn { top: 6px; right: 6px; width: 31px; height: 31px; } .egw-capfig .cap-btn.cap-btn-l { right: auto; left: 6px; } .egw-capfig .cap-btn .i { width: 16px; height: 16px; } }
@media (prefers-reduced-motion: reduce) { .egw-capfig .cap-btn { transition: none; } }
/* the enlarge viewer (3.28.1): a layer the script appends to <body> (never inside a figure, header or any transformed, filtered or
   overflow-clipped ancestor), fixed to the viewport, the media centred inside safe gutters, the Close button pinned inside the
   viewport. Not a <dialog>: the theme's reset (* { margin: 0 }) removed the dialog's auto margins, which left it in the top-left corner.
   Every box is border-box, no width is 100vw, and the layer clips, so it can never scroll sideways. */
.egw-cap-layer, .egw-cap-layer *, .egw-cap-layer *::before, .egw-cap-layer *::after { box-sizing: border-box; }
.egw-cap-layer { --cap-g: clamp(16px, 4vw, 32px); position: fixed; inset: 0; z-index: 3000; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow: hidden; overscroll-behavior: contain; margin: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) calc(env(safe-area-inset-right, 0px) + var(--cap-g)) calc(env(safe-area-inset-bottom, 0px) + var(--cap-g)) calc(env(safe-area-inset-left, 0px) + var(--cap-g));
  background: rgba(10,10,9,.97); color: #fff; font-family: var(--font, inherit); }
.egw-cap-layer.in { animation: egwcap-fade .18s ease-out; }
@keyframes egwcap-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .egw-cap-layer.in { animation: none; } }
.egw-cap-layer .lb-x { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + max(12px, var(--cap-g) - 8px)); z-index: 2; min-width: 44px; min-height: 44px; margin: 0; padding: 0 18px; border-radius: 999px; border: 0; background: #fff; color: #11110f; font: 600 .875rem/1 var(--font, inherit); cursor: pointer; }
.egw-cap-layer .lb-x:hover { background: #f1f0ea; }
.egw-cap-layer .lb-x:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 5px rgba(10,10,9,.9); }
.egw-cap-layer figure { margin: 0; padding: 0; min-width: 0; max-width: min(960px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; }
.egw-cap-layer .lb-media { min-width: 0; max-width: 100%; display: grid; border-radius: var(--r-lg, 16px); overflow: hidden; background: #141412; }
.egw-cap-layer .lb-media img, .egw-cap-layer .lb-media video { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); margin: 0 auto; object-fit: contain; }
.egw-cap-layer .cap { display: grid; gap: 2px; width: 100%; max-height: 120px; overflow-y: auto; overflow-x: hidden; padding: 4px 4px 0; font: 600 .875rem/1.45 var(--font, inherit); color: #f4f3ee; text-align: start; overflow-wrap: anywhere; }
.egw-cap-layer .cap-title { display: block; font-size: 1.125rem; font-weight: 700; color: #fff; }
.egw-cap-layer .cap-text { display: block; }
.egw-cap-layer .cap-source { display: block; font-size: .75rem; font-weight: 500; color: #d9d6cc; letter-spacing: .04em; }
/* the scroll lock goes on html (R40), never on body alone; EGWChrome.lock does the same when the chrome is loaded */
html.egw-cap-lock { overflow: hidden; overflow: clip; }
