/* ==========================================================================
   Infrito Insights - Content (.inf-prose)
   Typography for post and page content and the block editor (enqueued as
   an editor style too). Comfortable long-form reading: 16px Montserrat (the
   infrito.com typeface), 1.75 line height, a 760px measure and the blog's
   blue/orange accents.
   ========================================================================== */

.inf-prose {
  max-width: var(--inf-content-max);
  color: var(--inf-ink);
  font-size: var(--inf-text-lg);
  line-height: 1.7;
  overflow-wrap: break-word;
}

/* ---- Vertical rhythm ---- */
.inf-prose > * {
  margin-block: 0;
}

.inf-prose > * + * {
  margin-top: 1.25em;
}

/* ---- Headings ---- */
.inf-prose h2,
.inf-prose h3,
.inf-prose h4,
.inf-prose h5,
.inf-prose h6 {
  color: var(--inf-ink);
  font-family: var(--inf-font-body);
  text-wrap: balance;
  scroll-margin-top: 24px;
}

.inf-prose h2 {
  margin-top: 2.1em;
  font-size: clamp(1.5rem, 1.25rem + 0.75vw, 1.9375rem); /* 24-31px */
  font-weight: var(--inf-weight-heading);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.inf-prose h3 {
  margin-top: 1.7em;
  font-size: clamp(1.25rem, 1.1rem + 0.45vw, 1.5rem); /* 20-24px */
  font-weight: var(--inf-weight-semibold);
  line-height: 1.28;
  letter-spacing: var(--inf-tracking-tight);
}

.inf-prose h4 {
  margin-top: 1.6em;
  font-size: 1.1875rem; /* 19px */
  font-weight: var(--inf-weight-bold);
  line-height: 1.35;
}

.inf-prose h5,
.inf-prose h6 {
  margin-top: 1.5em;
  font-size: 1rem;
  font-weight: var(--inf-weight-bold);
  line-height: 1.4;
}

.inf-prose h2 + *,
.inf-prose h3 + *,
.inf-prose h4 + * {
  margin-top: 0.7em;
}

/* ---- Inline ---- */
.inf-prose a {
  color: var(--inf-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.inf-prose a:hover {
  color: var(--inf-orange-strong);
  text-decoration-thickness: 2px;
}

.inf-prose strong,
.inf-prose b {
  font-weight: var(--inf-weight-semibold);
}

.inf-prose mark {
  padding: 0 0.15em;
  border-radius: 2px;
  background: #fff1d6;
  color: inherit;
}

.inf-prose code,
.inf-prose kbd {
  padding: 0.12em 0.36em;
  border-radius: var(--inf-radius-xs);
  background: var(--inf-surface-alt);
  font-family: var(--inf-font-mono);
  font-size: 0.88em;
}

.inf-prose abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* ---- Lists ---- */
.inf-prose ul,
.inf-prose ol {
  padding-left: 1.35em;
}

.inf-prose li + li {
  margin-top: 0.45em;
}

.inf-prose li > ul,
.inf-prose li > ol {
  margin-top: 0.45em;
}

.inf-prose ul li::marker {
  color: var(--inf-orange);
}

.inf-prose ol li::marker {
  color: var(--inf-blue);
  font-weight: var(--inf-weight-bold);
}

/* ---- Quotes ---- */
.inf-prose blockquote,
.inf-prose .wp-block-quote {
  margin-inline: 0;
  padding: 2px 0 2px 22px;
  border-left: 3px solid var(--inf-orange);
  color: var(--inf-ink);
  font-size: 1.3125rem; /* 21px */
  font-weight: var(--inf-weight-medium);
  line-height: 1.55;
}

.inf-prose blockquote > * + * {
  margin-top: 0.7em;
}

.inf-prose blockquote cite,
.inf-prose .wp-block-quote cite,
.inf-prose .wp-block-pullquote cite {
  display: block;
  margin-top: 10px;
  color: var(--inf-quiet);
  font-size: var(--inf-text-sm);
  font-style: normal;
  font-weight: var(--inf-weight-semibold);
}

.inf-prose .wp-block-pullquote {
  padding: 24px 0;
  border-top: 3px solid var(--inf-navy);
  border-bottom: 1px solid var(--inf-line);
  text-align: left;
}

.inf-prose .wp-block-pullquote blockquote {
  padding: 0;
  border: 0;
  font-size: 1.5rem;
  font-weight: var(--inf-weight-semibold);
  letter-spacing: -0.015em;
}

/* ---- Media ---- */
.inf-prose figure {
  margin-inline: 0;
}

.inf-prose img {
  height: auto;
  border-radius: var(--inf-radius-md);
}

.inf-prose .wp-block-image img {
  border: 1px solid var(--inf-line);
}

.inf-prose figcaption,
.inf-prose .wp-element-caption {
  margin-top: 8px;
  color: var(--inf-quiet);
  font-size: var(--inf-text-sm);
  line-height: 1.45;
}

.inf-prose .wp-block-embed iframe,
.inf-prose iframe,
.inf-prose video {
  max-width: 100%;
  border-radius: var(--inf-radius-md);
}

.inf-prose .alignwide,
.inf-prose .alignfull {
  max-width: none;
}

/* ---- Tables (scroll sideways on small screens instead of overflowing) ---- */
.inf-prose .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* A rounded, white panel with row rules (separate borders, so the corners
   can be rounded; this also drops the core block's 3px header rule). */
.inf-prose table {
  width: 100%;
  border: 1px solid var(--inf-line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--inf-radius-md);
  background: var(--inf-surface);
  font-size: var(--inf-text-base);
  line-height: 1.5;
}

.inf-prose .wp-block-table table {
  min-width: 520px;
}

.inf-prose table :is(th, td) {
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--inf-line);
  text-align: left;
  vertical-align: top;
}

.inf-prose table :is(th, td) + :is(th, td) {
  border-left: 1px solid #edf1f6;
}

.inf-prose table th {
  color: var(--inf-ink);
  font-weight: var(--inf-weight-semibold);
}

.inf-prose table thead :is(th, td) {
  border-bottom-color: #d3dce8;
  background: var(--inf-surface-alt);
  font-size: var(--inf-text-sm);
  font-weight: var(--inf-weight-bold);
}

.inf-prose table tbody tr:nth-child(even) > :is(th, td) {
  background: #f9fbfd;
}

.inf-prose table > :last-child > tr:last-child > :is(th, td) {
  border-bottom: 0;
}

.inf-prose table tfoot :is(th, td) {
  border-top: 1px solid #d3dce8;
  background: var(--inf-surface-alt);
  font-weight: var(--inf-weight-semibold);
}

/* Keep cell backgrounds inside the rounded corners. */
.inf-prose table > :first-child > tr:first-child > :first-child {
  border-top-left-radius: calc(var(--inf-radius-md) - 1px);
}

.inf-prose table > :first-child > tr:first-child > :last-child {
  border-top-right-radius: calc(var(--inf-radius-md) - 1px);
}

.inf-prose table > :last-child > tr:last-child > :first-child {
  border-bottom-left-radius: calc(var(--inf-radius-md) - 1px);
}

.inf-prose table > :last-child > tr:last-child > :last-child {
  border-bottom-right-radius: calc(var(--inf-radius-md) - 1px);
}

/* Core "Stripes" style: tint the cells, not the rows (row backgrounds would
   poke out of the rounded corners). */
.inf-prose .wp-block-table.is-style-stripes {
  border-bottom: 0;
}

.inf-prose .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background: none;
}

.inf-prose .wp-block-table.is-style-stripes tbody tr:nth-child(odd) > :is(th, td) {
  background: var(--inf-surface-alt);
}

.inf-prose .wp-block-table.is-style-stripes tbody tr:nth-child(even) > :is(th, td) {
  background: var(--inf-surface);
}

.inf-prose .wp-block-table figcaption {
  text-align: left;
}

/* ---- Separator ---- */
.inf-prose hr,
.inf-prose .wp-block-separator {
  height: 1px;
  margin-block: 2.4em;
  border: 0;
  background-image: var(--inf-divider-fade); /* fades out like the theme's section rules */
  opacity: 1;
}

/* A colour picked in the editor (background-color) replaces the fade. */
.inf-prose .wp-block-separator.has-background {
  background-image: none;
}

.inf-prose .wp-block-separator.is-style-dots {
  height: auto;
  background-image: none;
}

/* ---- Code ---- */
.inf-prose pre,
.inf-prose .wp-block-code {
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: var(--inf-radius-md);
  background: var(--inf-navy);
  color: #e6edf8;
  font-family: var(--inf-font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.inf-prose pre code,
.inf-prose .wp-block-code code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* ---- Buttons block ---- */
.inf-prose .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inf-prose .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--inf-radius-sm);
  background: var(--inf-orange);
  color: var(--inf-on-orange);
  font-size: var(--inf-text-md);
  font-weight: var(--inf-weight-bold);
  line-height: 1.3;
  text-decoration: none;
  box-shadow: var(--inf-shadow-primary);
  transition:
    transform var(--inf-duration) var(--inf-ease),
    background-color var(--inf-duration) var(--inf-ease),
    border-color var(--inf-duration) var(--inf-ease),
    box-shadow var(--inf-duration) var(--inf-ease);
}

.inf-prose .wp-block-button__link:hover {
  background: var(--inf-orange-hover);
  color: var(--inf-on-orange);
  text-decoration: none;
  box-shadow: var(--inf-shadow-primary-hover);
  transform: translateY(-1px);
}

.inf-prose .is-style-outline .wp-block-button__link {
  border-color: var(--inf-line-control);
  background: var(--inf-surface);
  color: var(--inf-blue);
  box-shadow: var(--inf-shadow-xs);
}

.inf-prose .is-style-outline .wp-block-button__link:hover {
  border-color: #b9c9df;
  background: #f6f9fe;
  color: var(--inf-blue-dark);
  box-shadow: var(--inf-shadow-sm);
}

/* ---- Editor palette + font-size presets (setup.php) ---- */
.has-ink-color { color: #172538; }
.has-quiet-color { color: #516174; }
.has-blue-color { color: #2e5496; }
.has-blue-soft-color { color: #eaf1fa; }
.has-orange-color { color: #f84f12; }
.has-rust-color { color: #b6380d; }
.has-navy-color { color: #142641; }
.has-paper-color { color: #fbfcfe; }
.has-white-color { color: #ffffff; }

.has-ink-background-color { background-color: #172538; }
.has-quiet-background-color { background-color: #516174; }
.has-blue-background-color { background-color: #2e5496; }
.has-blue-soft-background-color { background-color: #eaf1fa; }
.has-orange-background-color { background-color: #f84f12; }
.has-rust-background-color { background-color: #b6380d; }
.has-navy-background-color { background-color: #142641; }
.has-paper-background-color { background-color: #fbfcfe; }
.has-white-background-color { background-color: #ffffff; }

.inf-prose .has-background {
  padding: 20px 22px;
  border-radius: var(--inf-radius-md);
}

.has-small-font-size { font-size: 0.9375rem; }
.has-normal-font-size { font-size: 1.125rem; }
.has-large-font-size { font-size: 1.5rem; line-height: 1.4; }
.has-x-large-font-size { font-size: 2rem; line-height: 1.25; }

/* ---- Tablets: one step down (shorter lines need less size) ---- */
@media (max-width: 1000px) {
  .inf-prose {
    font-size: 1.0625rem;
  }
}

/* ---- Small screens ---- */
@media (max-width: 540px) {
  .inf-prose {
    font-size: var(--inf-text-base);
    line-height: 1.72;
  }

  .inf-prose blockquote,
  .inf-prose .wp-block-quote {
    padding-left: 16px;
    font-size: 1.125rem;
  }
}
