/* Scraye Blog — front-end styles.
   Core design tokens + image-less blog index + centered article view.
   The primary color is overridden per-site at runtime via an inline <style>
   generated from the Customizer setting in functions.php. */

:root {
  --primary: #ff655b;
  --primary-ink: #ffffff;
  --bg: #ffffff;
  --surface: #fafafa;
  --ink: #0a0a0a;
  --ink-2: #1f1f22;
  --muted: #6b6b70;
  --muted-2: #a0a0a6;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --pad-y: 96px;
  --pad-x: 32px;
  --row-gap: 40px;
  --stack-gap: 12px;

  --font-sans: "DM Sans", "Inter", system-ui, -apple-system, sans-serif;
  --max: 1200px;
  --read: 680px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Reset WordPress block-group margins that would otherwise break the layout. */
.wp-block-group {
  margin: 0;
}

/* ============ Header (Scraye layout style) ============ */
.wp-site-blocks > header,
header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 0;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.logo__img {
  display: block;
  width: 86px;
  height: 20px;
  object-fit: contain;
}
.logo__mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
}
.logo__mark::after {
  content: "S";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.logo__wordmark {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ============ Eyebrow / label utilities ============ */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--muted);
}
.eyebrow--primary {
  color: var(--primary);
}
.eyebrow--tag {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-block;
  line-height: 1.5;
}
.eyebrow--tag.eyebrow--primary {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, #fff);
}

/* ============ Page-top intro ============ */
.page-top {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--pad-y) * 0.6) var(--pad-x) 40px;
}
.page-top__title {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0 0 20px;
  max-width: 900px;
  color: var(--ink);
  text-wrap: balance;
}
.page-top__dek {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}

/* ============ Hero post (image-less, type-forward) ============ */
.hero-post {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--pad-y) * 0.6) var(--pad-x) calc(var(--pad-y) * 0.6);
}
.hero-post__card {
  display: block;
  padding: 48px 48px 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.hero-post__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  opacity: 0.9;
}
.hero-post__card:hover {
  border-color: var(--border-strong);
  background: #f6f6f7;
}
.hero-post__stripe {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.hero-post__spacer {
  flex: 1;
}
.hero-post__title,
.hero-post__card .wp-block-post-title {
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0 0 20px;
  max-width: 900px;
  text-wrap: balance;
}
.hero-post__card .wp-block-post-title a {
  color: var(--ink);
  text-decoration: none;
}
.hero-post__dek,
.hero-post__card .wp-block-post-excerpt__excerpt {
  font-size: 19px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 40px;
  max-width: 720px;
  text-wrap: pretty;
}
.hero-post__card .wp-block-post-excerpt__more-link {
  display: none;
}
.hero-post__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}
.hero-post__read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
.hero-post__read .arrow {
  transition: transform 0.2s;
}
.hero-post__card:hover .hero-post__read .arrow {
  transform: translateX(4px);
}

/* ============ Post list + grid ============ */
.post-list {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x) calc(var(--pad-y) * 0.8);
}
.post-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 0;
}
.post-list__head h2,
.post-list__head .wp-block-heading {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.post-list__head .count {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.post-grid.wp-block-post-template,
.post-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  counter-reset: post-counter;
}
.post-grid > li {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.post-card {
  position: relative;
  padding: 36px 32px 32px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  transition: background 0.15s;
  counter-increment: post-counter;
}
.post-grid > li:nth-child(2n) > .post-card {
  border-right: none;
}
.post-card:hover {
  background: var(--surface);
}
.post-card::after {
  content: counter(post-counter, decimal-leading-zero);
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 12px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.post-card__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.post-card__title,
.post-card .wp-block-post-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink);
  text-wrap: balance;
}
.post-card .wp-block-post-title a {
  color: var(--ink);
  text-decoration: none;
}
.post-card .wp-block-post-title a:hover {
  color: var(--ink);
}
.post-card__dek,
.post-card .wp-block-post-excerpt__excerpt {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}
.post-card .wp-block-post-excerpt__more-link {
  display: none;
}
.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--muted);
  margin-top: auto;
  gap: 12px;
}
.post-card .arrow {
  color: var(--ink);
  font-size: 16px;
  transition: transform 0.2s;
}
.post-card:hover .arrow {
  transform: translate(3px, -3px);
}

/* Pagination */
.post-pagination {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.post-pagination a,
.post-pagination .page-numbers {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.post-pagination a:hover {
  color: var(--ink);
  background: var(--surface);
}
.post-pagination .current {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ============ Footer ============ */
.wp-site-blocks > footer,
footer.wp-block-template-part {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  background: var(--bg);
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted);
  gap: 16px;
}
.site-footer__inner p {
  margin: 0;
}

/* ============ Article page ============ */
.article {
  max-width: var(--read);
  margin: 0 auto;
  padding: 80px var(--pad-x) 0;
}
.article__back-link,
.article__back {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
  transition: color 0.15s;
}
.article__back-link:hover,
.article__back:hover {
  color: var(--ink);
}
.article__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 24px;
  flex-wrap: wrap;
}
.article__title,
.article .wp-block-post-title {
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 24px;
  text-wrap: balance;
  color: var(--ink);
}
.article__dek {
  margin: 0 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.article__dek .wp-block-post-excerpt__excerpt,
.article .wp-block-post-excerpt__excerpt {
  font-size: 20px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  font-weight: 400;
  text-wrap: pretty;
}
.article .wp-block-post-excerpt__more-link {
  display: none;
}

.article__body {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.article__body > * {
  margin-top: 0;
}
.article__body p,
.article__body .wp-block-paragraph {
  margin: 0 0 24px;
  text-wrap: pretty;
}
.article__body h2,
.article__body .wp-block-heading {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 48px 0 16px;
  color: var(--ink);
}
.article__body h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 36px 0 12px;
  color: var(--ink);
}
.article__body a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}
.article__body a:hover {
  opacity: 0.7;
}
.article__body blockquote {
  border-left: 3px solid var(--primary);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
  font-size: 20px;
  color: var(--ink);
  font-style: normal;
}
.article__body blockquote p:last-child {
  margin-bottom: 0;
}
.article__body ul,
.article__body ol {
  padding-left: 22px;
  margin: 0 0 24px;
}
.article__body li {
  margin-bottom: 8px;
}
.article__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.article__body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
  margin: 32px 0;
}
.article__body pre code {
  background: none;
  border: none;
  padding: 0;
}
.article__body img,
.article__body figure {
  margin: 32px 0;
  border-radius: 12px;
  overflow: hidden;
}

/* Tables — rounded outer wrapper, borderless inner table, soft row dividers. */
.article__body .wp-block-table,
.article__body figure.wp-block-table {
  margin: 40px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}
.article__body .wp-block-table table,
.article__body table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  background: transparent;
  border: none;
  margin: 0;
  table-layout: auto;
}
.article__body .wp-block-table thead th,
.article__body table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.005em;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border);
  vertical-align: bottom;
  white-space: nowrap;
}
.article__body .wp-block-table tbody td,
.article__body table tbody td {
  padding: 20px;
  border: none;
  border-top: 1px solid var(--border);
  vertical-align: top;
  text-wrap: pretty;
}
.article__body .wp-block-table tbody tr:first-child td,
.article__body table tbody tr:first-child td {
  border-top: none;
}
.article__body .wp-block-table tbody td:first-child,
.article__body table tbody td:first-child {
  color: var(--ink);
  font-weight: 600;
  width: 22%;
  min-width: 160px;
}
.article__body .wp-block-table tbody td:nth-child(2),
.article__body table tbody td:nth-child(2) {
  width: 36%;
}
.article__body .wp-block-table strong,
.article__body table strong {
  font-weight: 600;
  color: var(--ink);
}
.article__body .wp-block-table tbody tr:hover,
.article__body table tbody tr:hover {
  background: var(--surface);
}
.article__body .wp-block-table figcaption {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin: 0;
}

@media (min-width: 960px) {
  .article__body .wp-block-table,
  .article__body figure.wp-block-table {
    width: calc(100% + 120px);
    margin-left: -60px;
    margin-right: -60px;
  }
}

@media (max-width: 820px) {
  .article__body .wp-block-table,
  .article__body figure.wp-block-table {
    overflow-x: auto;
  }
  .article__body .wp-block-table table,
  .article__body table {
    min-width: 560px;
  }
}

/* ============ Responsive ============ */
@media (max-width: 820px) {
  :root {
    --pad-x: 20px;
  }
  .page-top__title {
    font-size: clamp(32px, 7vw, 44px);
  }
  .hero-post {
    padding-top: 32px;
    padding-bottom: 32px;
  }
  .hero-post__card {
    padding: 28px 24px 24px;
  }
  .hero-post__title,
  .hero-post__card .wp-block-post-title {
    font-size: clamp(26px, 6vw, 36px);
  }
  .hero-post__dek,
  .hero-post__card .wp-block-post-excerpt__excerpt {
    font-size: 16px;
    margin-bottom: 28px;
  }
  .hero-post__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .post-grid {
    grid-template-columns: 1fr;
  }
  .post-card {
    border-right: none !important;
    padding: 28px 4px;
    min-height: 0;
  }
  .post-card::after {
    right: 4px;
  }
  .article {
    padding-top: 40px;
  }
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
