/* ==========================================================================
   多米ポスト (TAME POST) 専用SNS風 CSS
   ========================================================================== */

/* 全体レイアウト */
.post-page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.post-intro-header {
  text-align: center;
  margin-bottom: 30px;
}

.post-intro-header h1 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: var(--primary-color-hover, #ff5e7e);
  margin-bottom: 8px;
}

.post-intro-header p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* 2ペイン切り替え（マップ / グリッド） */
.view-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.view-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 30px;
  border: 2px solid #eaeaea;
  background-color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-tab-btn.active {
  border-color: var(--primary-color-hover, #ff5e7e);
  background-color: var(--primary-color-hover, #ff5e7e);
  color: #fff;
}

/* Leaflet 地図エリア */
.map-view-wrapper {
  margin-bottom: 30px;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid #2a2926;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: none;
  /* デフォルト非表示、タブ切替 */
}

.map-view-wrapper.active {
  display: block;
}

#tame-post-map {
  width: 100%;
  height: 480px;
  background-color: #f7f7f7;
}

/* マップポップアップ内の画像 */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
  font-family: 'Zen Maru Gothic', sans-serif;
}

.map-popup-card {
  width: 220px;
}

.map-popup-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.map-popup-info {
  padding: 10px;
}

.map-popup-text {
  font-size: 12px;
  color: #333;
  margin: 6px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* インスタ風グリッドビュー */
.grid-view-wrapper {
  display: none;
}

.grid-view-wrapper.active {
  display: block;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  /* スマホで写真同士のピッチを広げてしっかり見せる */
  background-color: #fafafa;
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    /* PCではさらにゆったりと28pxの隙間 */
  }
}

.post-grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  /* 角丸なし（真四角） */
  overflow: hidden;
  cursor: pointer;
  background-color: #f0f0f0;
}

.post-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.post-grid-item:hover img {
  transform: scale(1.08);
}

/* グリッドカード上のグラデーションオーバーレイ */
.post-grid-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  box-sizing: border-box;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.post-grid-nickname {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.post-grid-category {
  align-self: flex-start;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 8px;
  color: #fff;
  margin-top: 4px;
}

/* フローティングアクションボタン（投稿する） */
.post-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color-hover, #ff5e7e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 94, 126, 0.4);
  cursor: pointer;
  z-index: 999;
  border: none;
  font-size: 28px;
  font-family: 'Zen Maru Gothic', sans-serif;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.post-fab:hover {
  transform: scale(1.1) rotate(90deg);
}

/* インスタ風詳細モーダル */
.post-modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

.post-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.post-modal-content {
  background-color: #fff;
  width: 100%;
  max-width: 850px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  max-height: 85vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .post-modal-content {
    flex-direction: row;
    height: 600px;
    max-height: 80vh;
  }
}

/* モーダル画像側 */
.post-modal-img-side {
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
  .post-modal-img-side {
    height: 100%;
    aspect-ratio: auto;
  }
}

.post-modal-img-side img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* モーダルテキスト側 */
.post-modal-info-side {
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 20px;
  background: #fff;
}

@media (min-width: 768px) {
  .post-modal-info-side {
    width: 320px;
    height: 100%;
    border-left: 1px solid #f0f0f0;
  }
}

.post-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f5f5f5;
}

.post-modal-header strong {
  font-size: 15px;
  color: #333;
}

.post-modal-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px 0;
  font-size: 14px;
  color: #444;
  line-height: 1.6;
}

.post-modal-footer {
  padding-top: 15px;
  border-top: 1px solid #f5f5f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-modal-date {
  font-size: 11px;
  color: #999;
}

.post-modal-close {
  position: absolute;
  right: -10px;
  top: -45px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  outline: none;
}

@media (min-width: 768px) {
  .post-modal-close {
    right: 20px;
    top: 20px;
    color: #333;
    font-size: 28px;
  }
}

/* 新規投稿フォームモーダル */
.form-modal-content {
  background-color: #fff;
  width: 100%;
  max-width: 500px;
  border-radius: 20px;
  padding: 24px;
  box-sizing: border-box;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.form-modal-title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: #333;
  margin: 0 0 20px 0;
  text-align: center;
}

.form-modal-group {
  margin-bottom: 16px;
}

.form-modal-group label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #555;
  margin-bottom: 6px;
}

.form-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 2px solid #eaeaea;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-modal-input:focus {
  border-color: var(--primary-color-hover, #ff5e7e);
}

.map-selector-hint {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  display: block;
}

/* 投稿成功・失敗アラート */
.alert-popup {
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: bold;
}

.alert-popup-success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.alert-popup-error {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}