/* 執筆者ブロック（moriue-blog/writer）フロント表示スタイル
   見出しは記事の大見出し（「6.まとめ」など .content.single-post h2）と同じ階層に見せる:
   文字の大きさ・太さ・左のアイコン位置・緑の下線をそろえる。ただし同じ部品に見えないよう、
   アイコンは菱形でなく鉛筆、下線は二重線でなく一本線、右端に開閉バッジ（記事のアコーディオンと同じ濃い緑）を置く。
   開いた中身は記事のアコーディオンと同じ薄いグレーの角丸の箱。
   HTML の構造（h2.h2_writer.add_action ＋ writer_wrapper）は Astro の執筆者欄と同じ。
   functions.php でブロックがある投稿ページだけ条件読み込みする（フロント専用。エディタには読み込まない）。
   テーマの .content.single-post h2（0,2,1）と .single-post .content h2::before（0,2,2）に確実に勝つため、
   セレクタは .content .moriue_writer を起点にして詳細度を (0,4,1) 以上にしている。 */

.content .moriue_writer {
  margin: 3rem 0;
}

/* 見出し（開閉トリガー）。大きさ・太さは .content.single-post h2 と同じ */
.content .moriue_writer h2.h2_writer.add_action {
  position: relative;
  margin: 0;
  padding: 10px 0;
  font-size: clamp(1.2rem, 1.14rem + 0.3vw, 1.5rem);
  font-weight: 700;
  line-height: 1.5;
  color: #333;
  background: none;
  border: none;
  border-bottom: 2px solid rgba(108, 156, 35, 0.5);
  border-radius: 0;
  cursor: pointer;
}

/* テーマの見出し装飾（.single-post .content h2::before の菱形アイコン）を打ち消す */
.content .moriue_writer h2.h2_writer.add_action::before {
  display: none;
}

/* 見出しを包むボタン（script.js が作る）を横並びにし、鉛筆アイコン・文字・バッジを並べる */
.content .moriue_writer h2.h2_writer.add_action > .moriue-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

/* 鉛筆アイコン（大見出しの菱形と同じく文字の高さに合わせる） */
.content .moriue_writer h2.h2_writer.add_action > .moriue-toggle::before {
  content: "";
  flex-shrink: 0;
  width: 1.3em;
  height: 1.3em;
  background: url("../../img/writer/icon-writer.svg?v=2") center/contain no-repeat;
}

/* 右端のバッジ（記事のアコーディオンの「タップで開く ▼」と同じ色・形）。
   開閉状態は script.js が付ける aria-expanded で見分ける（文字は読み上げから外す） */
.content .moriue_writer h2.h2_writer.add_action > .moriue-toggle::after {
  content: "タップで開く ▼";
  content: "タップで開く ▼" / "";
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  background-color: #3f6b14;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
}

.content .moriue_writer h2.h2_writer.add_action > .moriue-toggle[aria-expanded="true"]::after {
  content: "閉じる ▲";
  content: "閉じる ▲" / "";
}

/* 開閉する中身（初期は閉じる。開閉は script.js が担当） */
.content .moriue_writer .item_content {
  display: none;
}

/* 中身（記事のアコーディオンと同じ薄いグレーの角丸の箱） */
.content .moriue_writer .writer_wrapper {
  margin: 1.5rem 0 0 0;
  padding: 1.5rem;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.content .moriue_writer .writer_block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.content .moriue_writer .writer_thumbnail {
  flex: 0 0 160px;
}

.content .moriue_writer .writer_thumbnail figure {
  margin: 0;
  padding: 0;
}

.content .moriue_writer .writer_thumbnail figure img {
  display: block;
  width: 160px;
  height: 160px;
  max-width: none;
  border-radius: 50%;
  margin: 0 auto;
  object-fit: cover;
  box-shadow: none;
}

.content .moriue_writer .writer_profile {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}

.content .moriue_writer .writer_profile p {
  margin: 0 0 1rem 0;
  line-height: 1.9;
}

.content .moriue_writer .writer_profile p.writer_subttl {
  font-weight: 700;
  border-bottom: 1px dashed #c9c9c9;
  padding: 0 0 10px 0;
  margin: 0 0 10px 0;
}

.content .moriue_writer .writer_description p:last-child {
  margin-bottom: 0;
}

@media screen and (max-width: 768px) {
  .content .moriue_writer .writer_wrapper {
    padding: 1.25rem 1rem;
  }

  .content .moriue_writer .writer_thumbnail {
    flex-basis: 100%;
  }

  .content .moriue_writer .writer_profile {
    flex-basis: 100%;
  }

  .content .moriue_writer .writer_profile p.writer_subttl {
    text-align: center;
  }
}
