/* STEP3614 / fpsj-article-ui.1.0 — opt-in article design, reused by all AI authors.
 * Only Gutenberg patterns/styles with the FPSJ Article UI class are affected.
 * Existing editorial tables, DBLM shortcodes, commerce cards and page shells stay unchanged.
 */
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui {
  --fpsj-ui-ink:var(--fpsj-setting-editorial-text,#223348);
  --fpsj-ui-head:var(--fpsj-setting-editorial-heading,#132d48);
  --fpsj-ui-muted:var(--fpsj-setting-editorial-muted,#52647c);
  --fpsj-ui-line:var(--fpsj-setting-editorial-border,#ced9e7);
  --fpsj-ui-bg:var(--fpsj-setting-editorial-surface,#fff);
  --fpsj-ui-soft:var(--fpsj-setting-editorial-surface-soft,#f4f7fb);
  --fpsj-ui-accent:var(--fpsj-setting-editorial-accent,#3478ff);
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
  color:var(--fpsj-ui-ink);
  line-height:1.75;
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui :where(p,li) {
  color:inherit;
  line-height:inherit;
  overflow-wrap:anywhere;
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui :where(p:last-child,ul:last-child) {margin-bottom:0}

/* Comparison table: an accessible native core/table block, scrollable on narrow screens. */
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table {
  box-sizing:border-box;
  display:block;
  width:100%;
  max-width:100%;
  margin-block:1.6rem;
  border:1px solid var(--fpsj-setting-editorial-table-frame,#cad8e7);
  border-radius:12px;
  background:var(--fpsj-setting-editorial-table-row,#fff);
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  box-shadow:0 9px 24px var(--fpsj-setting-editorial-table-shadow,rgba(28,54,88,.08));
}
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table > table {
  border:0!important;
  border-collapse:separate;
  border-spacing:0;
  width:100%!important;
  min-width:550px;
  margin:0;
  border-radius:0;
  box-shadow:none;
}
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table table :where(th,td) {
  padding:.8rem .9rem!important;
  color:var(--fpsj-setting-editorial-table-text,#17263c)!important;
  background:var(--fpsj-setting-editorial-table-row,#fff)!important;
  border:0!important;
  border-right:1px solid var(--fpsj-setting-editorial-table-line,#d8e2ee)!important;
  border-bottom:1px solid var(--fpsj-setting-editorial-table-line,#d8e2ee)!important;
  text-align:left;
  vertical-align:middle;
  font-size:clamp(.86rem,1.4vw,.98rem);
  white-space:normal;
}
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table table thead th {
  background:var(--fpsj-setting-editorial-table-header-bg,#12345b)!important;
  color:var(--fpsj-setting-editorial-table-header-text,#fff)!important;
  font-weight:800;
}
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table table :where(tr > :last-child) {border-right:0!important}
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table table :where(tbody tr:last-child > *) {border-bottom:0!important}
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table > figcaption {
  padding:.55rem .85rem;
  margin:0;
  color:var(--fpsj-ui-muted);
  background:var(--fpsj-ui-soft);
  text-align:left;
  font-size:.8rem;
}

/* Bubble: no fake named author or avatar; decorative icon is not identity. */
:is(.fpsj-theme,.editor-styles-wrapper) .wp-block-group.fpsj-article-ui.is-style-fpsj-article-speech {
  position:relative;
  margin-block:1.5rem;
  padding:1.05rem 1.15rem 1.05rem 4.5rem;
  border:1px solid var(--fpsj-ui-line);
  border-radius:16px;
  background:var(--fpsj-ui-soft);
  color:var(--fpsj-ui-ink);
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-speech::before {
  content:'💬';
  position:absolute;
  inset-inline-start:1rem;
  top:50%;
  transform:translateY(-50%);
  width:2.65rem;
  height:2.65rem;
  display:grid;
  place-items:center;
  border:1px solid var(--fpsj-ui-line);
  border-radius:50%;
  background:var(--fpsj-ui-bg);
  font-size:1.23rem;
}

/* Article point and caution: shared geometry, one semantic color distinction. */
:is(.fpsj-theme,.editor-styles-wrapper) .wp-block-group.fpsj-article-ui:is(.is-style-fpsj-article-point,.is-style-fpsj-article-caution) {
  margin-block:1.5rem;
  padding:1rem 1.2rem;
  background:var(--fpsj-ui-soft);
  border:1px solid var(--fpsj-ui-line);
  border-inline-start:4px solid var(--fpsj-ui-accent);
  border-radius:10px;
  color:var(--fpsj-ui-ink);
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui:is(.is-style-fpsj-article-point,.is-style-fpsj-article-caution) > p:first-child {
  font-weight:800;
  color:var(--fpsj-ui-head);
  margin:0 0 .4rem;
}
:is(.fpsj-theme,.editor-styles-wrapper) .wp-block-group.fpsj-article-ui.is-style-fpsj-article-caution {
  border-inline-start-color:#c58a34;
}

/* Pros / cons: native columns, stacked on mobile, no hand-authored table HTML. */
:is(.fpsj-theme,.editor-styles-wrapper) .wp-block-columns.fpsj-article-ui.is-style-fpsj-article-pros-cons {
  box-sizing:border-box;
  gap:1rem;
  margin-block:1.5rem;
  align-items:stretch;
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons > .wp-block-column {
  min-width:0;
  display:flex;
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons .wp-block-group:is(.is-style-fpsj-article-pro,.is-style-fpsj-article-con) {
  box-sizing:border-box;
  flex:1;
  min-width:0;
  width:100%;
  padding:1rem 1.1rem;
  border:1px solid var(--fpsj-ui-line);
  border-top:3px solid #16896c;
  border-radius:11px;
  background:var(--fpsj-ui-soft);
  color:var(--fpsj-ui-ink);
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons .wp-block-group.is-style-fpsj-article-con {border-top-color:#c58a34}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons .wp-block-group > p:first-child {color:var(--fpsj-ui-head);font-weight:800;margin:0 0 .45rem}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons :where(ul,ol) {margin:.4rem 0 0;padding-inline-start:1.3rem}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons li + li {margin-top:.4rem}

@media(max-width:781px) {
  :is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons {flex-direction:column}
  :is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-pros-cons > .wp-block-column {flex-basis:auto!important;width:100%}
  :is(.fpsj-theme,.editor-styles-wrapper) .wp-block-group.fpsj-article-ui.is-style-fpsj-article-speech {padding:.9rem 1rem .9rem 3.7rem}
  :is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-speech::before {left:.75rem;width:2.25rem;height:2.25rem;font-size:1rem}
  :is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.is-style-fpsj-article-table table :where(th,td) {padding:.7rem .65rem!important;font-size:.86rem}
}

/* STEP3626: semantic companion blocks. Existing patterns and legacy HTML unchanged. */
:is(.fpsj-theme,.editor-styles-wrapper) .wp-block-group.fpsj-article-ui:is(.is-style-fpsj-article-supplement,.is-style-fpsj-article-source) {
  box-sizing:border-box;
  width:min(100%,var(--fpsj-editorial-prose-inline,780px));
  max-width:100%;
  min-width:0;
  margin-block:.8rem 1.5rem;
  margin-inline:auto;
  padding:.75rem 1rem;
  border:0;
  border-inline-start:2px solid var(--fpsj-ui-line);
  border-radius:0;
  background:transparent;
  box-shadow:none;
  overflow-wrap:anywhere;
  color:var(--fpsj-ui-ink);
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui:is(.is-style-fpsj-article-supplement,.is-style-fpsj-article-source) > p:first-child {
  margin-block:0 .35rem;
  color:var(--fpsj-ui-head);
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-source {
  font-size:.88rem;
  color:var(--fpsj-ui-muted);
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui.is-style-fpsj-article-source :where(a) {
  overflow-wrap:anywhere;
  text-decoration:underline;
  text-underline-offset:.15em;
}
/* Join nearby, independent table companions visually without new wrappers. */
:is(.fpsj-theme,.editor-styles-wrapper) figure.wp-block-table.fpsj-article-ui.is-style-fpsj-article-table + .fpsj-article-ui:is(.is-style-fpsj-article-supplement,.is-style-fpsj-article-source) {
  margin-block-start:.5rem;
}
:is(.fpsj-theme,.editor-styles-wrapper) .fpsj-article-ui:is(.is-style-fpsj-article-supplement,.is-style-fpsj-article-source) + .fpsj-article-ui:is(.is-style-fpsj-article-supplement,.is-style-fpsj-article-source) {
  margin-block-start:.5rem;
}
