/* Shared by the public content and Gutenberg canvas. Never target the admin body. */

/* A paragraph's spacing is visual; its text and paragraph boundary stay in the
 * native block. Explicit inline choices and WordPress presets take precedence. */

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(p, ul, ol) {
  margin-block: 1.35em;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(p) {
  margin-block: var(--gi-paragraph-margin-start, 1.35em) var(--gi-paragraph-margin-end, 1.35em);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(h2, h3, h4) {
  margin: 1.7em 0 0.6em;
  color: var(--gi-paper);
  font-family: var(--gi-display);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) h2 {
  position: relative;
  padding-top: 0.75rem;
  margin-block: var(--gi-h2-margin-start, 1.7em) var(--gi-h2-margin-end, 0.6em);
  font-size: var(--gi-h2-font-size, clamp(2rem, 5vw, 3.8rem));
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) h2::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.25rem;
  height: 2px;
  border-radius: 99px;
  background: var(--gi-primary);
  content: "";
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) h3 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) h4 {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) a {
  color: var(--gi-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(img, video, iframe) {
  max-width: 100%;
  border-radius: 18px;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(ul, ol) {
  padding-left: 1.4em;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) li::marker {
  color: var(--gi-primary);
}

/* Retain the indentation of nested copied lists without an empty outer bullet. */
:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) li.is-style-geniart-unmarked {
  list-style-type: none;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) blockquote {
  margin: 2.3rem 0;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--gi-border);
  border-left: 3px solid var(--gi-primary);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, 0.035);
  color: var(--gi-paper);
  font-size: 1.12em;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) blockquote > :first-child {
  margin-top: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) blockquote > :last-child {
  margin-bottom: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) code:not(pre code) {
  padding: 0.15em 0.4em;
  border: 1px solid var(--gi-border);
  border-radius: 6px;
  background: var(--gi-surface);
  font-size: 0.9em;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) pre {
  padding: 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--gi-border);
  border-radius: 16px;
  background: #050408;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(figure, .wp-block-image, .wp-block-gallery, .wp-block-embed) {
  margin-block: clamp(2rem, 5vw, 3.5rem);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) figcaption,
:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .wp-element-caption {
  margin-top: 0.65rem;
  color: var(--gi-muted);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(.wp-block-table, table) {
  width: 100%;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .wp-block-table {
  overflow-x: auto;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) table {
  border-spacing: 0;
  border-collapse: collapse;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) :where(th, td) {
  padding: 0.75rem;
  border: 1px solid var(--gi-border);
  text-align: left;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) th {
  background: rgba(255, 255, 255, 0.055);
  color: var(--gi-paper);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .wp-block-button__link {
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  background: var(--gi-paper);
  color: var(--gi-ink);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .wp-block-separator {
  margin-block: 3rem;
  border: 0;
  border-top: 1px solid var(--gi-border);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .wp-block-pullquote {
  padding: 1.5rem 0;
  border-block: 1px solid rgba(241, 146, 31, 0.35);
  color: var(--gi-paper);
  text-align: center;
}

/* Named styles appear in Gutenberg's Styles panel. The old names remain as
 * aliases while historical content is normalized, with no page-ID dependency. */
:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card, .is-style-geniart-outline, .is-style-geniart-callout, .is-style-geniart-warning, .gi-icon-text) {
  box-sizing: border-box;
  padding: 1.4rem;
  border: 1px solid var(--gi-border);
  border-radius: 16px;
  background: var(--gi-surface);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-outline {
  background: transparent;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-callout {
  border-left: 4px solid var(--gi-primary);
  background: linear-gradient(120deg, #241633, #12121d);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-warning {
  border-left: 4px solid var(--gi-amber);
  background: rgba(255, 178, 62, 0.075);
}

/* Saved Office Hours summaries retain their established presentation. */
:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-brief {
  margin: 0 0 32px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #8a63ce55;
  border-left: 4px solid #ffad00;
  border-radius: 16px;
  background: linear-gradient(120deg, #241633, #12121d);
  line-height: 1.7;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card, .is-style-geniart-outline, .is-style-geniart-callout, .is-style-geniart-warning, .gi-icon-text) > :is(h2, h3, h4):first-child {
  margin-top: 0;
  padding-top: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card, .is-style-geniart-outline, .is-style-geniart-callout, .is-style-geniart-warning, .gi-icon-text) > :is(h2, h3, h4):first-child::before {
  content: none;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card, .is-style-geniart-outline, .is-style-geniart-callout, .is-style-geniart-warning, .is-style-geniart-resource, .is-style-geniart-card-compact, .gi-icon-text, .geniart-resource-card, .geniart-card--medium) > :last-child {
  margin-bottom: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-resource, .geniart-resource-card) {
  box-sizing: border-box;
  padding: 0 1rem 1rem;
  border: 1px solid var(--gi-border);
  border-radius: 18px;
  background: var(--gi-surface);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-resource, .geniart-resource-card) > figure:first-child {
  margin: 0 -1rem 1rem;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-resource, .geniart-resource-card) > figure:first-child img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 17px 17px 0 0;
  object-fit: contain;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-resource, .geniart-resource-card) :is(h2, h3, h4) {
  font-size: 1.4rem;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-resource, .geniart-resource-card) h3 {
  font-size: 1.25rem;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) {
  padding: 1rem;
  border: 1px solid var(--gi-border);
  border-radius: 18px;
  background: var(--gi-surface);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) > .wp-block-columns {
  display: grid !important;
  grid-template-columns: minmax(60px, 1fr) minmax(0, 2fr);
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  transform: none;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) > .wp-block-columns > .wp-block-column {
  min-width: 0;
  margin: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) > .wp-block-columns > .wp-block-column:last-child {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) :is(h2, h3, h4) {
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  overflow-wrap: anywhere;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) :is(h2, h3, h4)::before {
  content: none;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) figure {
  margin: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 12px;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-card-compact, .geniart-card--medium) > hr {
  margin: 1rem 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-lead {
  color: var(--gi-paper);
  font-size: 1.25rem;
  line-height: 1.65;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-plain {
  padding-top: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-plain::before {
  content: none;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-compact {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .wp-block-image.is-style-geniart-framed {
  padding: 0.65rem;
  border: 1px solid var(--gi-border);
  border-radius: 24px;
  background: var(--gi-surface);
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .wp-block-image.is-style-geniart-square img {
  border-radius: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper)
:is(.is-style-geniart-positive, .is-style-geniart-negative) {
  padding-left: 1.4em;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-positive > li::marker {
  color: #67d992;
  content: "+  ";
  font-weight: 800;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .is-style-geniart-negative > li::marker {
  color: #ff9a9a;
  content: "−  ";
  font-weight: 800;
}

/* The Office Hours CTA is now authored content: native paragraphs and a button
 * share the same layout in the editor and on the site. No image or PHP rewrite. */
:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 28px;
  width: 100%;
  margin-block: 24px;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid #a78bfa66;
  border-radius: 18px;
  background: linear-gradient(115deg, #462071, #342663 55%, #182c47);
  color: #fff;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native > :is(p, .wp-block-buttons) {
  width: auto;
  max-width: none;
  margin: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native > .geniart-office-discord-title {
  font-size: clamp(20px, 2.5vw, 30px);
  line-height: 1.2;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native > .geniart-office-discord-description {
  grid-column: 1;
  color: #e2dcf4;
  font-size: 15px;
  line-height: 1.5;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native > .geniart-office-discord-buttons {
  grid-column: 2;
  grid-row: 1 / 3;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native .wp-block-button__link {
  padding: 12px 18px;
  border-radius: 999px;
  background: #fff;
  color: #382064;
  font-size: 15px;
  font-weight: 700;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native .wp-block-button__link:hover {
  background: #eee7ff;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native .wp-block-button__link:focus-visible {
  outline: 3px solid #ffad00;
  outline-offset: 4px;
}

@media (max-width: 600px) {
  :is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native {
    grid-template-columns: 1fr;
  }
  :is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) .geniart-office-discord-cta-native > .geniart-office-discord-buttons {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: 8px;
  }
}

/* The preserved Mosaic tool has a light interface inside the dark article.
 * Keep its controls readable without changing its embedded HTML/CSS/JS. */
:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) #stc-ui,
:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) #stc-ui :is(#stc-title, #stc-fileBtn, .stc-btn) {
  color: #222;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) #stc-ui #stc-title {
  padding-top: 0;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) #stc-ui #stc-title::before {
  content: none;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) #stc-ui #stc-paste {
  background: #fff;
  color: #222;
  caret-color: #222;
}

:is(.geniart-content:not(.geniart-content--legacy-fusion), .editor-styles-wrapper) #stc-ui #stc-paste::placeholder {
  color: #666;
  opacity: 1;
}
