/* Shared frontend/editor rules. Defaults defer to established token values. */
:root {
  --seu-theme-paragraph-start-gap: 0pt;
  --seu-theme-frontpage-grid-gap: 24pt;
  --seu-theme-frontpage-text-width: 50%;
}
.seu-theme-editorial-content :is(article, .wp-block-group, .wp-block-group__inner-container, .wp-block-column, .seu-theme-frontpage-editorial) > p,
.editor-styles-wrapper.editor-styles-wrapper p.wp-block-paragraph {
  margin-block-start: var(--seu-theme-paragraph-start-gap);
  margin-block-end: var(--seu-theme-paragraph-end-gap);
}
.seu-theme-frontpage-composition { display: grid; gap: var(--seu-theme-frontpage-grid-gap); }
.seu-theme-frontpage-composition > * { min-width: 0; }
.seu-theme-frontpage-composition img { max-width: 100%; }
.seu-theme-frontpage-composition--split {
  grid-template-columns: minmax(0, var(--seu-theme-frontpage-text-width)) minmax(0, 1fr);
  column-gap: 0;
}
.seu-theme-frontpage-composition--split > .seu-theme-frontpage-editorial { padding-inline-end: var(--seu-theme-frontpage-grid-gap); box-sizing: border-box; }
.seu-theme-frontpage-editor-text { border: 1px dashed #999; padding: 1rem; }
@media (max-width: 800px) {
  .seu-theme-frontpage-composition--split { grid-template-columns: minmax(0, 1fr); }
  .seu-theme-frontpage-composition--split > .seu-theme-frontpage-editorial { padding-inline-end: 0; }
}

.seu-theme-editorial-content :is(article, .wp-block-group, .wp-block-group__inner-container, .wp-block-column, .seu-theme-frontpage-editorial) > h1,
.editor-styles-wrapper.editor-styles-wrapper h1.wp-block-heading { margin-block-start: var(--seu-theme-heading-1-start-gap, 0pt); margin-block-end: var(--seu-theme-heading-1-end-gap, var(--seu-theme-heading-end-gap)); }

.seu-theme-editorial-content :is(article, .wp-block-group, .wp-block-group__inner-container, .wp-block-column, .seu-theme-frontpage-editorial) > h2,
.editor-styles-wrapper.editor-styles-wrapper h2.wp-block-heading { margin-block-start: var(--seu-theme-heading-2-start-gap, 0pt); margin-block-end: var(--seu-theme-heading-2-end-gap, var(--seu-theme-heading-end-gap)); }

.seu-theme-editorial-content :is(article, .wp-block-group, .wp-block-group__inner-container, .wp-block-column, .seu-theme-frontpage-editorial) > h3,
.editor-styles-wrapper.editor-styles-wrapper h3.wp-block-heading { margin-block-start: var(--seu-theme-heading-3-start-gap, 0pt); margin-block-end: var(--seu-theme-heading-3-end-gap, var(--seu-theme-heading-end-gap)); }

.seu-theme-editorial-content :is(article, .wp-block-group, .wp-block-group__inner-container, .wp-block-column, .seu-theme-frontpage-editorial) > h4,
.editor-styles-wrapper.editor-styles-wrapper h4.wp-block-heading { margin-block-start: var(--seu-theme-heading-4-start-gap, 0pt); margin-block-end: var(--seu-theme-heading-4-end-gap, var(--seu-theme-heading-end-gap)); }

.seu-theme-editorial-content :is(article, .wp-block-group, .wp-block-group__inner-container, .wp-block-column, .seu-theme-frontpage-editorial) > h5,
.editor-styles-wrapper.editor-styles-wrapper h5.wp-block-heading { margin-block-start: var(--seu-theme-heading-5-start-gap, 0pt); margin-block-end: var(--seu-theme-heading-5-end-gap, var(--seu-theme-heading-end-gap)); }

.seu-theme-editorial-content :is(article, .wp-block-group, .wp-block-group__inner-container, .wp-block-column, .seu-theme-frontpage-editorial) > h6,
.editor-styles-wrapper.editor-styles-wrapper h6.wp-block-heading { margin-block-start: var(--seu-theme-heading-6-start-gap, 0pt); margin-block-end: var(--seu-theme-heading-6-end-gap, var(--seu-theme-heading-end-gap)); }

/* Two editorial/feature rows plus optional full-width third editorial area. */
.seu-theme-frontpage-grid { display: grid; gap: var(--seu-theme-frontpage-grid-gap); }
.seu-theme-frontpage-grid .seu-theme-frontpage-feature { padding-block-end: 0; }
.seu-theme-frontpage-full { min-width: 0; }
.seu-theme-frontpage-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-block-end: 1rem; }
.seu-theme-frontpage-editor-row--full { grid-template-columns: minmax(0, 1fr); }
.seu-theme-frontpage-editor-row > * { min-width: 0; }

.seu-theme-frontpage-row > .seu-theme-frontpage-editorial:only-child { grid-column: 1 / -1; padding-inline-end: 0; }

/* Shared navigation distance; heading-before overrides must not offset either column. */
.seu-theme-content-shell.seu-theme-content--frontpage {
  padding-block-start: var(--seu-theme-frontpage-start-gap, var(--seu-theme-content-start-gap));
}
.seu-theme-frontpage-editorial > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-frontpage-editorial > .wp-block-group:first-child > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-frontpage-editorial > .wp-block-group:first-child > .wp-block-group__inner-container:first-child > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-frontpage-feature .seu-event-frontpage-rubric:first-child { margin-block-start: 0; }

/* One leading heading starts at the shell's configured navigation distance. */
.seu-theme-editorial-content > article > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-editorial-content > article > .entry-content:first-child > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-editorial-content > article > .wp-block-group:first-child > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-editorial-content > article > .wp-block-group:first-child > .wp-block-group__inner-container:first-child > :is(h1,h2,h3,h4,h5,h6):first-child { margin-block-start: 0; }
/* Rubric retains its structural level and uses the H1 typography scale. */
.seu-theme-frontpage-feature .seu-event-frontpage-rubric {
  font-size: var(--seu-theme-heading-1-size);
  margin-block-end: var(--seu-theme-heading-1-end-gap, var(--seu-theme-heading-end-gap));
}
@media (max-width: 620px) {
  .seu-theme-frontpage-feature .seu-event-frontpage-rubric { font-size: var(--seu-theme-heading-1-size-mobile); }
}

/* Leading contributed sections use the same start as direct editorial headings. */
.seu-theme-editorial-content > article > section:first-child,
.seu-theme-editorial-content > article > .entry-content:first-child > section:first-child,
.seu-theme-editorial-content > article > .wp-block-group:first-child > section:first-child,
.seu-theme-editorial-content > article > .wp-block-group:first-child > .wp-block-group__inner-container:first-child > section:first-child { margin-block-start: 0; }
.seu-theme-editorial-content > article > section:first-child > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-editorial-content > article > .entry-content:first-child > section:first-child > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-editorial-content > article > .wp-block-group:first-child > section:first-child > :is(h1,h2,h3,h4,h5,h6):first-child,
.seu-theme-editorial-content > article > .wp-block-group:first-child > .wp-block-group__inner-container:first-child > section:first-child > :is(h1,h2,h3,h4,h5,h6):first-child { margin-block-start: 0; }
