/* @version 6.541.0 */
/* ============================================================
   ChannelzIQ Blog — surface layer on top of the shared
   design system (style.css / Studio Clarity).
   Loaded AFTER style.css. Tokens only — never hardcode a
   palette here, or the blog drifts from the rest of the site
   again (that drift is exactly what this file replaced).
   ============================================================ */

/* --- Blog nav: the blog has no hero, so the bar is always
   surfaced rather than transparent-until-scrolled. --- */
.nav {
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

/* --- Page shell --- */
.blog-main {
  padding-top: 88px;
}

/* --- Blog hero --- */
.blog-hero {
  text-align: center;
  padding: 56px 0 40px;
}

.blog-hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  color: var(--text);
}

.blog-hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 32px;
}

/* --- Search --- */
.search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* --- Category tabs --- */
.tabs-wrap {
  display: flex;
  justify-content: center;
  margin: 32px 0 8px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- Article grid + cards --- */
.articles-section {
  padding: 32px 0 72px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  transition: var(--transition);
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(24, 33, 43, 0.08);
}

.card-tag {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  background: var(--surface-light);
  color: var(--primary);
}

.article-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 10px;
}

.article-card p {
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.card-link:hover { color: var(--primary-dark); }

.blog-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 56px 24px;
  grid-column: 1 / -1;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 48px 0 8px;
}

.pagination a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination a.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   SINGLE POST
   ============================================================ */

.post-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.post-meta .cat {
  background: var(--surface-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.post-container h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 28px;
}

/* --- Author card --- */
.author-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 32px;
}

.author-card img,
.author-card .author-initial {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-card .author-initial {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.author-card h4 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.author-card h4 a { color: var(--text); }
.author-card h4 a:hover { color: var(--primary); }

.author-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Article body typography ---
   The API returns raw HTML (h2/h3/p/ul/ol/blockquote/code/img/
   table). Every one of these needs a rule or the article
   renders as an unstyled blob. --- */
.post-content {
  font-size: 1.075rem;
  line-height: 1.75;
  color: var(--text);
}

.post-content > *:first-child { margin-top: 0; }

.post-content p {
  margin-bottom: 1.35em;
}

.post-content h2 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 2.2em 0 0.7em;
  padding-top: 0.4em;
  border-top: 1px solid var(--line);
}

.post-content h3 {
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 1.8em 0 0.6em;
}

.post-content h4 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.6em 0 0.5em;
}

.post-content a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover { color: var(--primary-dark); }

.post-content strong { font-weight: 700; color: var(--text); }
.post-content em { font-style: italic; }

/* style.css resets `ul, ol { list-style: none }` globally, so article
   bodies must restore markers explicitly (same as .legal-content). */
.post-content ul {
  list-style: disc;
  margin: 0 0 1.35em;
  padding-left: 1.5em;
}

.post-content ol {
  list-style: decimal;
  margin: 0 0 1.35em;
  padding-left: 1.5em;
}

.post-content ul ul { list-style: circle; margin-bottom: 0.4em; }
.post-content ol ol { list-style: lower-alpha; margin-bottom: 0.4em; }

.post-content li {
  margin-bottom: 0.55em;
  padding-left: 0.25em;
}

.post-content li::marker { color: var(--primary); }

.post-content blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--primary);
  color: var(--text-muted);
  font-style: italic;
}

.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--surface-light);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 6px;
}

.post-content pre {
  background: var(--text);
  color: #F4F6F8;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 1.5em;
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.6em 0;
  display: block;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.6em;
  font-size: 0.925rem;
  display: block;
  overflow-x: auto;
}

.post-content th,
.post-content td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
}

.post-content th {
  background: var(--surface-light);
  font-weight: 600;
  color: var(--text);
}

/* --- Back link / related --- */
.back-link {
  display: inline-block;
  margin-top: 44px;
  color: var(--primary);
  font-weight: 600;
}

.back-link:hover { color: var(--primary-dark); }

.related-section {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.related-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.related-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: var(--transition);
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 10px 26px rgba(24, 33, 43, 0.07);
}

.related-card .rc-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 8px;
}

.related-card .rc-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Loading / error states --- */
.blog-loading,
.blog-error {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
}

.blog-error h2 {
  color: var(--text);
  margin-bottom: 12px;
}

/* --- Listing pages (category / tag / author) --- */
.listing-header {
  padding: 48px 0 8px;
  text-align: center;
}

.listing-header .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 10px;
}

.listing-header h1 {
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.listing-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .blog-hero h1 { font-size: 2rem; }
  .blog-hero p { font-size: 1rem; }
  .post-container h1 { font-size: 1.85rem; }
  .post-content { font-size: 1.02rem; }
  .post-content h2 { font-size: 1.4rem; }
  .post-content h3 { font-size: 1.15rem; }
  .listing-header h1 { font-size: 1.85rem; }
  .articles-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   LISTING PAGES — breadcrumbs, card internals, author hero
   (class names kept in sync with the JS renderers in
   category.html / tag.html / author.html)
   ============================================================ */

.breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumbs a { color: var(--primary); transition: var(--transition); }
.breadcrumbs a:hover { color: var(--primary-dark); }

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 10px;
}

.card-excerpt {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.read-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}

.read-more:hover { color: var(--primary-dark); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
  font-size: 1rem;
}

.pagination button {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.pagination button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- Author page --- */
.author-hero {
  text-align: center;
  padding: 40px 0 8px;
}

.author-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 36px;
  font-weight: 700;
}

.author-hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.author-bio {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 620px;
  margin: 0 auto;
}

.author-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.author-social a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.author-social a:hover { color: var(--primary); }

.posts-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 20px;
}
