/*
 * ZipHealthy 90-Day Audit CSS
 * Added 2026-05-29 from MECE review
 * ----------------------------------------
 * Contains:
 *  - Hero scroll cue (CSS-only, fades after first scroll)
 *  - Mobile UX improvements (tap targets, reduced motion, parallax-off on mobile)
 *  - Accessibility improvements (focus-visible, ARIA support)
 *
 * Rollback: remove the <link> tag pointing to this file from <head>.
 * No JavaScript dependencies. All styles are additive — overrides existing only via specificity, never !important.
 */

/* ============================================
 * HERO SCROLL CUE
 * ============================================ */
.zh-hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.28s ease, transform 0.28s ease, background 0.18s ease;
  animation: zhScrollCueBounce 2.4s ease-in-out infinite;
  pointer-events: auto;
  /* Hide if user has already scrolled — controlled via body.zh-scrolled */
  opacity: 1;
}

.zh-hero-scroll-cue:hover,
.zh-hero-scroll-cue:focus-visible {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.zh-hero-scroll-cue-label {
  display: block;
  white-space: nowrap;
}

.zh-hero-scroll-cue-icon {
  font-size: 1.1rem;
  animation: zhScrollCueArrow 1.6s ease-in-out infinite;
}

/* Fade cue out after the user scrolls (body.zh-scrolled is toggled by main.js / new zh-page.js scroll handler).
   If neither is wired up yet, the cue stays visible — acceptable graceful degradation. */
body.zh-scrolled .zh-hero-scroll-cue,
.zh-hero-scroll-cue.zh-cue-dismissed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

@keyframes zhScrollCueBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

@keyframes zhScrollCueArrow {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .zh-hero-scroll-cue,
  .zh-hero-scroll-cue-icon {
    animation: none;
  }
  .zh-hero-scroll-cue {
    transition: opacity 0.2s ease;
  }
}

/* Hide cue on very small screens where it competes with content */
@media (max-width: 480px) {
  .zh-hero-scroll-cue {
    bottom: 16px;
    padding: 6px 12px;
    font-size: 0.74rem;
  }
  .zh-hero-scroll-cue-icon {
    font-size: 1rem;
  }
}

/* Hide cue on very short viewports (landscape mobile) */
@media (max-height: 500px) {
  .zh-hero-scroll-cue {
    display: none;
  }
}

/* ============================================
 * MOBILE UX — tap targets, parallax-off, font-size guards
 * ============================================ */
@media (max-width: 768px) {
  /* Primary CTAs: 48-56px minimum tap target per WCAG */
  .thm-btn,
  .zh-cta-btn,
  .zh-cta-button,
  .sticky-cta-btn,
  .fab-action,
  .nav-link,
  .navbar-toggler,
  button[type="submit"],
  .btn-primary,
  .btn-outline-primary {
    min-height: 48px;
    min-width: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* Phone/email links: 48px tap area with proper spacing */
  a[href^="tel:"],
  a[href^="mailto:"] {
    display: inline-block;
    padding: 8px 4px;
    line-height: 1.4;
    min-height: 44px;
  }

  /* Form inputs: 16px+ font to prevent iOS zoom-on-focus */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px;
  }

  /* Disable parallax + heavy animations on mobile (perf + accessibility) */
  [data-parallax],
  .parallax,
  .parallax-bg,
  .hero-video-bg,
  [data-background-parallax] {
    background-attachment: scroll !important;
    transform: none !important;
    will-change: auto !important;
  }

  /* Disable WOW.js animations on mobile (CLS contributor + perf) */
  .wow {
    visibility: visible !important;
    animation: none !important;
  }
}

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

/* ============================================
 * ACCESSIBILITY — focus-visible, skip link, ARIA
 * ============================================ */
*:focus-visible {
  outline: 2px solid #2E5A4C;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Don't show outline on mouse focus — only keyboard */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure modal close button is always reachable */
.zh-booking-close:focus-visible {
  outline: 2px solid #2E5A4C;
  outline-offset: 4px;
  border-radius: 50%;
}

/* ============================================
 * BLOG ARTICLE TAGS — real links to /tag-search.html
 * ============================================
 * 2026-05-30 dead-click audit:
 *  - phase 1: <a href="#"> tags converted to <span class="article-tag"> (no-op, fixed bait)
 *  - phase 2: <span class="article-tag"> upgraded to <a href="tag-search.html?tag=X" class="article-tag">
 *    Now real navigable links into the new tag-filter page.
 */
.article-tags .article-tag {
  display: inline-block;
  background: #fff;
  color: var(--zh-primary, #2E5A4C);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.18s ease;
}
a.article-tag {
  cursor: pointer;
}
a.article-tag:hover,
a.article-tag:focus-visible {
  background: var(--zh-primary, #2E5A4C);
  color: #fff;
  border-color: var(--zh-primary, #2E5A4C);
  transform: translateY(-1px);
}

/* ============================================
 * PRINT (small but worthwhile)
 * ============================================ */
@media print {
  .zh-hero-scroll-cue,
  .sticky-cta-bar,
  .fab-container,
  .zh-booking-overlay {
    display: none !important;
  }
}
