/* Blog lobby (blog.html) and shared card/grid styles for article.html. Headings come from css/custom/case.css. */
/*
 * 12-column page grid, shared with article.html: the .container (max 76rem, no side padding
 * on desktop, 1rem on mobile, like .header-container), so every left edge lines up with the
 * header logo and the main page content.
 * Column gap 1.5rem desktop, 1rem mobile. Values follow css/custom/grid.css (--grid-max,
 * --grid-gap, .grid-12) and fall back to the same numbers if that file is missing.
 */
.blog, .post { --page-gap: var(--grid-gap, 1.5rem); }
.page-wrap {
  max-width: var(--grid-max, 76rem);
  margin-top: 0;
  padding-left: 0;
  padding-right: 0;
}
.blog { background: #080808; color: #fff; padding: 12rem 0 5rem; }
/* Title, then the description under it, then the filters */
.blog-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.blog-head .case-lead { max-width: 36rem; color: rgba(255, 255, 255, 0.75); }

/* Toolbar: category tabs with counts on the left, date sort on the right */
.blog-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: inset 0 -1px rgba(255, 255, 255, 0.14); /* tab underlines paint over this line */
}
.blog-filters {
  display: flex;
  gap: 1.75rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.blog-filters::-webkit-scrollbar { display: none; }
.blog-tab, .blog-sort-btn {
  padding: 0;
  border: 0;
  background: none;
  font: 600 0.8125rem/1 Thicccboi, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s ease;
}
.blog-tab {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.9rem 0 0.85rem;
  border-bottom: 1px solid transparent;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.blog-tab-count { font-size: 0.6875rem; color: rgba(255, 255, 255, 0.4); font-variant-numeric: tabular-nums; }
.blog-tab:hover { color: rgba(255, 255, 255, 0.85); }
.blog-tab[aria-pressed="true"] { color: #fff; border-bottom-color: #fff; }
.blog-tab[aria-pressed="true"] .blog-tab-count { color: rgba(255, 255, 255, 0.7); }
.blog-tab:focus-visible, .blog-sort-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.blog-sort {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.9rem 0 0.85rem;
  font: 600 0.8125rem/1 Thicccboi, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.35);
}
.blog-sort-label { color: rgba(255, 255, 255, 0.5); }
.blog-sort-btn { color: rgba(255, 255, 255, 0.5); }
.blog-sort-btn:hover { color: rgba(255, 255, 255, 0.85); }
.blog-sort-btn[aria-pressed="true"] { color: #fff; }

/* Cards */
.blog-card { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; color: #fff; text-decoration: none; }
.blog-card:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.blog-card-media { overflow: hidden; background: #161618; aspect-ratio: 16 / 10; }
.blog-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.blog-card:hover .blog-card-media img { transform: scale(1.04); }
.blog-card-body { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.blog-card-body p { margin: 0; font-size: 0.9375rem; line-height: 1.3; color: rgba(255, 255, 255, 0.65); }
.blog-card-title {
  margin: 0;
  font-family: "Type Juice Unison Pro", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.15;
  color: #fff;
}
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.blog-featured { margin-bottom: 4.5rem; }
/* Featured: image 7 columns, text 5 */
.blog-card--featured {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: 2rem var(--page-gap);
}
.blog-card--featured .blog-card-media { grid-column: span 7; aspect-ratio: 16 / 10; }
.blog-card--featured .blog-card-body { grid-column: span 5; }
.blog-card--featured .case-h2 { margin: 0; font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.1; color: #fff; }

/* Cards: 4 of 12 columns on desktop, 6 on tablet, 12 on mobile */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3.5rem var(--page-gap);
}
.blog-grid > .blog-card { grid-column: span 4; }
.blog-empty { margin: 2rem 0 0; color: rgba(255, 255, 255, 0.6); }

@media (max-width: 991px) {
  .blog-grid > .blog-card { grid-column: span 6; }
}
@media (max-width: 767px) {
  .blog { padding: 8.5rem 0 3.5rem; }
  .blog-head { gap: 1rem; margin-bottom: 2rem; }
  .blog, .post { --page-gap: 1rem; }
  .page-wrap { padding-left: 1rem; padding-right: 1rem; }
  /* Tabs scroll sideways; sort stacks under them */
  .blog-toolbar { flex-direction: column; align-items: stretch; gap: 0; margin-bottom: 2rem; box-shadow: none; }
  .blog-filters { gap: 1.5rem; margin: 0 -1rem; padding: 0 1rem; box-shadow: inset 0 -1px rgba(255, 255, 255, 0.14); }
  .blog-sort { padding: 1rem 0 0; }
  .blog-featured { margin-bottom: 3rem; }
  .blog-card--featured { row-gap: 1.25rem; }
  .blog-card--featured .blog-card-media, .blog-card--featured .blog-card-body { grid-column: 1 / -1; }
  .blog-grid { row-gap: 2.5rem; }
  .blog-grid > .blog-card { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-card-media img, .blog-tab, .blog-sort-btn { transition: none; }
}
