/* ════════════════════════════════════════════════
   DEM Blog — blog.css
   Extends style.css (must load after it)
════════════════════════════════════════════════ */

/* ── UTILS ── */
.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-active {
  color: var(--blue) !important;
  border-bottom-color: var(--blue) !important;
}

/* ── BLOG HERO ── */
.blog-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
  margin-top: var(--nav-h);
  background: var(--cream);
}
.blog-hero-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 5% 4rem 8%;
}
.blog-hero-title {
  font-family: var(--fd);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
}
.blog-hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--blue);
}
.blog-hero-desc {
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.85;
}
.blog-hero-img {
  overflow: hidden;
}
.blog-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(.75);
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 1.25rem;
}
.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: .4rem;
  list-style: none;
}
.breadcrumb a {
  font-family: var(--fd);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb li[aria-current="page"] {
  font-family: var(--fd);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
}
.breadcrumb svg { color: var(--soft); flex-shrink: 0; }

/* ── FILTERS BAR ── */
.blog-filters-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
}
.blog-filters-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: .875rem 8%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.filter-label {
  font-family: var(--fd);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--soft);
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-tabs {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  flex: 1;
}
.filter-tab {
  font-family: var(--fd);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--muted);
  padding: .45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.filter-tab:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.filter-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.filter-tab:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Search */
.blog-search { margin-left: auto; }
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap svg {
  position: absolute;
  left: .75rem;
  color: var(--soft);
  pointer-events: none;
}
.search-wrap input {
  padding: .45rem .75rem .45rem 2.25rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--cream);
  font-family: var(--fb);
  font-size: .85rem;
  color: var(--text);
  width: 200px;
  outline: none;
  transition: border-color .2s, width .25s, box-shadow .2s;
}
.search-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(3,105,161,.1);
  width: 260px;
}

/* ── BLOG SECTION ── */
.blog-section {
  background: var(--white);
  padding: 3.5rem 8% 5rem;
}
.blog-section-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.articles-count {
  font-family: var(--fd);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 1.75rem;
}

/* ── ARTICLE GRID ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

/* Featured card — spans 2 cols, horizontal layout */
.article-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
.article-card.featured .card-img {
  aspect-ratio: auto;
  height: 100%;
}
.article-card.featured .card-img img {
  height: 100%;
}
.article-card.featured .card-body {
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.article-card.featured .card-title {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

/* Standard card */
.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card-img {
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.card-img img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
  display: block;
}
.article-card:hover .card-img img { transform: scale(1.04); }

/* Category badge on image */
.card-cat {
  position: absolute;
  top: .85rem;
  left: .85rem;
  font-family: var(--fd);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
}
.card-cat[data-cat="impact-windows"] { background: #0369A1; }
.card-cat[data-cat="impact-doors"]   { background: #0F172A; }
.card-cat[data-cat="remodeling"]     { background: #7C3AED; }
.card-cat[data-cat="tips"]           { background: #D4A853; color: #1a1a1a; }

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-title {
  font-family: var(--fd);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: .65rem;
  transition: color .2s;
}
.article-card:hover .card-title { color: var(--blue); }

.card-desc {
  font-size: .9rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.75;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.card-date {
  font-family: var(--fd);
  font-size: .72rem;
  font-weight: 400;
  color: var(--soft);
  letter-spacing: .04em;
}
.card-read-time {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--fd);
  font-size: .72rem;
  color: var(--soft);
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--fd);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-top: 1rem;
  transition: gap .2s;
}
.article-card:hover .card-link { gap: .55rem; }

/* Image placeholder (no image) */
.card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.25);
}

/* ── SKELETON LOADING ── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sk-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
}
.sk-body { padding: 1.5rem; }
.sk-tag, .sk-title, .sk-desc, .sk-meta {
  border-radius: 4px;
  margin-bottom: .75rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
}
.sk-tag  { width: 80px; height: 20px; border-radius: 999px; }
.sk-title { width: 90%; height: 22px; }
.sk-desc  { width: 100%; height: 60px; }
.sk-meta  { width: 60%; height: 16px; margin-top: 1rem; }

/* ── EMPTY STATE ── */
.blog-empty {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--soft);
}
.blog-empty svg { margin: 0 auto 1rem; }
.blog-empty p {
  font-family: var(--fd);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: .35rem;
}
.blog-empty span {
  font-size: .9rem;
  color: var(--soft);
}

/* ── LOAD MORE ── */
.load-more-wrap {
  text-align: center;
  margin-top: 3rem;
}
.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--fd);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  padding: .85rem 2rem;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: all .2s;
}
.btn-load-more:hover {
  background: var(--navy);
  color: var(--white);
}
.btn-load-more:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ── CTA STRIP ── */
.blog-cta-strip {
  background: var(--navy);
  padding: 4rem 8%;
}
.blog-cta-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.blog-cta-inner h2 {
  font-family: var(--fd);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
  margin-top: .5rem;
}
.blog-cta-inner h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.blog-cta-inner p {
  font-size: .93rem;
  font-weight: 300;
  color: rgba(255,255,255,.55);
  margin-top: .5rem;
}

/* ── ARTICLE PAGE STYLES ── */
.article-hero {
  margin-top: var(--nav-h);
  background: var(--navy);
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
  padding: 4rem 8% 3.5rem;
}
.article-hero-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: .22;
}
.article-hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}
.article-hero h1 {
  font-family: var(--fd);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: .75rem 0 1rem;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--fd);
  font-size: .75rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  letter-spacing: .05em;
}
.article-meta-item svg { color: var(--gold); }

.article-body-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.5rem 8% 5rem;
}
.article-content {
  max-width: 720px;
}
.article-content h2 {
  font-family: var(--fd);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 600;
  color: var(--navy);
  margin: 2.25rem 0 .85rem;
  line-height: 1.25;
  letter-spacing: -.015em;
}
.article-content h3 {
  font-family: var(--fd);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin: 1.75rem 0 .65rem;
}
.article-content p {
  font-family: var(--fb);
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 1.25rem;
}
.article-content ul, .article-content ol {
  margin: .75rem 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.article-content ul { list-style: none; margin-left: 0; }
.article-content ul li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-family: var(--fb);
  font-size: .95rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.75;
}
.article-content ul li::before {
  content: '';
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: .55em;
  flex-shrink: 0;
}
.article-content ol li {
  font-family: var(--fb);
  font-size: .95rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.75;
}
.article-content strong {
  font-weight: 600;
  color: var(--navy);
}
.article-content a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-content blockquote {
  border-left: 3px solid var(--blue);
  padding: .85rem 1.25rem;
  margin: 1.75rem 0;
  background: var(--cream);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content blockquote p {
  font-family: var(--fd);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 300;
  color: var(--slate);
  margin: 0;
}
.article-content .info-box {
  background: rgba(3,105,161,.07);
  border: 1px solid rgba(3,105,161,.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.article-content .info-box p { color: var(--slate); margin: 0; }

/* Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}
.sidebar-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.sidebar-card-title {
  font-family: var(--fd);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 1rem;
}
.sidebar-cta {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.sidebar-cta .sidebar-card-title { color: rgba(255,255,255,.5); }
.sidebar-cta h3 {
  font-family: var(--fd);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: .65rem;
}
.sidebar-cta p {
  font-size: .85rem;
  font-weight: 300;
  color: rgba(255,255,255,.55);
  margin-bottom: 1.25rem;
  line-height: 1.65;
}
.toc-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toc-link {
  font-family: var(--fd);
  font-size: .82rem;
  font-weight: 400;
  color: var(--muted);
  padding: .35rem .5rem;
  border-radius: 3px;
  border-left: 2px solid transparent;
  transition: all .2s;
  display: block;
}
.toc-link:hover, .toc-link.active {
  color: var(--blue);
  border-left-color: var(--blue);
  background: rgba(3,105,161,.06);
}
.related-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.related-item {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  cursor: pointer;
}
.related-item img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.related-item-title {
  font-family: var(--fd);
  font-size: .82rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.35;
  transition: color .2s;
}
.related-item:hover .related-item-title { color: var(--blue); }
.related-item-date {
  font-size: .72rem;
  color: var(--soft);
  margin-top: .15rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .article-body-wrap { grid-template-columns: 1fr; gap: 2rem; }
  .article-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar-card { flex: 1; min-width: 260px; }
}

@media (max-width: 1024px) {
  .blog-hero { grid-template-columns: 1fr; min-height: auto; }
  .blog-hero-inner { padding: 3rem 6%; }
  .blog-hero-img { height: 260px; }

  .blog-grid { grid-template-columns: 1fr 1fr; }
  .article-card.featured {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }
  .article-card.featured .card-img { aspect-ratio: 16/9; height: auto; }
  .article-card.featured .card-img img { height: auto; }

  .blog-cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .blog-filters-inner { padding: .75rem 5%; gap: .75rem; }
  .blog-search { margin-left: 0; width: 100%; }
  .search-wrap input { width: 100%; }
  .search-wrap input:focus { width: 100%; }

  .blog-section { padding: 2.5rem 5% 4rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .article-card.featured { grid-column: span 1; grid-template-columns: 1fr; }
  .article-card.featured .card-body { padding: 1.5rem; }

  .blog-cta-strip { padding: 3rem 5%; }

  .article-hero { padding: 3rem 5% 2.5rem; min-height: 360px; }
  .article-body-wrap { padding: 2.5rem 5% 4rem; }
  .article-sidebar { flex-direction: column; }
  .sidebar-card { min-width: auto; }
}

@media (max-width: 640px) {
  .blog-hero-inner { padding: 2.5rem 5%; }
  .filter-tabs { gap: .3rem; }
  .filter-tab { font-size: .68rem; padding: .4rem .75rem; }
}
