/*
 * WordPress owns the editable presets. Bridge them to Earthworks tokens.
 * Re-declare derived spacing at the editor canvas to support non-iframe editors.
 */
:root,
.editor-styles-wrapper {
  --primary: var(--wp--preset--color--primary);
  --primary-light: var(--wp--preset--color--primary-light);
  --secondary: var(--wp--preset--color--secondary);
  --secondary-light: var(--wp--preset--color--secondary-light);
  --accent-one: var(--wp--preset--color--accent-one);
  --white: var(--wp--preset--color--white);
  --black: var(--wp--preset--color--black);
  --gray: var(--wp--preset--color--gray);
  --link: var(--wp--preset--color--link);
  --unit: var(--wp--custom--earthworks--unit, 1rem);
  --unit-f85: calc(var(--unit) * 0.85);
  --unit-d2: calc(var(--unit) / 2);
  --unit-d3: calc(var(--unit) / 3);
  --unit-d4: calc(var(--unit) / 4);
  --unit-x2: calc(var(--unit) * 2);
  --unit-x3: calc(var(--unit) * 3);
  --unit-x4: calc(var(--unit) * 4);
  --unit-x5: calc(var(--unit) * 5);
  --unit-x6: calc(var(--unit) * 6);
  --radius: var(--unit-d2);
  --gap: var(--unit-d2);
  --page-width: var(--wp--style--global--wide-size);
  --page-padding: var(--wp--custom--earthworks--gutter, 1rem);
  --box-shadow: 5px 5px 0 0 var(--black);
}

.ew-site-header,
.ew-site-footer {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--unit);
  max-width: calc(var(--wp--style--global--wide-size) + var(--page-padding) * 2);
  margin-inline: auto;
  padding: var(--unit-x2) var(--page-padding);
}

.ew-site-header__title,
.ew-site-footer__title,
.ew-site-footer__tagline {
  margin: 0;
}

.ew-site-header__nav {
  margin-inline-start: auto;
}

.ew-main {
  padding-block: var(--unit-x3);
}

.ew-site-footer {
  margin-block-start: var(--unit-x3);
}

.ew-posts .wp-block-post + .wp-block-post {
  margin-block-start: var(--unit-x3);
}

.ew-posts__title {
  margin-block-end: var(--unit-d2);
}

/* Long titles and URLs should wrap without forcing horizontal scrolling. */
.ew-main :where(h1, h2, h3, p, a) {
  overflow-wrap: anywhere;
}

:where(.wp-site-blocks, .editor-styles-wrapper) :focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

:where(.wp-site-blocks, .editor-styles-wrapper) :where(a) {
  text-underline-offset: 0.18em;
}

/* No theme JavaScript, content rewriting, global reset, or core CSS removal. */
