/* ============================================================
   WordPress content typography — Tailwind design tokens
   Hierarchy: h1 > h2 > h3 > h4, relaxed body, styled lists,
   blockquotes, figures, links and code.
   ============================================================ */

.entry-content,
.user-content,
.wp-block-post-content,
.prose {
  color: var(--color-text, #1a1a1a);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 1.2rem;
  line-height: 1.625;
}

/* ── Headings (font-display / Poppins, navy) ── */
.entry-content :where(h1, h2, h3, h4, h5, h6),
.user-content :where(h1, h2, h3, h4, h5, h6),
.wp-block-post-content :where(h1, h2, h3, h4, h5, h6),
.prose :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-display, 'Poppins', system-ui, sans-serif);
  color: var(--color-navy, #16294f);
  line-height: 1.25;
  text-align: start;
  scroll-margin-top: 6rem;
}

.entry-content :where(h1),
.user-content :where(h1),
.wp-block-post-content :where(h1),
.prose :where(h1) {
  font-size: 2.7rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-block: 2.5rem 1.25rem;
}

.entry-content :where(h2),
.user-content :where(h2),
.wp-block-post-content :where(h2),
.prose :where(h2) {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-block: 2.5rem 1rem;
}

.entry-content :where(h3),
.user-content :where(h3),
.wp-block-post-content :where(h3),
.prose :where(h3) {
  font-size: 1.5rem;
  font-weight: 700;
  margin-block: 2rem 0.75rem;
}

.entry-content :where(h4),
.user-content :where(h4),
.wp-block-post-content :where(h4),
.prose :where(h4) {
  font-size: 1.35rem;
  font-weight: 600;
  margin-block: 1.5rem 0.5rem;
}

.entry-content :where(h5, h6),
.user-content :where(h5, h6),
.wp-block-post-content :where(h5, h6),
.prose :where(h5, h6) {
  font-size: 1.2rem;
  font-weight: 600;
  margin-block: 1.25rem 0.5rem;
}

@media (min-width: 768px) {
  .entry-content :where(h1),
  .user-content :where(h1),
  .wp-block-post-content :where(h1),
  .prose :where(h1) {
    font-size: 3rem;
  }

  .entry-content :where(h2),
  .user-content :where(h2),
  .wp-block-post-content :where(h2),
  .prose :where(h2) {
    font-size: 2.4rem;
  }
}

/* ── Body copy ── */
.entry-content :where(p),
.user-content :where(p),
.wp-block-post-content :where(p),
.prose :where(p) {
  margin-block: 0 1.25rem;
  line-height: 1.625;
}

.entry-content :where(strong),
.user-content :where(strong),
.wp-block-post-content :where(strong),
.prose :where(strong) {
  font-weight: 600;
  color: var(--color-navy, #16294f);
}

.entry-content :where(em),
.user-content :where(em),
.wp-block-post-content :where(em),
.prose :where(em) {
  font-style: italic;
}

/* ── Links ── */
.entry-content :where(a),
.user-content :where(a),
.wp-block-post-content :where(a),
.prose :where(a) {
  color: var(--color-teal, #2baab8);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}

.entry-content :where(a):hover,
.user-content :where(a):hover,
.wp-block-post-content :where(a):hover,
.prose :where(a):hover {
  color: var(--color-navy, #16294f);
}

/* ── Lists ── */
.entry-content :where(ul, ol),
.user-content :where(ul, ol),
.wp-block-post-content :where(ul, ol),
.prose :where(ul, ol) {
  margin-block: 0 1.25rem;
  padding-inline-start: 1.5rem;
}

.entry-content :where(ul),
.user-content :where(ul),
.wp-block-post-content :where(ul),
.prose :where(ul) {
  list-style: disc;
}

.entry-content :where(ol),
.user-content :where(ol),
.wp-block-post-content :where(ol),
.prose :where(ol) {
  list-style: decimal;
}

.entry-content :where(ul li)::marker,
.user-content :where(ul li)::marker,
.wp-block-post-content :where(ul li)::marker,
.prose :where(ul li)::marker {
  color: var(--color-teal, #2baab8);
}

.entry-content :where(li),
.user-content :where(li),
.wp-block-post-content :where(li),
.prose :where(li) {
  margin-block: 0 0.45rem;
  line-height: 1.625;
}

/* ── Blockquote ── */
.entry-content :where(blockquote),
.user-content :where(blockquote),
.wp-block-post-content :where(blockquote),
.prose :where(blockquote) {
  margin-block: 2rem;
  margin-inline: 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-cream-light, #fbf9f4);
  border-left: 4px solid var(--color-teal, #2baab8);
  border-radius: 0 1rem 1rem 0;
  font-style: italic;
  color: var(--color-text-muted, #5c5c5c);
}

.entry-content :where(blockquote) :where(p),
.user-content :where(blockquote) :where(p),
.wp-block-post-content :where(blockquote) :where(p),
.prose :where(blockquote) :where(p) {
  margin-block: 0.5rem;
}

/* ── Figures & images ── */
.entry-content :where(figure),
.user-content :where(figure),
.wp-block-post-content :where(figure),
.prose :where(figure) {
  margin-block: 2rem;
  margin-inline: 0;
}

.entry-content :where(img),
.user-content :where(img),
.wp-block-post-content :where(img),
.prose :where(img) {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
}

.entry-content :where(figcaption),
.user-content :where(figcaption),
.wp-block-post-content :where(figcaption),
.prose :where(figcaption) {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.25rem;
  color: var(--color-text-muted, #5c5c5c);
  text-align: center;
}

/* Gutenberg gallery */
.entry-content :where(.wp-block-gallery),
.user-content :where(.wp-block-gallery),
.wp-block-post-content :where(.wp-block-gallery),
.prose :where(.wp-block-gallery) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-block: 2rem;
}

.entry-content :where(.wp-block-gallery figure),
.user-content :where(.wp-block-gallery figure),
.wp-block-post-content :where(.wp-block-gallery figure),
.prose :where(.wp-block-gallery figure) {
  margin: 0;
}

/* Nested-image galleries (WP Core): force a uniform grid with equal-height
   cells so the last, wider image does not blow up the row. This must beat
   wp-block-gallery-inline-css (higher specificity than the :where() above). */
.entry-content .wp-block-gallery.has-nested-images,
.user-content .wp-block-gallery.has-nested-images,
.wp-block-post-content .wp-block-gallery.has-nested-images,
.prose .wp-block-gallery.has-nested-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image,
.user-content .wp-block-gallery.has-nested-images figure.wp-block-image,
.wp-block-post-content .wp-block-gallery.has-nested-images figure.wp-block-image,
.prose .wp-block-gallery.has-nested-images figure.wp-block-image {
  width: auto;
  margin: 0;
  align-self: stretch;
}

.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image img,
.user-content .wp-block-gallery.has-nested-images figure.wp-block-image img,
.wp-block-post-content .wp-block-gallery.has-nested-images figure.wp-block-image img,
.prose .wp-block-gallery.has-nested-images figure.wp-block-image img {
  width: 100% !important;
  height: 100%;
  object-fit: cover;
}

/* Cropped galleries: fixed 3-column grid when 3+ images are present. */
.entry-content .wp-block-gallery.has-nested-images.is-cropped,
.user-content .wp-block-gallery.has-nested-images.is-cropped,
.wp-block-post-content .wp-block-gallery.has-nested-images.is-cropped,
.prose .wp-block-gallery.has-nested-images.is-cropped {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .entry-content .wp-block-gallery.has-nested-images.is-cropped,
  .user-content .wp-block-gallery.has-nested-images.is-cropped,
  .wp-block-post-content .wp-block-gallery.has-nested-images.is-cropped,
  .prose .wp-block-gallery.has-nested-images.is-cropped {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Horizontal rule ── */
.entry-content :where(hr),
.user-content :where(hr),
.wp-block-post-content :where(hr),
.prose :where(hr) {
  margin-block: 2.5rem;
  border: 0;
  border-top: 1px solid var(--color-border, #dcd5c6);
}

/* ── Code ── */
.entry-content :where(code, kbd, samp),
.user-content :where(code, kbd, samp),
.wp-block-post-content :where(code, kbd, samp),
.prose :where(code, kbd, samp) {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1.05rem;
  background: var(--color-cream-light, #fbf9f4);
  border-radius: 0.375rem;
  padding: 0.125rem 0.375rem;
}

.entry-content :where(pre),
.user-content :where(pre),
.wp-block-post-content :where(pre),
.prose :where(pre) {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1.05rem;
  line-height: 1.625;
  background: var(--color-navy, #16294f);
  color: #ffffff;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-block: 2rem;
}

/* ── Tables ── */
.entry-content :where(table),
.user-content :where(table),
.wp-block-post-content :where(table),
.prose :where(table) {
  width: 100%;
  margin-block: 2rem;
  border-collapse: collapse;
  font-size: 1.125rem;
}

.entry-content :where(th, td),
.user-content :where(th, td),
.wp-block-post-content :where(th, td),
.prose :where(th, td) {
  border: 1px solid var(--color-border, #dcd5c6);
  padding: 0.625rem 0.875rem;
  text-align: start;
}

.entry-content :where(th),
.user-content :where(th),
.wp-block-post-content :where(th),
.prose :where(th) {
  font-family: var(--font-display, 'Poppins', system-ui, sans-serif);
  font-weight: 600;
  background: var(--color-cream-light, #fbf9f4);
}

/* ── First heading spacing ── */
.entry-content :where(:first-child),
.user-content :where(:first-child),
.wp-block-post-content :where(:first-child),
.prose :where(:first-child) {
  margin-top: 0;
}