/* Blog Card Styles - Consolidated from list.css and typography.css */

/* HERO SECTION Bullets */
#writing-topics li {
  padding-left: 6px;
  list-style: hiragana-iroha;
  font-family: monospace;
  letter-spacing: 0px;
  font-weight: bold;
  font-size: 14px;
  line-break: pretty;
}

/* Blog Card Grid Layout */
.md-blog-grid,
.blog-grid,
.grid.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: var(--spacing-lg) 0; /* 24px (mt-6) instead of 32px (mt-8) */
}

/* Responsive grid - moved to responsive.css */

/* Featured Image Aspect Ratio */
.bg-cover,
.md-post-image,
.blog-card-image,
.featured-image {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  /* Removed background-color: #1a1a1a to avoid dark backgrounds */
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
  .bg-cover,
  .md-post-image,
  .blog-card-image,
  .featured-image {
    padding-bottom: 56.25%;
    height: 0;
    position: relative;
  }

  .bg-cover img,
  .md-post-image img,
  .blog-card-image img,
  .featured-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

.bg-cover {
  min-height: auto;
}

/* Card Text Truncation */
.line-clamp-2,
.card-text > h1,
h2,
h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.card-text > h1 {
  font-size: 18px;
  margin-bottom: 4px;
  min-height: 2rem;
}

.card-text > h2 {
  font-size: 1.5em;
  font-weight: 600;
  margin: 0;
  padding: 0;
  line-height: 1.25em;
  min-height: 1em;
  height: 2.75em;
  overflow: hidden;
}

div.container > h2,
div.card-text > h2 {
  border-left: none;
  min-height: 2rem;
  margin-top: 8px;
}

.card-text > p.text-lg {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 18px;
  margin-top: 8px;
  color: #7c7d85;
  font-weight: 400;
}

/* Card Text Padding */
.card-text {
  padding: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
}

/* Card Overlay Link */
a.card-overlay-link {
  text-decoration: none;
  cursor: pointer;
}

a.card-overlay-link:hover {
  text-decoration: none;
}

/* Focus Indicators for Accessibility */
a.card-overlay-link:focus-visible {
  outline: 3px solid #ff9800;
  outline-offset: -3px;
}

.md-meta__link:focus-visible {
  outline: 2px solid #ff9800;
  outline-offset: 2px;
}

/* Blog Card Metadata */
.md-post-meta,
.blog-card-meta,
.card-metadata {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--spacing-sm) 0 var(--spacing-sm);
  font-size: 13px;
  color: #888;
  flex-wrap: wrap;
}

/* Blog Card Header - Negative margin overlaps with image */
.md-post__header {
  position: relative;
  z-index: 5;
}

/* Author Avatar - Fix clipping */
.md-post-meta .avatar,
.blog-card-meta .avatar,
.md-author__image,
.md-post__authors img,
.md-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-block;
  border: 2px solid #1a1a1a;
  background: #1a1a1a;
  pointer-events: auto;
}

.md-post__authors,
.md-author {
  overflow: visible;
  line-height: 0;
}

.md-post-meta .date,
.blog-card-date {
  font-weight: 500;
  color: #999;
}

.md-post-meta .separator,
.blog-card-separator {
  color: #555;
}

.md-post-meta .read-time,
.blog-card-read-time {
  color: #888;
}

/* Multiple Tags Handling */
.md-post-meta .tags,
.md-post-meta .categories,
.blog-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.md-post-meta .category,
.md-post-meta .tag,
.blog-card-category,
.md-tag {
  background-color: rgba(255, 107, 53, 0.15);
  color: #ff6b35;
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

/* Blog Card Title */
.md-post-title,
.blog-card-title,
.card-text > h1,
.card-text > h2 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  line-height: 1.4;
  color: #fff;
}

/* Blog Card Excerpt */
.md-post-excerpt,
.blog-card-excerpt,
.card-text > p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: #999;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: var(--spacing-sm);
  text-align: left;
  width: 100%;
}

/* Blog Card Container */
.md-post,
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Fix excessive bottom margin from MkDocs Material theme */
.md-post--excerpt {
  margin-bottom: 0;
}

.md-post:hover,
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Inner Content Wrapper */
.md-post-content,
.blog-card-content {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Category Pills */
.category-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background-color: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.25);
  border-radius: 12px;
  color: #ff9800;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.category-pill:hover {
  background-color: rgba(255, 152, 0, 0.15);
  border-color: rgba(255, 152, 0, 0.4);
  color: #ffa726;
  transform: translateY(-1px);
}

.category-pill.category-more {
  background-color: rgba(153, 153, 153, 0.1);
  border-color: rgba(153, 153, 153, 0.25);
  color: #999;
  cursor: default;
  pointer-events: none;
}
