/* ======================================================================
   mypage.css | マイページ（シンプル＆視認性重視）
====================================================================== */

/* メイン：下だけ余白。上のヘッダー分はレイアウト側に任せる */
.mypage-main {
  padding: 0 0 60px;
}

/* ================= プロフィールヘッダー ================= */

.profile-header {
  max-width: 860px;
  margin: 0 auto 40px;
  padding: 0 16px 28px;
  border-bottom: 1px solid var(--color-border);
}

/* ★ PC でもスマホでも共通：縦1カラム・中央寄せレイアウト */
.profile-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}

/* 右側ブロック（といっても縦並び） */
.profile-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* 名前・IDなど */
.display-name {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.univ-user-name{
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
	margin-left:56px;
}

.id-follow-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 4px;
  justify-content: center;
  /* ★ 常に中央寄せ */
  flex-wrap: wrap;
}

/* ホームページURL（大学のみ表示） */
.hp-row {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.hp-link {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  word-break: break-all;
  /* 長いURLでも崩れない */
}

.hp-link:hover {
  text-decoration: underline;
  color: #e5e7eb;
}

.user-id,
.follow-info {
  font-size: 13px;
  color: #9ca3af;
}

.follow-link {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: none;
}

.follow-link:hover {
  text-decoration: underline;
  color: #e5e7eb;
}

/* 第一志望系 */
.first-wish {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  margin-top: 6px;
}

.first-wish span {
  color: #9ed0f6;
  font-weight: 600;
}

/* フォロー情報 */
.stats {
  font-size: 15px;
  color: #d1d5db;
  margin-top: 4px;
}

.stats a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.stats a:hover {
  border-color: currentColor;
}

/* 自己紹介 */
.bio {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.7;
  color: #e5e7eb;
}

/* ボタン */
.action-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
  /* ★ 常に中央寄せ */
  flex-wrap: wrap;
}

.action-row .btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1b1d22;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s ease;
}

.action-row .btn:hover {
  background: #2a2e36;
}

/* ================= 見出し（univ_page と共通スタイル） ================= */
.univ-posts-title {
  max-width: 860px;
  margin: 0 auto 12px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-left: 4px solid #9ed0f6;
  padding-left: 10px;
}

/* 投稿一覧（余計な枠は付けない） */
.feed {
  max-width: 860px;
  margin: 0 auto 60px;
  background: transparent;
  border: none;
  box-shadow: none;
}


/* ==========================================================
   管理者用　投稿切り替えタブ
========================================================== */
.sw-post {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--color-bg);
}

.swp-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  padding: 0 12px;
  overflow-x: auto;
}

.swp-tab {
  flex: 1 0 33.33%;
  display: grid;
  place-items: center;
  height: 46px;
  font-weight: 700;
  color: #dfe3e7;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.swp-tab[aria-selected="true"] {
  color: #fff;
}

.swp-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px;
  background: #fff;
}


/* ================= 投稿 ================= */
.txt-limit {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  /* 任意の行数を指定 */
}

/* 承認するボタン *//* 投稿取り消しボタン */
.approval_button,
.post_cancel_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  padding: 0 12px;
  min-width: 120px;

  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;

  color: #fff;
  border: 1px solid rgba(255,255,255,.10);

  cursor: pointer;
  transition: 0.2s ease;
}

/* 承認するボタン 背景 */
.approval_button {
  background: linear-gradient(180deg, #049fff 0%, #0277d9 100%);
}
.approval_button:hover {
  filter: brightness(1.2);
}

/* 投稿取り消しボタン 背景 */
.post_cancel_button {
  background: #151515;
}
.post_cancel_button:hover {
  background: #2a2e36;
}

.approval_button:active,
.post_cancel_button:active {
  transform: translateY(1px);
}

/* 承認ステータスバッジ */
.approval-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;

  transform: translateY(-2px);
}
/* 承認待ち*/
.approval-badge.pending {
  background: rgba(255, 60, 60, .10);
  color: #ff9b9b;
  border-color: rgba(255, 60, 60, .35);
}
/* 承認済み*/
.approval-badge.done {
  background: rgba(80, 160, 255, .12);
  color: #93c5fd;
  border-color: rgba(80, 160, 255, .35);
}

/*フッターのボタン位置調整用*/
footer {
  display: flex;
  justify-content: space-between; /* 左右に振り分け */
  align-items: center;
  padding: 12px 0;               /* 上下余白 */
  border-top: 1px solid rgba(255,255,255,.1); /* 任意で区切り線 */
}

/* 左のいいねボタングループ */
.left-buttons,
.right-buttons {
  display: flex;
  align-items: center;
  gap: 8px; /* ボタン間の間隔 */
}

/* 右の承認ボタングループ */
.right-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= スマホ調整 ================= */
@media (max-width: 640px) {
  .profile-header {
    margin-bottom: 28px;
    padding: 0 12px 20px;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  .display-name {
    font-size: 22px;
  }

  .first-wish {
    font-size: 15px;
  }

  .bio {
    font-size: 14px;
  }
}

/* モバイルヘッダー分の上マージン調整（全ページ共通） */
@media (max-width: 950px) {
  body.has-mobile-header .main {
    margin-top: var(--mobile-header-h) !important;
  }
}

/* ===== mypage：モバイルヘッダーに隠れないように強制で下げる ===== */
@media (max-width: 950px) {
  main.mypage-main {
    padding-top: calc(var(--mobile-header-h) + var(--safe-top)) !important;
  }

  /* ヘッダーを隠す挙動（body.header-hidden）を使ってるなら、そこだけ戻す */
  body.header-hidden main.mypage-main {
    padding-top: 0 !important;
  }

  /* 念のため：プロフィール側で変なマイナスマージン等があっても潰す */
  .profile-header {
    margin-top: 0 !important;
  }
}





/* ==========================================================
   LIGHT THEME OVERRIDES (mypage.css)
========================================================== */
:root[data-theme="light"] .profile-header {
  border-bottom-color: var(--color-border) !important;
}

:root[data-theme="light"] .hp-link,
:root[data-theme="light"] .user-id,
:root[data-theme="light"] .follow-info,
:root[data-theme="light"] .follow-link {
  color: var(--color-muted) !important;
}

:root[data-theme="light"] .hp-link:hover,
:root[data-theme="light"] .follow-link:hover {
  color: var(--color-text) !important;
}

:root[data-theme="light"] .first-wish span {
  color: #2563eb !important;
  /* 薄すぎない青 */
}

:root[data-theme="light"] .stats {
  color: var(--color-text) !important;
}

:root[data-theme="light"] .bio {
  color: var(--color-text) !important;
}

:root[data-theme="light"] .action-row .btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, .14) !important;
}

:root[data-theme="light"] .action-row .btn:hover {
  background: #eef2f7 !important;
}

:root[data-theme="light"] .univ-posts-title {
  color: var(--color-text) !important;
  border-left-color: #2563eb !important;
}

:root[data-theme="light"] .swp-tab {
  color: var(--color-muted);
}

:root[data-theme="light"] .swp-tab[aria-selected="true"] {
  color: var(--color-text);
}

:root[data-theme="light"] .swp-tab[aria-selected="true"]::after {
  background: var(--color-text);
}


:root[data-theme="light"] .post_cancel_button {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, .14) !important;
}

:root[data-theme="light"] .post_cancel_button:hover {
  background: #eef2f7 !important;
}



.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* 空のバッジは表示しない（管理人/不明の“枠だけ”対策） */
.role-badge:empty {
  display: none !important;
}







/* ====== 「自分の投稿」見出し右の sort ピル（homeと同じ） ====== */
.mypage-posts-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.mypage-posts-head .home-sort{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
}

.mypage-posts-head .sort-btn{
  border: 0;
  background: transparent;
  color: #dfe3e7;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mypage-posts-head .sort-btn.is-active,
.mypage-posts-head .sort-btn[aria-pressed="true"]{
  background: rgba(255,255,255,.10);
  color: #fff;
}

/* light mode */
:root[data-theme="light"] .mypage-posts-head .home-sort{
  background: rgba(2,6,23,.03);
}
:root[data-theme="light"] .mypage-posts-head .sort-btn{
  color: rgba(2,6,23,.70);
}
:root[data-theme="light"] .mypage-posts-head .sort-btn.is-active,
:root[data-theme="light"] .mypage-posts-head .sort-btn[aria-pressed="true"]{
  background: rgba(2,6,23,.08);
  color: var(--color-text);
}

:root[data-theme="light"] .role-badge {
  border-color: rgba(2, 6, 23, .18) !important;
  background: rgba(2, 6, 23, .05) !important;
  color: rgba(2, 6, 23, .78) !important;
}






/* ==========================================================
   FIX: 「自分の投稿」見出しの配置ずれ（flex化に対応）
========================================================== */

/* “行全体” を 860px で中央寄せする */
.mypage-posts-head{
  max-width: 860px;
  margin: 0 auto 12px;
  padding: 0 16px;          /* profile-header と揃える */
}

/* タイトル側は “単体中央寄せ” を無効化して左に固定 */
.mypage-posts-head .univ-posts-title{
  max-width: none;
  margin: 0;                /* ← これが一番効く */
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 10px;       /* 既存と同じ */
}

/* 右のソートは右端に */
.mypage-posts-head .home-sort{
  margin-left: auto;
}


/* ===============================
   モーダルデザイン（幅いっぱい統一版）
   =============================== */

/* 背景 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

/* コンテンツ */
.modal-content {
  background: #111;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  animation: slideUp 0.3s ease forwards;
  max-width: 340px;
  width: 90%;
}

/* テキスト */
.modal-message {
  font-size: 1.05rem;
  color: #f5f5f5;
  margin-bottom: 1.6rem;
  line-height: 1.6;
}

/* ボタン配置 */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: stretch; /* ← 横幅いっぱいに変更 */
  width: 100%;
}

/* 共通ボタン */
.modal-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  width: 100%;          /* ← 親の幅いっぱい */
  border: none;
  border-radius: 9999px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 44px;
}

/* 戻る */
.cancel-btn {
  background: linear-gradient(180deg, #2a2a2a, #1e1e1e);
  color: #fff;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.cancel-btn:hover {
  background: linear-gradient(180deg, #333, #222);
  transform: translateY(-2px);
}

/* 申し込む（同じ幅・光沢感あり） */
.submit-btn {
  background: linear-gradient(180deg, #f2f3f5, #e3e4e7);
  color: #111;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.submit-btn:hover {
  background: linear-gradient(180deg, #fff, #dfe1e4);
  transform: translateY(-2px);
}

/* アニメーション */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

