/* ============================================================
   Flexicore — Blog list + detail styles
   Layered on top of styles.css + brand.css
   ============================================================ */

/* ====== Editorial typography for posts ====== */
.editorial { font-family: var(--font-display); letter-spacing: -0.025em; }

/* ====== Loading states ====== */
.featured-loading { min-height: 420px; display: flex; align-items: center; justify-content: center; color: var(--fg-subtle); }
.post-loading { color: var(--fg-subtle); }

/* ====== Page header (used on Blog list + breadcrumbs) ====== */
.page-head {
  padding: 150px 0 60px;
  background: var(--canvas);
  border-bottom: 1px solid var(--border-default);
}
.page-head .container { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: end; }
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin: 16px 0 0;
}
.page-head h1 em { font-style: normal; color: var(--cyan-700); }
.page-head .lede {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 50ch;
  margin: 0;
}

/* breadcrumb */
.crumbs {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--fg-muted);
  font-family: var(--font-mono);
}
.crumbs a { color: var(--fg-muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan-700); }
.crumbs span.sep { opacity: 0.5; }

/* ====== Filter chips ====== */
.chips {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  padding: 32px 0 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 56px;
}
.chip {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--surface);
  color: var(--fg-default);
  cursor: pointer;
  transition: background 140ms, border 140ms, color 140ms;
  display: inline-flex; align-items: center; gap: 8px;
}
.chip:hover { background: var(--bg-hover); }
.chip.active { background: var(--charcoal); color: #F4F7FA; border-color: var(--charcoal); }
.chip .count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--coffee-100);
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--fg-muted);
}
.chip.active .count { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.85); }

.chips-row {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  flex-wrap: wrap;
}
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 8px 14px;
  width: 280px;
  max-width: 100%;
}
.search input {
  flex: 1; border: 0; outline: none;
  font-family: var(--font-sans);
  font-size: 14px;
  background: transparent;
  color: var(--fg-default);
}
.search svg { width: 16px; height: 16px; color: var(--fg-muted); flex: none; }

/* ====== Featured post ====== */
.featured {
  background: var(--surface);
  padding: 80px 0;
}
.featured-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  overflow: hidden;
}
.featured-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--coffee-100);
}
.featured-cover img { width: 100%; height: 100%; object-fit: cover; }
.featured-cover .featured-tag {
  position: absolute; top: 20px; left: 20px;
  background: var(--charcoal);
  color: #F4F7FA;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.featured-body {
  padding: 56px 56px 48px;
  display: flex; flex-direction: column;
  justify-content: center;
}
.featured-cat {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan-700);
  margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 10px;
}
.featured-cat::before {
  content: ''; width: 22px; height: 1px; background: var(--cyan-700);
}
.featured-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 18px;
}
.featured-body h2 a { color: inherit; text-decoration: none; }
.featured-body h2 a:hover { color: var(--cyan-700); }
.featured-body p { color: var(--fg-muted); font-size: 17px; line-height: 1.55; margin: 0 0 28px; max-width: 48ch; }
.byline {
  display: flex; align-items: center; gap: 12px;
  margin-top: auto;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-muted);
}
.byline .avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--slateblue-100);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--slateblue-700);
  font-size: 14px;
  flex: none;
}
.byline strong { color: var(--fg-default); font-weight: 500; }
.byline .dot {
  width: 3px; height: 3px; border-radius: 999px; background: var(--fg-subtle); display: inline-block;
}

/* ====== Article grid ====== */
.articles { padding: 60px 0 80px; }
.articles-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 36px;
}
.articles-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0;
}
.articles-head .meta { font-family: var(--font-mono); font-size: 13px; color: var(--fg-muted); }

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}
.article-card {
  display: flex; flex-direction: column;
  background: transparent;
  text-decoration: none;
  color: inherit;
}
.article-card .cover {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--coffee-100);
  margin-bottom: 18px;
  transition: transform 320ms var(--ease-default);
}
.article-card:hover .cover { transform: translateY(-3px); }
.article-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 480ms var(--ease-default); }
.article-card:hover .cover img { transform: scale(1.04); }
.article-card .cat {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan-700);
  margin-bottom: 10px;
}
.article-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.022em;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--fg-default);
}
.article-card:hover h3 { color: var(--cyan-700); }
.article-card p {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .meta-row {
  display: flex; gap: 12px; align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-subtle);
  margin-top: auto;
}
.article-card .meta-row .sep { opacity: 0.5; }

/* slate accent variant for non-customer-story cats */
.cat.product { color: var(--slateblue-700); }
.cat.operations { color: var(--amber-700); }
.cat.marketing { color: var(--brick-700); }
.cat.engineering { color: var(--sage-700); }
.cat.ict { color: var(--slateblue-700); }

/* ====== Pagination ====== */
.pagination {
  display: flex; justify-content: center;
  gap: 6px;
  margin-top: 56px;
}
.page-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-default);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 140ms, color 140ms, border 140ms;
}
.page-btn:hover { background: var(--bg-hover); }
.page-btn.active { background: var(--charcoal); color: #F4F7FA; border-color: var(--charcoal); }
.page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ====== Newsletter band ====== */
.newsletter {
  background: var(--charcoal);
  color: #F4F7FA;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.newsletter::before {
  content: '';
  position: absolute; top: 0; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(70, 189, 214, 0.15), transparent 60%);
  border-radius: 50%; pointer-events: none;
}
.newsletter .container {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: center;
  position: relative;
}
.newsletter h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #F4F7FA;
  margin: 0 0 16px;
}
.newsletter p { color: rgba(244, 247, 250, 0.7); font-size: 16px; margin: 0; max-width: 40ch; }
.newsletter form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 400px;
}

/* Email input */
.nl-email-input {
  width: 100%;
  background: rgba(244, 247, 250, 0.08);
  border: 1px solid rgba(244, 247, 250, 0.15);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: #F4F7FA;
  outline: none;
  transition: border-color 160ms;
}
.nl-email-input::placeholder { color: rgba(244, 247, 250, 0.4); }
.nl-email-input:focus { border-color: var(--cyan-500); }

/* Custom checkbox row */
.nl-consent {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.nl-consent input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.nl-check-box {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1.5px solid rgba(244, 247, 250, 0.35);
  background: transparent;
  display: grid; place-items: center;
  transition: background 140ms, border-color 140ms;
}
.nl-consent input:checked ~ .nl-check-box {
  background: var(--cyan-500);
  border-color: var(--cyan-500);
}
.nl-consent input:checked ~ .nl-check-box::after {
  content: '';
  width: 7px; height: 5px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(0px, -1px);
  display: block;
}
.nl-check-text {
  font-size: 11px;
  color: rgba(244, 247, 250, 0.45);
  line-height: 1.4;
}
.nl-consent:hover .nl-check-text { color: rgba(244, 247, 250, 0.65); }

/* Submit */
.nl-submit { align-self: flex-start; }
.nl-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Status messages */
.nl-msg { font-size: 12px; margin: 0; min-height: 16px; color: rgba(244, 247, 250, 0.5); }
.nl-msg--error { color: #FCA5A5; }
.nl-success { color: rgba(244, 247, 250, 0.85); font-size: 15px; margin: 4px 0 0; }

/* ============================================================
   BLOG DETAIL
   ============================================================ */

.post-header {
  padding: 140px 0 56px;
  background: var(--canvas);
  border-bottom: 1px solid var(--border-subtle);
}
.post-header .container {
  max-width: 820px;
}
.post-header .cat-line {
  display: flex; gap: 16px; align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 24px;
}
.post-header .cat-line a {
  color: var(--cyan-700);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  font-family: var(--font-sans);
}
.post-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 28px;
}
.post-header .deck {
  font-size: 21px;
  line-height: 1.5;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0 0 36px;
  max-width: 56ch;
}
.post-header .byline { font-size: 14px; }
.post-header .byline .avatar { width: 42px; height: 42px; font-size: 16px; }

.post-cover {
  background: var(--surface);
  padding: 40px 0 0;
}
.post-cover .container { max-width: 1120px; }
.post-cover .frame {
  aspect-ratio: 16 / 8;
  border-radius: 20px;
  overflow: hidden;
  background: var(--coffee-100);
  position: relative;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover .caption {
  font-size: 13px;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  margin-top: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--border-strong);
}

/* Article body — editorial typography */
.post-body {
  background: var(--surface);
  padding: 60px 0 80px;
}
.post-body .container { max-width: 1120px; }
.post-layout {
  display: grid;
  grid-template-columns: 56px 1fr 240px;
  gap: 36px;
  align-items: flex-start;
}
.post-tools {
  position: sticky; top: 100px;
  display: flex; flex-direction: column; gap: 10px;
}
.tool-btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer; color: var(--fg-muted);
  transition: color 140ms, border 140ms, background 140ms;
}
.tool-btn:hover { color: var(--cyan-700); border-color: var(--cyan-300); background: var(--cyan-50); }
.tool-btn svg { width: 16px; height: 16px; }

.post-prose {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--fg-default);
  max-width: 70ch;
  margin: 0 auto;
}
.post-prose > p { margin: 0 0 24px; }
.post-prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 76px;
  line-height: 0.88;
  padding: 6px 12px 0 0;
  color: var(--cyan-700);
}
.post-prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 56px 0 18px;
}
.post-prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.022em;
  line-height: 1.25;
  margin: 36px 0 14px;
}
.post-prose ul, .post-prose ol { padding-left: 22px; margin: 0 0 24px; }
.post-prose li { padding: 4px 0; }
.post-prose a {
  color: var(--cyan-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-prose blockquote {
  margin: 36px 0;
  padding: 6px 0 6px 24px;
  border-left: 3px solid var(--cyan-500);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--fg-default);
}
.post-prose blockquote cite {
  display: block;
  margin-top: 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0;
}
.post-prose figure { margin: 36px 0; }
.post-prose figure img {
  width: 100%; border-radius: 14px;
  display: block;
}
.post-prose figcaption {
  font-size: 13px; color: var(--fg-muted); margin-top: 10px; font-family: var(--font-sans);
}
.post-prose .stats-inline {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 36px 0;
  padding: 28px 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
}
.post-prose .stats-inline > div {
  padding: 0 24px;
  border-left: 1px solid var(--border-subtle);
}
.post-prose .stats-inline > div:first-child { border-left: 0; padding-left: 0; }
.post-prose .stats-inline .v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--cyan-700);
}
.post-prose .stats-inline .l {
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 8px;
  font-family: var(--font-sans);
}
.post-prose hr { border: 0; border-top: 1px solid var(--border-default); margin: 36px 0; }

/* sticky TOC */
.post-toc {
  position: sticky; top: 100px;
  font-family: var(--font-sans);
  font-size: 13px;
}
.post-toc .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 14px;
}
.post-toc a {
  display: block;
  padding: 8px 0;
  color: var(--fg-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -12px;
  line-height: 1.4;
  transition: color 140ms, border 140ms;
}
.post-toc a:hover { color: var(--fg-default); }
.post-toc a.active { color: var(--cyan-700); border-left-color: var(--cyan-500); }

/* author bio */
.author-bio {
  margin: 56px auto 0;
  max-width: 70ch;
  padding: 28px;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  display: flex; gap: 20px; align-items: center;
  background: var(--canvas);
}
.author-bio .avatar { width: 56px; height: 56px; border-radius: 999px; background: var(--slateblue-100); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; color: var(--slateblue-700); font-size: 20px; flex: none; }
.author-bio .name { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; color: var(--fg-default); }
.author-bio .role { font-size: 13px; color: var(--fg-muted); margin-top: 2px; }
.author-bio p { font-size: 14px; color: var(--fg-muted); margin: 8px 0 0; line-height: 1.55; }

/* tags */
.tags {
  margin-top: 36px;
  display: flex; gap: 8px; flex-wrap: wrap;
  max-width: 70ch; margin-left: auto; margin-right: auto;
}
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--fg-muted);
  border: 1px solid var(--border-subtle);
}

/* related posts */
.related {
  background: var(--canvas);
  padding: 80px 0;
  border-top: 1px solid var(--border-default);
}
.related h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.03em;
  margin: 0 0 36px;
}

/* product CTA below article */
.post-cta {
  background: var(--surface);
  padding: 80px 0;
  border-top: 1px solid var(--border-default);
}
.post-cta .container { max-width: 980px; text-align: center; }
.post-cta .eyebrow { color: var(--cyan-700); justify-content: center; }
.post-cta .eyebrow::before { display: none; }
.post-cta h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 14px 0 16px;
}
.post-cta p { color: var(--fg-muted); font-size: 17px; margin: 0 auto 28px; max-width: 50ch; }
.post-cta .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* progress bar at top of detail page */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: transparent;
  z-index: 101;
  pointer-events: none;
}
.reading-progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-500), var(--slateblue-500));
  transition: width 60ms linear;
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
  .page-head .container { grid-template-columns: 1fr; gap: 24px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-body { padding: 36px 32px; }
  .article-grid { grid-template-columns: 1fr 1fr; }
  .newsletter .container { grid-template-columns: 1fr; gap: 32px; }
  .post-layout { grid-template-columns: 48px 1fr; }
  .post-toc { display: none; }
}
@media (max-width: 720px) {
  .page-head { padding: 110px 0 40px; }
  .article-grid { grid-template-columns: 1fr; }
  .chips-row { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .featured-body { padding: 28px 24px; }
  .featured-body h2 { font-size: 26px; }
  .post-layout { grid-template-columns: 1fr; gap: 24px; }
  .post-tools { position: static; flex-direction: row; }
  .post-prose { font-size: 17px; }
  .post-prose > p:first-of-type::first-letter { font-size: 60px; }
  .post-prose .stats-inline { grid-template-columns: 1fr; gap: 16px; padding: 18px 0; }
  .post-prose .stats-inline > div { border-left: 0; padding: 14px 0; border-top: 1px solid var(--border-subtle); }
  .post-prose .stats-inline > div:first-child { border-top: 0; }
  .author-bio { flex-direction: column; align-items: flex-start; text-align: left; }
}
