/* ==============================
   メンバープロフィール専用CSS
   ファイル: assets/css/about-member-profile-template.css
   ============================== */

/* ------- 基本トークン（好みで調整可） ------- */
:root{
  --card-bg: #ffffff;
  --ink: #16202e;
  --ink-soft:#445066;
  --line:#e7eaf0;
  --brand:#3655ff;
  --brand-ink:#2a3fae;
  --shadow: 0 6px 26px rgba(20,30,60,.08);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* ====== ラッパー ====== */
.member-profile-wrapper{
  max-width: 1100px;
  margin: 40px auto;
  padding: 28px;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  color: var(--ink);
  line-height: 1.7;
}

/* ====== 上段：顔写真 + メディア / ギャラリー ====== */
.member-profile-main{
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.member-profile-left{
  width: 320px;
  flex-shrink: 0;
  text-align: center;
}

.member-profile-face img{
  width: 210px;
  height: 210px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #f3f6ff;
  box-shadow: 0 10px 28px rgba(18,32,86,.12);
  margin-bottom: 14px;
}

.member-profile-name{
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 10px;
}

.member-profile-sns{
  display: flex;
  justify-content: center;
  gap: 16px;
}

.member-profile-sns .sns-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(30,40,90,.08);
  transition: transform .15s ease, box-shadow .2s ease;
  outline: none;
}
.member-profile-sns .sns-link:focus-visible{
  box-shadow: 0 0 0 3px rgba(54,85,255,.25), 0 6px 18px rgba(30,40,90,.08);
}
.member-profile-sns .sns-link:hover{ transform: translateY(-2px) scale(1.03); }
.member-profile-sns .sns-img{ width: 70%; height: 70%; object-fit: contain; }

/* ギャラリー（16:9） */
.member-profile-gallery{
  flex: 1;
  min-width: 320px;
  border-radius: var(--radius-lg);
  background: #eef1f6;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
  aspect-ratio: 16/9;
}
.member-profile-gallery img,
.member-profile-gallery video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ====== 中段：BIO（見栄え強化） ====== */
.member-profile-bio.bio-with-style{
  margin-top: 30px;
}
.bio-with-style .bio-inner{
  background: linear-gradient(180deg, #f8fbff 0%, #f3f6ff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(20,30,60,.06);
  color: var(--ink);
  font-size: 1.05rem;
}
.bio-with-style .bio-inner em{ font-style: normal; color: var(--brand-ink); }

/* ====== Portfolio section（カテゴリ別） ====== */
.portfolio-section{ margin-top:28px; }
.portfolio-title{ font-size:1.35rem; margin:0 0 10px; }

.portfolio-group{ margin-top:14px; }

/* 隠しトグル */
.pg-toggle{ position:absolute; opacity:0; pointer-events:none; }

/* ピル型バー：はみ出さないようにフレックス＆100%幅。±と件数は右端固定 */
.pg-bar{
  display:flex; align-items:center; gap:10px;
  width:100%; box-sizing:border-box; overflow:hidden; /* ← はみ出し防止 */
  padding:12px 14px; border-radius:14px;
  background:linear-gradient(90deg,#eef2ff 0%,#e6ecff 100%);
  border:1px solid #dfe5ff; color:#2d3f7a; font-weight:700; letter-spacing:.06em;
  cursor:pointer; box-shadow:0 8px 20px rgba(40,60,140,.10);
}

/* タイトル／サブタイトルは省略可能にして横幅圧縮に耐える */
.pg-title,
.pg-desc{
  min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pg-title{ font-size:1.02rem; }
.pg-desc{ color:#6b7792; font-weight:600; font-size:.92rem; margin-left:.25rem; }

/* 件数チップ：右端へ押し出し、縮まない */
.pg-chip{
  margin-left:auto; flex:0 0 auto;
  padding:2px 8px; font-size:.85rem; font-weight:700;
  color:#2a3fae; background:#fff; border:1px solid #dfe5ff; border-radius:999px;
  box-shadow:0 4px 12px rgba(20,30,60,.06);
}

/* ＋ → −（縦棒を消すアニメ） */
.pg-plus{ position:relative; width:22px; height:22px; flex:0 0 auto; }
.pg-plus::before, .pg-plus::after{
  content:""; position:absolute; left:50%; top:50%;
  width:14px; height:2.5px; background:#3d51b3; border-radius:3px;
  transform:translate(-50%,-50%); transition:transform .28s, opacity .2s;
}
.pg-plus::after{ transform:translate(-50%,-50%) rotate(90deg); }
.pg-toggle:checked + .pg-bar .pg-plus::after{
  opacity:0; transform:translate(-50%,-50%) rotate(0) scaleX(.25);
}

/* 中身（閉→開） */
.pg-content{
  max-height:0; overflow:hidden; opacity:0; transform:translateY(-6px);
  transition:max-height .45s cubic-bezier(.4,0,.2,1), opacity .35s, transform .35s;
}
.pg-toggle:checked + .pg-bar + .pg-content{
  max-height:1500px; opacity:1; transform:translateY(0); margin-top:12px;
}

/* グリッド & カード（リンクなし・ページ内完結） */
.pg-grid{
  display:grid; gap:14px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width:1024px){
  .pg-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}

.pg-card{
  display:flex; gap:14px; align-items:flex-start;
  padding:12px 14px; border-radius:12px; background:#fff;
  border:1px solid #e7eaf0; box-shadow:0 8px 20px rgba(18,26,56,.06);
  transition:transform .12s, box-shadow .18s, background .18s;
}
.pg-card:hover{ transform:translateY(-2px); background:#f9fbff; box-shadow:0 14px 30px rgba(18,26,56,.10); }

/* サムネは16:9で統一 */
.pg-card img{
  width:148px; aspect-ratio:16/9; object-fit:cover; border-radius:8px; background:#e7ebf6;
}

/* タイトルは2行省略 */
.pg-card-title{
  font-weight:800; font-size:.98rem; line-height:1.35;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
}
.pg-card-desc{ color:#55617a; font-size:.9rem; margin-top:.2rem; }

/* ===== デスクトップ(広い画面)ではピルを“本文サイズ”にして
   件数チップと±をタイトル直後に寄せる ===== */
@media (min-width: 1024px) {
  /* 幅を自動にして間延びしないピルに（100%幅を解除） */
  .pg-bar{
    width: auto;                 /* ← コンテンツ幅に縮む */
    display: inline-flex;        /* 行内で自然に並ぶ */
    max-width: 100%;             /* はみ出し保険 */
    overflow: visible;           /* 右端のパーツが切れないように */
  }
  /* モバイル向けだった “右端へ押し出し” をオフに */
  .pg-chip{ margin-left: 10px; flex: 0 0 auto; }
  .pg-plus{ margin-left: 6px;  flex: 0 0 auto; }
}

/* ===== タブレット以下はこれまで通り：100%幅にして
   右端へチップと±を寄せる（既存挙動の維持） ===== */
@media (max-width: 1023.98px) {
  .pg-bar{ width: 100%; }        /* フル幅で読みやすく */
  .pg-chip{ margin-left: auto; } /* 右端へ固定 */
  .pg-plus{ flex: 0 0 auto; }
}


/* ==== Portfolio Modal（モーダル処理） ==== */
.pf-modal{
  position:fixed; inset:0; z-index:9999;
  display:none; /* is-openで表示 */ 
}
.pf-modal.is-open{ display:block; }
.pf-modal__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.5); }
.pf-modal__dialog{
  position:relative; max-width:min(960px,92vw); margin:0 auto;
  top:50%; transform:translateY(-50%); /* 画面中央へ */
  background:#fff; border-radius:12px; overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.pf-modal__media{ width:100%; aspect-ratio:16/9; background:#000; }
.pf-modal__media iframe,
.pf-modal__media video{ width:100%; height:100%; display:block; object-fit:cover; }
.pf-modal__meta{ padding:14px 16px 18px; }
.pf-modal__meta h3{ margin:0 0 6px; font-size:1.15rem; }
.pf-modal__meta p{ margin:0; color:#555; line-height:1.6; }
.pf-modal__close{
  position:absolute; right:8px; top:6px; font-size:28px; line-height:1;
  border:none; background:transparent; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.7); cursor:pointer;
}
body.pf-modal-open{ overflow:hidden; } /* 背景スクロール抑止 */

/* ======= Portfolio カードのモバイル最適化 ======= */
@media (max-width:520px){
  /* 極端に狭い幅ではサブタイトルは非表示にして崩れ防止 */
  .pg-desc{ display:none; }
  .pg-bar{ padding-right:12px; }

  /* カードは縦積み・説明はモーダルに任せる */
  .pg-card{ flex-direction:column; padding:10px 12px; }
  .pg-card img{ width:100%; }
  .pg-card-desc{ display:none; }
}

/* ======= Portfolioトグルのはみ出し対策（モバイル最適化） ======= */
/* コンテナ側で横スクロールを抑止（全体の保険） */
.member-profile-wrapper{ overflow-x:hidden; }

/* トグルの外枠が常に枠内に収まるように */
.portfolio-section,
.portfolio-group,
.pg-bar{ max-width:100%; }



/* ====== Contact ====== */
.member-profile-contact{
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.member-profile-contact h3{
  margin: 0 0 8px;
  font-size: 1.25rem;
}
.contact-message{
  color: var(--ink-soft);
  font-size: .98rem;
}
.contact-list{
  display:flex; flex-wrap:wrap;
  gap: 20px 28px;
  margin-top: 10px;
}
.contact-info{
  display:flex; align-items:center; gap:10px;
  font-size: 1rem; color: var(--ink);
}
.contact-icon-img{
  width: 30px; height: 30px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 4px 10px rgba(18,26,56,.08);
}

/* ====== レスポンシブ ====== */
@media (max-width: 980px){
  .member-profile-main{ flex-direction: column; }
  .member-profile-left{ width: 100%; }
  .member-profile-gallery{ width: 100%; min-width: 0; }
  .member-profile-wrapper{ padding: 22px; }
  .portfolio-bar{ min-width: 240px; }
}

@media (prefers-reduced-motion: reduce){
  .member-profile-sns .sns-link,
  .portfolio-content,
  .portfolio-link-card,
  .portfolio-ui-plus::after{ transition: none !important; }
}

/* 画像をモーダル内で確実に表示する（黒背景の上に“contain”で乗せる） */
.pf-modal__media .pf-modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* 全体を見せたい場合は contain、トリミングしたいなら cover */
  display: block;
}
