/* ==========================================================================
   Aqua Pure Water Solutions - Blog list & article styles
   Loads AFTER style.css and reuses its tokens (navy --bg-dark, blue --tan,
   6px radius) so the blog matches index.html.
   ========================================================================== */

/* ── Blog hero ──────────────────────────────────────────────────────────── */
.blog-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(85.5vh, 680px);
  padding: 5rem 0 5.5rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
}

.blog-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero background: image / video toggle (shared with the article hero) */
.hero-bg-image { display: block; }
.hero-bg-video { display: none; }
.hero-bg--video .hero-bg-image { display: none; }
.hero-bg--video .hero-bg-video { display: block; }

@media (max-width: 768px) {
  .blog-hero {
    min-height: 0;
    padding: 3.5rem 0 4rem;
  }
}

@media (max-width: 600px) {
  .blog-hero .cta-actions .btn {
    width: 100%;
    max-width: 20rem;
  }
}

/* In-page jump targets sit below the sticky header */
#blog-controls,
#ask-team {
  scroll-margin-top: 6rem;
}

/* ── Category filter + search ───────────────────────────────────────────── */
.blog-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .blog-controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

@media (min-width: 768px) {
  .blog-filters {
    flex: 1;
    justify-content: flex-start;
  }
}

.filter-btn {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius) !important;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--tan);
  background: var(--tan-light);
  color: var(--fg);
}

.filter-btn.active {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-color: var(--bg-dark);
}

.blog-search {
  position: relative;
  width: 100%;
}

@media (min-width: 768px) {
  .blog-search {
    max-width: 280px;
  }
}

/* padding/radius/focus come from the global input rules in style.css */
.blog-search input {
  padding-left: 2.75rem;
}

.blog-search i,
.blog-search svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  pointer-events: none;
}

/* ── Featured / latest post ─────────────────────────────────────────────── */
.featured-post {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: stretch;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  margin-bottom: 3rem;
  min-height: 420px;
}

.featured-post:hover {
  border-color: var(--tan);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.featured-img-wrap {
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-3);
}

.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-post:hover .featured-img-wrap img { transform: scale(1.06); }

.featured-content {
  padding: 2.25rem 2.5rem 2.25rem 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.featured-content .card-category {
  position: static;
  box-shadow: none;
  background: var(--tan-light);
}

.featured-title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-top: 0.9rem;
  overflow-wrap: break-word;
}

.featured-excerpt {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.featured-content .post-tags { margin-top: 1.25rem; }

.featured-readmore {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg);
}

.featured-readmore i,
.featured-readmore svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.2s;
}

.featured-post:hover .featured-readmore svg { transform: translateX(3px); }

.featured-author { margin-top: auto; padding-top: 1.5rem; }

@media (max-width: 860px) {
  .featured-post { grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 0; }
  .featured-img-wrap { height: 220px; }
  .featured-content { padding: 1.75rem; }
}

/* ── Meta + author rows (shared) ────────────────────────────────────────── */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-item i,
.meta-item svg {
  width: 0.85rem;
  height: 0.85rem;
}

/* style.css stacks .author-info in a column; here it is avatar + name in a row */
.card-footer .author-info,
.featured-author {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
}

img.author-avatar {
  object-fit: cover;
  background: var(--tan-light);
  padding: 4px;
}

/* ── Post cards ─────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .blog-grid { grid-template-columns: minmax(0, 1fr); }
}

.blog-card { text-decoration: none; }

/* cards gently fade in when a filter or page change reveals them */
.blog-card.is-entering { animation: blog-in 0.35s ease both; }

@keyframes blog-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.card-img-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg-3);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .card-img-wrap img { transform: scale(1.06); }

.card-category {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bg-dark);
  background: #FFFFFF;
  padding: 0.3rem 0.7rem;
  border-radius: 4px !important;
  box-shadow: var(--shadow-sm);
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  line-height: 1.4;
}

.card-excerpt {
  margin-top: 0.6rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.card-title + .card-footer,
.card-excerpt + .card-footer { margin-top: 1.25rem; }

.card-footer > i,
.card-footer > svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.blog-card:hover .card-footer > svg { color: var(--tan); }

.blog-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0 3rem;
}

/* ── Pagination (built by blog.js, hidden when there is only one page) ──── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 4rem;
}

.page-num {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius) !important;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.page-num:hover { border-color: var(--tan); color: var(--fg); }

.page-num.active {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-color: var(--bg-dark);
}

.pagination .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pagination .btn:disabled:hover {
  background: transparent;
  border-color: var(--fg);
  color: var(--fg);
  box-shadow: none;
}

@media (max-width: 480px) {
  .pagination { flex-wrap: nowrap; gap: 0.4rem; }

  .pagination .btn {
    padding: 0.7rem 0.9rem;
    font-size: 0.72rem;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .pagination .btn i,
  .pagination .btn svg { width: 1rem; height: 1rem; }

  .page-num { width: 2.2rem; height: 2.2rem; }
}

/* ── "Ask the team" card (replaces the newsletter box, which had no backend) ─ */
.help-card {
  padding: 3rem;
  border-radius: var(--radius) !important;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.help-card .lead { margin-top: 0.75rem; }

@media (max-width: 480px) {
  .help-card { padding: 2rem 1.25rem; }
}

/* ==========================================================================
   Article page (blog-detail.html)
   ========================================================================== */
.post-hero {
  position: relative;
  padding: 4rem 0 0;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}

/* The hero photo is a clear backdrop here, not the faded one used elsewhere
   (style.css fades .hero-bg-media to 0.35); a white veil keeps text legible. */
.post-hero .hero-bg-media,
.post-hero .hero-bg img {
  opacity: 1;
}

.post-hero .hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.6) 45%, rgba(255, 255, 255, 0.92) 100%);
  pointer-events: none;
}

.post-header-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--fg); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--tan); }

.breadcrumb > i,
.breadcrumb > svg { width: 0.9rem; height: 0.9rem; }

/* "Back to Blog" is a solid navy button so it stays legible over the photo */
.breadcrumb a.btn-back {
  margin-right: 1.25rem;
  padding: 0.45rem 1rem;
  background: var(--bg-dark);
  border-color: var(--bg-dark);
  color: #FFFFFF;
}

.breadcrumb a.btn-back:hover {
  background: var(--tan);
  border-color: var(--tan);
  color: #FFFFFF;
}

.breadcrumb a.btn-back i,
.breadcrumb a.btn-back svg { width: 1rem; height: 1rem; }

@media (max-width: 480px) {
  .breadcrumb a.btn-back { margin-right: 0; flex-basis: 100%; justify-content: center; max-width: 12rem; margin-bottom: 0.5rem; }
}

.post-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0;
  overflow-wrap: break-word;
}

.post-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--fg);
}

.post-hero-meta .meta-item { gap: 0.4rem; }

.post-hero-meta i,
.post-hero-meta svg { width: 0.9rem; height: 0.9rem; }

.post-banner {
  margin-top: 3rem;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  max-height: 480px;
  /* .hero-bg is absolutely positioned, so lift the banner above it */
  position: relative;
  z-index: 2;
}

.post-banner img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.post-section { padding-top: 0; }

.article-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 3.5rem;
  align-items: start;
  padding-top: 3.5rem;
}

@media (max-width: 960px) {
  .article-wrapper { grid-template-columns: minmax(0, 1fr); }
}

.article-content {
  min-width: 0;
  max-width: 72ch; /* comfortable reading line length */
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--fg);
}

@media (max-width: 960px) {
  .article-content { max-width: none; }
}

.article-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 500;
  margin: 2.5rem 0 1rem;
  color: var(--fg);
}

.article-content h2:first-child { margin-top: 0; }

.article-content p {
  margin-bottom: 1.25rem;
  color: var(--fg);
}

.article-content p.lead {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 2rem;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }

.article-content li { line-height: 1.7; }

.article-content a {
  color: var(--tan);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content img {
  width: 100%;
  border-radius: var(--radius) !important;
  margin: 2rem 0;
  box-shadow: var(--shadow-card);
}

.article-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-left: 3px solid var(--tan);
  background: var(--bg-2);
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--fg);
  font-style: italic;
}

/* Tags & share */
.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.post-tag {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.social-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.social-share .icon-btn { text-decoration: none; }

.copy-note {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tan);
  min-width: 4.5rem;
}

/* Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6rem;
}

@media (max-width: 960px) {
  .article-sidebar { position: static; }
}

.sidebar-widget {
  padding: 1.75rem;
  border-radius: var(--radius) !important;
}

.sidebar-widget .widget-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 0.4rem;
}

.widget-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.author-bio-widget { text-align: center; }

.author-bio-widget img {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: contain;
  background: var(--tan-light);
  padding: 0.6rem;
  margin: 0 auto 1rem;
  display: block;
}

.author-bio-widget h4 {
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.author-bio-widget .eyebrow {
  margin-bottom: 0.6rem;
  font-size: 0.68rem;
}

.author-bio-widget p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.author-bio-widget p.eyebrow { color: var(--tan); }

/* More articles */
.related-posts {
  margin-top: 4.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.related-posts-header {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  margin: 0 0 2rem;
  text-align: center;
}

.related-posts .blog-grid { margin-bottom: 0; }

@media (max-width: 640px) {
  .post-hero { padding-top: 3rem; }
  .post-banner { margin-top: 2rem; }
  .article-wrapper { padding-top: 2.5rem; gap: 2.5rem; }
  .post-footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card.is-entering { animation: none; }
  .featured-post,
  .card-img-wrap img,
  .featured-img-wrap img { transition: none; }
  .featured-post:hover { transform: none; }
}