/* WordPress-specific glue for the SynaTree redesign */

/* Hide the review banner styles if leftover markup ever appears */
.mockup-note {
  display: none !important;
}

/* Synced pattern embeds on the front page */
.hero__copy > *,
.lede > *,
.case__text > .wp-block-paragraph,
.about__side > .wp-block-paragraph,
.contact__side > .wp-block-paragraph {
  margin: 0;
}

.hero__copy .wp-block-paragraph + .wp-block-paragraph,
.hero__copy p + p {
  margin-block-start: 0.85rem;
}

.lede p {
  margin: 0;
  font: inherit;
  color: inherit;
}

.about .wp-block-quote,
.about blockquote {
  margin: 0;
  border: 0;
  padding: 0;
}

.about .wp-block-quote cite,
.about cite {
  display: block;
  margin-block-start: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-style: normal;
  color: var(--muted);
}

.case__text .wp-block-paragraph:first-child strong,
.case__text > p:first-child strong {
  display: block;
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--on-ink);
}

.case__text .wp-block-paragraph + .wp-block-paragraph,
.case__text p + p {
  margin-block-start: 1rem;
  color: var(--on-ink-soft);
}

/* Keep sticky header above the WP admin bar when logged in */
.admin-bar .site-header {
  inset-block-start: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    inset-block-start: 46px;
  }
}

.admin-bar .toc {
  inset-block-start: calc(6.5rem + 32px);
}

/* Generic content pages and posts reuse the redesign tokens */
.entry {
  padding-block: var(--section);
}

.entry__header {
  display: grid;
  gap: 0.75rem;
  max-inline-size: 48rem;
  margin-block-end: clamp(1.5rem, 3vw, 2.5rem);
}

.entry__header h1 {
  font-size: var(--text-h1);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.entry__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

.entry-content {
  max-inline-size: 42rem;
  color: var(--text-soft);
}

.entry-content > *:first-child {
  margin-block-start: 0;
}

.entry-content > * + * {
  margin-block-start: 1rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--text);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.entry-content h2 {
  margin-block: 2.5rem 0.85rem;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
}

.entry-content h3 {
  margin-block: 1.75rem 0.5rem;
  font-size: var(--text-lg);
  font-weight: 700;
}

.entry-content p,
.entry-content li {
  text-wrap: pretty;
}

.entry-content ul,
.entry-content ol {
  padding-inline-start: 1.25rem;
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content a {
  font-weight: 600;
  color: var(--text);
}

.entry-content a:hover {
  color: var(--signal);
}

.entry-content img {
  border-radius: var(--radius);
}

/* Images with a fixed editor width must still shrink to fit their column.
   WordPress floats aligned images as tables, which ignore max-width, so
   inside columns they are laid out as blocks and aligned with margins. */
.entry-content figure img {
  max-inline-size: 100%;
  block-size: auto;
}

.entry-content .wp-block-column .wp-block-image figure:is(.alignleft, .alignright) {
  display: block;
  float: none;
  inline-size: fit-content;
  max-inline-size: 100%;
  margin: 0;
}

.entry-content .wp-block-column .wp-block-image figure.alignright {
  margin-inline-start: auto;
}

.entry-content .alignwide {
  max-inline-size: min(100%, 56rem);
}

/* Full-width blocks span the page shell. The text column is left-aligned and
   narrower than the shell, so a viewport-based breakout would shift them
   off-screen; size them against the shell instead. */
.entry > .shell {
  container-type: inline-size;
}

.entry-content > .alignfull {
  max-inline-size: none;
  inline-size: 100cqi;
  margin-inline: 0;
}

.entry-content .alignfull .alignfull {
  max-inline-size: none;
  inline-size: auto;
  margin-inline: 0;
}

.entry-content .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.875rem;
  padding: 0.6rem 1.35rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-ink) !important;
  font-weight: 600;
  text-decoration: none;
}

.entry-content .is-style-outline .wp-block-button__link {
  background: transparent;
  border: 1px solid currentColor;
  color: var(--text) !important;
}

/* Blog index */
.posts-index {
  display: grid;
  gap: 0;
  border-block-end: 1px solid var(--line);
}

.posts-index a {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) auto;
  gap: 0.25rem 2rem;
  align-items: baseline;
  padding: 1.35rem 0.75rem;
  border-block-start: 1px solid var(--line);
  text-decoration: none;
  transition: background 200ms var(--ease);
}

.posts-index a:hover {
  background: var(--cream);
}

.posts-index time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

.posts-index h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

@media (max-width: 40rem) {
  .posts-index a {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .posts-index time {
    grid-column: 1 / -1;
  }
}
