/* v12-audit-fixes — 2026-05-11
 *
 * Fixes from the 5-agent UI/UX audit:
 *
 *   1. Contrast: WCAG AA compliance for text that was too low
 *   2. Touch targets: enforce 44px on theme toggle + all small buttons
 *   3. Crisis button: consistent style across all pages
 *   4. Nav active state: visual indicator for current page
 *   5. Empty states: style for when API data is unavailable
 *   6. Support nav label: clarify it's a tip jar
 *   7. Footer/nav consistency improvements
 *
 * ~2KB. Loaded after v11.
 */

/* ═══════════════════════════════════════════════════════════════════
   1. CONTRAST FIXES — meet WCAG AA 4.5:1
   ═══════════════════════════════════════════════════════════════════ */

/* Timer display text — was too low contrast */
.fs-timer-display {
  color: var(--ink, #1a1814);
}

/* Card descriptions — boost from muted to readable */
.lib-card p,
.game-card p,
.wall-card p,
.az-card p {
  color: #3d3428;
}
[data-theme="dark"] .lib-card p,
[data-theme="dark"] .game-card p,
[data-theme="dark"] .wall-card p,
[data-theme="dark"] .az-card p {
  color: #c4b89a;
}

/* Section eyebrow labels — terracotta on cream was too faint */
.section-eyebrow,
.hero-eyebrow {
  color: #8b4a2a;
}
[data-theme="dark"] .section-eyebrow,
[data-theme="dark"] .hero-eyebrow {
  color: #d4885e;
}

/* Hint/muted text — ensure minimum readable contrast */
.dr-muted,
.text-muted,
.subtitle {
  color: #5e4e38;
}
[data-theme="dark"] .dr-muted,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .subtitle {
  color: #a89878;
}

/* ═══════════════════════════════════════════════════════════════════
   2. TOUCH TARGETS — 44px minimum on small interactive elements
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  /* Theme toggle was 29x24px — way too small */
  .dr-theme-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
  }

  /* Sound toggle in nav */
  .dr-sound-toggle,
  [data-deskrune-sound-toggle] {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   3. CRISIS BUTTON — consistent dark style on ALL pages
   ═══════════════════════════════════════════════════════════════════ */
.spiraling-badge-link {
  position: fixed !important;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  left: 14px !important;
  background: #1a1814 !important;
  color: #faf7f2 !important;
  padding: 9px 14px !important;
  border-radius: 99px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  z-index: 50 !important;
  border: 1px solid #c9613f !important;
  box-shadow: 0 6px 18px rgba(20,20,19,0.18) !important;
}
/* Even in light sections, keep it dark for visibility */
[data-theme="dark"] .spiraling-badge-link {
  background: #f2ead8 !important;
  color: #1a1814 !important;
  border-color: #c9613f !important;
}

/* ═══════════════════════════════════════════════════════════════════
   4. NAV ACTIVE STATE — current page indicator
   ═══════════════════════════════════════════════════════════════════ */
.dr-canon-nav .links a[aria-current="page"],
.nav-mobile-panel-links a[aria-current="page"] {
  font-weight: 600;
  opacity: 1;
  border-bottom: 2px solid #c9613f;
  padding-bottom: 2px;
}
[data-theme="dark"] .dr-canon-nav .links a[aria-current="page"] {
  border-bottom-color: #e88e5f;
}

/* ═══════════════════════════════════════════════════════════════════
   5. EMPTY STATES — when wall/today/comments have no data
   ═══════════════════════════════════════════════════════════════════ */
.wall-empty-state,
.comments-empty-state,
.today-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #6f6a60;
  font-size: 14px;
  font-style: italic;
}
[data-theme="dark"] .wall-empty-state,
[data-theme="dark"] .comments-empty-state,
[data-theme="dark"] .today-empty-state {
  color: #8a8070;
}

/* ═══════════════════════════════════════════════════════════════════
   6. MOBILE HERO OVERFLOW — prevent headline clipping
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .hero h1,
  .section h1,
  .page-header h1 {
    font-size: clamp(24px, 7vw, 44px);
    line-height: 1.15;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* CTA buttons — prevent text clipping */
  .cta-primary,
  .cta-secondary,
  .buy-cta,
  .dr-buy-btn {
    white-space: normal;
    min-height: 48px;
    padding: 12px 20px;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   7. PRICING CARD HOVER STATES — make cards obviously clickable
   ═══════════════════════════════════════════════════════════════════ */
.tip-card,
.pricing-card,
.support-tier {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tip-card:hover,
.pricing-card:hover,
.support-tier:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20,20,19,0.15);
}
