/* ============================================
   Haiku Partners - Clean, content-focused design
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1b2a4a;
  --color-text-muted: #6b7280;
  --color-accent: #1b2a4a;
  --color-accent-hover: #2d4a7a;
  --color-border: #e7e5e4;
  --color-tag-bg: #f5f5f4;
  --color-tag-active: #1b2a4a;
  --color-tag-active-text: #ffffff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --max-width: 1400px;
  --header-height: 148px;
}

html {
  font-size: 22px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 22px;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* --- Header --- */
.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.site-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo {
  height: 132px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 48px;
}

.site-nav a {
  color: var(--color-text-muted);
  font-size: 28px;
  font-weight: 500;
  transition: color 0.15s;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-text);
  text-decoration: underline;
}

/* --- Hero --- */
.hero {
  text-align: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.hero-graphic-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-graphic-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.hero .container {
  padding-top: 16px;
  padding-bottom: 48px;
}

.hero-title {
  font-size: 72px;
  font-weight: 700;
  color: #4a86c8;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.hero-tagline {
  font-size: 36px;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* --- Main content --- */
main {
  padding: 0 0 48px;
}

/* --- Section Headings --- */
.section-heading {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
}

/* --- Popular / Featured Post --- */
.popular-section {
  margin-bottom: 48px;
}

.featured-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.featured-link:hover {
  opacity: 0.92;
}

.featured-banner {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.featured-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.featured-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.featured-summary {
  color: var(--color-text-muted);
  font-size: 28px;
  line-height: 1.5;
}

/* --- Recent Section --- */
.recent-section {
  margin-bottom: 40px;
}

/* --- Tag Filter --- */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.tag-filter button {
  background: var(--color-tag-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 22px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
}

.tag-filter button:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.tag-filter button.active {
  background: var(--color-tag-active);
  border-color: var(--color-tag-active);
  color: var(--color-tag-active-text);
}

/* --- Article Cards --- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.article-card a.card-link {
  display: flex;
  color: inherit;
  text-decoration: none;
}

.card-banner {
  width: 480px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-tag-bg);
  display: flex;
  align-items: center;
}

.card-banner img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.card-body {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.card-type {
  background: var(--color-tag-bg);
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.card-type.substack { color: #ff6719; }
.card-type.medium { color: #00ab6c; }
.card-type.pdf { color: #e11d48; }
.card-type.blog { color: var(--color-accent); }

.card-body h2 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card-summary {
  color: var(--color-text-muted);
  font-size: 24px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-abstract {
  color: var(--color-text);
  font-size: 20px;
  line-height: 1.6;
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-abstract p {
  margin: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card-tags span {
  background: var(--color-tag-bg);
  font-size: 20px;
  padding: 6px 14px;
  border-radius: 4px;
  color: var(--color-text-muted);
}

/* --- Blog post card (no banner) --- */
.article-card.no-banner .card-link {
  display: block;
}

.article-card.no-banner .card-body {
  padding: 24px 32px;
}

/* --- Single Article (PDF page) --- */
.article-single {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

.article-single h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.article-single .meta {
  color: var(--color-text-muted);
  font-size: 22px;
  margin-bottom: 24px;
}

.article-single .banner-img {
  border-radius: 8px;
  margin-bottom: 24px;
}

.article-abstract {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.75;
  margin-bottom: 32px;
}

.article-abstract p {
  margin-bottom: 20px;
}

.pdf-download {
  display: inline-block;
  padding: 16px 32px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
  font-size: 24px;
  transition: background 0.15s;
}

.pdf-download:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

/* --- Blog Post Single --- */
.blog-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

.blog-content h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.blog-content .meta {
  color: var(--color-text-muted);
  font-size: 22px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.blog-content .prose {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.75;
}

.blog-content .prose h2 {
  font-family: var(--font-sans);
  font-size: 36px;
  font-weight: 600;
  margin: 40px 0 16px;
}

.blog-content .prose h3 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.blog-content .prose p {
  margin-bottom: 20px;
}

.blog-content .prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 20px;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 24px 0;
}

.blog-content .prose code {
  background: var(--color-tag-bg);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.blog-content .prose pre {
  background: var(--color-text);
  color: #e7e5e4;
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
}

.blog-content .prose pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.blog-content .prose ul,
.blog-content .prose ol {
  margin: 16px 0 20px 32px;
}

.blog-content .prose li {
  margin-bottom: 8px;
}

.blog-content .prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- About Page --- */
.about-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

.about-content h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 24px;
}

.about-content .prose {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.75;
}

.about-content .prose p {
  margin-bottom: 20px;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  margin-top: 48px;
}

.site-footer p {
  font-size: 18px;
  color: var(--color-text-muted);
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 700px) {
  .article-card a.card-link {
    flex-direction: column;
  }

  .card-banner {
    width: 100%;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-tagline {
    font-size: 22px;
  }

  .hero {
    padding: 24px 0 20px;
  }

  .site-logo {
    height: 56px;
  }

  .site-nav a {
    font-size: 18px;
  }

  .section-heading {
    font-size: 24px;
  }

  .featured-title {
    font-size: 28px;
  }

  .card-body h2 {
    font-size: 22px;
  }

  .tag-filter button {
    font-size: 16px;
    padding: 8px 16px;
  }

  .article-single h1,
  .blog-content h1 {
    font-size: 32px;
  }

  body {
    font-size: 18px;
  }
}
