/* =========================================================
   カスタムブロック: 監修者・執筆者カード (careritz/author-card)
   フロント・エディタ共通スタイル

   記事下の「この記事を書いた人」(.p_single_article-footer_profile) と
   同じ見た目を、記事本文中に自由に置けるようにしたもの。
   単独で完結させたいので既存クラスは使わず c-author-card__* で組み直す。

   ※ 本文(.p_single_content)内では app.css が p / h2 / h3 を詳細度 (0,1,1)
     でスタイルしている（例: .p_single_content p{font-size:1rem;line-height:1.8}、
     h2 はオレンジ帯）。そのため当ブロックは column-card と同じく
     「ルートクラス + 要素クラス」= 詳細度 (0,2,0) で書いて明示的に上書きする。
     見出しも h2/h3 を避けて div/span で組む（本文の見出し装飾と
     アウトラインの両方を汚さないため）。
   ========================================================= */

.c-author-card {
  margin-top: 40px;
}

/* ---- 見出し（Author / この記事を書いた人）----
   app.css の .p_single_aside_heading と同じ見た目 */
.c-author-card .c-author-card__heading {
  margin: 0 0 20px;
  padding: 0 0 0 1rem;
  border-left: 0.5rem solid var(--color-accent);
  font-weight: 700;
}

.c-author-card .c-author-card__heading-en {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-accent);
}

.c-author-card .c-author-card__heading-ja {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text-default);
}

/* ---- カード本体 ---- */
.c-author-card .c-author-card__inner {
  padding: 25px;
  border: 1px solid var(--color-gray);
  border-radius: 10px;
  background: var(--color-white);
}

/* アバター＋名前＋肩書きの上段 */
.c-author-card .c-author-card__head {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 40px;
}

.c-author-card .c-author-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #cde2fb;
}

.c-author-card .c-author-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
}

/* 画像未設定時のデフォルトアイコン */
.c-author-card .c-author-card__avatar-default {
  width: 58%;
  height: 58%;
}

.c-author-card .c-author-card__name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text-default);
}

/* 名前の下の小さいグレー行（資格等） */
.c-author-card .c-author-card__role {
  margin: 8px 0 0;
  font-size: var(--font-size-xs);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-gray);
}

/* 紹介文とリンクの下段。カードの padding に対してさらに一段内側に寄せる */
.c-author-card .c-author-card__body {
  margin-top: 20px;
  padding-inline: 20px;
}

.c-author-card .c-author-card__description {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.875; /* 30px */
  color: var(--color-text-default);
}

/* 紹介文の直後に、同じ行送りのまま続く想定なので margin は付けない */
.c-author-card .c-author-card__link {
  display: inline-block;
  font-size: 16px;
  line-height: 1.875;
  color: var(--color-text-link);
  text-decoration: underline;
}

.c-author-card .c-author-card__link:hover {
  text-decoration: none;
}

@media (max-width: 768px) {
  .c-author-card {
    margin-block: 8vw;
  }

  .c-author-card .c-author-card__heading {
    margin-bottom: 4.2666666667vw;
  }

  .c-author-card .c-author-card__heading-en {
    font-size: 2.6666666667vw;
  }

  .c-author-card .c-author-card__heading-ja {
    margin-top: 0;
    font-size: 4.8vw;
  }

  .c-author-card .c-author-card__inner {
    padding: 5.3333333333vw;
  }

  /* 1カラムに畳んでアバターと名前を中央寄せ（記事下プロフィールと同じ挙動） */
  .c-author-card .c-author-card__head {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2.6666666667vw;
    text-align: center;
  }

  .c-author-card .c-author-card__avatar {
    width: 24vw;
    height: 24vw;
  }

  .c-author-card .c-author-card__name {
    font-size: 4.2666666667vw;
  }

  .c-author-card .c-author-card__role {
    margin-top: 1.3333333333vw;
    font-size: 3.2vw;
  }

  /* 紹介文は読みやすさ優先で左揃えのまま、内側の余白は外す */
  .c-author-card .c-author-card__body {
    margin-top: 5.3333333333vw;
    padding-inline: 0;
  }

  .c-author-card .c-author-card__description,
  .c-author-card .c-author-card__link {
    font-size: 3.7333333333vw;
    line-height: 1.8;
  }
}

/* =========================================================
   エディタ専用（フロントには出ない要素の見た目調整）
   ========================================================= */

/* アバターはクリックでメディアライブラリを開くボタンにしている */
.c-author-card .c-author-card__avatar--button {
  padding: 0;
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* リンク先URL未入力の警告（エディタにしか出ない要素） */
.c-author-card .c-author-card__link-notice {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #b32d2e;
}

/* RichText のプレースホルダーが潰れないように最小幅を持たせる */
.c-author-card .c-author-card__name[data-rich-text-placeholder],
.c-author-card .c-author-card__role[data-rich-text-placeholder] {
  min-width: 8em;
}
