/*
 * Styles for the prerendered /insights pages.
 * Standalone HTML — does not load the SolidJS bundle — so this CSS includes
 * the global resets, color tokens, and font setup that the SPA's index.css
 * provides for the rest of the site.
 */

:root {
  --navy: #1e1b4b;
  --navy-light: #2e2b5b;
  --purple: #a78bfa;
  --purple-light: #c4b5fd;
  --green: #4ade80;
  --green-dark: #22c55e;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: clamp(16px, 1.2vw, 20px);
}

body {
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--white);
  font-size: clamp(1rem, 1.2vw, 1.25rem);
}

a {
  color: var(--purple);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover {
  border-bottom-color: var(--purple);
}

/* --- Header (matches Nav.css; duplicated because insights pages don't load the SPA) --- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-100);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  border: none;
}

.logo img {
  height: 28px;
  width: auto;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: 1rem;
}

.site-header nav a {
  color: var(--gray-600);
  font-family:
    "Manrope",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: clamp(0.875rem, 1.2vw, 1.05rem);
  font-weight: 500;
  border: none;
  transition: color 0.2s;
}

.site-header nav a:hover {
  color: var(--navy);
  border-bottom: none;
}

/* --- Page wrapper --- */

main.insights-main {
  padding: 7rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Listing pages (index, tag, author) --- */

.insights-hero {
  margin-bottom: 4rem;
  max-width: 800px;
}

.insights-hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.insights-hero .insights-hero-kicker {
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple);
  margin-bottom: 0.75rem;
}

.insights-hero p {
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  color: var(--gray-600);
  line-height: 1.6;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.insight-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--gray-100);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.insight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border-bottom-color: var(--gray-100);
}

.insight-card-image {
  aspect-ratio: 16 / 9;
  background: var(--gray-100);
  background-size: cover;
  background-position: center;
}

.insight-card-image.placeholder {
  background: linear-gradient(135deg, var(--purple) 0%, var(--navy) 100%);
}

.insight-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.insight-card-meta {
  font-size: 0.8125rem;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.insight-card h2 {
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.insight-card p {
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.insight-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--gray-400);
}

/* --- Article page --- */

article.insight-article {
  max-width: 760px;
  margin: 0 auto;
}

.insight-article-header {
  position: static;
  z-index: auto;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
  margin-bottom: 3rem;
  text-align: center;
}

.insight-article-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple);
  margin-bottom: 1.25rem;
  border: none;
}

.insight-article-tag:hover {
  color: var(--navy);
  border-bottom: none;
}

.insight-article h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.insight-article-excerpt {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  color: var(--gray-600);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 2rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.insight-article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--gray-600);
}

.insight-article-meta a {
  color: var(--gray-800);
  font-weight: 600;
  border: none;
}

.insight-article-meta a:hover {
  color: var(--purple);
}

.insight-article-meta .dot {
  color: var(--gray-400);
}

.insight-article-feature-image {
  margin: 0 -2rem 3rem;
  border-radius: 16px;
  overflow: hidden;
}

.insight-article-feature-image img {
  width: 100%;
  height: auto;
  display: block;
}

.insight-article-feature-image figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-top: 0.75rem;
  padding: 0 2rem;
}

/* Article body (Ghost-generated HTML) */
.insight-article-body {
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.75;
  color: var(--gray-800);
}

.insight-article-body > * + * {
  margin-top: 1.5rem;
}

.insight-article-body h2,
.insight-article-body h3,
.insight-article-body h4 {
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.insight-article-body h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 3rem;
}

.insight-article-body h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  margin-top: 2.5rem;
}

.insight-article-body h4 {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  margin-top: 2rem;
}

.insight-article-body p {
  color: var(--gray-800);
}

.insight-article-body a {
  color: var(--purple);
  border-bottom: 1px solid var(--purple-light);
}

.insight-article-body a:hover {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.insight-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem 0;
  display: block;
}

.insight-article-body figure {
  margin: 2rem 0;
}

.insight-article-body figcaption {
  font-size: 0.875rem;
  color: var(--gray-400);
  text-align: center;
  margin-top: 0.75rem;
}

.insight-article-body blockquote {
  border-left: 4px solid var(--purple);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-style: italic;
  color: var(--gray-600);
  line-height: 1.5;
}

.insight-article-body blockquote p {
  color: inherit;
}

.insight-article-body ul,
.insight-article-body ol {
  padding-left: 1.5rem;
}

.insight-article-body li + li {
  margin-top: 0.5rem;
}

.insight-article-body code {
  background: var(--gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SF Mono", "Menlo", monospace;
}

.insight-article-body pre {
  background: var(--gray-800);
  color: var(--gray-50);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.insight-article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.insight-article-body hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 3rem 0;
}

/* Footer of article: tags + back link */
.insight-article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

.insight-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.insight-article-tags a {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--gray-600);
  transition: all 0.2s;
}

.insight-article-tags a:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.insight-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--gray-600);
  font-size: 0.95rem;
  border: none;
}

.insight-back-link:hover {
  color: var(--navy);
  border-bottom: none;
}

/* --- Author profile --- */

.author-profile {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.author-profile-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--purple);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.author-profile-info h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.author-profile-info p {
  font-size: 1.0625rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* --- Footer --- */

footer.insights-footer {
  background: var(--navy);
  border-top: 1px solid var(--navy-light);
  padding: 3rem 2rem;
  margin-top: 6rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.footer-left p {
  color: var(--gray-400);
  font-size: clamp(0.8125rem, 1.2vw, 1rem);
}

.tagline-footer {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  color: var(--green);
  font-size: clamp(0.875rem, 1.3vw, 1.1rem);
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--gray-400);
  font-size: clamp(0.8125rem, 1.2vw, 1rem);
  border: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--white);
  border-bottom: none;
}

/* --- Empty state --- */

.insights-empty {
  text-align: center;
  padding: 4rem 0;
  color: var(--gray-400);
  font-size: 1.125rem;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .site-header nav {
    gap: 1rem;
    margin-left: 0;
  }

  main.insights-main {
    padding: 6rem 1.5rem 3rem;
  }

  .insights-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .insight-article-feature-image {
    margin: 0 -1.5rem 2rem;
    border-radius: 0;
  }

  .author-profile {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  footer.insights-footer {
    padding: 2rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
}
