/* ==========================================================================
   911 KOOL — BLOG PAGE
   Styles for blog.html only. Shared tokens come from css/style.css.
   The Soro embed is themed by overriding its injected classes with higher
   specificity (.blog-embed .soro-blog …) so load order cannot beat us.
   ========================================================================== */

/* ---------- LAYOUT ---------- */
.blog-section {
  padding-block: var(--space-16) var(--space-20);
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-12);
  align-items: start;
}

.blog-main { min-width: 0; }

.blog-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.blog-kicker span {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.blog-kicker::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.blog-embed {
  max-width: 840px;
}

/* ---------- SORO FEED — CARD LIST ---------- */
.blog-embed .soro-blog {
  max-width: none;
  font-family: var(--font-body);
  color: var(--color-text);
}

.blog-embed .soro-blog .soro-blog-list {
  gap: var(--space-4);
}

.blog-embed .soro-blog .soro-blog-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  gap: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
}

.blog-embed .soro-blog .soro-blog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-dark);
}

.blog-embed .soro-blog .soro-blog-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.blog-embed .soro-blog .soro-blog-card-image {
  width: 180px;
  height: 124px;
  border-radius: var(--radius-md);
}

.blog-embed .soro-blog .soro-blog-card-title,
.blog-embed .soro-blog h2.soro-blog-card-title {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-2);
  transition: color var(--duration) var(--ease);
}

.blog-embed .soro-blog .soro-blog-card:hover .soro-blog-card-title {
  color: var(--color-primary);
}

.blog-embed .soro-blog .soro-blog-card-excerpt {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.blog-embed .soro-blog .soro-blog-card-date {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---------- SORO FEED — SINGLE ARTICLE ---------- */
.blog-embed .soro-blog .soro-blog-header {
  margin-bottom: var(--space-6);
}

.blog-embed .soro-blog .soro-blog-back {
  border: 2px solid var(--color-border-dark);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-5);
}

.blog-embed .soro-blog .soro-blog-back:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.blog-embed .soro-blog .soro-blog-article-title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--color-primary-dark);
}

.blog-embed .soro-blog .soro-blog-article-date {
  font-size: var(--fs-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-6);
}

.blog-embed .soro-blog .soro-blog-article-image {
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
}

.blog-embed .soro-blog .soro-blog-article-content {
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--color-text);
  max-width: 68ch;
}

.blog-embed .soro-blog .soro-blog-article-content h2 {
  font-size: var(--fs-2xl);
  color: var(--color-primary-dark);
  margin-top: var(--space-10);
}

.blog-embed .soro-blog .soro-blog-article-content h3 {
  font-size: var(--fs-xl);
  color: var(--color-primary-dark);
  margin-top: var(--space-8);
}

.blog-embed .soro-blog .soro-blog-article-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- SORO FEED — STATES ---------- */
.blog-embed .soro-blog .soro-blog-loading,
.blog-embed .soro-blog .soro-blog-error {
  padding: var(--space-12) var(--space-6);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.blog-embed .soro-blog .soro-blog-spinner {
  border-color: var(--color-border);
  border-top-color: var(--color-primary);
}

/* When the feed is empty we replace Soro's system message with our own panel. */
.blog-embed.is-empty .soro-blog .soro-blog-empty { display: none; }

/* "Latest articles" makes no sense above an empty feed — hide it in that state. */
.blog-embed.is-empty .blog-kicker { display: none; }

/* ---------- EMPTY STATE ---------- */
.blog-empty-state {
  background: var(--color-card);
  border: 1px dashed var(--color-border-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.blog-empty-state[hidden] { display: none; }

.blog-empty-state .empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-5);
  border-radius: var(--radius-full);
  background: var(--color-accent-50);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-empty-state .empty-icon svg {
  width: 26px;
  height: 26px;
}

.blog-empty-state h2 {
  font-size: var(--fs-xl);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-3);
}

.blog-empty-state p {
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--color-text-muted);
  max-width: 46ch;
  margin: 0 auto var(--space-4);
}

.blog-empty-state .empty-note {
  font-size: var(--fs-sm);
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: var(--space-6);
}

.empty-topics {
  list-style: none;
  max-width: 42ch;
  margin: 0 auto var(--space-6);
  text-align: left;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

.empty-topics li {
  position: relative;
  padding-left: var(--space-6);
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--color-text);
}

.empty-topics li:last-child { margin-bottom: 0; }

.empty-topics li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

/* ---------- ASIDE ---------- */
.blog-aside {
  display: grid;
  gap: var(--space-4);
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
}

.aside-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.aside-cta {
  background: var(--grad-primary);
  border: none;
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
}

.aside-eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary-light);
  margin-bottom: var(--space-2);
}

.aside-cta h2 {
  font-size: var(--fs-xl);
  color: var(--color-text-inverse);
  margin-bottom: var(--space-3);
  line-height: 1.2;
}

.aside-cta p {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: rgba(247, 245, 240, 0.82);
  margin-bottom: var(--space-5);
}

.aside-cta .btn {
  width: 100%;
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
}

.aside-cta .btn:last-child { margin-bottom: 0; }

.aside-card h3 {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.aside-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  transition: color var(--duration) var(--ease);
}

.aside-links a:last-child { border-bottom: none; padding-bottom: 0; }

.aside-links a::after {
  content: '→';
  color: var(--color-accent-dark);
  transition: transform var(--duration) var(--ease);
}

.aside-links a:hover { color: var(--color-primary); }
.aside-links a:hover::after { transform: translateX(3px); }

/* CTA banner sits inside the blog section (same rhythm as the services page). */
.blog-cta {
  margin-top: var(--space-12);
}

/* ---------- ARTICLE MODE ----------
   Soro injects its own <h1> for the open article, so the page header steps
   back to a breadcrumb bar instead of competing with it. */
body.blog-article-open .page-header {
  padding-bottom: var(--space-8);
}

body.blog-article-open .page-header h1,
body.blog-article-open .page-header p {
  display: none;
}

body.blog-article-open .blog-kicker { display: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 1fr; gap: var(--space-10); }
  .blog-aside {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .blog-section { padding-block: var(--space-12) var(--space-16); }
  .blog-embed .soro-blog .soro-blog-card-title,
  .blog-embed .soro-blog h2.soro-blog-card-title { font-size: 1.0625rem; }
  .blog-embed .soro-blog .soro-blog-article-title { font-size: var(--fs-2xl); }
  .blog-empty-state { padding: var(--space-10) var(--space-5); }
}

@media (max-width: 640px) {
  .blog-aside { grid-template-columns: 1fr; }
  .blog-embed .soro-blog .soro-blog-card {
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
  }
  .blog-embed .soro-blog .soro-blog-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
