/* ===========================================
   BLOG POST SIDEBAR STYLES
   =========================================== */


.custom-sidebar {
  height: auto;
  background: inherit;
  zoom: 0.75;
}


/* Back to Index link */
.sidebar-back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #999;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.sidebar-back-link:hover {
  color: #e5e5e5;
}

.sidebar-back-link svg {
  flex-shrink: 0;
}

/* Sidebar dividers */
.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0.25rem 0;
}

/* Author Card - Grid layout (1/3 photo, 2/3 info) */
.sidebar-author-card {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.5rem 0;
}

.author-photo-col {
  display: flex;
  justify-content: center;
}

.sidebar-author-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.author-name-row {
  font-weight: 600;
  font-size: 0.8rem;
  color: #e5e5e5;
}

.author-name-row a {
  color: #e5e5e5;
  text-decoration: none;
}

.author-name-row a:hover {
  color: #ff9800;
}

.author-about-row {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
}

/* Metadata rows */
.sidebar-metadata {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #999;
}

.meta-row svg {
  flex-shrink: 0;
  color: #666;
}

.meta-row a {
  color: #999;
  text-decoration: none;
}

.meta-row a:hover {
  color: #e5e5e5;
}

/* Sidebar sections */
.sidebar-section {
  padding: 0.25rem 0;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Tags with pastel colors */
.sidebar-tags,
.header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-pill,
.header-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.tag-pill:hover,
.header-tag:hover {
  opacity: 0.8;
}

/* Pastel color palette for tags (10 colors) */
.tag-0 { background: rgba(255, 182, 193, 0.2); color: #ffb6c1; border: 1px solid rgba(255, 182, 193, 0.3); } /* Light Pink */
.tag-1 { background: rgba(173, 216, 230, 0.2); color: #add8e6; border: 1px solid rgba(173, 216, 230, 0.3); } /* Light Blue */
.tag-2 { background: rgba(144, 238, 144, 0.2); color: #90ee90; border: 1px solid rgba(144, 238, 144, 0.3); } /* Light Green */
.tag-3 { background: rgba(255, 218, 185, 0.2); color: #ffdab9; border: 1px solid rgba(255, 218, 185, 0.3); } /* Peach */
.tag-4 { background: rgba(221, 160, 221, 0.2); color: #dda0dd; border: 1px solid rgba(221, 160, 221, 0.3); } /* Plum */
.tag-5 { background: rgba(240, 230, 140, 0.2); color: #f0e68c; border: 1px solid rgba(240, 230, 140, 0.3); } /* Khaki */
.tag-6 { background: rgba(175, 238, 238, 0.2); color: #afeeee; border: 1px solid rgba(175, 238, 238, 0.3); } /* Pale Turquoise */
.tag-7 { background: rgba(255, 160, 122, 0.2); color: #ffa07a; border: 1px solid rgba(255, 160, 122, 0.3); } /* Light Salmon */
.tag-8 { background: rgba(216, 191, 216, 0.2); color: #d8bfd8; border: 1px solid rgba(216, 191, 216, 0.3); } /* Thistle */
.tag-9 { background: rgba(152, 251, 152, 0.2); color: #98fb98; border: 1px solid rgba(152, 251, 152, 0.3); } /* Pale Green */

/* Share icon buttons */
.sidebar-share-icons {
  display: flex;
  gap: 0.5rem;
}

.share-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  color: #999;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.share-icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #e5e5e5;
  background: rgba(255, 255, 255, 0.05);
}

.share-icon-btn.copied {
  border-color: rgba(144, 238, 144, 0.5);
  color: #90ee90;
}

.share-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ===========================================
   SUBSTACK-STYLE HEADER
   =========================================== */

.substack-header {
  max-width: 70ch;
  margin: 0 0 1rem;  /* Reduced margin */
  padding: 0;
  border-bottom: none;
}

/* Category badge - better colors */
.post-category-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: rgba(100, 181, 246, 0.15);  /* Light blue instead of orange */
  border: 1px solid rgba(100, 181, 246, 0.3);
  border-radius: 4px;
  color: #64b5f6;  /* Light blue */
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.post-category-badge:hover {
  background: rgba(100, 181, 246, 0.25);
  color: #90caf9;
}

/* Title */
.post-title-hero {
  font-family: var(--font-sans);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;  /* Adjusted margin */
  color: #e5e5e5;
  letter-spacing: -0.02em;
}

/* Hide duplicate h1 from content */
.md-content--post .md-content__inner > h1:first-of-type,
.md-content--post .md-typeset > h1:first-of-type {
  display: none;
}

/* Also hide the Material tags that appear before content */
.md-content--post .md-content__inner > nav.md-tags:first-of-type {
  display: none;
}

.post-subtitle {
  font-size: 18px;
  color: #999;
  line-height: 1.5;
  margin: 0.5rem 0 1rem;
  font-weight: 400;
}

/* Header tags */
.header-tags {
  margin: 0.75rem 0;
}

.header-tag {
  font-size: 0.65rem;
}

/* Author meta */
.post-author-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Override article img margin for author avatar */
.substack-header .author-avatar-large,
.post-author-meta .author-avatar-large,
article .author-avatar-large,
article.md-typeset .author-avatar-large {
  margin: 0 !important;  /* Override article img margin */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.author-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e5e5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.author-name:hover {
  color: #ff9800;
}

.post-meta-line {
  font-size: 0.8rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-separator {
  color: #444;
}

.read-time {
  color: #666;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS
   =========================================== */

@media (max-width: 768px) {
  .substack-header {
    padding: 0 1rem;
  }

  .post-title-hero {
    font-size: 28px;
  }

  .post-subtitle {
    font-size: 16px;
  }

  .author-avatar-large {
    width: 40px !important;
    height: 40px !important;
  }

  .sidebar-author-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .sidebar-author-img {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .post-title-hero {
    font-size: 24px;
  }

  .post-subtitle {
    font-size: 15px;
  }

  .header-tags {
    display: none;  /* Hide tags in header on very small screens */
  }
}
