/* ============================================================
   BLOG INDEX PAGE — blog.css
   Extends style.css + mobile.css — no token duplication.
   ============================================================ */

/* ── MASTHEAD ───────────────────────────────────────────────
   Clean cream header — editorial masthead feel.
   Title + eyebrow left, dispatch count right.
──────────────────────────────────────────────────────────── */
.blog-masthead {
  background: var(--white);
  padding: clamp(120px, 16vh, 180px) var(--gutter) 0;
  min-height: 44vh;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

/* Ghost wordmark — identical to homepage about-wordmark treatment */
.blog-masthead-wordmark {
  position: absolute;
  bottom: -12%;
  left: 0;
  right: 0;
  line-height: 0;
  pointer-events: none;
  z-index: 0;
}

.blog-masthead-wordmark img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0);
  opacity: 0.035;
}

.blog-masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-end;
  gap: clamp(32px, 4vw, 64px);
  padding: clamp(28px, 3.5vw, 48px) 0 clamp(36px, 5vw, 64px);
  position: relative;
  z-index: 1;
}

.blog-masthead-left {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
}

.blog-masthead-eyebrow {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cobalt);
  display: flex;
  align-items: center;
  gap: 10px;
}

.blog-masthead-eyebrow::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

.blog-masthead-title {
  font-family: var(--display);
  font-size: clamp(52px, 8.5vw, 132px);
  font-weight: 300;
  font-style: italic;
  line-height: 0.88;
  letter-spacing: -0.035em;
  color: var(--navy);
}

/* Bold sans cobalt block — mirrors work-hero-title em treatment */
.blog-masthead-title em {
  font-family: var(--body);
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  display: block;
  color: var(--cobalt);
  margin-top: 0.18em;
}

.blog-masthead-sub {
  font-family: var(--body);
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--grey);
  max-width: 440px;
}

.blog-masthead-right {
  text-align: right;
  flex-shrink: 0;
}

.blog-masthead-count-num {
  font-family: var(--display);
  font-size: clamp(72px, 10vw, 156px);
  font-weight: 300;
  font-style: italic;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--cobalt);
  display: block;
}

.blog-masthead-count-label {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
  display: block;
  margin-top: 4px;
}

/* ── CARDS GRID ─────────────────────────────────────────────
   Three portrait cards on a navy base. Each card is a full-
   bleed image with gradient overlay and text at the bottom.
   Hover: image scale up, overlay deepens, CTA nudges right.
──────────────────────────────────────────────────────────── */
.blog-cards {
  background: var(--navy);
  padding: clamp(40px, 5vw, 64px) var(--gutter) clamp(64px, 8vw, 100px);
}

.blog-cards-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(10px, 1.2vw, 16px);
}

/* Each card is a linked <article> */
.blog-card {
  position: relative;
  border-radius: clamp(12px, 1.4vw, 20px);
  /* No overflow:hidden here — clipping is handled by .blog-card-media
     to avoid GPU compositing artifacts at rounded corners on hover */
  aspect-ratio: 3/4;
  display: block;
  text-decoration: none;
  cursor: pointer;
  background: var(--navy);
}

/* Inner media wrapper handles image clipping in isolation */
.blog-card-media {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  /* Inset shadow paints over sub-pixel anti-aliasing at rounded corners */
  box-shadow: inset 0 0 0 3px var(--navy);
  z-index: 0;
}

.blog-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin-top: -10%;
  will-change: transform;
  transition: transform 0.8s var(--ease);
}

.blog-card:hover .blog-card-img {
  transform: scale(1.05) translate3d(0, -1%, 0);
}

/* Gradient overlay — lighter at top, dense at bottom */
.blog-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 26, 79, 0.97) 0%,
    rgba(0, 26, 79, 0.55) 45%,
    rgba(0, 26, 79, 0.08) 100%
  );
  transition: background 0.5s var(--ease);
}

.blog-card:hover .blog-card-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 26, 79, 1) 0%,
    rgba(0, 26, 79, 0.65) 50%,
    rgba(0, 26, 79, 0.15) 100%
  );
}

/* Card content overlaid at bottom */
.blog-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: clamp(22px, 2.8vw, 40px);
  z-index: 2;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(10px, 1.2vw, 16px);
}

.blog-card-category {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(11, 208, 250, 0.12);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}

.blog-card-date {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.38);
}

.blog-card-title {
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 34px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: clamp(12px, 1.4vw, 20px);
}

.blog-card-excerpt {
  font-family: var(--body);
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: clamp(14px, 1.8vw, 24px);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}

.blog-card:hover .blog-card-cta {
  gap: 14px;
  color: var(--white);
}

.blog-card-cta svg {
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.blog-card:hover .blog-card-cta svg {
  transform: translateX(4px);
}

/* ── CTA BACKGROUND PARALLAX ─────────────────────────────────
   Mirrors work.css / project.css exactly — portrait image
   drifts behind the navy overlay. Must be here because blog.css
   does not load work.css or project.css.
──────────────────────────────────────────────────────────── */
.cta-bg-parallax {
  position: absolute;
  inset: -20% 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.cta-bg-parallax img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.6;
  display: block;
}

/* ── MOBILE ──────────────────────────────────────────────────
   Below 768px — masthead stacks, cards go single column.
──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .blog-card:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 16/9;
  }
}

@media (max-width: 768px) {
  .blog-masthead {
    min-height: auto;
    padding-top: clamp(90px, 14vh, 130px);
  }

  .blog-masthead-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .blog-masthead-right {
    text-align: left;
  }

  .blog-masthead-title {
    font-size: clamp(44px, 14vw, 80px);
  }

  .blog-masthead-count-num {
    font-size: clamp(48px, 16vw, 80px);
  }

  .blog-cards {
    padding: clamp(28px, 5vw, 48px) 20px clamp(48px, 8vw, 72px);
  }

  .blog-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .blog-card {
    aspect-ratio: 4/3;
  }

  .blog-card:last-child {
    grid-column: auto;
    aspect-ratio: 4/3;
  }

  /* Hide excerpt and date on mobile — keeps cards clean with
     just category badge, title, and CTA */
  .blog-card-excerpt { display: none; }
  .blog-card-date    { display: none; }
}
