/* Reading Progress Bar */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background-color: var(--md-accent-fg-color);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* Post Header */
.post-header {
  margin-bottom: 2rem;
}

.post-tags {
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin-right: 0.5rem;
  background-color: rgba(var(--md-accent-fg-color--rgb), 0.1);
  color: var(--md-accent-fg-color);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.post-header h1 {
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--md-typeset-color-light);
}

.post-meta .author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

/* TL;DR Card */
.tldr {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background-color: var(--md-code-bg-color);
  border-left: 4px solid var(--md-accent-fg-color);
  border-radius: 4px;
}

.tldr p {
  margin: 0;
}

/* Related Posts */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--md-typeset-color-light);
}

.related-posts h2 {
  margin-bottom: 1.5rem;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.related-post-card {
  padding: 1.5rem;
  background-color: var(--md-code-bg-color);
  border-radius: 8px;
}

.related-post-title a {
  text-decoration: none;
  color: var(--md-typeset-color);
  font-weight: 600;
}

.related-post-meta {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--md-typeset-color-light);
}

/* Author Profile Card */
.author-container {
  position: relative;
}

.author-card-wrapper {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  width: 300px;
  margin-top: 0.5rem;
}

.author-container:hover .author-card-wrapper {
  display: block;
}

.author-card {
  padding: 1rem;
  background-color: var(--md-code-bg-color);
  border: 1px solid var(--md-typeset-color-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.author-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.author-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-right: 1rem;
}

.author-card-info {
  display: flex;
  flex-direction: column;
}

.author-card-name {
  font-weight: 600;
}

.author-card-stats {
  font-size: 0.8rem;
  color: var(--md-typeset-color-light);
}

.author-card-topics {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.author-card-link {
  display: block;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--md-accent-fg-color);
  text-decoration: none;
}

/* Author Profile Page */
.author-profile-page .author-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--md-typeset-color-light);
}

.author-profile-page .author-avatar img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
}

.author-profile-page .author-stats {
  font-size: 1rem;
  color: var(--md-typeset-color-light);
}

.author-profile-page .author-topics {
  margin-bottom: 2rem;
}

.author-profile-page .author-posts ul {
  list-style: none;
  padding: 0;
}

.author-profile-page .author-posts li {
  margin-bottom: 1.5rem;
}

/* Tags Index Page */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.tag-card {
  display: block;
  padding: 1.5rem;
  background-color: var(--md-code-bg-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--md-typeset-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tag-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.tag-card-name {
  font-weight: 600;
  font-size: 1.2rem;
}

.tag-card-count {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--md-typeset-color-light);
}

/* Search Results */
.search-result {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--md-typeset-color-light);
}

.search-result h2 {
  margin-bottom: 0.5rem;
}

.search-result-excerpt mark {
  background-color: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
}

.search-result-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--md-typeset-color-light);
}

/* Post List / Home Page */
.post-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.view-toggle button {
  background: none;
  border: 1px solid var(--md-typeset-color-light);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.view-toggle button.active {
  background-color: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
  border-color: var(--md-accent-fg-color);
}

.post-card {
  padding: 2rem;
  background-color: var(--md-code-bg-color);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.post-card-title a {
  text-decoration: none;
  color: var(--md-typeset-color);
}

.post-card-summary {
  margin-top: 1rem;
  color: var(--md-typeset-color-light);
}

.post-card-meta {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.post-card-meta .author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
