/* ==========================================================================
   DigitAllEase — Phase 2B additive design-system layer
   Loads AFTER style.css. ADDITIVE ONLY: existing tokens/classes are never
   redefined here; this file adds new tokens, accessibility helpers, touch
   targets and responsive refinements (1440px / 768px / 375px audit).
   ========================================================================== */

:root {
  /* Spacing scale (8-step rem scale) — NEW tokens, existing spacing untouched */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Accent mapping (owner direction: sky blue / dark / yellow) — aliases,
     so future phase can re-point an alias without touching old classes */
  --accent-sky: var(--accent);          /* #38bdf8 sky blue  */
  --accent-dark: var(--secondary);      /* #0f172a dark/navy */
  --accent-yellow: #f59e0b;             /* amber/yellow accent */
  --accent-yellow-strong: #d97706;

  /* Accessibility: shared focus ring */
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

/* --------------------------------------------------------------------------
   Skip-to-content link (keyboard users land here with Tab before anything else)
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background-color: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   Keyboard focus visibility (additive; does not remove existing focus styles)
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-link:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* --------------------------------------------------------------------------
   Touch-friendly controls (44px minimum, per WCAG 2.5.8 guidance)
   -------------------------------------------------------------------------- */
.theme-toggle-btn,
.menu-toggle-btn {
  min-width: 44px;
  min-height: 44px;
}

.btn {
  min-height: 44px;
}

/* --------------------------------------------------------------------------
   Footer about paragraph (was an inline style in the Phase 2A template)
   -------------------------------------------------------------------------- */
.footer-about {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Mobile navigation refinement (<= 768px, same threshold as style.css)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .nav-menu .nav-link {
    display: block;
    padding: 0.85rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
  }

  .nav-menu .nav-link:hover {
    background-color: var(--bg-surface);
    color: var(--primary);
  }

  .nav-menu .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
  }

  /* On mobile a filled highlight replaces the desktop underline */
  .nav-link.active::after {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion (respect user preference; additive)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Phase 2C (additive) — homepage components (approved v5)
   ADDITIVE ONLY: new classes below; no existing token or rule is redefined.
   ========================================================================== */

/* Anchored homepage sections: keep headings clear of the sticky header
   (header height 4.25rem + breathing room) after in-page anchor jumps. */
section[id] {
  scroll-margin-top: 5rem;
}

/* Non-interactive card variants (guides/products/tools presented as static
   content): no pointer cursor, no hover lift that would fake a link. */
.tool-card--static,
.product-card--static,
.article-card--static {
  cursor: default;
}

.tool-card--static:hover,
.product-card--static:hover,
.article-card--static:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border-color);
}

/* Section status badge ("6 Tools in Development") — tinted like the hero pill */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  margin-left: 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

/* "Coming soon" status chip — dashed border signals pending availability */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  margin-left: 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  border: 1px dashed var(--border-color);
}

/* Small neutral category chip used on tool and guide cards */
.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--bg-surface);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

/* Chip spacing inside cards (base classes already define the card rhythm) */
.tool-card .category-chip {
  margin-bottom: 0.85rem;
}

.tool-card .tool-desc {
  margin-bottom: 0;
}

/* Generic "Coming soon" panel for the products section (no seed-data cards) */
.coming-panel {
  border: 1px dashed var(--border-color);
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  max-width: 62rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.coming-panel p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.coming-panel p:last-child {
  color: var(--text-main);
  font-weight: 500;
}

/* Guide (article) cards — non-linked presentation */
.article-card--static {
  padding: 1.25rem;
}

.article-card--static .category-chip {
  margin-bottom: 0.9rem;
}

.article-card .article-title-static {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.article-card .article-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0.25rem 0 0;
}

/* Why DigitAllEase — grouped benefits ("Current Platform" / "Coming Soon") */
.why-panel .why-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.why-panel .why-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.why-panel .why-list li strong {
  color: var(--text-main);
}

.why-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}

.why-tag--today {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.why-tag--soon {
  background-color: var(--bg-surface);
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}

/* Phase 2C mobile fix: .grid-2 (style.css) has a 420px minimum track, which
   cannot fit narrow viewports (why-panel sections overflowed at 375px).
   Collapse it to one fluid column below 768px. Additive, scoped, no change
   to style.css or to desktop layout. */
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
