/* Shared finish pass for older Zoe feature pages. */
img,
video,
iframe {
  max-width: 100%;
}

button,
a {
  touch-action: manipulation;
}

#loadingGate:not(.hidden) ~ :not(script) {
  visibility: hidden;
}

.loading-gate {
  display: none !important;
}

.loading-gate.auth-denied:not(.hidden) {
  display: flex !important;
  background:
    linear-gradient(90deg, rgba(251, 250, 247, 0.94) 0%, rgba(251, 250, 247, 0.78) 44%, rgba(251, 250, 247, 0.22) 100%),
    var(--hero-image, #fbfaf7) center / cover no-repeat !important;
}

.loading-gate.hidden {
  display: none !important;
}

.loading-box {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.68) !important;
  box-shadow: 0 18px 48px rgba(11, 24, 21, 0.14) !important;
  backdrop-filter: blur(12px);
}

.top-nav {
  box-sizing: border-box;
  position: sticky !important;
  top: 0 !important;
  min-height: 58px;
  gap: 12px;
  background: rgba(255, 255, 255, 0.58) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.46) !important;
  box-shadow: 0 12px 36px rgba(24, 38, 35, 0.10) !important;
  backdrop-filter: blur(16px) saturate(1.04) !important;
}

.back-link {
  min-height: 40px;
  padding: 0 8px 0 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink, #182623) !important;
}

.back-link::before {
  content: '';
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--paper, #fbfaf7) url('/assets/icons/home-front-watercolor-icon-2026-v4.webp') center / cover no-repeat;
  box-shadow: 0 8px 18px rgba(24, 38, 35, 0.10);
}

.back-link:hover {
  text-decoration: none;
}

.user-info {
  display: none;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--purple, #9b6b9e);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sign-out {
  min-height: 40px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  white-space: nowrap;
}

.back-link:focus-visible,
.sign-out:focus-visible,
.nav-btn:focus-visible,
.dot:focus-visible,
.checklist-link:focus-visible,
.video-card:focus-visible,
.lightbox-close:focus-visible,
.footer a:focus-visible {
  outline: 3px solid rgba(245, 197, 66, 0.78);
  outline-offset: 3px;
}

.page-header,
.story,
.flipbook,
.grid,
.video-grid {
  box-sizing: border-box;
  width: 100%;
}

.footer {
  box-sizing: border-box;
  width: min(1080px, calc(100% - clamp(24px, 8vw, 104px)));
  margin: 0 auto clamp(18px, 4vw, 34px);
  text-align: center;
  padding: 26px clamp(20px, 4vw, 34px);
  color: var(--ink-light, #3a4644);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 16px 44px rgba(11, 24, 21, 0.14);
  backdrop-filter: blur(16px) saturate(1.04);
}

.footer a {
  color: var(--ink, currentColor);
  font-weight: 800;
  min-height: 36px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
}

.page-dots {
  gap: 2px;
  max-width: min(100%, 720px);
}

.dot {
  position: relative !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  background: transparent !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transform: none !important;
}

.dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(155, 107, 158, 0.28);
  transition: background 0.2s ease, transform 0.2s ease;
}

.dot:hover::after {
  background: rgba(155, 107, 158, 0.55);
}

.dot.active::after {
  background: var(--purple-light, #c490c7);
  transform: scale(1.35);
}

.lightbox-close {
  width: 44px !important;
  height: 44px !important;
  top: -54px !important;
  font-size: 1.35rem !important;
}

@media (max-width: 520px) {
  .top-nav {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .back-link {
    max-width: calc(100vw - 152px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .back-link::before {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .user-info {
    gap: 8px;
  }

  .sign-out {
    position: relative;
    width: 44px;
    min-width: 44px;
    padding: 0 10px !important;
    overflow: hidden;
    color: transparent !important;
    font-size: 0 !important;
  }

  .sign-out::after {
    content: 'Out';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-light, #43524f);
    font-size: 0.76rem;
    font-weight: 800;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
