/* ============================================================
   familign. blog-post.css
   - ブログ記事詳細ページ（/blog/[slug]/）固有のスタイル
   - common.css（フォント・変数・リセット・背景・ヘッダー・
     ドロワー・フッター等）を先に読み込んでからこのファイルを読み込む

   もくじ（.toc）／吹き出し（.speech-bubble）／記事本文のh2・h3／
   リスト＋ボックス（.box-list）は、制作実績の詳細ページでも
   同じ見た目を使う想定の「テンプレパーツ」。汎用クラス名にして
   あるので、Astro化する際はそれぞれ TableOfContents.astro /
   SpeechBubble.astro / BoxList.astro 等の単体コンポーネントに
   切り出し、本文（h2・h3）はArticleBody.astro側で<slot>を
   ラップする形にすると共有しやすい
   ============================================================ */

/* ============================================================
   Page Title（見出し部分）
   一覧ページ（.page-title）の画像・ラベル・「ブログ」見出しを
   そのまま流用（上書きなし）。実際の記事タイトルは直後の
   .article-titleセクション側でh1として表示する
   ============================================================ */

   .bg__object--asanoha-2{
    display: none;
   }

   @media (max-width: 48em) {
        .bg__object--asanoha-1 {
            display: none;
        }
        .bg__object--shibori-1 {
                    display: none;
        }
    }

/* ============================================================
   Article（記事全体のラッパー・コンテンツ幅）
   .article-title〜.article-bodyをまとめて囲む<article>。
   コンテンツ幅（620px・中央寄せ）はここで一括設定し、タイトル・メタ・
   アイキャッチ・吹き出し・本文はすべて.articleの幅に合わせて表示される。
   今後記事部分に白背景を敷きたくなった場合もこの要素に対して
   background等を追加すればよい

   .article-nav（前後記事リンク）だけは.articleの外側（記事本体とは別の
   セクション）に置きたいため<article>には含めないが、コンテンツ幅は
   .articleと揃えたいので、.article-nav__innerにも同じ幅指定を併記する */
.article,
.article-nav__inner {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
}

/* SPでは画面幅いっぱいに広がらないよう、他の[class$="__inner"]と同じ
   92.5%幅にして左右の余白（パディング代わりの見た目）を確保する */
@media (max-width: 48em) {
    .article,
    .article-nav__inner {
        width: 92.5%;
    }
}

/* タイトル・メタ・アイキャッチ・吹き出し・本文は.article幅いっぱいに
   広げる（.articleがすでに620px幅で中央寄せ済みのため） */
.article-title__inner,
.article-meta__inner,
.article-body__inner {
    width: 100%;
}

/* ============================================================
   Article Title（記事タイトル）
   ============================================================ */
.article-title__heading {
    position: relative;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2.4rem, 2rem + 1.5vw, 3.2rem);
    line-height: 1.6;
}

.article-title__heading::first-letter {
    color: var(--color-primary);
}

.main--lower section + section,
.main--lower article + section{
    margin-top: .8em;
}

/* ============================================================
   Article Meta（更新日・投稿日）
   ============================================================ */
.article-meta__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .4em 2em;
    font-size: .9em;
    color: var(--color-text-sub);
}

/* page-title直後の余白は共通ルール（.main--lower .page-title + section）に任せ、
   本文側の記事メタ→アイキャッチの間隔だけ詰める */
.article-meta + .article-eyecatch {
    margin-top: clamp(1.6rem, 1.2rem + 1vw, 2.4rem);
    margin-bottom: 3em;
}

.article-eyecatch{
    display: flex;
    flex-direction: column;
    gap: 2em;
}

/* ============================================================
   Article Eyecatch（アイキャッチ画像）
   ============================================================ */
/* 幅は親の.articleにまかせ（js-reveal付きで[class$="__inner"]に
   マッチしない点は変わらないが、.articleが幅を持つので個別指定は不要）、
   ここでは見た目（縁取り）だけ指定する */
.article-eyecatch__inner {
    overflow: hidden;
    border: .6rem solid #fff;
}

/* .article-intro__inner も同様に、幅は親の.articleにまかせる */
.article-intro{
    margin-bottom: 2em;
}

/* ============================================================
   Article Body（記事本文）
   ============================================================ */
.article-body p {
    margin-block: 1.6em;
}

/* 段落単独で置かれたリンク（<p>の中身がリンクのみ）は、文中リンクと
   区別してservice-block__works-more-link（service.css）と同じ
   ゴールドボタンデザインで表示する。works記事のarticle-bodyにも
   このファイルが読み込まれているため、blog・works両方に適用される */
.article-body p > .link {
    position: relative;
    display: block;
    width: 70%;
    min-width: 250px;
    padding: .9em 2.4em .9em 1.6em;
    margin: auto;
    background-color: var(--color-accent);
    font-weight: 700;
    color: var(--color-white);
    text-align: center;
    line-height: 1.5;
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease, opacity 0.3s ease;
    text-shadow: none;
    text-decoration: none;
}

.article-body p > .link:hover {
    background-color: var(--color-accent-dark);
    opacity: 1;
    text-decoration: none;
}

.article-body p > .link::before {
    content: "";
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 1.2rem 1.2rem;
    border-color: rgba(0,0,0,0) rgba(0,0,0,0) #fff rgba(0,0,0,0);
}

.article-body p > a{
    text-decoration: underline;
}
.article-body p > a:hover{
    text-decoration: none;
}


/* ============================================================
   Speech Bubble（吹き出し）※テンプレパーツ
   アバター＋吹き出し本文。もくじ・h2・h3等と同様、記事内で
   繰り返し使うことを想定した汎用パーツ
   ============================================================ */
.speech-bubble {
    display: flex;
    align-items: flex-start;
    gap: 1.2em;
}

.speech-bubble__avatar {
    flex: 0 0 auto;
    width: clamp(5.6rem, 4.8rem + 2vw, 7.2rem);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 2px solid var(--color-accent-circle);
    border-radius: 50%;
}

.speech-bubble__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.speech-bubble__body {
    position: relative;
    flex: 1;
    padding: 1.2em 1.6em;
    background-color: rgba(255,255,255,.9);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-m);
}

/* 吹き出しの三角（アバター側を向く） */
.speech-bubble__body::before {
    content: "";
    position: absolute;
    top: 1.5em;
    left: -0.8em;
    border: 0.5em solid transparent;
    border-right-color: var(--color-white);
}

p.speech-bubble__text {
    margin-block: 0;
    font-size: .9em;
    line-height: 1.9;
}

@media (max-width: 48em) {
    .speech-bubble {
        gap: .8em;
    }
    .speech-bubble__body {
        padding: 1em 1.2em;
    }
}

/* ============================================================
   TOC（もくじ）※テンプレパーツ
   ============================================================ */
.toc {
    margin-block: 2.8em;
    padding: 1.8em 2.2em;
    background-color: rgba(255,255,255,.8);
    border: 1px solid var(--color-line);
    text-shadow: none;
}

p.toc__title {
    margin-top: 0;
    margin-bottom: .8em;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.15em;
    color: var(--color-text);
}
.toc__title::first-letter{
    color: var(--color-primary);
}

.toc__list {
    counter-reset: toc;
    display: flex;
    flex-direction: column;
    gap: .7em;
}

.toc__item {
    counter-increment: toc;
    position: relative;
    padding-left: 2.8em;
    font-size: .9em;
    line-height: 1.6;
}

.toc__item::before {
    content: counter(toc, decimal-leading-zero) " ｜";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-family: var(--font-serif);
    font-weight: 500;
}

.toc__item a:hover {
    text-decoration: underline;
}

.toc__sublist {
    margin-top: .6em;
    display: flex;
    flex-direction: column;
    gap: .4em;
}

.toc__subitem {
    position: relative;
    padding-left: 1.4em;
    font-size: .85em;
    color: var(--color-text-sub);
}

.toc__subitem::before {
    content: "−";
    color: var(--color-primary);
    position: absolute;
    left: 0;
}

/* ============================================================
   記事本文の見出し（h2 / h3）※テンプレパーツ
   h2は他ページの見出し（about.css の.craft__title等）と同じ
   デザイン：中央揃え・明朝体・上下にドットライン・一文字目のみ
   .title-accentで着色
   ============================================================ */
.article-body h2 {
    position: relative;
    margin-top: 2.8em;
    margin-bottom: 1.2em;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2.2rem, 1.9rem + 1vw, 2.8rem);
    text-align: center;
}

.article-body h2::before,
.article-body h2::after {
    content: "";
    display: block;
    width: clamp(4rem, 3rem + 3vw, 6rem);
    height: 0.3rem;
    margin: 0 auto;
    background-image: radial-gradient(circle, var(--color-primary) 32%, rgba(0, 0, 0, 0) 33%);
    background-size: 0.7rem 0.7rem;
    background-position: center;
    background-repeat: repeat-x;
}

.article-body h2::before {
    margin-bottom: 0.5em;
}

.article-body h2::after {
    margin-top: 0.5em;
}

.title-accent {
    font-style: normal;
    color: var(--color-primary);
}

.article-body h3 {
    margin-block: 1.8em 1.2em;
    padding: .3em .8em;
    border-left: 4px dotted var(--color-primary);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.1em;
    line-height: 1.75;
}

@media (max-width: 499px) {
    .article-body h2 {
        font-size: 6.6vw;
    }
}

@media (min-width: 500px) and (max-width: 48em) {
    .article-body h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 48em) {
    .article-body h3 {
        padding: .9em 1.1em;
    }
}

/* ============================================================
   Box List（リスト＋ボックス）※テンプレパーツ
   ============================================================ */
.box-list {
    margin-block: 1.8em;
    padding: 1.4em 2em;
    background-color: rgba(255,255,255,.8);
    border: 1px solid var(--color-line);
}

.box-list__item {
    position: relative;
    padding-left: 1.4em;
    font-size: .95em;
    line-height: 1.9;
}

.box-list__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: .85em;
    width: .5em;
    height: .5em;
    border-radius: 50%;
    background-color: var(--color-primary);
}

/* ============================================================
   Article Nav（前の記事・次の記事）
   ============================================================ */
.main--lower section + section.article-nav,
.main--lower article + section.article-nav{
    margin-top: 4em;
}

.article-nav__inner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.6em 2em;
    padding-block: 1em;
    border-top: 1px solid var(--color-white);
    border-bottom: 1px solid var(--color-white);
}

/* 中央の縦のドット線。他の見出し装飾（about.css/service.cssのタイトル上下線）と
   同じradial-gradientのドットを、縦方向（repeat-y）に並べて描く */
.article-nav__inner::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    bottom: 1.5rem;
    left: 50%;
    width: 0.6rem;
    transform: translateX(-50%);
    background-image: radial-gradient(circle, var(--color-white) 32%, transparent 33%);
    background-size: 0.6rem 0.6rem;
    background-repeat: repeat-y;
    background-position: center;
}

/* 最新記事など「次の記事」がない場合。リンクが1つだけになるので
   中央のドット線（::before）は不要 */
.article-nav__inner--no-next::before {
    content: none;
}

.article-nav__link {
    display: flex;
    align-items: center;
    gap: .5em;
    max-width: 45%;
}

.article-nav__link--next {
    margin-left: auto;
    text-align: right;
}

.article-nav__text {
    display: flex;
    flex-direction: column;
    gap: .4em;
    font-size: .9em;
}

.article-nav__direction {
    font-size: .8em;
    color: var(--color-text-sub);
}

.article-nav__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    font-size: .9em;
    font-weight: 500;
    line-height: 1.75;
}

/* 矢印（CSS実装）：正方形の右下2辺だけを枠線にして45度回転させ、
   V字＝シェブロンを作る（qa.cssの.faq__question-icon::beforeと同じ考え方） */
.article-nav__arrow {
    position: relative;
    flex: 0 0 auto;
    width: 3.3em;
    height: 3.3em;
    transition: transform .3s ease;
}

.article-nav__link--prev:hover .article-nav__arrow {
    transform: translateX(-0.4em);
}

.article-nav__link--next:hover .article-nav__arrow {
    transform: translateX(0.4em);
}

.article-nav__arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.35em;
    height: 1.35em;
    border-right: 1px solid var(--color-primary);
    border-bottom: 1px solid var(--color-primary);
}

.article-nav__link--prev .article-nav__arrow::before {
    transform: translate(-30%, -50%) rotate(135deg);
}

.article-nav__link--next .article-nav__arrow::before {
    transform: translate(-70%, -50%) rotate(-45deg);
}

@media (max-width: 48em) {
    .article-nav__title{
        font-size: 1em;
    }
    .article-nav__inner {
        flex-wrap: nowrap;
        gap: 1em;
    }
    .article-nav__link {
        max-width: 47%;
        min-width: 0;
        gap: .3em;
    }
    .article-nav__link--next {
        margin-left: auto;
    }
    .article-nav__text {
        min-width: 0;
        gap: .3em;
        font-size: .8em;
    }
    .article-nav__arrow {
        width: 2.7em;
        height: 2.7em;
    }
}

/* CTA直前セクションの余白調整（works.css等と同じ考え方） */
.main section + .cta {
    margin-top: -3em;
}

@media (max-width: 48em) {
    .main section + .cta {
        margin-top: -8em;
    }
}
