/**
 * WordPress content interpreter
 *
 * Migrated Gutenberg posts (from the previous site) ship block markup
 * without wp-block-library. Recent posts are usually custom HTML with
 * inline styles and should keep that freedom.
 *
 * Rules here:
 * - Only target Gutenberg / Elementor classes inside .post-content
 * - Prefer author inline styles (no !important except mobile stack)
 * - Force a sane image/layout baseline so 200px media-text icons
 *   cannot stretch to the full article width
 */

.post-content {
    --wp--preset--color--black: #000;
    --wp--preset--color--cyan-bluish-gray: #abb8c3;
    --wp--preset--color--white: #fff;
    --wp--preset--color--pale-pink: #f78da7;
    --wp--preset--color--vivid-red: #cf2e2e;
    --wp--preset--color--luminous-vivid-orange: #ff6900;
    --wp--preset--color--luminous-vivid-amber: #fcb900;
    --wp--preset--color--light-green-cyan: #7bdcb5;
    --wp--preset--color--vivid-green-cyan: #00d084;
    --wp--preset--color--pale-cyan-blue: #8ed1fc;
    --wp--preset--color--vivid-cyan-blue: #0693e3;
    --wp--preset--color--vivid-purple: #9b51e0;
    --wp--preset--font-size--small: 0.875rem;
    --wp--preset--font-size--medium: 1.25rem;
    --wp--preset--font-size--large: 2rem;
    --wp--preset--font-size--x-large: 2.625rem;
}

/* ------------------------------------------------------------------ */
/* Images — never blow past the column; honor block size classes      */
/* ------------------------------------------------------------------ */

.post-content img {
    max-width: 100%;
    height: auto;
}

.post-content figure {
    max-width: 100%;
}

.post-content figure img {
    width: auto;
    max-width: 100%;
    height: auto;
}

.post-content .wp-block-image {
    margin: 1.5rem 0;
}

.post-content .wp-block-image img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0;
}

.post-content .wp-block-image.size-large img,
.post-content .wp-block-image.size-full img,
.post-content .wp-block-image.alignwide img,
.post-content .wp-block-image.alignfull img {
    width: 100%;
}

.post-content .wp-block-image.size-medium img {
    max-width: min(100%, 300px);
}

.post-content .wp-block-image.size-thumbnail img {
    max-width: min(100%, 150px);
}

.post-content .wp-block-image.aligncenter,
.post-content figure.aligncenter {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.post-content .wp-block-image.aligncenter img,
.post-content figure.aligncenter img {
    margin-left: auto;
    margin-right: auto;
}

.post-content .alignfull {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.post-content img.emoji {
    width: 1.15em;
    height: 1.15em;
    margin: 0 0.1em;
    vertical-align: -0.15em;
    border-radius: 0;
    display: inline;
}

/* ------------------------------------------------------------------ */
/* Media & Text — the block that breaks hardest without Gutenberg CSS */
/* ------------------------------------------------------------------ */

.post-content .wp-block-media-text {
    display: grid;
    grid-template-columns: 50% 1fr;
    grid-template-rows: auto;
    align-items: stretch;
    box-sizing: border-box;
    margin: 1.5rem 0;
    overflow: hidden;
}

.post-content .wp-block-media-text.has-background:not([style*="border-radius"]) {
    border-radius: 12px;
}

.post-content .wp-block-media-text__media {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    min-width: 0;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-content .wp-block-media-text__content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 1.25rem 8%;
    word-break: break-word;
}

.post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media {
    grid-column: 2;
}

.post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
    grid-column: 1;
}

.post-content .wp-block-media-text.is-vertically-aligned-top {
    align-items: start;
}

.post-content .wp-block-media-text.is-vertically-aligned-center {
    align-items: center;
}

.post-content .wp-block-media-text.is-vertically-aligned-bottom {
    align-items: end;
}

.post-content .wp-block-media-text__media img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    object-fit: contain;
}

@media (max-width: 600px) {
    .post-content .wp-block-media-text.is-stacked-on-mobile {
        grid-template-columns: 100% !important;
    }

    .post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media,
    .post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
        grid-column: 1;
        grid-row: auto;
    }

    .post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media {
        grid-row: 1;
    }

    .post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
        grid-row: 2;
        padding: 1.1rem 1.25rem 1.25rem;
    }
}

/* ------------------------------------------------------------------ */
/* Columns, groups, flex layouts                                      */
/* ------------------------------------------------------------------ */

.post-content .wp-block-columns {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: stretch;
    box-sizing: border-box;
    margin: 1.5rem 0;
}

.post-content .wp-block-column {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
}

.post-content .wp-block-column.has-background {
    padding: 0.75rem 0.5rem 1.25rem;
    overflow: hidden;
}

@media (max-width: 781px) {
    .post-content .wp-block-columns:not(.is-not-stacked-on-mobile) {
        flex-direction: column;
    }
}

.post-content .is-layout-flex {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.post-content .is-nowrap {
    flex-wrap: nowrap;
}

.post-content .is-layout-constrained > * {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.post-content .wp-block-group {
    box-sizing: border-box;
}

.post-content .wp-block-spacer {
    clear: both;
}

/* ------------------------------------------------------------------ */
/* Buttons, embeds, tables, quotes                                    */
/* ------------------------------------------------------------------ */

.post-content .wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1.25rem 0;
}

.post-content .wp-block-buttons.is-content-justification-center {
    justify-content: center;
}

.post-content .wp-block-buttons.is-content-justification-right {
    justify-content: flex-end;
}

.post-content .wp-block-button__link {
    display: inline-block;
    padding: 0.75rem 1.4rem;
    border-radius: 6px;
    background: var(--tj-color-theme-primary, #006eb9);
    color: #fff;
    text-decoration: none;
    line-height: 1.3;
}

.post-content .wp-block-button__link:hover {
    text-decoration: none;
    filter: brightness(1.06);
}

.post-content .wp-block-embed,
.post-content .wp-block-video {
    margin: 1.5rem 0;
}

.post-content .wp-block-embed iframe,
.post-content .wp-block-embed video,
.post-content .wp-block-video video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}

.post-content .wp-block-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.post-content .wp-block-table th,
.post-content .wp-block-table td {
    border: 1px solid #e5e5e5;
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.post-content .wp-block-quote {
    margin: 1.6rem 0;
}

/* ------------------------------------------------------------------ */
/* Alignment + Gutenberg color / type presets                         */
/* ------------------------------------------------------------------ */

.post-content .has-text-align-center {
    text-align: center;
}

.post-content .has-text-align-left {
    text-align: left;
}

.post-content .has-text-align-right {
    text-align: right;
}

.post-content .has-small-font-size {
    font-size: var(--wp--preset--font-size--small);
}

.post-content .has-medium-font-size {
    font-size: var(--wp--preset--font-size--medium);
}

.post-content .has-large-font-size {
    font-size: var(--wp--preset--font-size--large);
}

.post-content .has-x-large-font-size {
    font-size: var(--wp--preset--font-size--x-large);
}

.post-content .has-black-color {
    color: var(--wp--preset--color--black);
}

.post-content .has-white-color {
    color: var(--wp--preset--color--white);
}

.post-content .has-cyan-bluish-gray-color {
    color: var(--wp--preset--color--cyan-bluish-gray);
}

.post-content .has-pale-pink-color {
    color: var(--wp--preset--color--pale-pink);
}

.post-content .has-vivid-red-color {
    color: var(--wp--preset--color--vivid-red);
}

.post-content .has-luminous-vivid-orange-color {
    color: var(--wp--preset--color--luminous-vivid-orange);
}

.post-content .has-luminous-vivid-amber-color {
    color: var(--wp--preset--color--luminous-vivid-amber);
}

.post-content .has-light-green-cyan-color {
    color: var(--wp--preset--color--light-green-cyan);
}

.post-content .has-vivid-green-cyan-color {
    color: var(--wp--preset--color--vivid-green-cyan);
}

.post-content .has-pale-cyan-blue-color {
    color: var(--wp--preset--color--pale-cyan-blue);
}

.post-content .has-vivid-cyan-blue-color {
    color: var(--wp--preset--color--vivid-cyan-blue);
}

.post-content .has-vivid-purple-color {
    color: var(--wp--preset--color--vivid-purple);
}

.post-content .has-black-background-color {
    background-color: var(--wp--preset--color--black);
}

.post-content .has-white-background-color {
    background-color: var(--wp--preset--color--white);
}

.post-content .has-cyan-bluish-gray-background-color {
    background-color: var(--wp--preset--color--cyan-bluish-gray);
}

.post-content .has-pale-pink-background-color {
    background-color: var(--wp--preset--color--pale-pink);
}

.post-content .has-vivid-red-background-color {
    background-color: var(--wp--preset--color--vivid-red);
}

.post-content .has-luminous-vivid-orange-background-color {
    background-color: var(--wp--preset--color--luminous-vivid-orange);
}

.post-content .has-luminous-vivid-amber-background-color {
    background-color: var(--wp--preset--color--luminous-vivid-amber);
}

.post-content .has-light-green-cyan-background-color {
    background-color: var(--wp--preset--color--light-green-cyan);
}

.post-content .has-vivid-green-cyan-background-color {
    background-color: var(--wp--preset--color--vivid-green-cyan);
}

.post-content .has-pale-cyan-blue-background-color {
    background-color: var(--wp--preset--color--pale-cyan-blue);
}

.post-content .has-vivid-cyan-blue-background-color {
    background-color: var(--wp--preset--color--vivid-cyan-blue);
}

.post-content .has-vivid-purple-background-color {
    background-color: var(--wp--preset--color--vivid-purple);
}

.post-content .has-link-color a {
    color: inherit;
}
