/* ====== Reset & Global ====== */
* { box-sizing: border-box; }
html, body {
  width: 100%; margin: 0; padding: 0;
  overflow-x: hidden; background: #fafafa;
}

/* ====== Page / Container ====== */
body {
  max-width: none !important;
  width: 100%;
  padding: 20px;
  margin: 0 auto;
  color: #000;
}

/* ====== 検索フォーム（共通） ====== */
#search-form {
  padding: 15px; border: 1px solid #ddd; margin-top: 10px;
  background: #fff; border-radius: 10px;
}

/* 検索ボタン（フォーム開閉） */
button[onclick*="toggleSearchForm"]{
  border-radius: 10px; padding: 10px 16px; font-weight: 700;
  background:#007bff; color:#fff; border:none; margin-bottom: 20px;
}

/* ====== 検索フォーム内レイアウト ====== */
.search-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px 18px;
}

.search-item label{ display:block; font-weight:700; margin-bottom:6px; }
.search-item input, .search-item select{
  width:100%; padding:8px; border:1px solid #ccc; border-radius:6px;
  font-size:14px; color:#000;
}

/* 年齢 */
.age-row{
  display: grid; grid-template-columns: 1fr auto 1fr; gap:8px; align-items:center;
}
.age-row .tilde{ text-align:center; }

/* ===== 入会理由（PC/タブレットは2列） ===== */
.reason-group{
  display:grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px 16px;
}

/* ✅ チェックと文字を縦積みに */
.reason-group label{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: normal;
  cursor: pointer;
  line-height: 1.3;
}

.reason-group input[type="checkbox"]{
  margin: 0;
  transform: translateY(0);
}

.reason-group label span{
  font-size:14px;
  color:#000;
  text-align:center;
}

/* Noimage 表示用：画像と同じ枠の中に文字を中央表示 */
.no-photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;      /* 写真の縦横比に合わせて調整 */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  color: #555;              /* 濃いグレーで視認性アップ */
  font-size: 1.2rem;        /* 少し大きめの文字サイズ */
  font-weight: 600;         /* 太字にして読みやすく */
  letter-spacing: 0.05em;   /* わずかに文字間を広げる */
  box-sizing: border-box;
}

/* 送信ボタン行 */
.search-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.search-actions button{ padding:10px 14px; border:none; border-radius:8px; cursor:pointer; }
.search-actions .submit{ background:#007bff; color:#fff; }
.search-actions .clear { background:#e5e7eb; color:#111; }

/* ====== スマホ並び替え ====== */
@media (max-width: 600px){
  .search-grid{ grid-template-columns: 1fr; }
  .row-sort    { order: 1; }
  .row-age     { order: 2; }
  .row-address { order: 3; }
  .row-marital { order: 4; }
  .row-reason  { order: 5; }
  .row-actions { order: 6; }
}

/* ✅ スマホでは入会理由を1列表示 */
@media (max-width: 768px){
  .reason-group{ grid-template-columns: 1fr; }
}

/* ====== カードグリッド ====== */
.profile-container{
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px; max-width: 1100px; margin: 10px auto 40px; padding: 0 10px;
}
@media (min-width:1200px){
  .profile-container{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width:1199px){
  .profile-container{
    grid-template-columns: repeat(2, 1fr);
    max-width: 95%; margin: 0 auto;
  }
}

/* ====== カード ====== */
.profile-card{
  background:#fff; border-radius:16px; overflow:hidden;
  box-shadow:0 10px 24px rgba(0,0,0,.08);
  transition: transform .18s ease, box-shadow .18s ease;
  display:flex; flex-direction:column; text-align:center;
}
.profile-card:hover{ transform: translateY(-2px); box-shadow:0 14px 30px rgba(0,0,0,.10); }

.profile-card .image-container{
  position:relative; width:100%; aspect-ratio:4/5; overflow:hidden; background:#f3f4f6;
}
.profile-card .image-container img{
  width:100% !important; height:100% !important; object-fit:cover; display:block;
}

/* バッジ */
.new-badge{
  position:absolute; top:10px; right:10px; background:#ff3b30; color:#fff;
  font-size:12px; font-weight:700; padding:6px 10px; border-radius:999px; z-index:2;
}
/* 休止中バッジ：写真中央に固定 */
.paused-badge{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 14px;     /* ← スマホ基準は従来どおり */
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 5;          /* NEWバッジより前面に */
}

/* テキスト */
.profile-details{ padding:16px 18px 20px; }
.profile-details h3{ margin:6px 0; font-size:20px; font-weight:800; color:#000; }
.profile-details p { margin:4px 0; font-size:14px; color:#000; }

/* ボタン */
.profile-button{
  display:inline-block; margin-top:10px; background:#f6ae2d; color:#fff !important;
  padding:10px 18px; border-radius:10px; text-decoration:none; font-weight:800;
  box-shadow:0 4px 10px rgba(246,174,45,.35);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.profile-button:hover{ background:#e09b1a; transform: translateY(-1px); box-shadow:0 6px 14px rgba(224,155,26,.35); }

/* 🔧 未ログイン時の詳細ボタンもログイン時と同じ色に */
.disabled-link, .disabled-link:visited, a.disabled-link.profile-button{
  background-color:#f6ae2d;
  color:#fff !important;
  box-shadow:0 4px 10px rgba(246,174,45,.35);
  pointer-events:none;
  cursor:not-allowed;
  opacity:1 !important;  /* ← 薄くしない */
}

/* ページネーション */
.pagination a{
  border-radius:8px; border:1px solid #d1d5db; padding:6px 10px; margin:0 4px;
}
.pagination a:hover{ background:#0056b3; color:#fff; }

.dashboard-btn-wrap {
    text-align: center;
    margin-top: 20px;
}
.btn-dashboard {
    background-color: #007bff;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
}
.btn-dashboard:hover {
    background-color: #0056b3;
}

/* ===== PC表示のレイアウト調整 ===== */
@media (min-width: 1024px) {
  .search-grid .row-reason { grid-column: 1 / -1; }
  .search-grid .row-actions { 
    grid-column: 1 / -1; 
    margin-top: 8px;
    justify-content: center;
  }
  .search-item.row-reason .reason-group {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    justify-items: center;
    gap: 20px 24px;
  }
  .search-item.row-reason .reason {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    gap: 6px;
  }

  .paused-badge{
    font-size: 18px;   /* ← PCだけ文字サイズUP */
    padding: 10px 16px;
    letter-spacing: 0.02em;
  }

}

/* 📱 スマホ時：入会理由の文字を左寄せにする */
@media (max-width: 768px) {
  .reason-group {
    grid-template-columns: 1fr;
    justify-items: start;
    align-items: start;
    text-align: left;
  }
  .reason-group label,
  .search-item.row-reason .reason {
    align-items: flex-start;
    text-align: left;
    gap: 4px;
  }
  .reason-group label span,
  .search-item.row-reason .reason span {
    text-align: left;
  }
}

/* 📱 スマホのときだけ画像を縦長に */
@media (max-width: 768px) {
  .profile-card .image-container {
    aspect-ratio: 3/5;
  }
}

/* 📱 スマホ時だけ「詳細はログイン後」を小さく */
@media (max-width: 600px) {
  a.profile-button.disabled-link {
    font-size: 13px;
    line-height: 1.2;
    padding: 8px 12px;
    white-space: nowrap;
    text-align: center;
  }
}

/* --- 強制センタリング上書き（最優先） --- */
.profile-card .image-container .paused-badge{
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9 !important;
}

@media (min-width: 1024px){
  .profile-card .image-container .paused-badge{
    font-size: 18px !important;
    padding: 10px 16px !important;
    letter-spacing: 0.02em;
  }
}

@media screen and (max-width: 480px) {
  .pagination a {
    font-size: 12px;
    padding: 4px 6px;
    margin: 0 2px;
  }
}


.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.pagination a {
  display: inline-block;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  text-decoration: none;
  color: #007bff;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}

/* 現在のページ */
.pagination a[style*="background-color"] {
  background-color: #007bff !important;
  color: white !important;
}

/* スマホ縦表示対応 */
@media screen and (max-width: 480px) {
  .pagination {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
  }

  .pagination a {
    font-size: 12px;
    padding: 4px 8px;
    min-width: auto;
    white-space: nowrap;
    flex-shrink: 0;
  }
}