/**************************************************
 * Entity Profile 共通
 **************************************************/
.sm-entity-profile {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  box-sizing: border-box;
  font-size: 14px;
}

/**************************************************
 * ヘッダー（タイトル／ロゴ／アクションボタン）
 **************************************************/
.sm-entity-header {
  background: #f5f7fb;
  border-radius: 12px;
  padding: 20px 20px 14px;
  margin-bottom: 16px;
}

.sm-entity-header-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sm-entity-header-main {
  display: flex;
  gap: 16px;
  align-items: center;
}

.sm-entity-header {
  background: #f5f7fb;
  border-radius: 12px;
  padding: 20px 20px 18px;
  margin-bottom: 16px;  /* 24px → 16px くらいに */
}

.sm-entity-logo {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-entity-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sm-entity-header-text {
  flex: 1 1 auto;
}

.sm-entity-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

/* チップ群 */
.sm-entity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.sm-entity-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.3;
  background: #ffffff;
  border: 1px solid #e0e4f0;
  color: #333;
}

/* 種別ごとの色味 */
.sm-entity-chip--sport {
  border-color: #016fcd;
  color: #016fcd;
  background: #e8f2ff;
}

.sm-entity-chip--area {
  border-color: #e0e4f0;
}

.sm-entity-chip--ages {
  border-color: #e0e4f0;
}

/* 外部リンク */
.sm-entity-external-link {
  margin: 4px 0 0;
  font-size: 13px;
}

.sm-entity-external-link a {
  text-decoration: none;
  color: #016fcd;
}

.sm-entity-external-link a:hover {
  text-decoration: underline;
}

/* ヘッダー右上のアクションエリア */
.sm-entity-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.sm-entity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  white-space: nowrap;
}

/* プライマリボタン（オーナー編集） */
.sm-entity-btn--primary {
  background-color: #016fcd;
  color: #ffffff;
  border-color: #016fcd;
  box-shadow: 0 2px 6px rgba(1, 111, 205, 0.25);
}

.sm-entity-btn--primary:hover {
  background-color: #005da9;
  border-color: #005da9;
}

/* アウトラインボタン（問い合わせ） */
.sm-entity-btn--outline {
  background-color: #ffffff;
  color: #016fcd;
  border-color: #016fcd;
}

.sm-entity-btn--outline:hover {
  background-color: #e8f2ff;
}

.sm-entity-owner-label {
  margin: 0;
  font-size: 11px;
  color: #666;
}

/**************************************************
 * レイアウト（2カラム）
 **************************************************/
.sm-entity-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sm-entity-main-column {
  flex: 1 1 auto;
}

.sm-entity-sidebar {
  flex: 0 0 280px;
}

/* PC で 2 カラムにする */
@media (min-width: 960px) {
  .sm-entity-header-inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .sm-entity-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

/**************************************************
 * セクション共通
 **************************************************/
.sm-entity-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.sm-entity-section-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  border-left: 3px solid #016fcd;
  padding-left: 8px;
}

.sm-entity-muted {
  font-size: 13px;
  color: #777;
}

/**************************************************
 * 所在地 & マップ
 **************************************************/
.sm-entity-section--address .sm-entity-address-text {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.sm-entity-map-block {
  margin-top: 8px;
}

.sm-entity-card {
  margin-top: 8px;
}

/**************************************************
 * オーナー表示
 **************************************************/
.sm-entity-owner-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sm-entity-owner-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f2f7;
}

.sm-entity-owner-item:last-child {
  border-bottom: none;
}

.sm-entity-owner-name {
  font-weight: 600;
  font-size: 14px;
}

.sm-entity-owner-email {
  font-size: 12px;
  color: #555;
}

.sm-entity-owner-email--private::before {
  content: "（管理用）";
  margin-right: 3px;
  font-size: 11px;
  color: #888;
}

/**************************************************
 * サイドバー：基本情報・メタ情報
 **************************************************/
.sm-entity-summary-list,
.sm-entity-meta-list {
  margin: 0;
  padding: 0;
}

.sm-entity-summary-list dt,
.sm-entity-meta-list dt {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-top: 8px;
}

.sm-entity-summary-list dd,
.sm-entity-meta-list dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: #222;
}

/**************************************************
 * エラーメッセージ
 **************************************************/
.sm-entity-error {
  max-width: 780px;
  margin: 40px auto;
  padding: 16px 18px;
  border-radius: 8px;
  background: #fff4f4;
  border: 1px solid #f1c0c0;
  color: #a72222;
  font-size: 14px;
}

/**************************************************
 * 広告ブロック
 **************************************************/
.sm-entity-ads-block {
  margin-top: 24px;
}

.sm-entity-ads-inner {
  padding-top: 4px;
  border-top: 1px solid #e0e4f0;
  text-align: center;
}

/**************************************************
 * スマホ最適化
 **************************************************/
@media (max-width: 768px) {
  .sm-entity-profile {
    padding: 16px 12px 32px;
  }

  .sm-entity-header {
    padding: 16px 14px 14px;
  }

  .sm-entity-header-main {
    align-items: flex-start;
  }

  .sm-entity-logo {
    width: 60px;
    height: 60px;
  }

  .sm-entity-title {
    font-size: 18px;
  }

  .sm-entity-section {
    padding: 14px 14px 16px;
  }
}

/**************************************************
 * ロゴ・写真セクション
 **************************************************/
.sm-entity-images {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 16px 16px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.sm-entity-images-title {
  margin-bottom: 10px;
}

.sm-entity-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sm-entity-images-item {
  flex: 0 0 auto;
  width: 140px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-entity-images-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

/* ロゴだけ少し小ぶりにしたい場合 */
.sm-entity-images-item--logo {
  width: 120px;
  height: 120px;
}

/* スマホ用調整 */
@media (max-width: 768px) {
  .sm-entity-images-item {
    width: 45%;
    height: 120px;
  }
}

/**************************************************
 * 戻るリンク
 **************************************************/
.sm-entity-back-row {
  max-width: 1080px;
  margin: 24px auto 8px;
  padding: 0 16px;
  box-sizing: border-box;
}

/* 戻るボタン風リンク */
.sm-entity-back-link {
  border: none;
  background: transparent;
  color: #016fcd;
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.sm-entity-back-link:hover {
  text-decoration: underline;
}

/**************************************************
 * 紹介セクション
 **************************************************/
.sm-entity-section--description .sm-entity-description {
  font-size: 14px;
  line-height: 1.8;
  color: #222;
}

.sm-entity-section--description .sm-entity-description p {
  margin: 0 0 8px;
}

/* サイドバー内アクションボタン用微調整 */
.sm-entity-section--actions {
  text-align: left;
}

.sm-entity-section--actions .sm-entity-btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 6px;
}

.sm-entity-section--actions .sm-entity-owner-label {
  margin-top: 4px;
}

/* 活動地域グループ */
.sm-entity-form-group {
  margin-top: 20px;
  padding: 16px 14px;
  border-radius: 12px;
  background: #f9fafb;
}

.sm-entity-form-group-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* 上段：都道府県 + 市区町村 */
.sm-entity-form-row--area-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* PCでは横並び、モバイルでは縦積み */
.sm-entity-form-field--prefecture,
.sm-entity-form-field--city {
  flex: 1 1 160px;
}

/* 下段：住所テキストエリア */
.sm-entity-form-field--address {
  margin-top: 8px;
}

.sm-entity-disclaimer {
  margin-top: 24px;
  padding: 12px 16px;
  font-size: 12px;
  color: #666;
  background: #f8f8f8;
  border-radius: 8px;
  line-height: 1.6;
}
.sm-entity-disclaimer a {
  text-decoration: underline;
}

/* プロフィールページだけ calendar を 100% に広げる */
.sm-entity-profile .team-calendar-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.sm-search-more-row {
  text-align: center;
  margin: 20px 0 28px;
}

.sm-search-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  background-color: #ffffff;
  color: #016fcd;
  border: 1px solid #016fcd;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sm-search-more-btn:hover {
  background-color: #eaf4ff;
}

/* =========================
   Image Modal
========================= */
.sm-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;

  /* 追加 */
  align-items: center;
  justify-content: center;
  padding: 16px;           /* 端の余白 */
  box-sizing: border-box;
}

.sm-image-modal.is-open {
  display: flex;
}

.sm-image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}

.sm-image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: 5vh auto;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.sm-image-modal-content img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.sm-image-modal-close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 24px;
  background: transparent;
  color: #fff;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/**************************************************
 * 関連プロフィール（下部カード）
 **************************************************/
.sm-related-entities {
  margin-top: 8px;
}

.sm-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 960px) {
  .sm-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

.sm-related-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e8ecf5;
  border-radius: 12px;
  background: #fff;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.sm-related-card:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
  transform: translateY(-1px);
}

.sm-related-card-inner {
  display: flex;
  gap: 10px;
  padding: 10px;
  align-items: center;
}

.sm-related-card-logo {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f7fb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-related-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sm-related-card-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #016fcd;
  font-size: 18px;
}

.sm-related-card-body {
  min-width: 0;
  flex: 1 1 auto;
}

.sm-related-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sm-related-card-meta {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-related-card-distance {
  margin-top: 4px;
  font-size: 12px;
  color: #016fcd;
  font-weight: 600;
}

/* モバイルでは関連カードを1列リストにする */
@media (max-width: 767px) {
  .sm-related-grid {
    grid-template-columns: 1fr;
    gap: 10px; /* 好みで */
  }

  /* 1列化した時にカード内の余白やロゴサイズを少し広げたい場合（任意） */
  .sm-related-card-inner {
    padding: 12px;
  }
  .sm-related-card-logo {
    width: 60px;
    height: 60px;
  }
}

/**************************************************
 * 下部：スポーツ募集リンク
 **************************************************/
.sm-sport-links {
  margin-top: 8px;
}

.sm-sport-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sm-sport-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #ffffff;
  color: #016fcd;
  border: 1px solid #016fcd;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.sm-sport-link-btn:hover {
  background: #e8f2ff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
  transform: translateY(-1px);
}

/* スマホ：2列っぽく並べたい場合 */
@media (max-width: 768px) {
  .sm-sport-link-btn {
    width: calc(50% - 5px);
    white-space: normal;
    text-align: center;
  }
}

/**************************************************
 * 下部：スポーツ募集リンク（1ボタン・中央）
 **************************************************/
.sm-sport-links {
  margin-top: 8px;
}

.sm-sport-link-btn {
  display: block;
  width: fit-content;
  margin: 12px auto 0;    /* 中央配置 */
  padding: 8px 16px;      /* ← 他を検索する と同じに寄せる */
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  background-color: #ffffff;
  color: #016fcd;
  border: 1px solid #016fcd;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sm-sport-link-btn:hover {
  background-color: #eaf4ff;
}
/* 地図直下CTA（デフォルト：縦積み＝モバイル優先） */
.sm-entity-cta-row{
  display: flex;
  flex-direction: column;   /* ← デフォルト縦 */
  gap: 10px;
  margin: 14px 0 18px;
}

.sm-cta-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  width: 100%;              /* ← モバイルで押しやすく */
}

/* PC（横並び） */
@media (min-width: 960px){
  .sm-entity-cta-row{
    flex-direction: row;    /* ← PCで横 */
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
  }
  .sm-cta-btn{
    width: auto;            /* ← PCではボタン幅は中身に合わせる */
  }
}

/* 右：募集（強め） */
.sm-cta-btn--primary{
  background: #016fcd;
  color: #fff;
  border-color: #016fcd;
}
.sm-cta-btn--primary:hover{
  background: #005da9;
  border-color: #005da9;
}

/* 左：周辺（控えめ） */
.sm-cta-btn--outline{
  background: #fff;
  color: #016fcd;
  border-color: #016fcd;
}
.sm-cta-btn--outline:hover{
  background: #eaf4ff;
}

.sm-summary-sport-link{
  margin-left: 6px;
  font-size: 12px;
  text-decoration: underline;
  color: #016fcd;
  white-space: nowrap;
}

.sm-summary-sport-link:hover{
  text-decoration: none;
}
