/*
 * Block content styles, shared by the front end (.pb-content) and the block editor (.editor-styles-wrapper).
 * Scoped on purpose: the compiled Tailwind reset strips heading sizes, list bullets and margins site-wide,
 * and the hand-built templates (home, about, services, contact) rely on that reset.
 * Colors, fonts and sizes come from theme.json presets, so change them there.
 */

.editor-styles-wrapper {
    background: var(--wp--preset--color--background);
}

:is(.pb-content, .editor-styles-wrapper) {
    color: var(--wp--preset--color--body);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--medium);
    line-height: 1.8;
}

/* Headings */
:is(.pb-content, .editor-styles-wrapper) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--wp--preset--color--foreground);
    font-family: var(--wp--preset--font-family--headline);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

:is(.pb-content, .editor-styles-wrapper) h1 {
    font-size: var(--wp--preset--font-size--display);
    font-weight: 900;
}

:is(.pb-content, .editor-styles-wrapper) h2 {
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--x-large);
}

:is(.pb-content, .editor-styles-wrapper) h3 {
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--large);
}

:is(.pb-content, .editor-styles-wrapper) h4 {
    font-size: 1.25rem;
}

:is(.pb-content, .editor-styles-wrapper) h5 {
    font-size: var(--wp--preset--font-size--medium);
}

:is(.pb-content, .editor-styles-wrapper) h6 {
    color: var(--wp--preset--color--accent);
    font-size: var(--wp--preset--font-size--small);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* Extra room above section headings in normal page flow */
.pb-content > :is(h2, h3, h4):not(:first-child),
.editor-styles-wrapper .is-root-container > :is(h2, h3, h4):not(:first-child) {
    margin-block-start: 3rem;
}

/* Text */
:is(.pb-content, .editor-styles-wrapper) strong {
    color: var(--wp--preset--color--foreground);
}

:is(.pb-content, .editor-styles-wrapper) a:where(:not(.wp-element-button, .wp-block-button__link, [class*="pb-"])) {
    color: var(--wp--preset--color--link);
    text-decoration: underline;
    text-underline-offset: 4px;
}

:is(.pb-content, .editor-styles-wrapper) a:where(:not(.wp-element-button, .wp-block-button__link, [class*="pb-"])):hover {
    color: var(--wp--preset--color--primary);
}

/* Lists (skips the pb-* pattern lists, which have their own styles) */
:is(.pb-content, .editor-styles-wrapper) :is(ul, ol):is(.wp-block-list, :not([class])):not([class*="pb-"]) {
    padding-inline-start: 1.5rem;
}

:is(.pb-content, .editor-styles-wrapper) ul:is(.wp-block-list, :not([class])):not([class*="pb-"]) {
    list-style: disc;
}

:is(.pb-content, .editor-styles-wrapper) ol:is(.wp-block-list, :not([class])):not([class*="pb-"]) {
    list-style: decimal;
}

:is(.pb-content, .editor-styles-wrapper) :is(ul, ol):is(.wp-block-list, :not([class])):not([class*="pb-"]) li + li {
    margin-top: 0.5rem;
}

:is(.pb-content, .editor-styles-wrapper) :is(ul, ol):is(.wp-block-list, :not([class])):not([class*="pb-"]) li::marker {
    color: var(--wp--preset--color--primary);
}

/* Quotes, code, tables, separators */
:is(.pb-content, .editor-styles-wrapper) .wp-block-quote cite,
:is(.pb-content, .editor-styles-wrapper) .wp-block-pullquote cite {
    color: var(--wp--preset--color--muted);
    font-size: var(--wp--preset--font-size--small);
    font-style: normal;
}

:is(.pb-content, .editor-styles-wrapper) :not(pre) > code {
    background: var(--wp--preset--color--surface);
    border-radius: 4px;
    color: var(--wp--preset--color--primary-soft);
    font-size: 0.9em;
    padding: 0.15em 0.4em;
}

:is(.pb-content, .editor-styles-wrapper) .wp-block-table :is(th, td) {
    border: 1px solid #2a3336;
    padding: 0.75rem 1rem;
    text-align: left;
}

:is(.pb-content, .editor-styles-wrapper) .wp-block-table th {
    background: var(--wp--preset--color--surface);
    color: var(--wp--preset--color--foreground);
    font-family: var(--wp--preset--font-family--headline);
}

:is(.pb-content, .editor-styles-wrapper) .wp-block-separator {
    border: 0;
    border-top: 1px solid currentColor;
    opacity: 1;
}

:is(.pb-content, .editor-styles-wrapper) img {
    height: auto;
    max-width: 100%;
}

/* Buttons: theme.json sets colors and type; this adds the theme's glow */
:is(.pb-content, .editor-styles-wrapper) .wp-element-button:hover {
    box-shadow: 0 0 15px rgba(0, 219, 233, 0.5);
}
