/*
 * Block content styles: anything built in the WordPress editor.
 * Loaded on the front end (inside .entry) and in the editor (via add_editor_style),
 * so what Ryan or Jeff sees while editing matches the live page.
 * Tokens come from style.css :root (front end) or are re-declared in editor.css.
 */

.entry,
.editor-styles-wrapper {
    font-family: var(--body);
    font-size: var(--text-base);
    line-height: 1.65;
    color: var(--ink);
}

.editor-styles-wrapper a { color: var(--pacific); text-underline-offset: 0.2em; }

/* Measure: prose stays readable, wide/full blocks break out */
.entry > * { max-width: 44rem; }
.entry > #buddypress, .entry > .wp-block-query, .entry > .wp-block-sensei-lms-course-list { max-width: none; }
.entry > .alignwide { max-width: var(--wide); }
.entry > .alignfull { max-width: none; }

.entry > * + * { margin-top: var(--space-sm); }
.entry > h2, .entry > .wp-block-heading:is(h2) { margin-top: var(--space-2xl); }
.entry > h3 { margin-top: var(--space-xl); }

.entry h2, .editor-styles-wrapper h2 { font-family: var(--display); font-size: var(--text-h2); font-weight: 600; line-height: 1; }
.entry h3, .editor-styles-wrapper h3 { font-family: var(--display); font-size: var(--text-h3); font-weight: 600; line-height: 1.1; }
.entry h4, .editor-styles-wrapper h4 {
    font-family: var(--ui); font-size: 0.8rem; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

.entry p.has-large-font-size,
.editor-styles-wrapper p.has-large-font-size { line-height: 1.45; color: var(--ink-2); }

/* Lists: ruled, like the ledger */
:is(.entry, .editor-styles-wrapper) ul:not([class*="wp-block-"]):not(#buddypress *),
:is(.entry, .editor-styles-wrapper) .wp-block-list {
    list-style: none; padding: 0;
    border-top: 1px solid var(--rule);
}
:is(.entry, .editor-styles-wrapper) .wp-block-list > li,
:is(.entry, .editor-styles-wrapper) ul:not([class*="wp-block-"]):not(#buddypress *) > li {
    position: relative;
    padding: var(--space-xs) 0 var(--space-xs) 1.75rem;
    border-bottom: 1px solid var(--rule);
    margin: 0;
}
:is(.entry, .editor-styles-wrapper) .wp-block-list > li::before,
:is(.entry, .editor-styles-wrapper) ul:not([class*="wp-block-"]):not(#buddypress *) > li::before {
    content: "\2192"; position: absolute; left: 0; top: var(--space-xs);
    font-family: var(--ui); color: var(--pacific);
}
:is(.entry, .editor-styles-wrapper) ol.wp-block-list { counter-reset: n; }
:is(.entry, .editor-styles-wrapper) ol.wp-block-list > li { counter-increment: n; padding-left: 2.25rem; }
:is(.entry, .editor-styles-wrapper) ol.wp-block-list > li::before {
    content: counter(n, decimal-leading-zero);
    font-size: 0.8rem; font-weight: 600; color: var(--muted); top: calc(var(--space-xs) + 0.2rem);
}

/* Buttons */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.wp-block-button__link {
    display: inline-flex; align-items: center; min-height: 3rem;
    padding: 0 1.4rem; border-radius: 2px;
    font: 600 1rem/1 var(--ui); text-decoration: none;
    background: var(--ink); color: var(--paper);
    border: 1.5px solid var(--ink);
}
.wp-block-button__link:hover { background: var(--pacific); border-color: var(--pacific); color: var(--paper); }
.is-style-outline .wp-block-button__link { background: transparent; color: var(--ink); }
.is-style-outline .wp-block-button__link:hover { background: var(--ink); color: var(--paper); }

/* Quote / pullquote: condensed display, no side stripe */
.wp-block-quote, .wp-block-pullquote {
    margin: var(--space-xl) 0; padding: var(--space-md) 0;
    border: 0; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.wp-block-quote p, .wp-block-pullquote p {
    font-family: var(--display); font-size: 1.75rem; font-weight: 600; line-height: 1.15;
}
.wp-block-quote cite, .wp-block-pullquote cite {
    display: block; margin-top: var(--space-xs);
    font: 600 0.8rem var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
    font-style: normal;
}

/* Tables: before/after numbers for the case study */
.wp-block-table { overflow-x: auto; }
.wp-block-table table { width: 100%; border-collapse: collapse; font-family: var(--ui); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.wp-block-table :is(table, th, td) { border: 0; }   /* drop core's boxed cells */
.wp-block-table thead { border-bottom: 1.5px solid var(--ink); }
.wp-block-table th { text-align: left; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: var(--space-xs) var(--space-sm) var(--space-xs) 0; }
.wp-block-table td { padding: var(--space-xs) var(--space-sm) var(--space-xs) 0; border-bottom: 1px solid var(--rule) !important; vertical-align: top; }
.wp-block-table figcaption { font: 0.85rem var(--ui); color: var(--muted); margin-top: var(--space-xs); }

/* Separator, columns, group, images */
.wp-block-separator { border: 0; border-top: 1px solid var(--rule); margin: var(--space-xl) 0; }
.wp-block-separator.is-style-wide { border-top: 1.5px solid var(--ink); }
.wp-block-columns { display: flex; flex-wrap: wrap; gap: var(--space-lg) var(--space-xl); }
.wp-block-column { flex: 1 1 16rem; min-width: 0; }
.wp-block-group.has-background { padding: var(--space-lg); }
.wp-block-image img { display: block; }
.wp-block-image figcaption { font: 0.85rem var(--ui); color: var(--muted); margin-top: var(--space-2xs); }

/* Details (FAQ) */
.wp-block-details { border-bottom: 1px solid var(--rule); padding: var(--space-sm) 0; }
.wp-block-details summary { font: 600 1.1rem var(--ui); cursor: pointer; }
.wp-block-details[open] summary { margin-bottom: var(--space-xs); }

/* Palette + size classes from theme.json */
.has-paper-color { color: var(--paper); }        .has-paper-background-color { background-color: var(--paper); }
.has-paper-2-color { color: var(--paper-2); }    .has-paper-2-background-color { background-color: var(--paper-2); }
.has-ink-color { color: var(--ink); }            .has-ink-background-color { background-color: var(--ink); color: var(--on-ink); }
.has-ink-2-color { color: var(--ink-2); }        .has-ink-2-background-color { background-color: var(--ink-2); color: var(--on-ink); }
.has-pacific-color { color: var(--pacific); }    .has-pacific-background-color { background-color: var(--pacific); color: var(--paper); }
.has-signal-color { color: var(--signal-ink); }  .has-signal-background-color { background-color: var(--signal); color: var(--ink); }
.has-display-font-family { font-family: var(--display); }
.has-ui-font-family { font-family: var(--ui); }
.has-body-font-family { font-family: var(--body); }
