/* Shared article pattern styles for the editor canvas and published posts. */
.byst-article-pattern {
    color: #3f3532;
    font-family: var(--byst-sans, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.95;
    margin-block: 28px;
}

.byst-article-pattern > :first-child {
    margin-top: 0;
}

.byst-article-pattern > :last-child {
    margin-bottom: 0;
}

.byst-article-pattern .wp-block-heading {
    color: #211c1b;
    font-weight: 900;
    line-height: 1.45;
}

.byst-article-pattern h2.wp-block-heading {
    padding-bottom: 12px;
    border-bottom: 3px solid #f5dbe1;
    font-size: clamp(25px, 3vw, 32px);
}

.byst-article-pattern.wp-block-group > h2.wp-block-heading {
    margin: 0 0 18px;
}

.byst-article-intro .byst-article-intro__lead {
    color: #211c1b;
    font-weight: 700;
}

.byst-pattern-menu {
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid #f0d5de;
    border-left: 4px solid var(--byst-pink, #e86f86);
    border-radius: 18px;
    background: #fff8fa;
}

.byst-pattern-menu > .byst-article-callout__title {
    margin: 0 0 16px;
    color: #a8385c;
    font-weight: 900;
    line-height: 1.6;
}

.byst-article-pattern.byst-pattern-menu p.byst-article-menu__note {
    margin-bottom: 0;
    font-size: 14px;
}

.byst-article-gallery.wp-block-gallery.has-nested-images {
    --wp--style--unstable-gallery-gap: 16px;
    gap: 16px;
    margin-block: 24px;
}

.byst-article-gallery.wp-block-gallery.has-nested-images figure.wp-block-image {
    margin-block: 0;
}

.byst-article-gallery.wp-block-gallery.has-nested-images figure.wp-block-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.byst-article-contact-buttons {
    gap: 12px;
}

.byst-article-contact-button .wp-block-button__link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 14px 24px;
    border: 1px solid #b73c61;
    border-radius: 999px;
    background: #b73c61;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
}

/* Override the article body's general pink link color on the contact button. */
.byst-article-page .byst-article-content .byst-article-contact-button .wp-block-button__link {
    color: #fff;
    text-decoration: none;
}

.byst-article-contact-button .wp-block-button__link:hover {
    background: #a8385c;
    border-color: #a8385c;
}

.byst-article-contact-button .wp-block-button__link:focus-visible {
    outline: 3px solid #a8385c;
    outline-offset: 4px;
}

@media (max-width: 600px) {
    /* Core gallery calculates a desktop width for each image; stack on mobile. */
    .byst-article-gallery.wp-block-gallery.has-nested-images figure.wp-block-image {
        width: 100% !important;
        flex-basis: 100% !important;
    }

    .byst-article-contact-buttons,
    .byst-article-contact-button {
        width: 100%;
    }

    .byst-article-contact-button .wp-block-button__link {
        box-sizing: border-box;
        width: 100%;
    }
}

/* Shared logo directory: linked brand marks with an optional mobile expansion. */
.byst-logo-directory {
    margin-block: 28px;
}
.byst-logo-directory .byst-logo-directory__grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 16px 10px;
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}
.byst-logo-directory .byst-logo-directory__grid > li {
    min-width: 0;
    margin: 0;
    padding: 0;
}
.byst-logo-directory .byst-logo-directory__grid a {
    display: flex;
    flex-direction: column;
    gap: 7px;
    height: 100%;
    color: #211c1b;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.byst-logo-directory .byst-logo-directory__grid img {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    border: 1px solid #f0d5de;
    border-radius: 8px;
    background: #fff;
}
.byst-logo-directory__grid a:hover img {
    border-color: var(--byst-pink, #e86f86);
}
.byst-logo-directory__grid a:focus-visible {
    outline: 3px solid #a8385c;
    outline-offset: 3px;
    border-radius: 8px;
}
.byst-logo-directory__toggle,
.byst-logo-directory__expand {
    display: none;
}
@media (max-width: 767px) {
    .byst-logo-directory .byst-logo-directory__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px 7px;
    }
    .byst-logo-directory .byst-logo-directory__grid a {
        font-size: 11px;
    }
    .byst-logo-directory__toggle {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
    .byst-logo-directory__toggle:not(:checked) ~ .byst-logo-directory__grid > li:nth-child(n+16) {
        display: none;
    }
    .byst-logo-directory__expand {
        display: block;
        width: fit-content;
        margin: 22px auto 0;
        padding: 10px 22px;
        border: 1px solid #f0d5de;
        border-radius: 999px;
        font-weight: 800;
        line-height: 1.5;
        text-align: center;
        cursor: pointer;
        background: #fff;
    }
    .byst-logo-directory__toggle:focus-visible ~ .byst-logo-directory__expand {
        outline: 3px solid #a8385c;
        outline-offset: 3px;
    }
    .byst-logo-directory__toggle:not(:checked) ~ .byst-logo-directory__expand .byst-logo-directory__hide,
    .byst-logo-directory__toggle:checked ~ .byst-logo-directory__expand .byst-logo-directory__show {
        display: none;
    }
}

/* Native-block roundup titles share the listing-name and reading treatment. */
.byst-guide-page .byst-guide-content .byst-roundup-item h3.byst-roundup-item__title {
    margin: 0 0 12px;
    font-size: calc(var(--wp--preset--font-size--large, 24px) + 5px);
    font-weight: 700;
    line-height: 1.2;
}
.byst-roundup-item__title .byst-roundup-item__reading {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}
.byst-roundup-item__title .byst-roundup-item__name {
    display: block;
}

/* Reusable roundup brand header; logos retain their original proportions. */
.byst-guide-page .byst-roundup-item__brand-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    grid-template-areas: "name logo";
    align-items: start;
    gap: 18px;
    margin-bottom: 14px;
}
.byst-guide-page .byst-guide-content .byst-roundup-item__brand-header > h3.byst-roundup-item__title {
    grid-area: name;
    min-width: 0;
    margin: 0;
}
.byst-guide-page .byst-roundup-item__brand-header > .byst-roundup-item__logo {
    grid-area: logo;
    width: 200px;
    height: 90px;
    margin: 0;
}
.byst-guide-page .byst-roundup-item__logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}
@media (max-width: 767px) {
    .byst-guide-page .byst-roundup-item__brand-header {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "logo" "name";
        gap: 14px;
    }
    .byst-guide-page .byst-roundup-item__brand-header > .byst-roundup-item__logo {
        width: min(220px, 100%);
        height: 80px;
    }
}

/* The common TOC card supplies its own inset; do not add prose-heading spacing. */
.byst-guide-page .byst-guide-content .byst-roundup-toc > .byst-roundup-toc__title {
    margin-top: 0;
}
