body {
  background: var(--color-bg);
  color: var(--color-text);
  padding-bottom: calc(var(--height-bottom-nav) + var(--space-screen));
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-screen);
}

/* ---------- Header ---------- */
/* モバイル: 折りたたみメニューボックス（既定は閉、Bottom Navigationが主ナビ）
   PC: 常時横並びナビ（折りたたみ不要） */
.header {
  display: block;
  padding: var(--space-screen) var(--space-screen) 0;
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
}

.header__box {
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--height-header);
  padding: 0 var(--space-card);
}

.header__logo {
  font-weight: 700;
  font-size: 18px;
}

.header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-button);
  background: var(--color-bg);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.header__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--space-card);
  transition: max-height 0.2s ease;
}

.header.is-open .header__nav {
  max-height: 260px;
  padding-bottom: var(--space-card);
}

.header__nav-item {
  padding: 10px 12px;
  border-radius: var(--radius-button);
  font-size: 14px;
  color: var(--color-text-sub);
}

.header__nav-item.is-active {
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 700;
}

@media (min-width: 900px) {
  .header {
    padding: 0 24px;
    border-bottom: 1px solid var(--color-border);
  }

  .header__box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--height-header);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .header__bar {
    height: auto;
    padding: 0;
  }

  .header__toggle {
    display: none;
  }

  .header__nav {
    flex-direction: row;
    gap: 24px;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .header.is-open .header__nav {
    padding-bottom: 0;
  }

  .header__nav-item {
    padding: 0;
    border-radius: 0;
  }

  .header__nav-item.is-active {
    background: none;
  }

  body {
    padding-bottom: var(--space-screen);
  }
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--height-bottom-nav);
  display: flex;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  z-index: 10;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--color-text-sub);
}

.bottom-nav__item .bottom-nav__icon {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav__item.is-active {
  color: var(--color-text);
  font-weight: 700;
}

@media (min-width: 900px) {
  /* PC: Headerが常時表示ナビを担うためBottom Navigationは非表示 */
  .bottom-nav {
    display: none;
  }
}

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-component);
}

.section-header__title {
  font-size: 18px;
  font-weight: 700;
}

.section-header__more {
  font-size: 13px;
  color: var(--color-text-sub);
}

/* ---------- Tag Chip ---------- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  height: var(--height-tag);
  padding: 0 14px;
  border-radius: var(--radius-tag);
  background: var(--color-surface);
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tag-chip.is-selected {
  background: var(--color-primary-bg);
  color: var(--color-primary-text);
}

.tag-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: var(--space-component);
  scrollbar-width: none;
}

.tag-list::-webkit-scrollbar {
  display: none;
}

.tag-list--wrap {
  flex-wrap: wrap;
  overflow-x: visible;
}

/* ---------- Post Grid (Pinterest / masonry) ---------- */
.post-grid {
  column-count: 2;
  column-gap: var(--space-component);
}

@media (min-width: 640px) {
  .post-grid {
    column-count: 3;
  }
}

@media (min-width: 900px) {
  .post-grid {
    column-count: 4;
  }
}

/* ---------- Post Card ---------- */
.post-card {
  display: block;
  break-inside: avoid;
  margin-bottom: var(--space-component);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.post-card__img {
  width: 100%;
  display: block;
}

.post-card__body {
  padding: var(--space-card);
}

.post-card__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.post-card__tags .tag-chip {
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
}

.post-card__spot {
  font-size: 13px;
  font-weight: 700;
}

.post-card__location {
  font-size: 12px;
  color: var(--color-text-sub);
}

/* ---------- Spot Row (Location detail) ---------- */
.spot-row {
  margin-bottom: 28px;
}

.spot-row__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.spot-row__scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.spot-row__scroll::-webkit-scrollbar {
  display: none;
}

.spot-row__item {
  flex: 0 0 auto;
  width: 140px;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.spot-row__item img {
  width: 140px;
  height: 140px;
  object-fit: cover;
}

/* ---------- Related Post Carousel ---------- */
.carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: var(--space-component);
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel .post-card {
  flex: 0 0 auto;
  width: 140px;
  margin-bottom: 0;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-sub);
}

.empty-state__title {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--color-text);
}

.empty-state__hint {
  font-size: 13px;
  margin-bottom: 16px;
}

.empty-state__tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Search Tabs ---------- */
.search-tabs {
  display: flex;
  border-radius: var(--radius-button);
  background: var(--color-surface);
  padding: 4px;
  margin-bottom: var(--space-component);
}

.search-tabs__item {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 14px;
  border-radius: calc(var(--radius-button) - 4px);
  color: var(--color-text-sub);
}

.search-tabs__item.is-active {
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 700;
  box-shadow: var(--shadow-card);
}

/* ---------- Location list (エリアタブ) ---------- */
.location-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.location-list__name {
  font-weight: 700;
  font-size: 14px;
}

.location-list__type {
  font-size: 12px;
  color: var(--color-text-sub);
}

/* ---------- Button ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--height-button);
  padding: 0 20px;
  border-radius: var(--radius-button);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.button--primary {
  background: var(--color-primary-bg);
  color: var(--color-primary-text);
}

.button--secondary {
  background: var(--color-secondary-bg);
  color: var(--color-secondary-text);
  border: 1px solid var(--color-border);
}

.button--block {
  width: 100%;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-screen);
}

.modal-overlay.is-hidden {
  display: none;
}

.modal {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  padding: 28px 20px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-modal);
}

.modal__emoji {
  font-size: 32px;
  margin-bottom: 12px;
}

.modal__text {
  font-size: 14px;
  margin-bottom: 4px;
}

.modal__text strong {
  font-size: 16px;
}

.modal__actions {
  margin-top: 20px;
}

/* ---------- Progress Card ---------- */
.progress-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: var(--space-component);
}

.progress-card__label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.progress-card__value {
  font-size: 20px;
  font-weight: 700;
}

.progress-card__rate {
  color: var(--color-accent);
  margin-left: 6px;
}

/* ---------- Post Detail ---------- */
.post-detail__photos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-component);
}

.post-detail__photos img {
  width: 100%;
  border-radius: var(--radius-card);
}

.post-detail__meta {
  margin-bottom: var(--space-component);
}

.post-detail__location {
  font-size: 14px;
  color: var(--color-text-sub);
  margin-bottom: 2px;
}

.post-detail__spot {
  font-size: 18px;
  font-weight: 700;
}

.post-detail__spot-comment {
  font-size: 13px;
  color: var(--color-text-sub);
  margin-top: 4px;
}

.post-detail__comment {
  font-size: 14px;
  margin: var(--space-component) 0;
  padding: var(--space-card);
  background: var(--color-surface);
  border-radius: var(--radius-card);
}

.post-detail__user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-component);
  font-size: 13px;
}

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

/* ---------- Upload Form ---------- */
.form-group {
  margin-bottom: var(--space-component);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  font-size: 14px;
  background: var(--color-bg);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-photo-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.form-photo-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.tag-select-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-select-list .tag-chip {
  cursor: pointer;
}

/* ---------- Favorites tabs content ---------- */
.favorite-count {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-left: 4px;
}
