/* ══════════════════════════════════════════════════════════
   CLEANWAVE BLOG STYLES
   Premium, minimalist architecture for professional reading.
   ══════════════════════════════════════════════════════════ */

:root {
  --blog-bg: #fdfdfe;
  --blog-card-shadow: 0 4px 20px rgba(12, 48, 87, 0.05);
  --blog-card-hover: 0 12px 30px rgba(12, 48, 87, 0.1);
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--blue);
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--cyan);
}

.breadcrumbs span.sep {
  opacity: 0.5;
}

.cross-link {
  display: inline-flex;
  align-items: center;
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
  font-size: 16px;
  transition: transform 0.2s;
}

.cross-link:hover {
  transform: translateX(4px);
}

.cross-link svg {
  stroke-width: 3;
  margin-left: 8px;
}

/* ── Archive Grid ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}

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

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #eaf1f8;
  box-shadow: 0 4px 20px rgba(12,48,87,.05);
  display: flex;
  flex-direction: column;
}

/* Stretched link — makes entire card clickable */
.stretched-link::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--blog-card-hover);
}

.post-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
}

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

.post-card:hover .post-card-img img {
  transform: scale(1.05);
}

.post-category-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.post-card-body {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.post-card-body h3 {
  font-size: 20px;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--navy);
}

.post-card-body p {
  font-size: 15px;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 20px;
  flex: 1;
}

.post-card-body h3 a {
  text-decoration: none;
  color: inherit;
}

.post-card-read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f7ff;
  color: #1572B1;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
}

.post-card-read-time svg {
  width: 10px;
  height: 10px;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #f0f5fa;
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #6b8aa0;
}

.post-card-author-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1572B1, #0098D4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.post-card:hover { transform: translateY(-6px); box-shadow: 0 16px 44px rgba(12,48,87,.12); border-color: #c8dff2; }

/* ── Single Post Layout ── */
.blog-content-wrapper {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.post-article {
  background: #fff;
  padding: 0;
}

.post-article-header {
  margin-bottom: 40px;
}

.post-featured-image {
  width: 100%;
  border-radius: 20px;
  margin-bottom: 32px;
  overflow: hidden;
  box-shadow: var(--blog-card-shadow);
}

.post-title {
  font-size: 42px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 24px;
}

.post-main-content {
  font-size: 18px;
  line-height: 1.8;
  color: #334155;
}

.post-main-content h2 {
  margin: 40px 0 20px;
  color: var(--navy);
  scroll-margin-top: 96px; /* offset for fixed navbar */
}
.post-main-content p { margin-bottom: 24px; }
.post-main-content ul { margin-bottom: 24px; padding-left: 20px; }
.post-main-content li { margin-bottom: 12px; }
.post-main-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 32px auto;
  border-radius: 12px;
}

/* ── Tables (pasted from Google Docs imports — no <th>/<thead> guaranteed) ── */
.post-main-content table {
  width: 100%;
  margin: 32px 0;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.5;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.post-main-content td,
.post-main-content th {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #eef2f6;
  border-right: 1px solid #eef2f6;
}
.post-main-content td:last-child,
.post-main-content th:last-child { border-right: none; }
.post-main-content tr:last-child td,
.post-main-content tr:last-child th { border-bottom: none; }
.post-main-content table p { margin: 0; }

/* Header row from a real <thead> */
.post-main-content table > thead > tr > td,
.post-main-content table > thead > tr > th {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* Fallback for tables with no <thead> at all — style the very first row as the header.
   Scoped to a <tbody> that is the table's first child, so it never matches a stray
   empty <tbody> (a common Google Docs export artifact) sitting after a real <thead>. */
.post-main-content table > tbody:first-child > tr:first-child > td,
.post-main-content table > tbody:first-child > tr:first-child > th {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.post-main-content tbody tr:nth-child(even) td { background: #f8fafc; }

@media (max-width: 640px) {
  .post-main-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }
}

/* ── Table of Contents links ── */
.sidebar-widget nav a:hover {
  background: #f0f7ff;
  color: var(--blue) !important;
}

/* ── Sidebar ── */
.blog-sidebar {
  position: sticky;
  top: 100px;
  transition: top .25s ease;
}
body.nav-compact .blog-sidebar { top: 72px; }

.sidebar-widget {
  background: #fff;
  border: 1px solid #f0f4f8;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.sidebar-widget h4 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--navy);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cyan);
}

.widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-list li {
  margin-bottom: 12px;
}

.widget-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.widget-list a:hover {
  color: var(--blue);
}

.widget-list span.count {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 12px;
  color: var(--muted);
}

.widget-post-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  text-decoration: none;
}

.widget-post-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.widget-post-info h5 {
  font-size: 14px;
  line-height: 1.4;
  color: var(--navy);
  margin-bottom: 4px;
}

.widget-post-info span { font-size: 12px; color: var(--muted); }

/* ── Author Card ── */
.author-box {
  background: var(--offwhite);
  border-radius: 16px;
  padding: 32px;
  margin-top: 60px;
  display: flex;
  gap: 24px;
  align-items: center;
}

.author-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.author-info h4 { font-size: 20px; margin-bottom: 8px; color: var(--navy); }
.author-info p { font-size: 15px; color: #64748b; line-height: 1.5; margin-bottom: 12px; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .blog-content-wrapper { grid-template-columns: 1fr; }
  .blog-sidebar { 
    position: static !important; 
    top: auto !important;
  }
  .post-title { font-size: 32px; }
}
