/* ==========================================================================
   Footer (partials/footer.php): drawing paper. Its top edge rises into old Tbilisi at the inline start (ink that
   draws itself, then lights up) and into a ledge under the licences' dock at the inline end. The edge's shape is an
   SVG drawn by assets/js/footer.js; without the script the edge is flat and everything is simply there.
   ========================================================================== */
.site-footer {
  --paper-f: #F6F2E9; --ink-f: var(--ink); --line-f: #1A2742; --rule-f: rgb(11 26 51 / .11); --lamp: #F29A2E;
  --pw: min(54vw, 860px);                                       /* the drawing's width */
  --tile: clamp(54px, 4.6vw, 72px); --tile-h: calc(var(--tile) * 4 / 3); --dock-gap: clamp(14px, 1.7vw, 26px); --dock-max: 1.6;
  position: relative; z-index: 2; padding: 0 var(--gutter); color: var(--ink-f); overflow-x: clip;   /* (the raised edge still shows above it) */
  background: linear-gradient(var(--paper-f), #EDE6D6);
}
/* when the page ends in a full-screen room (the journal hall), the footer comes up over its last screen (journal.js) */
.site-footer.is-over { z-index: 10; }
.site-footer::before {   /* survey paper, faint, fading in below the edge */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgb(11 26 51 / .05) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgb(11 26 51 / .05) 1px, transparent 1px) 0 0 / 24px 24px;
  -webkit-mask: linear-gradient(transparent 60px, #000 260px); mask: linear-gradient(transparent 60px, #000 260px);
}

/* ---------- the edge: a ledge under the dock, rising in an S (footer.js) ---------- */
.sf-edge { position: absolute; left: 0; bottom: calc(100% - 2px); width: 100%; height: 62px; overflow: visible; pointer-events: none; }
.sf-edge__fill { fill: var(--paper-f); }
.sf-edge__rim { fill: none; stroke: rgb(255 255 255 / .8); stroke-width: 1.2; }

/* ---------- old Tbilisi: the paper rises into it; the water line is the edge, the reflection below it ---------- */
.sf-city {
  position: absolute; z-index: 1; bottom: calc(100% - var(--pw) * 62 / 760); inset-inline-start: 0;   /* the water (y 170 of 232) on the edge */
  width: var(--pw); height: auto; overflow: visible; pointer-events: none; will-change: transform;   /* its own layer: drawing itself repaints only it */
}
[dir="ltr"] .sf-city { transform: scaleX(-1); }   /* the near end at the inline start */
.sf-city__paper { fill: var(--paper-f); }
.sf-city__rim { fill: none; stroke: rgb(255 255 255 / .85); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sf-city__ink path { fill: none; stroke: var(--line-f); stroke-opacity: .8; stroke-width: .9; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sf-city__ink path.is-solid { fill: var(--paper-f); }
.sf-city__ink .sf-city__ridge { stroke-opacity: .5; }
.sf-city__ink .sf-city__back { stroke-opacity: .5; }
.sf-city__ink .sf-city__glass { stroke-opacity: .42; stroke-width: .7; }
.sf-city__ink .sf-city__rock { stroke-opacity: .3; stroke-width: .7; }
.sf-city__ink .sf-city__balc { stroke-width: .7; }
.sf-city__ink path.sf-city__glow { fill: var(--amber); fill-opacity: .55; stroke: none; }
.sf-city__lit { fill: var(--lamp); }
.sf-city__leds { fill: none; stroke: var(--lamp); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sf-city__refl { fill: none; stroke: var(--lamp); stroke-opacity: .55; stroke-width: 1.3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sf-city__ledrefl { fill: none; stroke: var(--lamp); stroke-opacity: .4; stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sf-city__ripple { fill: none; stroke: var(--line-f); stroke-opacity: .25; stroke-width: .8; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* it draws itself when it comes into view (footer.js: --len and --d per line, .is-drawn), then the city lights up */
html.js .sf-city.is-ready .sf-city__ink > path:not(.sf-city__glow) { stroke-dasharray: var(--len, 0) var(--len, 0); stroke-dashoffset: var(--len, 0); }
html.js .sf-city.is-ready :is(.sf-city__lights, .sf-city__glow, .sf-city__water) { opacity: 0; }
html.js .sf-city.is-ready.is-drawn .sf-city__ink > path:not(.sf-city__glow) { stroke-dashoffset: 0; transition: stroke-dashoffset 2.8s cubic-bezier(.45, .05, .25, 1) var(--d, 0s); }
html.js .sf-city.is-ready.is-drawn :is(.sf-city__lights, .sf-city__glow) { opacity: 1; transition: opacity 1.4s ease 2.9s; }
html.js .sf-city.is-ready.is-drawn .sf-city__water { opacity: 1; transition: opacity 1.8s ease 3.3s; }
.sf-city-cap {
  position: absolute; z-index: 1; top: calc(var(--pw) * 62 / 760 + 10px); inset-inline-start: var(--gutter);
  margin: 0; color: rgb(11 26 51 / .5); font-size: 12px; font-weight: 600;
}
.sf-city-cap span { margin-inline-start: 6px; font-family: var(--font-ka); font-weight: 400; color: rgb(11 26 51 / .42); }

/* ---------- the licences' dock: framed certificates on the ledge ---------- */
.sf-dock {
  position: absolute; z-index: 2; top: calc(-1 * var(--tile-h) - 34px); inset-inline: calc(var(--pw) + 24px) var(--gutter);
  display: flex; flex-direction: column; align-items: center;
}
.sf-dock--wide { --tile: clamp(76px, 6.4vw, 100px); --tile-h: calc(var(--tile) * 3 / 4); }   /* most scans lie on their side: frames to match */
.sf-dock__row { display: flex; gap: var(--dock-gap); margin: 0; padding: 0; list-style: none; }
.sf-dock__slot { position: relative; width: var(--tile); height: var(--tile-h); flex: none; }
.sf-dock__item {
  position: absolute; inset: 0; display: block; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  cursor: pointer; outline: none; will-change: transform; -webkit-tap-highlight-color: transparent;
}
.sf-dock__pic {   /* drawn at the largest size and scaled down, so it stays sharp when it grows */
  position: absolute; bottom: 0; left: 50%; width: calc(var(--tile) * var(--dock-max)); height: calc(var(--tile-h) * var(--dock-max));
  margin-left: calc(var(--tile) * var(--dock-max) / -2); padding: 5px; box-sizing: border-box;
  background: #FBF8F0; border: 3px solid #1E2A44; border-radius: 3px;
  transform: scale(calc(var(--s, 1) / var(--dock-max))); transform-origin: 50% 100%; will-change: transform;
  box-shadow: 0 1px 0 rgb(255 255 255 / .5) inset, 0 22px 30px -16px rgb(0 0 0 / .55);
}
.sf-dock__pic svg, .sf-dock__pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.sf-dock__pic img { object-fit: contain; object-position: 50% 50%; padding: 4px; background: #fff; }   /* (a scan: the whole document, whatever its shape) */
.sf-dock__label {   /* the title and who issued it, in a small paper card over the one pointed at */
  position: absolute; left: 50%; bottom: calc(var(--tile-h) * var(--s, 1) + 14px); z-index: 2; display: grid; gap: 2px; justify-items: center;
  padding: 9px 16px 10px; border-radius: 12px; white-space: nowrap; pointer-events: none;
  background: var(--paper-f); color: var(--ink-f); box-shadow: 0 16px 30px -14px rgb(0 0 0 / .6), inset 0 0 0 1px rgb(11 26 51 / .06);
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .3s, transform .45s var(--ease-out);
}
.sf-dock__label::after { content: ""; position: absolute; top: 100%; left: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.sf-dock__label b { font-size: 14px; font-weight: 700; }
.sf-dock__label span { color: rgb(11 26 51 / .55); font-size: 12px; font-weight: 600; }
.sf-dock__item.is-hot .sf-dock__label, .sf-dock__item:focus-visible .sf-dock__label { opacity: 1; transform: translate(-50%, 0); }
.sf-dock__item:focus-visible .sf-dock__pic { box-shadow: 0 0 0 3px var(--paper-f), 0 0 0 5px var(--green-lo), 0 22px 30px -16px rgb(0 0 0 / .55); }
.sf-dock__cap { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--ink-f); font-size: 12.5px; font-weight: 700; }
.sf-dock__cap span { color: rgb(11 26 51 / .48); font-weight: 500; }
.sf-dock__cap span::before { content: ""; display: inline-block; width: 18px; height: 1px; margin-inline-end: 10px; vertical-align: middle; background: rgb(11 26 51 / .25); }
html:not(.js) .sf-dock__item:hover .sf-dock__label { opacity: 1; transform: translate(-50%, 0); }

/* ---------- the body ---------- */
.sf-body {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 32px; max-width: 1400px; margin: 0 auto;
  padding: 118px 0 60px;
}
.sf-k { margin: 0 0 16px; color: #4F8F12; font-size: 12.5px; font-weight: 750; }
.sf-ask { grid-column: 1 / span 5; }
.sf-ask__say { margin: 0 0 22px; font-size: clamp(22px, 2vw, 30px); font-weight: 650; line-height: 1.5; }
.sf-ask__say span { display: inline-block; margin-top: 4px; color: rgb(11 26 51 / .6); font-size: .6em; font-weight: 450; }
.sf-ask__acts { display: flex; flex-wrap: wrap; gap: 10px; }
.sf-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding-inline: 22px; border-radius: 999px;
  color: var(--ink-f); font-size: 14.5px; font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: inset 0 0 0 1px rgb(11 26 51 / .22);
  transition: background-color .3s, color .3s, box-shadow .3s, transform .3s var(--ease-out);
}
.sf-btn bdi { font-weight: 600; opacity: .7; }
.sf-btn svg { width: 20px; height: 20px; flex: none; }
.sf-btn:hover { background: var(--ink-f); color: var(--white); box-shadow: none; }
.sf-btn--wa { background: var(--green); color: var(--night); box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 12px 24px -12px rgb(79 143 18 / .7); }
.sf-btn--wa:hover { background: var(--green-hi); color: var(--night); box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 16px 28px -12px rgb(79 143 18 / .8); transform: translateY(-1px); }
.sf-links { grid-column: 7 / span 3; }
.sf-links ul { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 0; padding: 0; list-style: none; }
.sf-links a { position: relative; color: rgb(11 26 51 / .78); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: color .25s; }
.sf-links a::after { content: ""; position: absolute; inset-inline: 0; bottom: -3px; height: 1px; background: var(--green-lo); transform: scaleX(0); transform-origin: var(--o, right); transition: transform .4s var(--ease-out); }
[dir="ltr"] .sf-links a { --o: left; }
.sf-links a:hover { color: var(--ink-f); }
.sf-links a:hover::after { transform: scaleX(1); }
.sf-brand { grid-column: 10 / span 3; }
.brand--footer { color: var(--ink-f); }
.brand--footer .brand__mark { width: 46px; height: 46px; }
.sf-brand__line { max-width: 24em; margin: 16px 0 0; color: rgb(11 26 51 / .62); font-size: 14px; line-height: 1.95; }
.sf-btn:focus-visible, .sf-links a:focus-visible, .sf-up:focus-visible, .sf-langs a:focus-visible, .brand--footer:focus-visible { outline: 2px solid #4F8F12; outline-offset: 4px; }

/* ---------- the common questions (the home page's FAQPage, app/faq.php) ---------- */
.sf-faq { position: relative; max-width: 1400px; margin: 0 auto; padding: 0 0 44px; }
.sf-faq h2.sf-k { margin-bottom: 14px; font-size: 13px; }
.sf-faq__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px 18px; align-items: start; }
.sf-q { border-radius: 14px; background: rgb(255 255 255 / .55); box-shadow: inset 0 0 0 1px var(--rule-f); }
.sf-q > summary { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 12px 18px; list-style: none; cursor: pointer; font-size: 14.5px; font-weight: 700; line-height: 1.7; }
.sf-q > summary::-webkit-details-marker { display: none; }
.sf-q > summary i { flex: none; position: relative; width: 14px; height: 14px; }
.sf-q > summary i::before, .sf-q > summary i::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 2px; background: #4F8F12; transition: transform .3s var(--ease-out); }
.sf-q > summary i::after { transform: rotate(90deg); }
.sf-q[open] > summary i::after { transform: rotate(0); }
.sf-q > summary:focus-visible { outline: 2px solid #4F8F12; outline-offset: 2px; border-radius: 14px; }
.sf-q p { margin: 0; padding: 0 18px 16px; color: rgb(11 26 51 / .7); font-size: 14px; line-height: 1.95; }

/* ---------- the bottom line ---------- */
.sf-base {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1400px; margin: 0 auto;
  padding: 22px 0 28px; border-top: 1px solid var(--rule-f); color: rgb(11 26 51 / .55); font-size: 12.5px;
}
.sf-base__rights { margin: 0; }
.sf-langs { display: flex; gap: 6px; margin: 0; padding: 4px; list-style: none; border-radius: 999px; background: rgb(11 26 51 / .05); box-shadow: inset 0 0 0 1px rgb(11 26 51 / .1); }
.sf-langs a { display: block; padding: 6px 14px; border-radius: 999px; color: var(--ink-f); font-weight: 650; text-decoration: none; }
.sf-langs a[aria-current] { background: var(--ink-f); color: var(--white); }
.sf-up { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-f); font-weight: 650; text-decoration: none; }
.sf-up svg { width: 18px; height: 18px; transition: transform .4s var(--ease-out); }
.sf-up:hover svg { transform: translateY(-3px); }

/* ---------- a licence, open ---------- */
  width: min(860px, calc(100vw - 32px)); max-height: calc(100svh - 48px); padding: 0; border: 0; border-radius: 18px; overflow: auto;
  background: var(--paper-f); color: var(--ink-f); box-shadow: 0 40px 90px -30px rgb(0 0 0 / .7);
}

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .sf-ask { grid-column: 1 / -1; }
  .sf-links { grid-column: 1 / span 7; }
  .sf-brand { grid-column: 8 / span 5; }
}
@media (max-width: 760px) {
  .site-footer { --pw: 100vw; --tile: 50px; --dock-gap: 12px; --dock-max: 1.4; }   /* the row stays inside the screen when it spreads */
  .sf-dock--wide { --tile: 66px; }
  .sf-city-cap { top: calc(var(--pw) * 62 / 760 + 6px); inset-inline-start: var(--gutter); font-size: 12px; }
  .sf-dock { position: relative; top: auto; inset: auto; padding-top: calc(var(--pw) * 62 / 760 + 70px); }   /* in the paper, under the drawing's reflection: the label rises into the room above */
  .sf-dock__label { background: var(--ink-f); color: var(--white); }
  .sf-dock__label span { color: rgb(255 255 255 / .6); }
  .sf-dock__cap { flex-wrap: wrap; justify-content: center; margin-top: 16px; }
  .sf-body { grid-template-columns: 1fr; gap: 36px; padding: 44px 0 40px; }
  .sf-ask, .sf-links, .sf-brand { grid-column: 1 / -1; }
  .sf-ask__acts { flex-direction: column; }
  .sf-btn { justify-content: center; }
  .sf-base { flex-direction: column; gap: 16px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-dock__label, .sf-dock__pic { transition: none; }
}
