/* =========================================================================
   BLOG.HTML — additive stylesheet.
   Loaded AFTER styles.css. Reuses existing tokens (--bg-color, --border,
   --text-main, --text-dim, .cta-card, .cta-btn, .hero-stage, .motto,
   .scroll-reveal-item) and the site's Microsoft-style mouse-proximity glow
   pattern (see ".story-card::before" below, matching nav::before / .card::before
   in styles.css) so the blog never looks like a bolt-on.
   ========================================================================= */

/* ---------- HERO / OPENING ----------
   Reuses the site's real ".hero-main-title / .title-line / .blur-char"
   pattern (and its blur-in entrance animation) from styles.css, instead of
   a custom class, so the blog hero matches the homepage/projects/audit
   hero in both type scale and motion — no more feeling like a different,
   smaller page bolted onto the site. */
.blog-hero {
  min-height: 46vh; /* full-size title, but not the homepage's full 85vh stage — this page's job is to get to content fast */
  padding-bottom: 20px;
}

.blog-hero-title {
  margin: 14px 0 0;
}

.blog-title-bold {
  font-weight: 700;
  color: #ffffff;
}

.blog-title-medium {
  font-weight: 400;
  color: #7a7a7a;
}

/* ---------- PAGE CONTAINER ---------- */
.blog-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 5% 60px;
}

/* ---------- SEARCH + CATEGORY TABS ROW (sits directly under the hero) ---------- */
.blog-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
  margin-bottom: 14px;
}

.blog-controls-note {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 44px;
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 10px 18px;
  flex: 1 1 260px;
  max-width: 340px;
  color: var(--text-dim);
  transition: 0.25s ease;
}

.blog-search:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
}

.blog-search svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.blog-search input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
}

.blog-search input::placeholder {
  color: var(--text-dim);
}

.blog-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  flex: 1 1 auto;
}

/* On small screens, search sits full-width above tabs; tabs scroll
   horizontally instead of wrapping, so the row stays compact. */
@media (max-width: 600px) {
  .blog-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .blog-search {
    max-width: none;
  }
  .blog-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .blog-tabs::-webkit-scrollbar {
    display: none;
  }
}

.tab-btn {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  padding: 10px 20px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.tab-btn.active {
  background: #fff;
  color: #0d0d0f;
  border-color: #fff;
}

/* ---------- STORY CARD PIECES (shared by large + regular cards) ---------- */
.story-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(13, 13, 15, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.story-category-tag {
  display: inline-block;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.story-excerpt {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 18px;
}

.story-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 18px;
}

.story-author {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.read-time-chip {
  color: var(--text-dim);
}

.read-time-chip::before {
  content: "· ";
}

.author-avatar-mark {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
}

.story-cta-link {
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 3px;
  transition: 0.25s ease;
  align-self: flex-start;
  margin-top: auto;
}

.story-cta-link:hover {
  border-color: #fff;
  opacity: 0.85;
}

/* ---------- ARRANGEMENT ----------
   A 6-column track: the first two ".story-card--large" cards each take
   half the width (3 of 6 cols), so they read as a deliberate top row.
   Every regular ".story-card" after them takes a third of the width
   (2 of 6 cols), falling into a 3-across row underneath. This asymmetry
   is what signals "start here" without a separate oversized hero block. */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 25px;
}

.story-card {
  grid-column: span 2;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.3s ease;
}

.story-card--large {
  grid-column: span 3;
}

.story-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-4px);
}

/* Mouse-proximity edge glow — identical technique to nav::before /
   .card::before in styles.css, extended here so story cards get the
   same "Microsoft-feel" highlight the rest of the site uses. Driven by
   --mouse-x / --mouse-y, set in blog.html's mousemove listener. */
.story-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    300px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.4),
    transparent 70%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.story-card:hover::before {
  opacity: 1;
}

.story-image-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.story-card--large .story-image-wrapper {
  aspect-ratio: 16 / 9;
}

.story-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.story-card:hover .story-image-wrapper img {
  transform: scale(1.04);
}

.story-content {
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.story-card--large .story-content {
  padding: 32px 34px 34px;
}

.story-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  margin: 10px 0 12px;
}

.story-card--large .story-content h3 {
  font-size: clamp(1.3rem, 2vw, 1.55rem);
}

.stories-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
  font-size: 0.95rem;
}

/* =========================================================================
   RESPONSIVE — matches the site's existing breakpoints (1200 / 900 / 768 / 600)
   ========================================================================= */

/* TABLET: the 6-col track collapses to 4. Large cards keep half-width (2/4),
   regular cards go to half-width too (2/4) — a clean 2-across layout rather
   than fighting for thirds on a narrower viewport. */
@media (max-width: 900px) {
  .stories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .story-card {
    grid-column: span 2;
  }
  .story-card--large {
    grid-column: span 4;
  }
  .story-card--large .story-image-wrapper {
    aspect-ratio: 21 / 9;
  }
}

/* MOBILE: single column, everything the same width. Card images go
   slightly taller (4:3) than desktop's 16:9 — a wide crop reads as a
   thin sliver at this size, a taller crop keeps the subject legible. */
@media (max-width: 600px) {
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .story-card,
  .story-card--large {
    grid-column: 1 / -1;
  }
  .story-image-wrapper,
  .story-card--large .story-image-wrapper {
    aspect-ratio: 4 / 3;
  }
  .story-card--large .story-content {
    padding: 26px 22px 28px;
  }
  .story-content {
    padding: 22px 22px 26px;
  }
  .blog-hero {
    min-height: 30vh;
  }
  .blog-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .blog-controls-note {
    margin-bottom: 30px;
  }
}
