/* The Library - Grace Berman Knowledge Resource */
/* Clean, documentation-style design system */

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

:root {
  --primary: #1e293b;
  --background: #ffffff;
  --accent: #8b5cf6;
  --secondary: #14b8a6;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-700: #334155;

  --spacing-unit: 8px;
  --max-width: 1280px;
  --content-width: 720px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

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

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

/* Layout System */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* Header */
.site-header {
  background: var(--background);
  border-bottom: 1px solid var(--gray-200);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: var(--gray-700);
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-menu a.active {
  color: var(--accent);
}

/* Hero Section - Documentation Style */
.hero {
  padding: 4rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid var(--gray-200);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--gray-600);
  line-height: 1.6;
  max-width: 600px;
}

/* Topic Navigation */
.topics-section {
  padding: 4rem 0;
}

.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-description {
  color: var(--gray-600);
  font-size: 1.125rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.topic-card {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.topic-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.1);
}

.topic-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.topic-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.topic-description {
  color: var(--gray-600);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.875rem;
}

.resource-count {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8125rem;
}

/* Two Column Layout */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  padding: 4rem 0;
}

.main-content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

/* Popular Resources */
.popular-resources {
  background: var(--background);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.popular-resources h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.resource-link {
  display: block;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.resource-link:hover {
  background: var(--gray-100);
  transform: translateX(4px);
}

.resource-link h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: var(--primary);
}

.resource-topic {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
}

/* About Page */
.about-hero {
  padding: 4rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-photo {
  width: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 4px solid var(--gray-200);
}

.about-photo img {
  width: 100%;
  height: auto;
}

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.badge {
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
}

.badge.secondary {
  background: var(--secondary);
}

.badge.outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

/* Chapters */
.chapters {
  padding: 4rem 0;
}

.chapter {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--gray-200);
}

.chapter:last-child {
  border-bottom: none;
}

.chapter-number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.chapter h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.chapter p {
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.chapter ul {
  list-style: none;
  margin-left: 0;
}

.chapter li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.chapter li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.currently-section {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: white;
  padding: 3rem;
  border-radius: var(--radius-lg);
  margin-top: 3rem;
}

.currently-section h3 {
  color: white;
  margin-bottom: 1.5rem;
}

.current-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.role h4 {
  color: white;
  margin-bottom: 0.5rem;
}

.role p {
  color: rgba(255, 255, 255, 0.9);
}

/* Article Page */
.article-header {
  padding: 4rem 0 2rem;
  max-width: var(--content-width);
  margin: 0 auto;
}

.topic-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.author-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
}

.author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info {
  flex: 1;
}

.author-name {
  font-weight: 600;
  color: var(--primary);
}

.article-date {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  padding: 3rem 0;
  max-width: 1080px;
  margin: 0 auto;
}

.toc {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.toc h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.toc ul {
  list-style: none;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: var(--gray-600);
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.toc a:hover,
.toc a.active {
  color: var(--accent);
}

.article-content {
  max-width: var(--content-width);
}

.article-content h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.article-content strong {
  color: var(--primary);
  font-weight: 600;
}

.tip-box {
  background: var(--gray-50);
  border-left: 4px solid var(--accent);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: var(--radius-sm);
}

.tip-box h4 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Related Resources */
.related-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--gray-200);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.related-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.3s;
}

.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.related-card h4 {
  margin-bottom: 0.5rem;
}

.related-card p {
  font-size: 0.9375rem;
  color: var(--gray-600);
}

/* Topics Page */
.topics-header {
  padding: 4rem 0 2rem;
  text-align: center;
}

.topics-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.search-box {
  max-width: 600px;
  margin: 2rem auto;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.topics-list {
  padding: 3rem 0;
}

.large-topic-card {
  background: var(--background);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin-bottom: 2rem;
  transition: all 0.3s;
}

.large-topic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
}

.topic-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.large-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.topic-header h2 {
  margin: 0;
  flex: 1;
}

.large-topic-card p {
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.subtopics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.subtopic-tag {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: white;
  padding: 3rem 0;
  margin-top: 6rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-about h3 {
  color: white;
  margin-bottom: 1rem;
}

.footer-about p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.footer-links h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: var(--radius-md);
  }

  .two-col-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo,
  .about-photo {
    margin: 0 auto;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .article-title {
    font-size: 2rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .current-roles {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    gap: 1rem;
  }

  .container {
    padding: 0 1rem;
  }
}
