/* =========================================================
   インタビュー企画【私のストーリー】記事用スタイル
   - プラグイン「私のストーリー ブロック」が公開画面と編集画面に読み込みます
   - パターン／ブロックスタイルを使ったブロックにだけ効きます
     （過去の記事の見た目は変わりません）
   ========================================================= */

/* ---------- 見出し番号（STORY 01, 02…）の起点 ---------- */
.article__text,
.editor-styles-wrapper {
    counter-reset: ms-sec;
}

/* ---------- 記事全体（ms-profile を含む記事だけ） ---------- */
.article__text:has(.ms-profile) {
    max-width: 760px;
    margin: 4rem auto 6rem;
    font-size: 16px;
    line-height: 2;
    color: #333;
}
.article__container:has(.ms-profile) .article__title {
    font-size: 26px;
    line-height: 1.6;
    max-width: 760px;
    margin: 2rem auto 0;
}
.article__container:has(.ms-profile) .article__flex {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
.article__text:has(.ms-profile) p {
    margin: 0 0 1.2em;
}

/* グループの内側コンテナ（クラシックテーマで自動付与）対策 */
:is(.article__text, .editor-styles-wrapper) .wp-block-group__inner-container > :last-child {
    margin-bottom: 0;
}

/* ---------- 冒頭リード ---------- */
.ms-lead {
    background: #fff7f7;
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 40px;
}
:is(.article__text, .editor-styles-wrapper) .ms-series {
    display: inline-block;
    background: #ED9093;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.6;
    letter-spacing: .05em;
    padding: 6px 20px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.ms-lead p:not(.ms-series) {
    font-size: 15px;
}

/* ---------- プロフィール ---------- */
.ms-profile:not(:has(> .wp-block-group__inner-container)),
.ms-profile > .wp-block-group__inner-container {
    display: grid;
    grid-template-columns: 220px 1fr;
    column-gap: 32px;
    align-content: center;
}
.ms-profile {
    border: 2px solid #f3d3d4;
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 24px;
}
.ms-profile .ms-profile-photo {
    grid-column: 1;
    grid-row: 1 / span 6;
    margin: 0 !important;
    align-self: center;
}
.ms-profile .ms-profile-photo img {
    width: 100%;
    height: auto;
    border-radius: 14px;
}
.ms-profile > p,
.ms-profile > .wp-block-group__inner-container > p {
    grid-column: 2;
}
:is(.article__text, .editor-styles-wrapper) .ms-profile-label {
    color: #d0646a;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: .2em;
    margin: 0 0 4px;
    align-self: end;
}
:is(.article__text, .editor-styles-wrapper) .ms-profile-name {
    font-size: 26px;
    font-weight: bold;
    line-height: 1.5;
    margin: 0 0 6px;
}
:is(.article__text, .editor-styles-wrapper) .ms-profile-role {
    font-size: 15px;
    font-weight: bold;
    line-height: 1.7;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e5c4c5;
    margin: 0 0 12px;
}
:is(.article__text, .editor-styles-wrapper) .ms-profile-meta {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin: 0;
}

/* ---------- 大見出し（旧：ピンクのベタ塗り） ---------- */
:is(.article__text, .editor-styles-wrapper) .is-style-ms-heading {
    counter-increment: ms-sec;
    font-size: 26px;
    font-weight: bold;
    line-height: 1.5;
    margin-top: 80px;
    margin-bottom: 32px;
    padding: 0 0 18px;
    position: relative;
    border-bottom: 1px solid #eee;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-heading::before {
    content: "STORY " counter(ms-sec, decimal-leading-zero);
    display: block;
    color: #ED9093;
    font-size: 13px;
    letter-spacing: .25em;
    margin-bottom: 4px;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 72px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ED9093, #ffdf44);
}

/* ---------- 小見出し ---------- */
:is(.article__text, .editor-styles-wrapper) .is-style-ms-sub {
    font-size: 19px;
    font-weight: bold;
    line-height: 1.7;
    margin-top: 48px;
    margin-bottom: 20px;
    padding: 2px 0 2px 16px;
    border-left: 5px solid #ED9093;
}

/* ---------- 印象的なひと言（引用） ---------- */
:is(.article__text, .editor-styles-wrapper) .is-style-ms-quote {
    position: relative;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.8;
    color: #c95960;
    background: #fff7f7;
    border-radius: 14px;
    padding: 22px 28px 22px 64px;
    margin-top: 28px;
    margin-bottom: 28px;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-quote::before {
    content: "\201C";
    position: absolute;
    left: 20px;
    top: 8px;
    font-family: Georgia, serif;
    font-size: 56px;
    line-height: 1;
    color: #ED9093;
}

/* ---------- 写真 ---------- */
:is(.article__text, .editor-styles-wrapper) .is-style-ms-photo {
    max-width: 420px;
    margin: 36px auto !important;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-photo-wide {
    margin-top: 36px !important;
    margin-bottom: 36px !important;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-photo img,
:is(.article__text, .editor-styles-wrapper) .is-style-ms-photo-wide img {
    width: 100%;
    height: auto;
    border-radius: 16px;
}

/* 写真を並べる（ギャラリー） */
:is(.article__text, .editor-styles-wrapper) .is-style-ms-gallery {
    margin-top: 36px !important;
    margin-bottom: 36px !important;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-gallery img {
    border-radius: 16px;
}

/* 写真のキャプション */
:is(.article__text, .editor-styles-wrapper) :is(.is-style-ms-photo, .is-style-ms-photo-wide, .is-style-ms-gallery) figcaption {
    font-size: 13px;
    line-height: 1.6;
    color: #777;
    text-align: center;
    margin: 10px 0 0;
}

/* ---------- 社外メンター ---------- */
.is-style-ms-mentor {
    background: #f1f9f7;
    border-radius: 20px;
    padding: 28px 32px;
    margin-top: 48px;
}
:is(.article__text, .editor-styles-wrapper) .ms-mentor-title {
    font-size: 18px;
    font-weight: bold;
    color: #3f8f7d;
    margin: 0 0 4px;
}
:is(.article__text, .editor-styles-wrapper) .ms-mentor-title::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8ccdbe;
    margin-right: 10px;
    vertical-align: 1px;
}
.is-style-ms-mentor p:not(.ms-mentor-title) {
    font-size: 14px;
    margin-bottom: 14px;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    margin: 0;
}
:is(.article__text, .editor-styles-wrapper) .is-style-ms-tags li {
    background: #fff;
    border: 1px solid #8ccdbe;
    color: #2f7666;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.6;
    padding: 6px 16px;
    border-radius: 999px;
}

/* ---------- 取材後記（本文と別扱い） ---------- */
.is-style-ms-afterword {
    position: relative;
    background: #fffdec;
    border: 1px solid #efe4b0;
    border-radius: 20px;
    padding: 44px 32px 28px;
    margin-top: 72px;
}
:is(.article__text, .editor-styles-wrapper) .ms-afterword-title {
    position: absolute;
    top: -17px;
    left: 28px;
    background: #333;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.6;
    letter-spacing: .15em;
    padding: 5px 20px;
    border-radius: 999px;
    margin: 0;
}
:is(.article__text, .editor-styles-wrapper) .ms-afterword-title::before {
    content: "\270E";
    margin-right: 8px;
    color: #ffdf44;
}
.is-style-ms-afterword p:not(.ms-afterword-title) {
    font-size: 15px;
    color: #555;
}
:is(.article__text, .editor-styles-wrapper) .ms-credit {
    text-align: right;
    font-size: 13px !important;
    color: #888 !important;
    margin: 8px 0 0 !important;
}

/* 編集画面では取材後記ラベルを枠線の上に置く（ブロックの入れ子で絶対配置がずれるため） */
.editor-styles-wrapper .ms-afterword-title {
    position: relative;
    top: auto;
    left: auto;
    display: inline-block;
    margin: -61px 0 20px -4px !important;
}

/* ---------- スマホ ---------- */
@media screen and (max-width: 960px) {
    .article__container:has(.ms-profile) .article__title {
        font-size: 20px;
    }
    :is(.article__text, .editor-styles-wrapper) .ms-series {
        font-size: 14px;
        padding: 6px 14px;
        border-radius: 14px;
        word-break: auto-phrase; /* 単語の途中で改行しない（対応ブラウザのみ） */
        text-wrap: balance;
    }
    .ms-lead,
    .ms-profile,
    .is-style-ms-mentor {
        padding: 22px 20px;
    }
    .ms-profile:not(:has(> .wp-block-group__inner-container)),
    .ms-profile > .wp-block-group__inner-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .ms-profile .ms-profile-photo {
        grid-row: auto;
        max-width: 200px;
        margin: 0 auto 16px !important;
    }
    .ms-profile > p,
    .ms-profile > .wp-block-group__inner-container > p {
        grid-column: 1;
    }
    :is(.article__text, .editor-styles-wrapper) .is-style-ms-heading {
        font-size: 22px;
        margin-top: 60px;
    }
    :is(.article__text, .editor-styles-wrapper) .is-style-ms-sub {
        font-size: 17px;
        margin-top: 36px;
    }
    :is(.article__text, .editor-styles-wrapper) .is-style-ms-quote {
        font-size: 16px;
        padding: 18px 20px 18px 52px;
    }
    :is(.article__text, .editor-styles-wrapper) .is-style-ms-quote::before {
        left: 14px;
        font-size: 48px;
    }
    .is-style-ms-afterword {
        padding: 38px 16px 20px;
    }
    :is(.article__text, .editor-styles-wrapper) .ms-afterword-title {
        left: 20px;
    }
}
