/* ============================================================
   UpgradeAirKit.com — Blog styles
   Extends design-system.css tokens. Everything is scoped to
   .blog-* so nothing global is restyled. "Own your air." shine.
   ============================================================ */

/* ---- Page band tweak (reuses global .page-band if present) ---- */
.blog-band {
  position: relative;
  overflow: hidden;
  background: var(--grad-air);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(40px, 6vw, 72px);
}
.blog-band::before {
  content: "";
  position: absolute;
  inset: -30% 55% auto auto;
  width: 60%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(47,168,79,.16), transparent 70%);
  filter: blur(14px);
  pointer-events: none;
}
.blog-band .container { position: relative; z-index: 2; }
.blog-band .eyebrow { color: var(--green-dark); }
.blog-band h1 { margin-bottom: .35em; }
.blog-band .lede { max-width: 54ch; }

/* Clean-air hero image, right-anchored, feathered into the band so the
   headline stays crisp and readable on the left. */
.blog-band::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(48%, 640px);
  background: url("../assets/blog/erv-balanced-ventilation.jpg") center right / cover no-repeat;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 34%);
  mask-image: linear-gradient(to right, transparent 0%, #000 34%);
  opacity: .95;
  z-index: 1;
  pointer-events: none;
}
/* Ease the image narrower as the viewport shrinks, then drop it before it
   can crowd the headline on tablets/phones (band + text stay full-width). */
@media (max-width: 1000px) {
  .blog-band::after { width: min(40%, 460px); opacity: .8; }
}
@media (max-width: 860px) {
  .blog-band::after { display: none; }
  .blog-band .lede { max-width: 62ch; }
}

/* ---- Card grid ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(20px, 2.6vw, 32px);
  margin-top: clamp(24px, 4vw, 40px);
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .3s ease, border-color .25s ease;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #CBD9E9;
}
.blog-card::before { /* top gradient hairline */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 2;
  background: linear-gradient(135deg, #41CC65 0%, #2FA84F 55%, #12B5A6 100%);
  opacity: 0;
  transition: opacity .25s ease;
}
.blog-card:hover::before { opacity: 1; }

.blog-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--mist-2), var(--green-light));
}
.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.blog-card:hover .blog-card__media img { transform: scale(1.05); }
.blog-card__media--empty {
  display: grid;
  place-items: center;
  color: var(--green-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  opacity: .5;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.35rem 1.4rem 1.5rem;
  flex: 1 1 auto;
}
.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.blog-tag {
  display: inline-block;
  padding: .28rem .7rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: .02em;
  color: var(--green-dark);
  background: rgba(65,204,101,.12);
  border: 1px solid rgba(47,168,79,.28);
}
.blog-card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--navy);
  margin: 0;
}
.blog-card:hover .blog-card__title { color: var(--green-dark); }
.blog-card__excerpt {
  color: var(--ink-soft);
  font-size: .95rem;
  margin: 0;
  flex: 1 1 auto;
}
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--ink-soft);
  margin-top: .3rem;
}
.blog-card__meta .dot { opacity: .5; }
.blog-card__cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--green-dark);
  margin-top: .2rem;
}
.blog-card__cta::after { content: " \2192"; transition: margin-left .2s ease; }
.blog-card:hover .blog-card__cta::after { margin-left: .25rem; }

/* ---- Loading / error / empty states ---- */
.blog-state {
  text-align: center;
  padding: clamp(40px, 8vw, 96px) 1rem;
  color: var(--ink-soft);
}
.blog-state h2 { color: var(--navy); }
.blog-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(20px, 2.6vw, 32px);
  margin-top: clamp(24px, 4vw, 40px);
}
.blog-skel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
}
.blog-skel__media { aspect-ratio: 16/9; }
.blog-skel__line { height: 14px; border-radius: 7px; margin: 12px 16px; }
.blog-skel__line.short { width: 45%; }
.blog-skel__media, .blog-skel__line {
  background: linear-gradient(100deg, var(--mist-2) 30%, #f6f9fc 50%, var(--mist-2) 70%);
  background-size: 200% 100%;
  animation: blogShimmer 1.3s ease-in-out infinite;
}
@keyframes blogShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   Single post (blog-post.html)
   ============================================================ */
.blog-article {
  max-width: 720px;         /* ~68ch readable measure */
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.blog-article__header {
  text-align: center;
  padding-block: clamp(28px, 5vw, 52px) clamp(16px, 3vw, 28px);
}
.blog-article__tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
}
.blog-article__title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -.01em;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  color: var(--navy);
  margin: 0 0 .5em;
}
.blog-article__byline {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--ink-soft);
  font-size: .95rem;
}
.blog-article__byline .author { font-weight: 700; color: var(--navy); }
.blog-article__byline .dot { opacity: .5; }

.blog-article__hero {
  position: relative;
  margin: clamp(20px, 4vw, 40px) auto 0;
  max-width: 980px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -32px rgba(18,50,67,.5), 0 2px 0 rgba(255,255,255,.6) inset;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--mist-2), var(--green-light));
}
.blog-article__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* subtle inner ring + soft bottom gradient for editorial depth */
.blog-article__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(18,50,67,.06);
  background: linear-gradient(to top, rgba(12,42,77,.10), transparent 38%);
  pointer-events: none;
}
@media (max-width: 560px) { .blog-article__hero { aspect-ratio: 4 / 3; } }

/* ---- Article body typography (scoped) ---- */
.blog-body {
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--ink);
  margin-top: clamp(24px, 4vw, 40px);
}
.blog-body > * + * { margin-top: 1.25em; }
.blog-body h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  color: var(--navy);
  line-height: 1.2;
  margin-top: 1.9em;
  padding-top: .2em;
}
.blog-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  margin-top: 1.6em;
}
.blog-body p { margin: 0; }
.blog-body a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(47,168,79,.4);
  transition: text-decoration-color .2s ease;
}
.blog-body a:hover { text-decoration-color: var(--green); }
.blog-body ul, .blog-body ol { margin: 0; padding-left: 1.4em; }
.blog-body li { margin-top: .5em; }
.blog-body li::marker { color: var(--green-dark); }
.blog-body strong { color: var(--navy); font-weight: 700; }
.blog-body img { border-radius: var(--radius); margin-inline: auto; box-shadow: var(--shadow-sm); }

.blog-body blockquote {
  position: relative;
  margin: 1.8em 0;
  padding: 1.1em 1.4em 1.1em 1.6em;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 4px solid var(--green);
  background: linear-gradient(120deg, var(--green-light) 0%, rgba(244,247,251,.6) 100%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.4;
  color: var(--navy);
}
.blog-body blockquote::before {
  content: "\201C";
  position: absolute;
  top: -.15em;
  left: .35rem;
  font-size: 2.4rem;
  color: var(--green);
  opacity: .35;
  font-family: var(--font-display);
}
.blog-body blockquote p { margin: 0; }

/* ---- Article footer / back links ---- */
.blog-article__footer {
  max-width: 720px;
  margin: clamp(36px, 6vw, 64px) auto 0;
  padding: clamp(24px, 4vw, 40px) var(--gutter) 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.blog-article__cta-card {
  position: relative;
  overflow: hidden;
  margin-top: 1.5rem;
  padding: 2.2rem 1.6rem 2.4rem;
  border-radius: var(--radius-lg);
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #123243 0%, #17514F 55%, #1C7A37 100%);
  box-shadow: 0 24px 60px -30px rgba(18,50,67,.75);
}
.blog-article__cta-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #41CC65, #12B5A6, #34C7E0);
}
.blog-article__cta-card h2 { color: #fff; margin: .2rem 0 .5rem; }
.blog-article__cta-card p { color: #CFE4E0; max-width: 52ch; margin: 0 auto 1.2rem; }
.blog-article__cta-card .eyebrow { color: #6BE08C; }

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green-dark);
}
.blog-back::before { content: "\2190"; }

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .blog-body { font-size: 1.06rem; }
  .blog-article__hero { aspect-ratio: 16 / 10; }
}
