/* JunaMatch — base styles + utility classes used in the JSX prototypes.
   Tokens are in tokens.css. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
img { max-width: 100%; display: block; }

/* ---------- Utility text classes (used inline in JSX) ---------- */

.ja-display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}
.ja-display-it {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
}
.ja-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- ja-card ---------- */

.ja-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  position: relative;
}

/* ---------- ja-btn ---------- */

.ja-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0 18px;
  height: 40px;
  white-space: nowrap;
  transition: background 0.12s ease, transform 0.12s ease;
}
.ja-btn:hover { transform: translateY(-1px); }
.ja-btn.is-sm { height: 32px; padding: 0 14px; font-size: 12px; }
.ja-btn.is-lg { height: 52px; padding: 0 24px; font-size: 14px; }

.ja-btn.is-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: var(--shadow-btn);
}
.ja-btn.is-accent:hover { background: var(--accent-hover); }

.ja-btn.is-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

/* ---------- ja-chip ---------- */

.ja-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- ja-app (page shell) ---------- */
.ja-app { min-height: 100vh; }

/* ---------- mobile <768px overrides (v3 mobile-web pass) ----------
   The pages use inline styles for paddings, grids, and font sizes (faithful JSX port).
   Rather than rewrite every page, we override the well-known inline patterns
   with attribute selectors at the mobile breakpoint. */
@media (max-width: 767px) {
  /* Section paddings */
  section[style*="padding:80px 48px 56px"],
  section[style*="padding:80px 48px"],
  section[style*="padding:72px 48px"],
  section[style*="padding:64px 48px"],
  section[style*="padding: 80px 48px"],
  section[style*="padding: 72px 48px"] {
    padding: 32px 22px !important;
  }
  section[style*="padding:0 48px 80px"],
  section[style*="padding: 0 48px 80px"] {
    padding: 0 22px 32px !important;
  }

  /* Grid collapses */
  [style*="grid-template-columns:1.1fr 1fr"],
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr auto"],
  [style*="grid-template-columns: 1fr auto"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:repeat(2, 1fr)"],
  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  /* But not the moderation-table head/body — let table-layout handle it. */
  thead tr, tbody tr { grid-template-columns: initial !important; }

  /* Display-headline scale */
  .ja-display { letter-spacing: -0.02em; }
  h1.ja-display[style*="font-size:80px"],
  h1.ja-display[style*="font-size: 80px"],
  h1.ja-display[style*="font-size:88px"],
  h1.ja-display[style*="font-size: 88px"] { font-size: 44px !important; line-height: 0.98 !important; }
  h1.ja-display[style*="font-size:72px"],
  h1.ja-display[style*="font-size: 72px"],
  h1.ja-display[style*="font-size:64px"],
  h1.ja-display[style*="font-size: 64px"] { font-size: 40px !important; line-height: 1 !important; }
  h2.ja-display[style*="font-size:48px"],
  h2.ja-display[style*="font-size: 48px"] { font-size: 28px !important; line-height: 1.05 !important; }
  .ja-display[style*="font-size:56px"],
  .ja-display[style*="font-size: 56px"] { font-size: 36px !important; }
  .ja-display[style*="font-size:36px"],
  .ja-display[style*="font-size: 36px"] { font-size: 24px !important; }
  .ja-display[style*="font-size:32px"],
  .ja-display[style*="font-size: 32px"] { font-size: 22px !important; }
  .ja-display[style*="font-size:28px"],
  .ja-display[style*="font-size: 28px"] { font-size: 22px !important; }
  .ja-display[style*="font-size:26px"],
  .ja-display[style*="font-size: 26px"] { font-size: 20px !important; }

  /* Body type doesn't need to shrink below 14, but big leads do */
  p[style*="font-size:18px"],
  p[style*="font-size: 18px"] { font-size: 15px !important; }

  /* Buttons in CTA rows go full-width */
  div[style*="display:flex"][style*="gap:12px"] > .ja-btn.is-lg,
  div[style*="display: flex"][style*="gap: 12px"] > .ja-btn.is-lg { flex: 1; }

  /* Auth landing left/right grid stacks */
  .ja-app > div[style*="grid-template-columns:1fr 1fr"][style*="min-height:620px"],
  .ja-app > div[style*="grid-template-columns: 1fr 1fr"][style*="min-height: 620px"] {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }
  .ja-app > header[style*="padding:24px 48px"] { padding: 14px 18px !important; }

  /* Hide elements explicitly marked desktop-only */
  .ja-desktop-only { display: none !important; }

  /* Tighter hero font tweak for any 64–88 */
  h1.ja-display { font-size: clamp(40px, 11vw, 56px); }
}

/* Mobile nav drawer (jm-nav) — only used at <768px.
   !important needed because the headers carry inline display:flex/sticky. */
.jm-nav-bar-mobile { display: none !important; }
.jm-nav-drawer { display: none !important; }
@media (max-width: 767px) {
  .jm-nav-bar-desktop { display: none !important; }
  .jm-nav-bar-mobile { display: flex !important; }
  .jm-nav-drawer:not([hidden]) { display: block !important; }
}

/* Mobile-only blocks shown via .ja-mobile-only */
.ja-mobile-only { display: none; }
@media (max-width: 767px) { .ja-mobile-only { display: block; } }

/* Hide skip-to-content link until focused */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 14px; top: 14px; background: white; padding: 8px 14px; z-index: 100; }
