/* ================================================================
   BLOCK STYLES — blocks.css
   Applied to all Gutenberg blocks in single-project and page content.
   Registered via add_theme_support('editor-styles') and enqueued globally.
   ================================================================ */

/* ── BODY CONTENT WRAPPER ────────────────────────────────────── */
.wp-block-post-content,
.entry-content,
.cs-body .wp-block {
  /* Inherits from body */
}

/* ── HEADINGS ────────────────────────────────────────────────── */
.cs-body h1,
.cs-body h2,
.cs-body h3,
.cs-body h4,
.default-page__content h1,
.default-page__content h2,
.default-page__content h3 {
  font-family: var(--f-display);
  font-weight: 300;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 20px;
  margin-top: 48px;
}

.cs-body h2 { font-size: clamp(24px, 2.8vw, 38px); }
.cs-body h3 { font-size: clamp(20px, 2.2vw, 28px); }

/* Section label style — used for "Overview", "Challenge" headings etc */
.cs-body h2.wp-block-heading:first-child { margin-top: 0; }

/* ── PARAGRAPHS ──────────────────────────────────────────────── */
.cs-body p,
.cs-section p {
  font-size: 17px;
  font-weight: 300;
  line-height: 1.82;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* ── LISTS ───────────────────────────────────────────────────── */
.cs-body ul:not(.wp-block-gallery),
.cs-section ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 32px;
}

.cs-body ul:not(.wp-block-gallery) li,
.cs-section ul li {
  font-size: 15.5px;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.65;
  padding: 12px 0 12px 24px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.cs-body ul:not(.wp-block-gallery) li::before,
.cs-section ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--stone-lt);
}

/* ── SEPARATOR / HR ──────────────────────────────────────────── */
.cs-body hr,
.cs-body .wp-block-separator {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 56px 0;
  background: none;
  height: 1px;
}

.cs-body .wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
  max-width: none;
  width: 100%;
}

/* ── BLOCKQUOTE — Reflection style ──────────────────────────── */
.cs-body blockquote,
.cs-body .wp-block-quote {
  font-family: var(--f-display);
  font-size: clamp(19px, 2.2vw, 28px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
  border-left: 2px solid var(--rule);
  padding: 4px 0 4px 28px;
  margin: 48px 0;
}

.cs-body .wp-block-quote p {
  font-family: var(--f-display);
  font-size: inherit;
  font-style: italic;
  color: var(--ink);
  font-weight: 300;
}

.cs-body .wp-block-quote cite {
  display: block;
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  font-style: normal;
  margin-top: 16px;
}

/* ── IMAGES ──────────────────────────────────────────────────── */
.cs-body figure.wp-block-image {
  margin: 40px 0;
}

.cs-body figure.wp-block-image img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-body .wp-block-image.alignfull {
  margin-left: calc(-1 * var(--pad-x));
  margin-right: calc(-1 * var(--pad-x));
  width: calc(100% + var(--pad-x) * 2);
  max-width: none;
}

.cs-body figcaption,
.cs-body .wp-element-caption {
  font-size: 12px;
  color: var(--stone);
  letter-spacing: 0.04em;
  margin-top: 10px;
  font-weight: 300;
}

/* ── GALLERY ─────────────────────────────────────────────────── */
.cs-body .wp-block-gallery {
  margin: 40px 0;
}

.cs-body .wp-block-gallery .wp-block-image {
  margin: 0;
}

.cs-body .wp-block-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gallery 2-col */
.cs-body .wp-block-gallery.columns-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

/* Gallery 3-col */
.cs-body .wp-block-gallery.columns-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
}

@media (max-width: 640px) {
  .cs-body .wp-block-gallery.columns-2,
  .cs-body .wp-block-gallery.columns-3 {
    grid-template-columns: 1fr;
  }
}

/* ── COLUMNS BLOCK ───────────────────────────────────────────── */
.cs-body .wp-block-columns {
  gap: 32px;
  margin: 32px 0;
}

/* ── TABLE ───────────────────────────────────────────────────── */
.cs-body .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-weight: 300;
}
.cs-body .wp-block-table td,
.cs-body .wp-block-table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  color: var(--ink-soft);
}
.cs-body .wp-block-table th {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  border-bottom: 2px solid var(--rule);
}

/* ── PULLQUOTE / COVER ───────────────────────────────────────── */
.cs-body .wp-block-pullquote {
  border: none;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 48px 0;
  margin: 56px 0;
  text-align: left;
}
.cs-body .wp-block-pullquote blockquote {
  border-left: none;
  padding-left: 0;
}
.cs-body .wp-block-pullquote p {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.8vw, 36px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  line-height: 1.35;
}

/* ── LINKS ───────────────────────────────────────────────────── */
.cs-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.2s;
}
.cs-body a:hover {
  text-decoration-color: var(--ink);
}
