/* ─── Nexolar — Blog Styles ─── */

/* ─── Hero (listing + article) ─── */
.blog-hero {
  position: relative;
  background: linear-gradient(rgba(8, 24, 40, 0.86), rgba(8, 24, 40, 0.94)), var(--hero-img, url('../assets/images/solar_panels_bg.jpg')) center/cover no-repeat;
  color: var(--white);
  padding: 4.5rem 0 4rem;
  border-bottom: 4px solid var(--yellow);
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(181, 205, 44, 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.blog-hero > .container { position: relative; z-index: 2; }

.blog-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.25rem;
}
.blog-breadcrumb a { color: rgba(255, 255, 255, 0.7); }
.blog-breadcrumb a:hover { color: var(--yellow); }
.blog-breadcrumb span[aria-current] { color: var(--white); font-weight: 600; }

.blog-eyebrow {
  display: inline-block;
  color: var(--yellow);
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: 0.5rem;
}
.blog-hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 860px;
  margin-bottom: 1rem;
}
.blog-hero h1 span { color: var(--yellow); }
.blog-hero p.blog-hero-lead {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  max-width: 720px;
}

/* ─── Filters (chips + date) ─── */
.blog-controls {
  padding: 2.5rem 0 1.5rem;
  background: var(--gray-50);
}
.blog-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  padding: 1.25rem 1.75rem;
  box-shadow: var(--shadow-sm);
}
.blog-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.blog-chip {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid transparent;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.blog-chip:hover { background: var(--yellow-light); color: var(--gray-900); }
.blog-chip.active { background: var(--yellow); color: var(--primary-dark); border-color: var(--yellow); }

.blog-date-filter select {
  appearance: none;
  padding: 0.6rem 2.4rem 0.6rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: var(--gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") right 1rem center no-repeat;
  font-family: var(--font);
  font-size: var(--text-sm);
  color: var(--gray-700);
  cursor: pointer;
}
.blog-date-filter select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 57, 108, 0.1);
}

/* ─── Post list ─── */
.blog-list-section {
  padding: 1rem 0 5rem;
  background: var(--gray-50);
}
.blog-count {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}
.blog-list { display: flex; flex-direction: column; gap: 1.5rem; }

.blog-card {
  display: grid;
  grid-template-columns: 340px 1fr;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition);
}
.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--yellow);
  box-shadow: var(--shadow-xl);
}
.blog-card[hidden] { display: none; }
.blog-card-media { position: relative; min-height: 220px; }
.blog-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card-body {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-sm);
  color: var(--gray-500);
}
.blog-cat {
  background: var(--yellow);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: var(--text-xs);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
}
.blog-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--primary);
}
.blog-card h2 a { color: inherit; }
.blog-card h2 a:hover { color: var(--primary-light); }
.blog-card p { color: var(--gray-600); line-height: 1.6; }
.blog-read-more {
  margin-top: auto;
  font-weight: 700;
  color: var(--primary);
}
.blog-read-more:hover { color: var(--green); }

.blog-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

/* ─── Article page ─── */
.post-hero .blog-meta { color: rgba(255, 255, 255, 0.8); margin-top: 0.5rem; }
.post-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.post-author img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--yellow);
  object-fit: cover;
}
.post-author strong { display: block; color: var(--white); }
.post-author span { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.7); }

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 3rem;
  padding: 3.5rem 0 4rem;
  align-items: start;
}

.post-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
}

.post-body {
  font-size: 1.075rem;
  line-height: 1.8;
  color: var(--gray-700);
}
.post-body > * + * { margin-top: 1.1rem; }
.post-body h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 2.5rem;
}
.post-body h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-800);
  margin-top: 1.75rem;
}
.post-body a { color: var(--primary); font-weight: 600; text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
.post-body ul, .post-body ol { padding-left: 1.4rem; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li + li { margin-top: 0.4rem; }
.post-body strong { color: var(--gray-800); }

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.post-body th, .post-body td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.post-body th { background: var(--primary); color: var(--white); font-weight: 700; }
.post-body tr:last-child td { border-bottom: none; }
.post-note { font-size: var(--text-sm); color: var(--gray-500); font-style: italic; }

.post-callout {
  border-left: 4px solid var(--yellow);
  background: var(--gray-50);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  color: var(--gray-800);
}

.post-faq details {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  background: var(--white);
}
.post-faq details + details { margin-top: 0.75rem; }
.post-faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--gray-800);
}
.post-faq details[open] summary { color: var(--primary); margin-bottom: 0.5rem; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
}
.post-tags span {
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.post-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--primary-dark);
  border: 1px solid rgba(181, 205, 44, 0.5);
  border-radius: var(--radius-xl);
  color: var(--white);
}
.post-cta h3 { color: var(--white); font-size: 1.35rem; font-weight: 800; }
.post-cta p { color: rgba(255, 255, 255, 0.75); margin-top: 0.25rem; }
.post-cta .btn { background: #25D366; border-color: #25D366; color: var(--white); }

/* ─── Sidebar ─── */
.post-sidebar {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sidebar-box {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}
.sidebar-box h3 {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
}
.sidebar-cats li + li { margin-top: 0.5rem; }
.sidebar-cats a {
  display: flex;
  justify-content: space-between;
  color: var(--gray-700);
  font-weight: 600;
}
.sidebar-cats a:hover { color: var(--primary); }
.sidebar-cats a span { color: var(--gray-400); }
.sidebar-recent li + li { margin-top: 1rem; }
.sidebar-recent a { display: block; font-weight: 700; color: var(--gray-800); line-height: 1.35; }
.sidebar-recent a:hover { color: var(--primary); }
.sidebar-recent small { color: var(--gray-500); }

.sidebar-advisor { background: var(--primary-dark); border-color: rgba(181, 205, 44, 0.5); text-align: center; color: var(--white); }
.sidebar-advisor img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  object-fit: cover;
  margin: 0 auto 0.75rem;
}
.sidebar-advisor h3 { color: var(--white); margin-bottom: 0.25rem; }
.sidebar-advisor p { color: rgba(255, 255, 255, 0.75); font-size: var(--text-sm); margin-bottom: 1rem; }
.sidebar-advisor .btn { width: 100%; justify-content: center; background: #25D366; border-color: #25D366; color: var(--white); }

/* ─── Related ─── */
.post-related { background: var(--gray-50); padding: 4rem 0 5rem; }
.post-related h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1.5rem;
}
.post-related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.post-related .blog-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.post-related .blog-card-media { min-height: 200px; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
}
@media (max-width: 768px) {
  .blog-hero { padding: 3rem 0; }
  .blog-filter-bar { padding: 1rem; }
  .blog-date-filter, .blog-date-filter select { width: 100%; }
  .blog-card { grid-template-columns: 1fr; }
  .blog-card-media { min-height: 200px; }
  .blog-card-body { padding: 1.5rem; }
  .post-related-grid { grid-template-columns: 1fr; }
  .post-cta { padding: 1.5rem; }
  .post-body table { display: block; overflow-x: auto; }
}

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

/* ─── Home blog section ─── */
.home-blog { padding: 5rem 0; background: var(--white); }
.home-blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.home-blog .blog-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.home-blog .blog-card-media { min-height: 0; aspect-ratio: 16 / 10; }
.home-blog .blog-card h3 { font-size: 1.15rem; font-weight: 800; line-height: 1.3; color: var(--primary); }
.home-blog .blog-card h3 a { color: inherit; }
@media (max-width: 1024px) { .home-blog-grid { grid-template-columns: 1fr; } }
