/* ============================================
   Beautiful Minds Blog System
   Field Notes — Brianne's Clinical Writing
   ============================================ */

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  z-index: 10000;
  transition: width 0.1s linear;
}

/* --- Blog Index --- */
.blog-hero {
  padding: var(--space-3xl) 0 var(--space-xl);
  text-align: center;
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  margin-bottom: var(--space-xs);
}

.blog-hero .blog-subtitle {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
}

/* Category filters */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.blog-filter {
  background: transparent;
  border: 1.5px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.blog-filter:hover,
.blog-filter.active {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-icy);
}

/* Featured post card */
.blog-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-xl);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-featured:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.blog-featured-image {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--teal-icy), var(--coral-light));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.blog-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-featured-image .placeholder-icon {
  font-size: 4rem;
  opacity: 0.3;
}

.blog-featured-content {
  padding: var(--space-lg);
}

/* Post cards grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.blog-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card-image {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--teal-icy), var(--coral-light));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Shared post meta elements */
.post-category {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  width: fit-content;
}

.post-category.cat-clinical {
  background: var(--teal-icy);
  color: var(--teal-dark);
}

.post-category.cat-personal {
  background: var(--coral-light);
  color: var(--coral-dark);
}

.post-category.cat-education {
  background: #EDE8F5;
  color: #5B4A8A;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.post-meta .divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.post-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin-top: var(--space-sm);
}

.post-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-title a:hover {
  color: var(--teal);
}

.post-excerpt {
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  line-height: 1.65;
  flex: 1;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--teal);
  text-decoration: none;
  margin-top: var(--space-sm);
  transition: gap 0.2s ease;
}

.read-more:hover {
  gap: 0.65rem;
}

.read-more::after {
  content: '\2192';
}

/* --- Individual Post Layout --- */
.post-header {
  padding: var(--space-3xl) 0 var(--space-lg);
  max-width: 720px;
  margin: 0 auto;
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 1.2;
  margin-top: var(--space-sm);
}

.post-header .post-subtitle {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  line-height: 1.5;
}

/* Author byline */
.post-byline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.post-byline-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--teal-icy);
}

.post-byline-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.post-byline-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.post-byline-name a {
  color: var(--text-primary);
  text-decoration: none;
}

.post-byline-name a:hover {
  color: var(--teal);
}

.post-byline-credential {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Two-column article layout */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-xl);
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  align-items: start;
}

/* Article body */
.post-body {
  max-width: 720px;
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  scroll-margin-top: calc(var(--header-height) + var(--space-md));
}

.post-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.post-body p {
  margin-bottom: var(--space-md);
}

.post-body ul,
.post-body ol {
  margin-bottom: var(--space-md);
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-decoration-color: var(--teal-light);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}

.post-body a:hover {
  text-decoration-color: var(--teal);
}

/* Pull quote */
.pull-quote {
  position: relative;
  margin: var(--space-xl) calc(-1 * var(--space-md));
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--teal);
}

.pull-quote p {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

.pull-quote cite {
  display: block;
  margin-top: var(--space-xs);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--text-muted);
}

/* Key takeaway callout */
.callout {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.callout-teal {
  background: var(--teal-icy);
  border-color: var(--teal-light);
}

.callout-coral {
  background: var(--coral-light);
  border-color: var(--coral-mid);
}

.callout-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-dark);
  margin-bottom: 0.5rem;
}

.callout-coral .callout-label {
  color: var(--coral-dark);
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Section divider */
.post-divider {
  text-align: center;
  margin: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  letter-spacing: 0.5em;
}

/* Inline CTA within post */
.post-inline-cta {
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--teal-icy), var(--bg-white));
  border-radius: var(--radius-xl);
  text-align: center;
  border: 1px solid var(--teal-light);
}

.post-inline-cta h3 {
  font-family: var(--font-display);
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.post-inline-cta p {
  max-width: 480px;
  margin: 0 auto var(--space-sm);
  color: var(--text-secondary);
}

/* --- Sidebar --- */
.post-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
}

/* Table of contents */
.toc {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0;
}

.toc-list a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: all 0.2s ease;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--teal);
  border-left-color: var(--teal);
}

/* Sidebar author card */
.sidebar-author {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.sidebar-author img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-xs);
  border: 3px solid var(--teal-icy);
}

.sidebar-author h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.15rem;
}

.sidebar-author p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

/* Related condition tags */
.sidebar-tags {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--border);
}

.sidebar-tags h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.sidebar-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sidebar-tag-list a {
  font-size: 0.8125rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg);
  border-radius: 2rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-tag-list a:hover {
  background: var(--teal-icy);
  color: var(--teal-dark);
}

/* Related posts grid */
.related-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

/* Breadcrumbs */
.breadcrumbs {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-lg) 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

.breadcrumbs a:hover {
  color: var(--teal);
}

.breadcrumbs .sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 2.25rem;
  }

  .blog-featured {
    grid-template-columns: 1fr;
  }

  .blog-featured-image {
    aspect-ratio: 16/9;
  }

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

  .post-layout {
    grid-template-columns: 1fr;
    padding: 0 var(--space-sm);
  }

  .post-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .post-header h1 {
    font-size: 2rem;
  }

  .pull-quote {
    margin-left: 0;
    margin-right: 0;
  }

  .related-posts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .post-sidebar {
    grid-template-columns: 1fr;
  }

  .post-meta {
    flex-wrap: wrap;
  }
}

@media (min-width: 1024px) {
  .blog-hero h1 {
    font-size: 3.5rem;
  }

  .post-header h1 {
    font-size: 3rem;
  }
}
