/*
 * Zeitfinder 6.9.65 · Responsive scale + mobile "screens"
 * Behaviour lives in /static/zf-screens.js. Loaded after theme.css.
 *
 * Viewport units in the other stylesheets are written as
 *   calc(100vh / var(--zf-vu, 1))
 * so they stay true to the real viewport while <html> is zoomed.
 */

:root {
  --zf-screen-ease: cubic-bezier(.32, .72, 0, 1);
  --zf-screen-ease-out: cubic-bezier(.22, 1, .36, 1);
  --zf-screen-time: 480ms;
  --zf-screen-desk: #161c12;
  --zf-bar-height: 56px;
}

/* ---------- 1. Fluid scale on large monitors ---------- */
html.zf-scaled { zoom: var(--zf-zoom, 1); }

/* ---------- 2. Page transitions between screens (mobile) ---------- */
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

::view-transition { background: var(--zf-screen-desk); }
::view-transition-group(root) { animation-duration: var(--zf-screen-time); animation-timing-function: var(--zf-screen-ease); }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--zf-screen-time); animation-timing-function: var(--zf-screen-ease); mix-blend-mode: normal; }

html:active-view-transition-type(zf-forward)::view-transition-old(root) { animation-name: zf-screen-fold-away; transform-origin: 0 50%; }
html:active-view-transition-type(zf-forward)::view-transition-new(root) { animation-name: zf-screen-arrive; }
html:active-view-transition-type(zf-back)::view-transition-old(root) { animation-name: zf-screen-leave; z-index: 2; }
html:active-view-transition-type(zf-back)::view-transition-new(root) { animation-name: zf-screen-unfold; transform-origin: 0 50%; z-index: 1; }

html:active-view-transition-type(zf-fade)::view-transition-old(root),
html:active-view-transition-type(zf-fade)::view-transition-new(root) { animation-duration: 220ms; animation-timing-function: ease; }

/* The app bar stays put while the content underneath changes. */
::view-transition-group(zf-bar) { animation-duration: calc(var(--zf-screen-time) * .7); animation-timing-function: var(--zf-screen-ease); z-index: 5; }
::view-transition-old(zf-bar),
::view-transition-new(zf-bar) { animation-duration: calc(var(--zf-screen-time) * .7); height: 100%; object-fit: none; object-position: left top; }

@keyframes zf-screen-fold-away {
  from { transform: none; filter: brightness(1); clip-path: inset(0 round 0); }
  to { transform: perspective(1400px) translate3d(-28%, 0, 0) rotateY(9deg) scale(.9); filter: brightness(.5); clip-path: inset(0 round 30px); }
}
@keyframes zf-screen-arrive {
  from { transform: translate3d(100%, 0, 0); box-shadow: -30px 0 60px rgba(8, 12, 4, .34); clip-path: inset(0 round 30px); }
  70% { clip-path: inset(0 round 18px); }
  to { transform: none; box-shadow: -30px 0 60px rgba(8, 12, 4, 0); clip-path: inset(0 round 0); }
}
@keyframes zf-screen-leave {
  from { transform: none; box-shadow: -30px 0 60px rgba(8, 12, 4, .34); clip-path: inset(0 round 0); }
  to { transform: translate3d(100%, 0, 0); box-shadow: -30px 0 60px rgba(8, 12, 4, 0); clip-path: inset(0 round 30px); }
}
@keyframes zf-screen-unfold {
  from { transform: perspective(1400px) translate3d(-28%, 0, 0) rotateY(9deg) scale(.9); filter: brightness(.5); clip-path: inset(0 round 30px); }
  to { transform: none; filter: brightness(1); clip-path: inset(0 round 0); }
}

/* Fallback entrance where cross-document view transitions are unavailable. */
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  html.zf-enter-forward body > :not(.zf-fold-shade):not(.zf-admin-sidebar):not(.global-loader) { animation: zf-screen-enter-forward 420ms var(--zf-screen-ease) both; }
  html.zf-enter-back body > :not(.zf-fold-shade):not(.zf-admin-sidebar):not(.global-loader) { animation: zf-screen-enter-back 420ms var(--zf-screen-ease) both; }
}
@keyframes zf-screen-enter-forward { from { transform: translate3d(36%, 0, 0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zf-screen-enter-back { from { transform: translate3d(-18%, 0, 0) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 3. Interactive slide (swipe back / menu) ---------- */
.zf-fold-shade, .zf-sheet { display: none; }

@media (max-width: 860px) {
  html.zf-sliding { background: var(--zf-screen-desk) !important; overflow: hidden; overscroll-behavior: none; }
  html.zf-sliding body { overflow: visible; touch-action: none; }

  /* Everything that belongs to the current screen moves as one sheet. */
  html.zf-sliding body > :not(.zf-under):not(.zf-admin-sidebar):not(script) {
    transform: translate3d(var(--zf-dx, 0px), 0, 0) !important;
    will-change: transform;
    transition: none !important;
    animation: none !important;
  }
  html.zf-sliding.zf-settling body > :not(.zf-under):not(.zf-admin-sidebar):not(script) {
    transition: transform var(--zf-settle, 380ms) var(--zf-screen-ease-out) !important;
  }

  /* The sheet: paper behind the screen's content, with the fold's shadow. */
  html.zf-sliding .zf-fold-shade {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    background:
      linear-gradient(90deg, rgba(10, 16, 6, calc(.16 * var(--zf-p, 0))) 0, rgba(10, 16, 6, 0) 34%),
      rgba(10, 16, 6, calc(.05 * var(--zf-p, 0)));
    box-shadow: -1px 0 0 rgba(255, 255, 255, .5), -24px 0 48px rgba(6, 10, 3, calc(.12 + .2 * var(--zf-p, 0)));
  }
  html.zf-sliding.zf-menu-open .zf-fold-shade { pointer-events: auto; cursor: pointer; }
  html.zf-sliding body { background: transparent !important; }
  .zf-sheet { display: none; }
  html.zf-sliding .zf-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: var(--zf-sheet-color, #fbfcf8);
    background-image: var(--zf-sheet-image, none);
  }

  /* What lies underneath: the previous screen or the menu, gently parallaxed. */
  .zf-under{
    position: fixed !important;
    inset: 0 !important;
    z-index: -2 !important;
    transform: translate3d(calc((var(--zf-p, 0) - 1) * 30%), 0, 0);
    will-change: transform;
  }
  html.zf-settling .zf-under{ transition: transform var(--zf-settle, 380ms) var(--zf-screen-ease-out); }

  .zf-ghost { overflow: hidden; pointer-events: none; background-color: var(--zf-sheet-color, #fbfcf8); background-image: var(--zf-sheet-image, none); }
  .zf-ghost-flow { position: absolute; top: 0; left: 0; right: 0; }
  .zf-ghost-fixed { position: absolute; inset: 0; transform: translateZ(0); }
  .zf-ghost-fixed > * { pointer-events: none; }
  .zf-ghost .zf-gx { color: transparent !important; background: rgba(28, 36, 23, .07); border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; text-shadow: none !important; -webkit-text-fill-color: transparent; }

  .zf-ghost .zf-mobile-bar { view-transition-name: none !important; }
  .zf-ghost-dim { position: absolute; inset: 0; background: var(--zf-screen-desk); opacity: calc(.42 * (1 - var(--zf-p, 0))); }
  html.zf-settling .zf-ghost-dim { transition: opacity var(--zf-settle, 380ms) var(--zf-screen-ease-out); }
  .zf-ghost-skeleton { position: absolute; inset: calc(var(--zf-bar-height) + env(safe-area-inset-top, 0px) + 24px) 20px auto; display: grid; gap: 12px; }
  .zf-ghost-skeleton > * { display: block; border-radius: 10px; background: rgba(28, 36, 23, .07); }
  .zf-ghost-skeleton i { width: 34%; height: 10px; }
  .zf-ghost-skeleton b { width: 72%; height: 34px; margin-bottom: 8px; }
  .zf-ghost-skeleton span { height: 12px; }
  .zf-ghost-skeleton span.is-short { width: 60%; margin-bottom: 18px; }
  .zf-ghost-skeleton em { height: 112px; border-radius: 22px; background: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 1px rgba(28, 36, 23, .06); }
}

/* ---------- 4. Workspace on phones and small tablets ---------- */
.zf-mobile-bar { display: none; }

@media (max-width: 860px) {
  body.is-workspace .zf-mobile-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 6px;
    height: calc(var(--zf-bar-height) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
    background: rgba(251, 252, 248, .82);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
    border-bottom: 1px solid rgba(226, 233, 216, 0);
    transition: border-color .25s ease, background-color .25s ease;
    view-transition-name: zf-bar;
  }
  body.is-workspace .zf-mobile-bar.has-title { border-bottom-color: var(--zf-line, #e2e9d8); background: rgba(251, 252, 248, .9); }

  .zf-mobile-bar button,
  .zf-mobile-bar-brand {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--zf-ink, #1c2417);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s var(--zf-screen-ease-out);
  }
  .zf-mobile-bar button:active { transform: scale(.9); background: rgba(28, 36, 23, .06); }
  .zf-mobile-bar-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .zf-mobile-bar-brand { grid-column: 1; grid-row: 1; }
  .zf-mobile-bar-brand .zf-brand-mark { width: 30px; height: 30px; }
  .zf-mobile-bar-back { grid-column: 1; grid-row: 1; }
  .zf-mobile-bar.is-root .zf-mobile-bar-back,
  .zf-mobile-bar:not(.is-root) .zf-mobile-bar-brand { display: none !important; }
  .zf-mobile-bar-title {
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    color: var(--zf-ink, #1c2417);
    font-size: 1rem;
    font-weight: 680;
    letter-spacing: -.01em;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translate3d(0, 6px, 0);
    transition: opacity .25s ease, transform .35s var(--zf-screen-ease-out);
  }
  .zf-mobile-bar.has-title .zf-mobile-bar-title { opacity: 1; transform: none; }

  /* Language button sits in the bar instead of floating over sticky form actions. */
  body.is-workspace > .zf-language-switcher .zf-language-trigger {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 9px) !important;
    right: max(58px, calc(env(safe-area-inset-right, 0px) + 58px)) !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 81 !important;
    height: 38px !important;
    min-height: 0 !important;
    padding: 0 10px !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, .7) !important;
  }
  body.is-workspace > .zf-language-switcher .zf-language-trigger .zf-language-flag { display: none !important; }

  /* Content no longer sits beside a sidebar. */
  html:has(body.is-workspace .zf-mobile-bar) { scroll-padding-top: calc(var(--zf-bar-height) + env(safe-area-inset-top, 0px) + 12px); }
  body.is-workspace .zf-booking-workspace > .zf-workspace-tabs { top: calc(var(--zf-bar-height) + env(safe-area-inset-top, 0px) + 8px) !important; }
  body.is-workspace:has(.zf-mobile-bar) .zf-admin-main {
    margin-left: 0 !important;
    width: auto !important;
    padding-top: calc(var(--zf-bar-height) + env(safe-area-inset-top, 0px)) !important;
  }
  body.is-workspace .zf-admin-content,
  body.is-workspace .zf-admin-content-narrow {
    width: auto !important;
    max-width: none !important;
    margin-left: max(16px, env(safe-area-inset-left, 0px)) !important;
    margin-right: max(16px, env(safe-area-inset-right, 0px)) !important;
    padding-top: 12px !important;
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* The sidebar becomes the menu screen, waiting underneath the page. */

  body.is-workspace .zf-admin-nav {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    gap: 2px !important;
    overflow: visible !important;
  }

  body.is-workspace .zf-admin-nav a {
    min-height: 48px !important;
    padding: 6px 12px !important;
    font-size: 1.02rem !important;
    white-space: normal !important;
    border-radius: 16px !important;
  }

  body.is-workspace .zf-admin-nav a span:last-child { display: inline !important; }

  /* Menu items arrive with a short stagger as the menu screen opens. */
  html.zf-menu-open body.is-workspace .zf-admin-nav a{ animation: zf-menu-item-in .5s var(--zf-screen-ease-out) both; }
  html.zf-menu-open body.is-workspace .zf-admin-nav a:nth-of-type(2) { animation-delay: 25ms; }
  html.zf-menu-open body.is-workspace .zf-admin-nav a:nth-of-type(3) { animation-delay: 50ms; }
  html.zf-menu-open body.is-workspace .zf-admin-nav a:nth-of-type(4) { animation-delay: 75ms; }
  html.zf-menu-open body.is-workspace .zf-admin-nav a:nth-of-type(5) { animation-delay: 100ms; }
  html.zf-menu-open body.is-workspace .zf-admin-nav a:nth-of-type(n+6) { animation-delay: 125ms; }

}
@keyframes zf-menu-item-in { from { opacity: 0; transform: translate3d(-14px, 0, 0); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  html.zf-menu-open body.is-workspace .zf-admin-nav a{ animation: none; }
}

/* ---------- 5. General hygiene: no sideways page wobble at any width ---------- */
html, body { overflow-x: clip; }
@media (max-width: 860px) {
  body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, video, canvas { max-width: 100%; }
  .zf-admin-content table { max-width: 100%; }
}
