/* Shared base styles — design tokens, reset, chrome (nav/header/footer)
   Served at /shared/style.css by the home Cloudflare Pages project.
   Sub-projects link this first, then layer project-specific rules on top. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* Nav */
nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.25rem;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-accent);
  text-decoration: none;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.nav-link:hover { color: var(--color-text); }

.nav-sep {
  color: var(--color-border);
  font-size: 0.9rem;
  user-select: none;
}

.nav-current {
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}

/* Header */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 2.5rem 1rem 2rem;
  text-align: center;
}

header h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.tagline {
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  font-size: 1rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.75rem 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

footer a { color: var(--color-text-muted); }

/* Main container */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

/* Topic / tool grid */
.tools-grid h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tool-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.12);
  transform: translateY(-2px);
}

.tool-card__icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.tool-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tool-card__desc {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  flex: 1;
  line-height: 1.55;
}

.tool-card__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 0.5rem;
}

/* Topic card (home → topic page) */
.topic-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.topic-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.12);
  transform: translateY(-2px);
}

.topic-card__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.topic-card__title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topic-card__count {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

.topic-card__desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
}

.topic-card__cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 0.5rem;
}

/* Ad units */
.ad-unit { width: 100%; min-height: 90px; margin: 1.5rem 0; }
.ad-unit--header { min-height: 280px; margin-top: 1.5rem; }
.ad-unit--content { min-height: 250px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
