/* ============================================================
   Blog listing page — mirrors the design Rashed shared:
   centered "Our Blog" title, two-column layout (post list +
   sidebar), pagination at the bottom. Uses the global brand
   header / footer / newsletter from site-header.css + footer.
   ============================================================ */

:root {
  --blog-ink: #0f0f14;
  --blog-body: #5f5a66;
  --blog-muted: #918b99;
  --blog-line: #e6e5e0;
  --blog-soft: #f7f4fb;
  --blog-brand: #8735ee;
  --blog-radius: 16px;
}

.blog-page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.blog-page-title {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0 0 56px;
  color: var(--blog-ink);
}

/* Legacy 2-column layout, kept in case any in-progress markup still
   uses it. The current /blog.html ships a single centered column —
   .blog-toolbar above + .blog-list below. */
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}

/* Top toolbar (search + keyword pills) — replaces the sidebar on the
   listing page. Centered under the page title, fills the reading
   column. */
.blog-toolbar {
  max-width: 820px;
  margin: 0 auto 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.blog-toolbar .blog-search {
  width: 100%;
}
.blog-toolbar .blog-keywords {
  justify-content: center;
}

/* List is now the only child of .blog-page below the toolbar — pull it
   into a narrower centered column so cards stay readable on wide
   monitors. */
.blog-page > .blog-list {
  max-width: 820px;
  margin: 0 auto;
}
.blog-page > .blog-pagination {
  max-width: 820px;
  margin: 56px auto 0;
}

/* ---------- Post list ---------- */
.blog-list { display: flex; flex-direction: column; gap: 56px; }
.blog-list-loading,
.blog-list-empty {
  padding: 80px 0;
  text-align: center;
  color: var(--blog-muted);
}

.blog-post {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.blog-post-cover {
  position: relative;
  display: block;
  border-radius: var(--blog-radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--blog-soft);
}
.blog-post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-post-date {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  background: #fff;
  color: var(--blog-ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(15, 17, 23, .08);
}
.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--blog-muted);
  font-size: 13px;
}
.blog-post-meta b { color: var(--blog-ink); font-weight: 500; }
.blog-post-meta .sep { color: var(--blog-muted); opacity: .6; }

.blog-post-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.blog-post-title {
  /* h3-scale heading — smaller, card-friendly. */
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--blog-ink);
  margin: 0;
  max-width: 640px;
}
.blog-post-title a { color: inherit; text-decoration: none; }
.blog-post-title a:hover { color: var(--blog-brand); }

.blog-post-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blog-soft);
  border: 1px solid var(--blog-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blog-ink);
  transition: background .2s, transform .2s;
}
.blog-post-arrow:hover {
  background: var(--blog-ink);
  color: #fff;
  transform: translate(2px, -2px);
}

/* ---------- Quote card (special list item) ---------- */
.blog-quote {
  border: 1px solid var(--blog-line);
  border-radius: var(--blog-radius);
  padding: 40px 32px 28px;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #fdfaff 100%);
  position: relative;
}
.blog-quote-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blog-brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.blog-quote-text {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.45;
  color: var(--blog-ink);
  font-weight: 500;
  margin: 0 0 18px;
}
.blog-quote-author {
  padding-top: 16px;
  border-top: 1px dashed var(--blog-line);
  font-size: 13px;
  color: var(--blog-muted);
}
.blog-quote-author b { color: var(--blog-ink); font-weight: 600; }

/* ---------- Sidebar ---------- */
.blog-sidebar { display: flex; flex-direction: column; gap: 28px; }

.blog-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--blog-line);
  border-radius: 10px;
  padding: 6px 14px 6px 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
/* No focus glow — the wrapper just keeps the resting border when the
   input is active, so clicking the field doesn't bloom a coloured ring. */
.blog-search:focus-within {
  border-color: var(--blog-line);
  box-shadow: none;
}
.blog-search input {
  flex: 1;
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
}
/* polish.css ships a global `input:focus-visible { box-shadow: 0 0 0 3px ... }`
   rule with !important for accessibility. Cancel it on the listing search
   so the field reads as flat — the wrapper border is the focus signal. */
.blog-search input:focus,
.blog-search input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.blog-search input { /* re-open shared block */
  font-size: 13px;
  color: var(--blog-ink);
  padding: 8px 0;
}
.blog-search input::placeholder { color: var(--blog-muted); }
/* Search trigger is type="button" so theme.js's button[type="submit"]
   rules (black fill, purple hover, radius) never touch it. Plain icon. */
.blog-search button {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.blog-search button:hover,
.blog-search button:focus-visible {
  background: transparent;
}
.blog-search button svg {
  stroke: #5b5563;
}
.blog-search button:hover svg,
.blog-search button:focus-visible svg {
  stroke: var(--blog-ink);
}

.blog-card h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--blog-ink);
}

.blog-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.blog-category-list li + li { border-top: 1px solid var(--blog-line); }
.blog-category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  color: var(--blog-body);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s;
}
.blog-category-list a:hover { color: var(--blog-brand); }
.blog-category-list a span { color: var(--blog-muted); font-size: 13px; }

.blog-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.blog-recent-list li { display: flex; flex-direction: column; gap: 4px; }
.blog-recent-date {
  font-size: 11px;
  color: var(--blog-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.blog-recent-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--blog-ink);
  text-decoration: none;
}
.blog-recent-title:hover { color: var(--blog-brand); }
.blog-recent-loading { color: var(--blog-muted); font-size: 13px; }

.blog-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.blog-keyword {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blog-soft);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blog-body);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.blog-keyword:hover {
  background: rgba(135, 53, 238, .14);
  color: var(--blog-brand);
}
.blog-keyword.is-active {
  background: var(--blog-brand);
  color: #fff;
}

.blog-cta {
  background: linear-gradient(135deg, #a259ff 0%, #8735ee 100%);
  color: #fff;
  border-radius: var(--blog-radius);
  padding: 28px 24px;
  text-align: center;
}
.blog-cta h3 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 18px;
  color: #fff;
}
.blog-cta-btn {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.blog-cta-btn:hover {
  background: #fff;
  color: var(--blog-brand);
}

/* ---------- Pagination ---------- */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
}
.blog-pagination a,
.blog-pagination span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--blog-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.blog-pagination a:hover { background: var(--blog-soft); color: var(--blog-ink); }
.blog-pagination .is-active {
  background: var(--blog-brand);
  color: #fff;
}
.blog-pagination .blog-pagination-next {
  width: auto;
  padding: 0 18px;
  color: var(--blog-ink);
  gap: 8px;
}
.blog-pagination .blog-pagination-next:hover {
  background: var(--blog-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .blog-page { padding: 48px 16px 64px; }
}

/* ============================================================
   Blog detail page — /blog/<slug>.
   Same brand vocabulary as the listing (purple #8735ee, soft
   surfaces, generous type) but laid out as an article + sidebar.
   ============================================================ */

.blog-detail {
  max-width: 1220px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* Breadcrumb removed — Medium-style page opens straight on the
   article title. Keep an empty top margin to balance the page. */

.blog-detail-article {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.blog-detail-header {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
/* Medium-style article header — left-aligned title, dek beneath,
   subtle inline byline. No eyebrow pill, no breadcrumb. */
.blog-detail-header {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: left;
}

.blog-detail-title {
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.024em;
  font-weight: 800;
  color: var(--blog-ink);
  margin: 0 0 16px;
}
.blog-detail-lede {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--blog-muted);
  margin: 0 0 28px;
  font-weight: 400;
  letter-spacing: -0.005em;
}
.blog-detail-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--blog-muted);
}
.blog-detail-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0ebff 0%, #d6c4ff 100%);
  color: #5524d4;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
/* When the post is authored by the brand itself, swap the letter for
   the logo mark. Keep the gradient ring as a soft halo around the
   logo so the byline doesn't lose the avatar shape. */
.blog-detail-avatar.is-brand {
  /* Bigger badge for the brand mark so 10px breathing room still leaves
     a readable logo. Letter-avatar variants stay 32px. */
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid #ece8f3;
  padding: 10px;
}
.blog-detail-avatar.is-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.blog-detail-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--blog-ink);
}
.blog-detail-byline-sep { opacity: 0.5; }
.blog-detail-byline-date { color: var(--blog-muted); }
.blog-detail-byline-read { color: var(--blog-muted); }

.blog-detail-cover {
  max-width: 980px;
  margin: 0 auto;
}
.blog-detail-cover img {
  width: 100%;
  border-radius: 20px;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--blog-soft);
  box-shadow: 0 30px 60px -28px rgba(135, 53, 238, 0.18);
}

/* ---------- Article body typography
   Sidebar-less layout: body lives in a single centered column for
   max readability (Medium / Substack-style). The reading column is
   capped at 720px so lines stay in the comfortable 60-75 character
   range. */
.blog-detail-body {
  max-width: 720px;
  margin: 16px auto 0;
  font-size: 18px;
  line-height: 1.78;
  color: var(--blog-body);
}
.blog-detail-body > * + * { margin-top: 1.2em; }
.blog-detail-body h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--blog-ink);
  font-weight: 700;
  margin-top: 2em;
}
.blog-detail-body h3 {
  font-size: clamp(20px, 1.9vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--blog-ink);
  font-weight: 700;
  margin-top: 1.6em;
}
.blog-detail-body h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--blog-ink);
  margin-top: 1.4em;
}
/* Tighten the gap between a heading and the next paragraph/list to 15px.
   `.blog-detail-body p { margin: 0 }` further down in this file would
   otherwise re-zero the margin-top for paragraphs, so override with
   !important rather than re-ordering the file. */
.blog-detail-body h2 + *,
.blog-detail-body h3 + *,
.blog-detail-body h4 + * {
  margin-top: 10px !important;
}
.blog-detail-body p { margin: 0; }
.blog-detail-body strong { color: var(--blog-ink); font-weight: 700; }
.blog-detail-body em { color: var(--blog-ink); font-style: italic; }
.blog-detail-body a {
  color: var(--blog-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.blog-detail-body a:hover { text-decoration-thickness: 2px; }
.blog-detail-body ul,
.blog-detail-body ol {
  padding-left: 22px;
  margin: 0;
}
.blog-detail-body li + li { margin-top: 0.4em; }
.blog-detail-body blockquote {
  margin: 0;
  padding: 22px 28px;
  background: var(--blog-soft);
  border-left: 3px solid var(--blog-brand);
  border-radius: 0 12px 12px 0;
}
.blog-detail-body blockquote p {
  color: var(--blog-ink);
  font-size: 18px;
  font-style: italic;
  margin: 0;
}
.blog-detail-body code {
  background: var(--blog-soft);
  color: var(--blog-brand);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.92em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.blog-detail-body pre {
  background: #0f0f14;
  color: #f5f3ff;
  padding: 20px 22px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
.blog-detail-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.blog-detail-body img {
  width: 100%;
  border-radius: 12px;
  margin: 6px 0;
}
.blog-detail-body hr {
  border: none;
  border-top: 1px solid var(--blog-line);
  margin: 2.2em 0;
}

/* ---------- Tag row under the article body ---------- */
.blog-detail-tagrow {
  max-width: 720px;
  margin: 48px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.blog-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--blog-soft);
  color: var(--blog-ink);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s, transform .15s;
}
.blog-tag:hover {
  background: var(--blog-brand);
  color: #fff;
  transform: translateY(-1px);
}

/* CTA card removed in the Medium-style pass — the article now ends
   on the tag row + the "Continue reading" strip. */

/* ---------- More posts strip ---------- */
.blog-detail-more {
  max-width: 1172px;
  margin: 72px auto 0;
  padding-top: 48px;
  border-top: 1px solid var(--blog-line);
}
.blog-detail-more-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.blog-detail-more-head h2 {
  font-size: clamp(22px, 2vw, 28px);
  margin: 0;
  color: var(--blog-ink);
  letter-spacing: -0.015em;
}
.blog-detail-more-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--blog-brand);
  text-decoration: none;
}
.blog-detail-more-link:hover { text-decoration: underline; }
.blog-detail-more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.blog-detail-more-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--blog-line);
  border-radius: var(--blog-radius);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.blog-detail-more-card:hover {
  border-color: var(--blog-brand);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(135, 53, 238, 0.10);
}
.blog-detail-more-card:hover .blog-detail-more-thumb img {
  transform: scale(1.04);
}

/* Card thumbnail — image with the date badge floating on top. */
.blog-detail-more-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #f4e9ff, #fce4d4);
  overflow: hidden;
}
.blog-detail-more-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.blog-detail-more-thumb-empty {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f4e9ff 0%, #fce4d4 60%, #ffe4f2 100%);
}
.blog-detail-more-date {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fff;
  color: var(--blog-ink);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(15, 15, 20, 0.08);
}

.blog-detail-more-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 22px;
  flex: 1;
}
.blog-detail-more-card h3 {
  font-size: 17px;
  line-height: 1.32;
  color: var(--blog-ink);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.blog-detail-more-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--blog-brand);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .blog-detail-more-grid {
    grid-template-columns: 1fr;
  }
  .blog-detail { padding: 32px 16px 64px; }
}

@media (max-width: 640px) {
  .blog-detail-title { font-size: 30px; }
  .blog-detail-body { font-size: 16.5px; }
}
