/* =========================================================
   Ductless Brothers blog
   Loaded after styles.css on /blog pages and inside the
   "From Our Blog" section on town pages. Uses the same color
   variables as styles.css (--primary, --logo-red, etc.).
   ========================================================= */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.nav-link.is-current { color: var(--primary-600); font-weight: 700; }

.blog-main { padding: 48px 0 72px; }

/* White pill heading, same look as the "areas" call-out on the homepage */
.blog-pill-title {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
  text-wrap: balance;
}

.blog-intro {
  max-width: 660px;
  margin: 18px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 1.05rem;
}

/* Category row */
.blog-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  max-width: 860px;
  margin: 26px auto 36px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.blog-cats a {
  color: var(--text);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.blog-cats a:hover,
.blog-cats a.is-active {
  text-decoration: none;
  border-bottom-color: var(--logo-red);
}

/* Shared card bits */
.blog-local-tag {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--logo-red);
}
.blog-meta {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.blog-meta a { color: var(--primary-600); font-weight: 600; }
.blog-excerpt {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.blog-more { font-weight: 700; color: var(--logo-red); }

.blog-featured,
.blog-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.blog-featured::before,
.blog-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--section-gradient);
  z-index: 1;
}

/* Featured post */
.blog-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.blog-featured-img { display: block; min-height: 300px; }
.blog-featured-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-featured-body { padding: 32px 34px; min-width: 0; }
.blog-featured-title {
  margin: 4px 0 10px;
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}
.blog-featured-title a,
.blog-card-title a { color: var(--text); }
.blog-featured-title a:hover,
.blog-card-title a:hover { color: var(--primary-600); text-decoration: none; }

/* Card grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.blog-card { display: flex; flex-direction: column; }
.blog-card-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.blog-card:hover .blog-card-img img { transform: scale(1.03); }
.blog-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.blog-card-body .blog-more { margin-top: auto; }
.blog-card-title {
  margin: 2px 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  text-wrap: balance;
}

/* Pagination */
.blog-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
  font-weight: 700;
}
.blog-pager span { color: var(--muted); }

/* Free quote bar */
.blog-quote-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 820px;
  margin: 48px auto 0;
  padding: 26px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.blog-quote-bar h2 { margin: 0 0 4px; font-size: 1.45rem; font-weight: 800; }
.blog-quote-bar p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.blog-quote-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Single post */
.blog-crumbs {
  max-width: 760px;
  margin: 0 auto 18px;
  font-size: 0.85rem;
  color: var(--muted);
}
.blog-crumbs a { color: var(--primary-600); }
.blog-post-head { max-width: 760px; margin: 0 auto; }
.blog-post-head h1 {
  margin: 4px 0 12px;
  font-size: clamp(1.9rem, 4.4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.12;
  text-wrap: balance;
}
.blog-post-hero { max-width: 940px; margin: 26px auto; }
.blog-post-hero img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.blog-post-body {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.06rem;
  line-height: 1.75;
}
.blog-post-body h2 {
  margin: 36px 0 10px;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.25;
}
.blog-post-body h3 { margin: 26px 0 8px; font-size: 1.2rem; font-weight: 700; }
.blog-post-body p { margin: 0 0 18px; }
.blog-post-body ul,
.blog-post-body ol { margin: 0 0 18px; padding-left: 1.3em; }
.blog-post-body li { margin-bottom: 8px; }
.blog-post-body a { color: var(--primary-600); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.blog-post-body figure { margin: 26px 0; }
.blog-post-body figure img { border-radius: 14px; width: 100%; }
.blog-post-body figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); text-align: center; }
.blog-town-link {
  margin-top: 30px !important;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-600);
  border-radius: 10px;
  font-size: 0.98rem;
}

.blog-related { margin-top: 64px; }

/* Common Questions (FAQ) and nearby towns */
.blog-faq {
  margin-top: 36px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.blog-faq h2 { margin-top: 0 !important; }
.blog-faq h3 { margin: 18px 0 4px; font-size: 1.08rem; }
.blog-faq p { margin: 0 0 6px; color: var(--muted); }
.blog-nearby { margin-top: 14px !important; font-size: 0.95rem; color: var(--muted); }

/* "From Our Blog" section on town pages */
.blog-town-section .blog-grid { margin-top: 28px; }
.blog-town-all { text-align: center; margin: 26px 0 0 !important; }

/* =========================================================
   Dark theme for the /blog pages
   Only applies to pages with <body class="blog-page">, so the
   "From Our Blog" section on the (light) town pages stays light.
   ========================================================= */
body.blog-page {
  --bg: #0b1220;
  --surface: #151e31;
  --surface-2: #1b2539;
  --text: #e8eef6;
  --muted: #a3b1c4;
  --border: #26324a;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  --tag: #6dbb71;
  background: var(--bg);
  color: var(--text);
}
body.blog-page .site-header {
  background: rgba(21, 30, 49, 0.96);
  border-bottom-color: var(--border);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
body.blog-page .nav-link,
body.blog-page .nav-toggle,
body.blog-page .brand { color: var(--text); }
body.blog-page .nav-link:hover,
body.blog-page .dropdown-menu .nav-link:hover { background: var(--surface-2); }
body.blog-page .nav-link.cta { color: #fff; }
body.blog-page .nav-link.is-current { color: var(--primary); }
body.blog-page .dropdown-menu,
body.blog-page .nested-menu {
  background: rgba(21, 30, 49, 0.98);
  border-color: var(--border);
}
body.blog-page .site-footer {
  background: var(--surface);
  border-top-color: var(--border);
  color: var(--muted);
}
body.blog-page .site-footer strong { color: var(--text); }
body.blog-page .site-footer a { color: var(--primary); }

/* Headline font on blog pages (matches the preview) */
body.blog-page .blog-pill-title,
body.blog-page .blog-featured-title,
body.blog-page .blog-card-title,
body.blog-page .blog-post-head h1,
body.blog-page .blog-post-body h2,
body.blog-page .blog-quote-bar h2 {
  font-family: 'Barlow', 'Inter', system-ui, sans-serif;
  letter-spacing: 0.005em;
}
body.blog-page .blog-pill-title { font-size: clamp(1.9rem, 4vw, 3rem); }
body.blog-page .blog-card-title { font-size: 1.35rem; }
body.blog-page .blog-post-body h2 { font-size: 1.75rem; }

body.blog-page .blog-local-tag { color: var(--tag); }
body.blog-page .blog-meta a { color: var(--logo-red); text-decoration: underline; text-underline-offset: 3px; }
body.blog-page .blog-cats a { color: var(--text); }
body.blog-page .blog-crumbs a,
body.blog-page .blog-post-body a { color: var(--primary); }
body.blog-page .blog-more { color: #f07a3e; }
body.blog-page .blog-pager a { color: var(--primary); }
body.blog-page .blog-featured-title a:hover,
body.blog-page .blog-card-title a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 900px) {
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured-img { min-height: 0; aspect-ratio: 16 / 9; }
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .blog-main { padding: 32px 0 56px; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-featured-body { padding: 22px; }
  .blog-pill-title { border-radius: 22px; padding: 10px 20px; }
  .blog-quote-bar { padding: 22px; }
  .blog-post-hero img { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-card-img img { transition: none; }
  .blog-card:hover .blog-card-img img { transform: none; }
}
