/* Success story detail: cover -> editorial text -> gallery -> video. */
.story-article { overflow: hidden; }
.story-article__shell { width: min(100%, 1120px); margin: 0 auto; }

.story-article__cover {
    width: min(100%, 1040px);
    margin: 0 auto clamp(30px, 4vw, 46px);
    overflow: hidden;
    border: 1px solid var(--mb-border);
    border-radius: 28px;
    background: var(--mb-surface);
    box-shadow: 0 18px 50px rgba(67, 45, 33, .10);
}
.story-article__cover img {
    display: block;
    width: 100%;
    max-height: 680px;
    object-fit: contain;
}

.story-article__intro,
.story-article__content,
.story-article__footer,
.story-gallery,
.story-video {
    width: min(100%, 900px);
    margin-left: auto;
    margin-right: auto;
}
.story-article__intro { margin-bottom: clamp(28px, 4vw, 42px); }
.story-article__meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--mb-brown);
    font-size: 14px;
    font-weight: 700;
}
.story-article__meta::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--mb-red);
    border-radius: 999px;
}
.story-article__lead {
    max-width: 860px;
    margin: 0;
    color: var(--mb-heading);
    font-size: clamp(19px, 2vw, 25px);
    font-weight: 600;
    line-height: 1.55;
}

.story-article__content {
    color: var(--mb-ink);
    font-size: 17px;
    line-height: 1.8;
}
.story-article__content::after { content: ""; display: table; clear: both; }
.story-article__content > :first-child { margin-top: 0; }
.story-article__content h2,
.story-article__content h3,
.story-article__content h4 { color: var(--mb-heading); line-height: 1.3; clear: both; }
.story-article__content p,
.story-article__content ul,
.story-article__content ol,
.story-article__content blockquote,
.story-article__content table,
.story-article__content figure { margin-top: 0; margin-bottom: 1.45em; }

/* Normal CKEditor images stay centered. */
.story-article__content figure.image {
    max-width: 100%;
    margin: 30px auto;
    text-align: center;
}
.story-article__content figure.image img,
.story-article__content > img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 18px;
}
.story-article__content figure.image figcaption {
    margin-top: 8px;
    color: var(--mb-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* CKEditor alignment styles become editorial pull-images with text wrapping. */
.story-article__content figure.image.image-style-side,
.story-article__content figure.image.image-style-align-right {
    float: right;
    width: min(42%, 360px);
    margin: 8px 0 22px 34px;
}
.story-article__content figure.image.image-style-align-left {
    float: left;
    width: min(42%, 360px);
    margin: 8px 34px 22px 0;
}
.story-article__content figure.image.image-style-block-align-left {
    margin-left: 0;
    margin-right: auto;
}
.story-article__content figure.image.image-style-block-align-right {
    margin-left: auto;
    margin-right: 0;
}

/* Any videos authored in CKEditor are removed from this flow by the template filter. */
.story-article__content .raw-html-embed:empty,
.story-article__content figure.media:empty,
.story-article__content .media:empty { display: none; }

.story-gallery,
.story-video {
    margin-top: clamp(46px, 7vw, 78px);
    padding-top: clamp(30px, 4vw, 42px);
    border-top: 1px solid var(--mb-border);
}
.story-gallery__heading,
.story-video__heading { margin-bottom: 24px; }
.story-gallery__eyebrow,
.story-video__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--mb-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.story-gallery__heading h2,
.story-video__heading h2 {
    margin: 0;
    color: var(--mb-heading);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.story-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.story-gallery__item {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--mb-border);
    border-radius: 20px;
    background: var(--mb-surface);
    box-shadow: 0 10px 30px rgba(67, 45, 33, .08);
}
.story-gallery__item a { display: block; overflow: hidden; background: #f6f2ee; }
.story-gallery__item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .25s ease;
}
.story-gallery__item a:hover img { transform: scale(1.025); }
.story-gallery__item figcaption {
    padding: 12px 14px 14px;
    color: var(--mb-muted);
    font-size: 13px;
    line-height: 1.5;
}

.story-video__items { display: grid; gap: 24px; }
.story-video__items video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 640px;
    margin: 0;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #151311;
    border: 1px solid rgba(98, 59, 42, .18);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(31, 24, 20, .14);
}

.story-article__footer {
    margin-top: clamp(42px, 6vw, 72px);
    padding-top: 28px;
    border-top: 1px solid var(--mb-border);
}

@media (max-width: 767.98px) {
    .story-article__cover { margin-bottom: 30px; border-radius: 20px; }
    .story-article__lead { font-size: 18px; }
    .story-article__content { font-size: 16px; line-height: 1.72; }
    .story-article__content figure.image.image-style-side,
    .story-article__content figure.image.image-style-align-right,
    .story-article__content figure.image.image-style-align-left {
        float: none;
        width: 100%;
        margin: 26px auto;
    }
    .story-gallery__grid { grid-template-columns: 1fr; gap: 14px; }
    .story-video__items video { border-radius: 16px; }
}
