/* ---- Blog index (shared trust + blog specific) ---- */
.bl-hero { position: relative; text-align: center; padding: 56px 0 32px; overflow: hidden; }
.bl-hero .wrap { position: relative; z-index: 2; }
.bl-hero .section-title { margin: 8px 0 10px; }
.bl-hero .section-sub { max-width: 640px; margin: 0 auto; }
.bl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bl-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink);
  background: var(--card-bg); border: 1.5px solid var(--line);
  border-radius: var(--radius-md); padding: 20px 18px;
  transition: transform .25s var(--ease-smooth), box-shadow .25s, border-color .25s;
}
.bl-card:hover { transform: translateY(-3px); border-color: var(--blue); box-shadow: 0 12px 30px -8px rgba(8,12,24,.28); }
.bl-emoji { font-size: 26px; line-height: 1; }
.bl-card strong { font-family: var(--font-display); font-size: 16px; line-height: 1.3; }
.bl-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

@media (max-width: 900px) { .bl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .bl-grid { grid-template-columns: 1fr; } .bl-hero { padding: 40px 0 24px; } }

/* ============================================================
   BLOG SIGNATURE THEME
   The blog keeps the Nyvoxa navy base but gets its own identity:
   a teal -> blue accent, a softly tinted hero and teal-lit cards,
   so /blog and /blog/<slug> feel editorial and separate from the shop.
   ============================================================ */
:root {
  --bl-accent:        #0FB5A5;
  --bl-accent-dark:   #0A8C81;
  --bl-accent-soft:   rgba(15, 181, 165, 0.10);
  --bl-accent-line:   rgba(15, 181, 165, 0.32);
  --bl-tint:          #F2FBFA;
  --bl-gradient:      linear-gradient(135deg, #0FB5A5 0%, #1E88C7 100%);
  --bl-gradient-soft: linear-gradient(135deg, rgba(15,181,165,.12) 0%, rgba(30,136,199,.12) 100%);
}

/* soft teal wash behind the blog hero */
.bl-hero {
  background:
    radial-gradient(1100px 340px at 50% -12%, rgba(15,181,165,.16), transparent 62%),
    radial-gradient(760px 300px at 88% 8%, rgba(30,136,199,.12), transparent 60%),
    var(--bl-tint);
  border-bottom: 1px solid var(--bl-accent-line);
}

/* teal eyebrow chip in the hero */
.bl-hero .eyebrow {
  background: var(--bl-accent-soft);
  border: 1px solid var(--bl-accent-line);
  color: var(--bl-accent-dark);
  font-weight: 800;
  letter-spacing: .04em;
}

/* teal underline accent on the hero title */
.bl-hero .section-title {
  color: #0B1220;
}
.bl-hero .section-title::after {
  content: "";
  display: block;
  width: 74px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 99px;
  background: var(--bl-gradient);
}
.bl-hero .section-sub { color: #46566B; }

/* blog cards get a teal lift instead of the plain navy hover */
.bl-card {
  position: relative;
  overflow: hidden;
  border-color: #E2E9F2;
  box-shadow: 0 2px 10px -6px rgba(11,18,32,.18);
}
.bl-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bl-gradient);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s var(--ease-smooth);
}
.bl-card:hover {
  transform: translateY(-4px);
  border-color: var(--bl-accent-line);
  box-shadow: 0 18px 38px -14px rgba(15,181,165,.42);
}
.bl-card:hover::before { transform: scaleY(1); }
.bl-card:hover strong { color: var(--bl-accent-dark); }
.bl-card strong { transition: color .2s; }

/* emoji tile gets the accent gradient so the grid feels branded */
.bl-emoji {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 23px;
  border-radius: 14px;
  background: var(--bl-gradient-soft);
  border: 1px solid var(--bl-accent-line);
}
.bl-sub { color: #56667C; }

/* blog post page (server-rendered) picks up the same accent */
body[data-page="blog"] .site-header,
body[data-page="blog-post"] .site-header { --bl-page: 1; }
.bl-date, .bl-tag {
  color: var(--bl-accent-dark);
  font-weight: 700;
}
a.bl-link, .bl-card a { color: var(--bl-accent-dark); }
a.bl-link:hover { color: var(--bl-accent); }

/* ---- Back button (blog index + post page) ----
   It used to sit at top:18px, which put it straight on top of the 64px site
   header and covered the round logo. Drop it just below the nav instead. */
.bl-back {
  position: fixed;
  top: calc(var(--nav-h, 64px) + 14px);
  left: 18px;
  z-index: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: rgba(10, 14, 24, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: 0 6px 20px rgba(4, 7, 16, 0.32);
  transition: transform .2s var(--ease-smooth), background .2s, box-shadow .2s;
}
.bl-back svg { width: 17px; height: 17px; }
.bl-back:hover {
  background: #05070E;
  color: #ffffff;
  transform: translateX(-2px);
  box-shadow: 0 10px 26px rgba(4, 7, 16, 0.45);
}
.bl-back:focus-visible { outline: 2px solid var(--bl-accent, #0FB5A5); outline-offset: 2px; }

@media (max-width: 640px) {
  .bl-back { top: calc(var(--nav-h, 62px) + 10px); left: 12px; height: 34px; padding: 0 13px 0 10px; font-size: 12px; }
  .bl-back svg { width: 15px; height: 15px; }
}

/* ---- Inline "back" links on account / order pages ----
   Several pages had a bare "&larr; Back to ..." anchor with no class, so it
   inherited link colour and had no padding, arrow gap or hover state. */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line, #e2e8f0);
  background: var(--card-bg, #fff);
  color: var(--ink, #0f172a);
  font-family: var(--font-body, inherit);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 10px -6px rgba(8, 12, 24, .22);
  transition: transform .2s var(--ease-smooth), border-color .2s, box-shadow .2s, color .2s;
}
.page-back:hover {
  transform: translateX(-3px);
  border-color: var(--bl-accent, #0FB5A5);
  color: var(--bl-accent-dark, #0A8C81);
  box-shadow: 0 10px 24px -12px rgba(15, 181, 165, .45);
}
.page-back:focus-visible { outline: 2px solid var(--bl-accent, #0FB5A5); outline-offset: 2px; }
.page-back .pb-arrow { font-size: 17px; line-height: 1; }

@media (max-width: 640px) {
  .page-back { margin-top: 18px; padding: 9px 15px 9px 12px; font-size: 13px; }
  .page-back .pb-arrow { font-size: 15px; }
}

/* ============================================================
   BLOG INDEX — V2
   Simpler, store-themed (navy + teal), with scroll animations.
   ============================================================ */

/* tighter hero */
.bl-hero { padding: 44px 0 26px; }
.bl-hero .section-title { font-size: clamp(26px, 4.4vw, 40px); }
.bl-hero .section-sub { font-size: 15px; }

/* ---- filter + search bar ---- */
.bl-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 0 22px;
}
.bl-search {
  position: relative; flex: 1 1 260px; min-width: 0;
}
.bl-search input {
  width: 100%;
  font-family: inherit; font-size: 14px; color: #0F172A;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid #E2E9F2; border-radius: 999px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.bl-search input::placeholder { color: #94A3B8; }
.bl-search input:focus {
  outline: none; border-color: var(--bl-accent);
  box-shadow: 0 0 0 4px rgba(15,181,165,.12);
}
.bl-search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: #94A3B8; pointer-events: none;
}

.bl-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.bl-chip {
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  padding: 8px 15px; border-radius: 999px; white-space: nowrap;
  background: #fff; border: 1.5px solid #E2E9F2; color: #46566B;
  transition: transform .18s var(--ease-smooth), border-color .18s,
              background .18s, color .18s, box-shadow .18s;
}
.bl-chip:hover { transform: translateY(-2px); border-color: var(--bl-accent-line); }
.bl-chip.is-on {
  background: var(--bl-gradient);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px -10px rgba(15,181,165,.9);
}
.bl-chip b { font-weight: 800; opacity: .7; margin-left: 4px; }

.bl-none {
  display: none;
  padding: 44px 20px; text-align: center;
  border: 1.5px dashed #CBD5E1; border-radius: 16px;
  color: #64748B; font-size: 14px; line-height: 1.6;
}
.bl-none.is-shown { display: block; animation: blFade .4s var(--ease-smooth); }
@keyframes blFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- real published posts ---- */
.bl-real { margin-top: 0; gap: 20px; }

.bl-real .bl-card {
  padding: 0; overflow: hidden;
  background: #fff;
  border: 1.5px solid #E7EDF5;
  border-radius: 18px;
  box-shadow: 0 2px 14px -10px rgba(11,18,32,.35);
  transition: transform .3s var(--ease-smooth), box-shadow .3s, border-color .3s;
}
.bl-real .bl-card:hover {
  transform: translateY(-6px);
  border-color: var(--bl-accent-line);
  box-shadow: 0 26px 50px -22px rgba(15,181,165,.55);
}
.bl-real .bl-card::before { display: none; }

.bl-real .bl-post .bl-cover {
  display: block; width: 100%;
  height: 92px;
  object-fit: cover; object-position: center;
  background: #EEF3F9;
  border-radius: 0;
  margin: 0;
  transition: transform .5s var(--ease-smooth), filter .4s;
}
.bl-real .bl-card:hover .bl-cover { transform: scale(1.06); }

.bl-real .bl-in { padding: 15px 17px 18px; display: flex; flex-direction: column; gap: 8px; }

.bl-pcat {
  display: inline-flex; align-items: center; gap: 5px;
  align-self: flex-start;
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--bl-accent-dark);
  background: var(--bl-accent-soft);
  border: 1px solid var(--bl-accent-line);
  border-radius: 999px; padding: 4px 10px;
}
.bl-real .bl-in > strong {
  font-family: var(--font-display, inherit);
  font-size: 16.5px; line-height: 1.32; color: #0B1220;
  transition: color .2s;
}
.bl-real .bl-card:hover .bl-in > strong { color: var(--bl-accent-dark); }
.bl-real .bl-sub { font-size: 13px; color: #56667C; line-height: 1.55; }

.bl-pmeta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 3px; font-size: 11.5px; font-weight: 700; color: #7B8AA0;
}
.bl-pmeta span { display: inline-flex; align-items: center; gap: 4px; }
.bl-pmeta .bl-date { color: var(--bl-accent-dark); }

/* ---- laptop: featured card spans two columns ---- */
/* ============================================================
   OVERFLOW SAFETY
   Grid and flex children default to min-width:auto, so one long word or an
   unbreakable title can push the whole page wider than the phone viewport.
   ============================================================ */
.bl-tools, .bl-chips, .bl-real, .bl-real > *,
.bl-in, .bl-in > * { min-width: 0; }
.bl-real .bl-in > strong,
.bl-real .bl-sub,
.bl-card > strong { overflow-wrap: anywhere; word-break: normal; }
body[data-page="blog"] { overflow-x: hidden; }

/* ---- laptop: featured card spans two columns ---- */
@media (min-width: 901px) {
  .bl-real { grid-template-columns: repeat(3, 1fr); }
  .bl-real .bl-post .bl-cover { height: 190px; }

  .bl-real > .bl-post:first-child {
    grid-column: span 2;
    display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch;
  }
  .bl-real > .bl-post:first-child > .bl-cover {
    height: 100%; min-height: 340px; border-radius: 0;
    object-fit: contain; object-position: center;
    background: #F4F7FB;
  }
  .bl-real > .bl-post:first-child > .bl-in {
    padding: 26px 28px; justify-content: center; gap: 12px; text-align: left;
    min-width: 0;
  }
  .bl-real > .bl-post:first-child .bl-in > strong { font-size: 24px; line-height: 1.22; }
  .bl-real > .bl-post:first-child .bl-sub { font-size: 14.5px; }
  .bl-real > .bl-post:first-child .bl-pmeta { margin-top: 4px; }
}

/* ---- scroll reveal ---- */
.bl-reveal { opacity: 0; transform: translateY(22px); }
.bl-reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease-smooth), transform .6s var(--ease-smooth);
}
@media (prefers-reduced-motion: reduce) {
  .bl-reveal { opacity: 1; transform: none; }
  .aiw::after, .aiw-spark, .bp-foot .btn-outline { animation: none; }
}

/* ---- mobile ---- */
@media (max-width: 640px) {
  .bl-hero { padding: 30px 0 20px; }
  .bl-tools { gap: 8px; }
  .bl-chips { width: 100%; overflow-x: auto; padding-bottom: 4px; flex-wrap: nowrap; }
  .bl-chip { flex: 0 0 auto; }

  /* one clear column: image on top, then a left-aligned text block */
  .bl-real { gap: 16px; }
  .bl-real .bl-card,
  .bl-real > .bl-post:first-child { display: block; }
  .bl-real > .bl-post:first-child .bl-cover,
  .bl-real .bl-post .bl-cover {
    height: 172px; min-height: 0; border-radius: 0;
    object-fit: contain; object-position: center;
    background: #F4F7FB;
  }
  .bl-real > .bl-post:first-child .bl-in,
  .bl-real .bl-in { padding: 14px 16px 17px; gap: 7px; text-align: left; }
  .bl-real > .bl-post:first-child .bl-in > strong,
  .bl-real .bl-in > strong { font-size: 16.5px; line-height: 1.34; }
  .bl-real > .bl-post:first-child .bl-sub,
  .bl-real .bl-sub { font-size: 13px; }
  .bl-pmeta { margin-top: 2px; }
}

@media (max-width: 400px) {
  .bl-real .bl-post .bl-cover,
  .bl-real > .bl-post:first-child .bl-cover { height: 150px; }
  .bl-real .bl-in,
  .bl-real > .bl-post:first-child .bl-in { padding: 12px 14px 15px; }
}

/* ---- tablet: two columns, featured still wide ---- */
@media (min-width: 641px) and (max-width: 900px) {
  .bl-real { grid-template-columns: repeat(2, 1fr); }
  .bl-real > .bl-post:first-child { grid-column: span 2; }
  .bl-real > .bl-post:first-child .bl-cover { min-height: 240px; }
  .bl-real > .bl-post:first-child .bl-in > strong { font-size: 21px; }
}
