/* =========================================================================
   Cirqley — blog post body (.prose) for WordPress block content.
   Loaded only on single posts, after site.css and the core block styles.
   The design's .prose rules (type size, h2, bulleted lists) live in site.css;
   this file covers the blocks the editor can add: h3, ordered lists, links,
   tables, images, galleries, covers and separators.
   ========================================================================= */

.prose { overflow-wrap: break-word; }

.prose a {
  color: var(--c-accent-3);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s;
}
.prose a:hover { color: var(--c-ink); }

.prose h3 {
  font-size: clamp(21px, 2vw, 25px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--c-ink);
  margin-top: 1.6em;
}
.prose h4, .prose h5, .prose h6 {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--c-ink);
  margin-top: 1.5em;
}

/* Ordered lists keep their numbers (the design's dot bullet is for <ul>). */
.prose ol { display: grid; gap: 10px; margin-bottom: 0; padding-left: 1.5em; }
.prose ol > li { padding-left: 6px; }
.prose ol > li::before { content: none; }
.prose ol > li::marker { color: var(--c-accent-3); font-weight: 600; }
.prose li > ul, .prose li > ol { margin-top: 10px; }

.prose blockquote {
  margin-inline: 0; margin-bottom: 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--c-accent-2);
  color: var(--c-ink);
}

/* Figures (tables, images, galleries) */
.prose figure { margin-inline: 0; margin-bottom: 0; }
.prose figcaption,
.prose .wp-element-caption {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-muted);
  text-align: center;
}

/* Tables */
.prose .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--c-line);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.5;
}
.prose table th,
.prose table td {
  border: 0;
  border-bottom: 1px solid var(--c-line);
  padding: 13px 18px;
  text-align: left;
  vertical-align: top;
  color: var(--c-ink-2);
}
.prose .wp-block-table thead, .prose .wp-block-table tfoot { border: 0; }
.prose table tr > :not(:last-child) { border-right: 1px solid var(--c-line); }
.prose table tbody tr:last-child > *, .prose table tfoot tr:last-child > * { border-bottom: 0; }
.prose thead th,
.prose thead td,
.prose table:not(:has(thead)) tbody tr:first-child > * { background: var(--c-paper); color: var(--c-ink); }
.prose .wp-block-table figcaption { padding: 0 18px 14px; }
@media (max-width: 640px) {
  .prose table { font-size: 14.5px; }
  .prose table th, .prose table td { padding: 11px 13px; }
  .prose .wp-block-table .has-fixed-layout td, .prose .wp-block-table .has-fixed-layout th { word-break: normal; }
  .prose table.has-fixed-layout { table-layout: auto; }
  .prose table:has(tr:first-child > :nth-child(4)) { min-width: 620px; }
}

/* Images and galleries */
.prose .wp-block-image img,
.prose .wp-block-gallery img {
  height: auto;
  border-radius: var(--r);
}
.prose .wp-block-image.alignleft,
.prose .wp-block-image.alignright,
.prose .wp-block-image.aligncenter { display: table; }
.prose .wp-block-image.aligncenter { margin-inline: auto; }
.prose .wp-block-gallery figure { margin: 0; }
.prose .wp-block-gallery.is-cropped figure img { border-radius: var(--r); }

/* Cover block */
.prose .wp-block-cover { border-radius: var(--r); overflow: hidden; }
.prose .wp-block-cover__inner-container > * + * { margin-top: 1em; }
.prose .wp-block-cover__inner-container { color: #fff; }
.prose .wp-block-cover__inner-container p:empty { display: none; }

/* Separator */
.prose hr {
  border: 0;
  height: 0;
  border-top: 1px solid var(--c-line);
  opacity: 1;
  margin-bottom: 0;
}
.prose > * + hr,
.prose > hr + * { margin-top: 2em; }

/* Embeds and code */
.prose iframe, .prose video { max-width: 100%; border-radius: var(--r); }
.prose .wp-block-embed__wrapper { position: relative; }
.prose code {
  font-family: var(--font-mono);
  font-size: .86em;
  padding: .12em .38em;
  border-radius: 6px;
  background: var(--c-paper);
}
.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--r-sm);
  background: var(--c-night);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
}
.prose pre code { padding: 0; background: none; font-size: inherit; }
