/* =============================================
   SHOPLABS BLOG INDEX — grid page styles
   Reuses design tokens from ../../css/styles.css
   Card design lifted from the article "More from
   the series" rail, adapted to a responsive grid.
   ============================================= */

/* ── Hero ── */
.bx-hero {
  background: var(--surface);
  border-bottom: 1px solid rgba(26, 26, 26, 0.07);
}

.bx-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) 32px clamp(48px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(32px, 4vw, 44px);
}

.bx-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
}

.bx-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 720px;
}

.bx-hero-cta {
  flex-shrink: 0;
  padding-bottom: 4px;
}

/* Clean brand-kit secondary: cream (surface) fill, light purple stroke,
   pill, 8px 24px, 14/500. Hover = stroke deepens + gentle lift, arrow
   nudges up-right. */
.bx-hero-cta .bx-blog-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 24px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid rgba(132, 76, 172, 0.40);
  border-radius: var(--radius-full);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(75, 42, 99, 0.08);
  transition: border-color var(--duration-base) var(--ease-smooth),
              box-shadow var(--duration-base) var(--ease-smooth),
              transform var(--duration-base) var(--ease-smooth);
}

.bx-hero-cta .bx-blog-btn:hover {
  border-color: var(--primary-light);
  box-shadow: 0 6px 16px rgba(75, 42, 99, 0.14);
  transform: translateY(-1px);
  color: var(--primary);
  text-decoration: none;
}

.bx-hero-cta .bx-blog-btn .arrow {
  display: inline-flex;
  align-items: center;
  transition: transform var(--duration-base) var(--ease-smooth);
}

.bx-hero-cta .bx-blog-btn:hover .arrow {
  transform: translate(2px, -2px);
}

.bx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(75, 42, 99, 0.06);
  border: 1px solid rgba(75, 42, 99, 0.15);
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--primary);
  margin-bottom: 16px;
}

.bx-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

.bx-title-accent {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--primary);
}

.bx-sub {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: rgba(26, 26, 26, 0.6);
  max-width: 560px;
  margin: 0;
}

.bx-sub strong {
  font-weight: 600;
  color: rgba(26, 26, 26, 0.78);
}

/* ── Customer story highlight card (Emma Sleep) ── */
.bx-story-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 48px;
  background:
    radial-gradient(80% 80% at 30% 20%, rgba(75, 42, 99, 0.55) 0%, rgba(75, 42, 99, 0) 60%),
    #1A0E25;
  border-radius: 32px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.3s var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow 0.3s var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
}

/* atmosphere: green wash + dot grid, echoing the card art idiom */
.bx-story-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 70% at 95% 105%, rgba(155, 207, 106, 0.10) 0%, rgba(155, 207, 106, 0) 60%),
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 18px 18px;
  pointer-events: none;
}

/* ambient: a soft purple aura drifting slowly behind the copy */
.bx-story-card::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: 14%;
  top: -32%;
  z-index: 0;
  background: radial-gradient(circle, rgba(132, 76, 172, 0.26) 0%, transparent 65%);
  animation: bx-aura-drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes bx-aura-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  to   { transform: translate3d(70px, 28px, 0) scale(1.14); opacity: 1; }
}

.bx-story-card > * {
  position: relative;
  z-index: 1;
}

.bx-story-card:hover {
  transform: translateY(-3px);
  box-shadow: rgba(26, 14, 37, 0.35) 0px 18px 44px;
  text-decoration: none;
}

.bx-story-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.bx-story-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11.5px;
  line-height: 17px;
  letter-spacing: 1.38px;
  text-transform: uppercase;
  color: #C7A6DE;
}

.bx-story-dot {
  width: 5px;
  height: 5px;
  border-radius: 2.5px;
  background: var(--accent);
  animation: bx-live-pulse 2.4s ease-in-out infinite;
}

@keyframes bx-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(155, 207, 106, 0.45); }
  50%      { box-shadow: 0 0 0 4px rgba(155, 207, 106, 0); }
}

.bx-story-title {
  margin: 0;
  padding-top: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 48px;
  color: rgba(255, 255, 255, 0.95);
}

.bx-story-sub {
  margin: 0;
  max-width: 555px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 26px;
  color: rgba(255, 255, 255, 0.7);
}

/* byline — quieter and italic so it reads apart from the quote */
.bx-story-attrib {
  display: block;
  margin-top: -6px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13.5px;
  line-height: 20px;
  color: rgba(255, 255, 255, 0.45);
}

.bx-story-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  width: 100%;
  max-width: 672px;
  padding-top: 24px;
}

.bx-story-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bx-story-num {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 48px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #C7A6DE;
}

.bx-story-num.is-green {
  color: var(--accent);
}

.bx-story-label {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 20px;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Grid section ── */
.bx-grid-section {
  background: var(--white);
  padding: clamp(48px, 6vw, 72px) 0 clamp(64px, 8vw, 104px);
}

.bx-grid-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: clamp(28px, 3.5vw, 40px);
}

.bx-grid-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

/* inline brand wordmark inside the title — sized to the text's
   lowercase body so it reads as one line of type */
.bx-wordmark {
  display: inline-block;
  vertical-align: baseline;
  color: var(--primary);
}

.bx-wordmark svg {
  display: inline-block;
  height: 1.18em;
  width: auto;
  /* wordmark has a descender ('p') baked into its 27px box —
     drop it so its baseline meets the text baseline */
  vertical-align: -0.24em;
}

.bx-grid-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.bx-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .bx-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .bx-hero-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .bx-hero-cta { padding-bottom: 0; }
}

@media (max-width: 768px) {
  .bx-story-card { padding: 32px 28px; }
  .bx-story-title { font-size: 30px; line-height: 36px; }
  .bx-story-stats { gap: 24px; }
  .bx-story-num { font-size: 38px; line-height: 40px; }
}

@media (max-width: 640px) {
  .bx-grid { grid-template-columns: 1fr; }
  .bx-story-stats { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Blog card (from article related-rail design) ── */
.bx-grid .blog-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid rgba(75, 42, 99, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0px 1px 2px rgba(0, 0, 0, 0.04),
    0px 4px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow 0.3s var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
  text-decoration: none;
}

.bx-grid a.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: rgba(75, 42, 99, 0.12) 0px 6px 24px;
  text-decoration: none;
}

.bx-grid .blog-card-hero {
  width: 100%;
  min-height: 170px;
  flex-shrink: 0;
  position: relative;
}

.bx-grid img.blog-card-hero {
  display: block;
  height: 170px;
  object-fit: cover;
}

.bx-grid .blog-card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.bx-grid .blog-card h3 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
}

.bx-grid .blog-card-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.bx-grid .blog-card-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  background: rgba(75, 42, 99, 0.08);
  border: 1px solid rgba(75, 42, 99, 0.12);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: rgba(26, 26, 26, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.bx-pill-new {
  background: rgba(155, 207, 106, 0.18);
  border-color: rgba(155, 207, 106, 0.5);
  color: #3a7018;
}

/* Upcoming articles: present but quiet */
.bx-grid .blog-card.is-soon { cursor: default; }
.bx-grid .blog-card.is-soon h3 { color: rgba(26, 26, 26, 0.62); }

/* ── "Coming soon" hero placeholder ──
   Layered cream wash + dot grid + sparkle lockup.
   Designed stand-in until real cover art ships. */
.bch-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #FBFAF7;
  border-bottom: 1px solid rgba(75, 42, 99, 0.07);
  overflow: hidden;
}

.bch-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 110% at 85% 110%, rgba(155, 207, 106, 0.18) 0%, rgba(155, 207, 106, 0) 62%),
    radial-gradient(80% 100% at 8% -10%, rgba(75, 42, 99, 0.07) 0%, rgba(75, 42, 99, 0) 60%),
    radial-gradient(rgba(75, 42, 99, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 14px 14px;
  pointer-events: none;
}

.bch-spark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(75, 42, 99, 0.14);
  box-shadow: 0 2px 10px rgba(75, 42, 99, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bch-spark svg {
  animation: bch-pulse 3.2s ease-in-out infinite;
  transform-origin: center;
}

@keyframes bch-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.18); opacity: 1; }
}

.bch-text {
  position: relative;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.bch-tag {
  position: relative;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(26, 26, 26, 0.38);
}

@media (prefers-reduced-motion: reduce) {
  .bch-spark svg { animation: none; }
  .bx-grid .blog-card { transition: none; }
  .bx-story-dot { animation: none; }
  .bx-story-card { transition: none; }
  .bx-story-card::after { animation: none; }
}
