/*
Theme Name: SaaS List Club
Theme URI: https://saaslistclub.com
Author: SaaS List Club
Description: Custom "ink on paper" theme for SaaS List Club — torn-paper scrap blocks, marker display type, monoline illustration. Home page is final; blog index and single post templates are first-pass and expected to evolve.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: saas-list-club
*/

/* =========================================================
   1. DESIGN TOKENS
   Source: SaaS List Club design system (tokens/*.css)
   ========================================================= */
:root {
  /* Base — ink & paper */
  --ink: #0c0c0b;
  --ink-2: #1d1d1b;
  --graphite: #3b3b38;
  --bone: #f5f3ee;
  --paper: #ece3d6;
  --paper-deep: #e0d4c2;
  --putty: #e8ded0;

  /* Muted portrait grounds */
  --stone: #cdcac3;
  --slate: #6a6964;
  --olive: #6f6c56;

  /* Semantic */
  --surface-page: var(--paper);
  --surface-inverse: var(--ink);
  --text-primary: var(--ink);
  --text-secondary: var(--graphite);
  --text-inverse: var(--bone);
  --text-on-ink-soft: var(--putty);
  --border-color: var(--ink);
  --border-on-ink: var(--bone);

  /* Fonts */
  --font-marker: "Permanent Marker", "Marker Felt", cursive;
  --font-condensed: "Anton", "Impact", "Arial Narrow", sans-serif;
  --font-grotesk: "Instrument Sans", "Helvetica Neue", Helvetica, sans-serif;
  --font-body: "Poppins", "Helvetica Neue", Helvetica, sans-serif;

  --lh-tight: 0.95;
  --lh-heading: 1.08;
  --lh-body: 1.5;
  --tracking-grotesk: -0.035em;
  --tracking-condensed: 0.01em;

  /* Spacing */
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-0: 0px;
  --radius-card: 4px;
  --radius-photo: 10px;

  --container: 1120px;
  --gutter: clamp(20px, 4vw, 48px);

  /* Effects */
  --border-hair: 1px solid var(--border-color);
  --border-strong: 2px solid var(--border-color);
  --shadow-offset: 4px 4px 0 var(--ink);
  --ease-snap: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: 120ms;
  --stripe-placeholder: repeating-linear-gradient(135deg, rgba(12, 12, 11, .07) 0 8px, transparent 8px 16px);
}

/* =========================================================
   2. RESET / BASE
   ========================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body, 15px);
  line-height: var(--lh-body);
}
img { max-width: 100%; display: block; }
a { color: var(--text-primary); text-decoration: none; }
a:hover { color: var(--graphite); }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.scl-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bone);
  padding: 12px 16px;
  z-index: 1000;
}
.scl-skip-link:focus { left: 12px; top: 12px; }

/* =========================================================
   3. LAYOUT UTILITIES
   ========================================================= */
.scl-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.scl-section { padding: clamp(64px, 8vw, 104px) var(--gutter); }
.scl-section--tight { padding: clamp(40px, 6vw, 72px) var(--gutter); }
.scl-section--rule-top { border-top: var(--border-hair); }
.scl-section--ink { background: var(--ink); color: var(--bone); }
.scl-section--ink a { color: var(--bone); }
.scl-center { display: grid; justify-items: center; text-align: center; gap: var(--space-6); }
.scl-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.scl-grid-2--center { align-items: center; }
.scl-cards {
  display: grid;
  /* auto-fit + 1fr: used where the item count is fixed and small (e.g. the
     2 team portraits) and should always stretch to fill the row. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 24px;
}
/* Self-sufficient (not just a .scl-cards modifier) — every template uses
   this standalone, e.g. class="scl-cards--fill" with no base .scl-cards
   alongside it, so it needs its own display:grid or none of the grid
   properties below take effect and cards silently stack as full-width
   blocks instead. */
.scl-cards--fill {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 40px 24px;
}
/* auto-fill variant of .scl-cards: for grids whose item count varies (e.g.
   "Recent Articles" showing however many posts exist so far) — auto-fit
   would collapse the empty tracks and stretch too-few items to fill the
   whole row (a single post ballooning to full width); auto-fill leaves
   the unused tracks in place so existing cards keep a normal width. */
.scl-cards--nostretch { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* =========================================================
   4. TYPOGRAPHY
   ========================================================= */
.scl-h-marker {
  font-family: var(--font-marker);
  font-weight: 400;
  line-height: var(--lh-tight);
  text-wrap: balance;
}
.scl-h-marker--xl { font-size: clamp(44px, 7vw, 84px); }
.scl-h-marker--l { font-size: clamp(36px, 5vw, 56px); line-height: 1.02; }
.scl-h-marker--m { font-size: clamp(32px, 5vw, 64px); line-height: 1.1; }

.scl-h-grotesk {
  font-family: var(--font-grotesk);
  font-weight: 400;
  letter-spacing: var(--tracking-grotesk);
  line-height: var(--lh-heading);
}

.scl-eyebrow, .scl-label, .scl-btn, .scl-pill, .scl-tag {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scl-lede { font-size: 21px; font-weight: 500; line-height: 1.35; }
.scl-body-l { font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; }
.scl-muted { color: var(--text-secondary); }
.scl-max-560 { max-width: 560px; }
.scl-max-620 { max-width: 620px; }

/* =========================================================
   5. NAV
   ========================================================= */
.scl-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px var(--gutter);
  flex-wrap: wrap;
}
.scl-nav__brand {
  font-family: var(--font-marker);
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
}
.scl-nav__links { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.scl-nav__link { font-family: var(--font-body); font-size: 14px; }
.scl-nav__link.is-active { text-decoration: underline; text-underline-offset: 4px; }
.scl-nav__toggle {
  display: none;
  border: var(--border-strong);
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
}
.scl-nav__toggle-bar { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; }

/* =========================================================
   6. BUTTONS / LINKS
   ========================================================= */
.scl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: var(--border-strong);
  border-radius: var(--radius-0);
  font-size: 16px;
  padding: 10px 16px;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-snap);
}
.scl-btn:hover { transform: rotate(-2deg); }
.scl-btn:active { transform: scale(.96); }
.scl-btn--primary { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.scl-btn--inverse { background: var(--bone); color: var(--ink); border-color: var(--bone); }
/* Higher specificity than ".scl-section--ink a" (class+tag), which would
   otherwise force these buttons' text to bone — invisible on a bone/ink
   background and, on --primary, invisible against its own ink background. */
.scl-section--ink a.scl-btn--primary,
.scl-section--ink a.scl-btn--inverse { color: var(--bone); }
.scl-section--ink a.scl-btn--inverse { color: var(--ink); }
.scl-btn--small { font-size: 13px; padding: 8px 12px; border-width: 2px; }

.scl-link-underline {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 16px;
  text-underline-offset: 4px;
}
.scl-link-underline:hover { text-decoration: underline; }

/* =========================================================
   7. SCRAP BLOCK (torn-paper collage shape)
   4 overlapping rotated rectangles behind text.
   ========================================================= */
.scl-scrap {
  position: relative;
  width: min(820px, 100%);
  padding: clamp(56px, 8vw, 88px) clamp(28px, 7vw, 96px);
  color: var(--bone);
  text-align: center;
}
.scl-scrap--wide { width: min(900px, 100%); }
.scl-scrap__layer {
  position: absolute;
  background: var(--ink);
}
.scl-scrap--onink .scl-scrap__layer { background: var(--bone); }
.scl-scrap__layer:nth-child(1) { left: 0;   top: 8%;  width: 30%; height: 84%; transform: rotate(-3deg); }
.scl-scrap__layer:nth-child(2) { left: 22%; top: 0;   width: 28%; height: 94%; transform: rotate(2deg); }
.scl-scrap__layer:nth-child(3) { left: 46%; top: 10%; width: 26%; height: 82%; transform: rotate(-1.5deg); }
.scl-scrap__layer:nth-child(4) { left: 68%; top: 3%;  width: 32%; height: 90%; transform: rotate(3deg); }
.scl-scrap__content { position: relative; display: grid; gap: 14px; }

/* =========================================================
   8. PILLS / TAGS / CHIPS
   ========================================================= */
.scl-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 1;
}
.scl-pill__dot { width: 9px; height: 9px; background: currentColor; flex: none; }

.scl-tag {
  display: inline-block;
  background: var(--ink);
  color: var(--bone);
  font-size: 11px;
  padding: 5px 8px;
  line-height: 1;
}
.scl-tag--onink { background: var(--bone); color: var(--ink); }

.scl-chip {
  border: var(--border-strong);
  border-radius: var(--radius-0);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  background: var(--surface-page);
  color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-snap);
}
.scl-chip:hover { transform: rotate(-2deg); }
.scl-chip.is-active { background: var(--ink); color: var(--bone); }

/* =========================================================
   9. TEAM / PHOTO CARDS
   ========================================================= */
.scl-team-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 5 / 4;
  background: var(--surface-page);
  border: var(--border-strong);
}
.scl-team-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.scl-team-card__name {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 15px;
  padding: 6px 9px;
  line-height: 1;
}

/* =========================================================
   10. PLACEHOLDER IMAGE (striped diagonal — swap for real media)
   ========================================================= */
.scl-placeholder {
  border-radius: var(--radius-card);
  background: var(--surface-page);
  background-image: var(--stripe-placeholder);
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
}
.scl-placeholder span { font-size: 11px; color: var(--graphite); }
.scl-placeholder--16-10 { aspect-ratio: 16 / 10; }
.scl-placeholder--4-3 { aspect-ratio: 4 / 3; }
.scl-placeholder--16-9 { aspect-ratio: 16 / 9; }
.scl-placeholder--21-9 { aspect-ratio: 21 / 9; }

/* Real post thumbnails (as opposed to the empty .scl-placeholder box above):
   combined with a .scl-placeholder--* modifier for the aspect-ratio, sized
   to its own box rather than the image's native pixel dimensions so it
   crops cleanly instead of stretching. */
.scl-media-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1px solid var(--ink);
}

/* =========================================================
   11. ARTICLE / POST CARDS
   ========================================================= */
.scl-article-card {
  display: grid;
  gap: 14px;
  align-content: start;
  color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-snap);
}
.scl-article-card:hover { transform: rotate(-1deg); color: var(--ink); }
.scl-article-card--onink { color: var(--bone); }
.scl-article-card--onink:hover { color: var(--bone); }
.scl-article-card__title {
  font-family: var(--font-marker);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  text-wrap: pretty;
}
.scl-article-card__desc { font-size: 14px; line-height: 1.5; color: var(--graphite); }
.scl-article-card--onink .scl-article-card__desc { color: var(--text-on-ink-soft); }

/* =========================================================
   12. STEPS LIST ("What to Expect")
   ========================================================= */
.scl-steps { display: grid; border-top: var(--border-hair); }
.scl-step { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding: 20px 0; border-bottom: var(--border-hair); }
.scl-step__n { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.04em; font-size: 22px; line-height: 1; }
.scl-step__title { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.04em; font-size: 20px; text-transform: uppercase; line-height: 1; display: block; margin-bottom: 6px; }
.scl-step__body { font-size: 14px; line-height: 1.5; }

/* =========================================================
   13. NEWSLETTER FORM
   ========================================================= */
.scl-newsletter-form { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: min(520px, 100%); }
/* Stacked variant (e.g. the single-post sidebar box): a plain flex-direction
   override isn't enough on its own — .scl-input's flex-basis:240px would
   apply to HEIGHT instead of width in a column flow, and flex-grow:1 would
   then let it expand to fill the box, producing a huge input. Resetting
   flex:none and giving explicit width:100% here fixes both. */
.scl-newsletter-form--stacked { flex-direction: column; width: 100%; }
.scl-newsletter-form--stacked .scl-input,
.scl-newsletter-form--stacked .scl-btn { flex: none; width: 100%; }
.scl-input {
  flex: 1 1 240px;
  background: var(--surface-page);
  border: var(--border-strong);
  border-radius: var(--radius-0);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.scl-input:focus { box-shadow: var(--shadow-offset); }
.scl-newsletter-note { font-size: 12px; color: var(--graphite); text-align: center; max-width: 420px; }
.scl-newsletter-box { border: var(--border-strong); border-radius: var(--radius-card); padding: 24px; display: grid; gap: 14px; }

/* Single-post sidebar table of contents, auto-built from the post's own
   h2/h3 headings (see scl_content_with_toc() in functions.php). Real post
   content, so grid-template-columns is explicit — see the .scl-article-body
   comment above for why an implicit "auto" column would be risky here. */
.scl-toc {
  border: var(--border-strong);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.scl-toc ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.scl-toc__item a { font-size: 14px; line-height: 1.4; overflow-wrap: break-word; }
.scl-toc__item a:hover { text-decoration: underline; }
.scl-toc__item--h3 { padding-left: 16px; }

/* =========================================================
   14. FOOTER
   ========================================================= */
.scl-footer {
  border-top: var(--border-hair);
  padding: 24px var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.scl-footer__brand { font-family: var(--font-marker); font-weight: 400; font-size: 22px; line-height: 1; }

/* =========================================================
   15. SINGLE ARTICLE
   ========================================================= */
.scl-article-header { display: inline-block; }
.scl-article-title { margin: 18px 0 24px; font-family: var(--font-marker); font-weight: 400; font-size: clamp(38px, 5.4vw, 64px); line-height: 1.05; text-wrap: balance; }
.scl-byline { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.scl-byline__author { display: flex; align-items: center; gap: 12px; }
.scl-byline__avatar { width: 44px; height: 44px; border-radius: 50%; border: var(--border-strong); object-fit: cover; }
.scl-byline__avatar--fallback { display: grid; place-items: center; background: var(--stone); font-family: var(--font-condensed); font-size: 14px; }
.scl-dek { margin: 24px 0 0; font-size: 18px; line-height: 1.55; font-weight: 500; text-wrap: pretty; }
.scl-rule { border: none; border-top: var(--border-hair); margin: 32px 0; }
/* grid-template-columns: minmax(0, 1fr) — without it, an implicit "auto"
   grid column sizes itself to fit whatever child content is widest (e.g. a
   long unbroken word/URL somewhere in the post), then stretches every
   sibling to match, blowing the whole article out past the page width. This
   wraps real post content (the_content()), so it can't be assumed short. */
.scl-article-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; font-size: 16px; line-height: 1.7; overflow-wrap: break-word; }
.scl-article-body h2 { font-family: var(--font-marker); font-weight: 400; font-size: clamp(24px, 2.8vw, 32px); line-height: 1.15; margin: 0 0 10px; }
.scl-article-body h3 { font-family: var(--font-grotesk); font-size: 22px; margin: 0 0 8px; }
.scl-article-body p { text-wrap: pretty; }
.scl-article-body img { border-radius: var(--radius-card); }
.scl-article-body ul, .scl-article-body ol { padding-left: 1.25em; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.scl-article-body ul { list-style: disc; }
.scl-article-body ol { list-style: decimal; }
.scl-pullquote,
.scl-article-body blockquote {
  background: var(--ink);
  color: var(--bone);
  padding: 28px 32px;
  border-radius: var(--radius-card);
  margin: 0;
}
.scl-pullquote p,
.scl-article-body blockquote p {
  font-family: var(--font-marker);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.25;
  margin: 0;
}

.scl-article-layout { display: flex; flex-wrap: wrap; gap: clamp(40px, 6vw, 80px); align-items: flex-start; margin-top: clamp(32px, 5vw, 56px); }
.scl-article-main { flex: 1 1 520px; min-width: 0; max-width: 680px; }
.scl-article-aside { flex: 0 1 300px; min-width: 260px; display: grid; gap: 28px; position: sticky; top: 24px; }
.scl-share { display: grid; gap: 12px; }
.scl-share__links { display: flex; gap: 8px; flex-wrap: wrap; }
.scl-share__btn {
  border: var(--border-strong);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 1;
  background: var(--surface-page);
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-snap);
}
.scl-share__btn:hover { transform: rotate(-2deg); }

/* =========================================================
   15b. PAGINATION
   ========================================================= */
.scl-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 2px solid currentColor;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--bone);
}
.scl-pagination .page-numbers.current { background: var(--bone); color: var(--ink); }
.scl-pagination .page-numbers.dots { border: none; }

/* =========================================================
   16. RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
  .scl-nav__toggle { display: block; }
  .scl-nav__links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-top: 16px;
  }
  .scl-nav__links.is-open { display: flex; }
  .scl-byline { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   17. ACCESSIBILITY / MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .scl-btn, .scl-chip, .scl-article-card, .scl-share__btn { transition: none; }
}
