/* つくり手のストーリー一覧ページのスタイル */
.vendor-stories {
  padding: 0 80px 48px;
}

@media (max-width: 768px) {
  .vendor-stories {
    padding: 0 12px 24px;
  }
}

.stories-container {
  padding: 2px;
  background: #EDE6E0;
}

/* フィルター部分 */
.filter-container {
  background: #FFFFFF;
  margin-bottom: 2px;
}

.filter-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .filter-header {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
}

.filter-header h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: #6D6C67;
  white-space: nowrap;
}

.filter-header .chevron {
  margin-left: 16px;
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

@media (max-width: 768px) {
  .filter-header .chevron {
    margin-left: auto;
  }
}

.filter-header .chevron.open {
  transform: rotate(180deg);
}

.filter-header .selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 24px;
}

@media (max-width: 768px) {
  .filter-header .selected-tags {
    display: none;
    /* スマホサイズでは選ばれたタグを非表示 */
  }
}

.filter-header .selected-tag {
  background: #F7F4EF;
  border: 1px solid #EDE6E0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  color: #6D6C67;
}

@media (max-width: 768px) {
  .filter-header .selected-tag {
    padding: 3px 6px;
    font-size: 11px;
  }
}

.filter-header .selected-tag .remove-tag {
  margin-left: 8px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: #AC828A;
}

@media (max-width: 768px) {
  .filter-header .selected-tag .remove-tag {
    margin-left: 6px;
    width: 14px;
    height: 14px;
    font-size: 12px;
  }
}

.filter-header .filter-count {
  background: #F7F4EF;
  border: 1px solid #EDE6E0;
  border-radius: 4px;
  padding: 4px 8px;
  margin-left: auto;
  font-size: 12px;
  color: #6D6C67;
  min-width: 24px;
  text-align: center;
}

@media (max-width: 768px) {
  .filter-header .filter-count {
    margin-left: 12px;
  }
}

/* モーダルオーバーレイ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Safari用 */
  z-index: 999;
}

.modal-overlay.open {
  display: block;
}

/* フィルターコンテンツ */
.filter-content {
  display: none;
  padding: 24px;
  background: #FFFFFF;
}

@media (max-width: 768px) {
  .filter-content {
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    z-index: 1000;
    overflow-y: hidden;
    border-radius: 4px 4px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
  }
}

.filter-content.open {
  display: block;
}

@media (max-width: 768px) {
  .filter-content.open {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
  }
}

/* スクロール可能なコンテンツ */
@media (max-width: 768px) {
  .filter-content-scrollable {
    padding: 16px;
    padding-top: 16px;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
  }
}

/* フィルター確定ボタン */
.filter-confirm-container {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.filter-confirm-container .filter-confirm-btn {
  width: 220px;
}

@media (max-width: 768px) {
  .filter-confirm-container {
    flex: 0 0 auto;
    padding: 16px;
  }

  .filter-confirm-container .filter-confirm-btn {
    width: 100%;
  }
}

/* スクロール禁止用のクラス */
body.modal-open {
  overflow: hidden;
}

/* モーダルヘッダー */
.filter-modal-header {
  display: none;
}

@media (max-width: 768px) {
  .filter-modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #EDE6E0;
    top: 0;
    background: #F7F4EF;
    margin: 0;
    width: 100%;
    position: relative;
  }

  .filter-modal-header h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    color: #6D6C67;
    width: 100%;
    text-align: center;
  }

  .filter-modal-header button {
    background: #6E767D;
    border: none;
    font-size: 24px;
    line-height: 22px;
    color: #FFFFFF;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 36px;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
  }
}

.filter-section {
  margin-bottom: 24px;
  padding: 8px;
  border: 1px solid #EDE6E0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 768px) {
  .filter-section {
    margin-bottom: 16px;
  }
}

.filter-section h4 {
  font-size: 16px;
  font-weight: 400;
  margin: 0;
  color: #6D6C67;
}

.filter-section h5 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: #6D6C67;
}


@media (max-width: 768px) {
  .filter-section h4 {
    margin: 0 0 8px 0;
  }
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  margin-left: 16px
}

@media (max-width: 768px) {
  .filter-options {
    margin-bottom: 12px;
  }
}

.filter-option {
  background: #FFFFFF;
  border: 1px solid #EDE6E0;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: #6D6C67;
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .filter-option {
    padding: 4px 8px;
    font-size: 11px;
  }
}

.filter-option:hover {
  background: #F7F4EF;
}

.filter-option.selected {
  background: #EDE6E0;
  border-color: #D5C1B8;
  color: #AC828A;
}

.filter-option .tag-prefix {
  margin-right: 4px;
  color: #AC828A;
}

/* 予算フィルター */
.budget-filter {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-left: 16px;
}

.budget-select-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.budget-select-group label {
  font-size: 12px;
  color: #6D6C67;
}

.budget-select {
  appearance: none;
  background: #FFFFFF;
  border: 1px solid #EDE6E0;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  color: #6D6C67;
  cursor: pointer;
  min-width: 120px;
}

.budget-select:focus {
  outline: none;
  border-color: #D5C1B8;
}

.budget-separator {
  font-size: 16px;
  color: #6D6C67;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .budget-filter {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
  }

  .budget-select-group {
    flex: 1;
    min-width: 0;
  }

  .budget-select {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
  }

  .budget-separator {
    margin-bottom: 8px;
    flex-shrink: 0;
    padding: 0 4px;
  }
}

/* ストーリーカードのグリッド */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-top: 2px;
}

@media (max-width: 1200px) {
  .stories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* 商品一覧ページは2カラム表示 */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
  }
}

/* ストーリーカード */
.story-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.12);
}

.story-card-image {
  position: relative;
  padding-top: 66.67%;
  /* 2:3 アスペクト比 */
  overflow: hidden;
}

.story-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-card:hover .story-card-image img {
  transform: scale(1.05);
}

.story-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
}

.story-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.story-card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin: 0 0 8px 0;
  color: #6E767D;
}

.story-card-subtitle {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin: 0 0 16px 0;
  color: #6D6C67;
}

.story-card-description {
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: #6E767D;
  display: -webkit-box;
  /* 全ての行を出したい */
  -webkit-line-clamp: 100;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* ページネーションのスタイル */
.pagination-container {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
}

.pagination .page-item {
  margin: 0;
}

.pagination .page-link {
  padding: 8px 12px;
  border: 1px solid #EDE6E0;
  border-radius: 4px;
  background: #FFFFFF;
  color: #6D6C67;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination .page-link:hover {
  background: #F7F4EF;
  border-color: #D5C1B8;
  color: #6D6C67;
}

.pagination .page-item.active .page-link {
  background: #EDE6E0;
  border-color: #D5C1B8;
  color: #AC828A;
  font-weight: 500;
}

.pagination .page-item.disabled .page-link {
  background: #F7F4EF;
  border-color: #EDE6E0;
  color: #C0BDB8;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 768px) {
  .pagination-container {
    margin-top: 24px;
  }

  .pagination {
    gap: 4px;
  }

  .pagination .page-link {
    padding: 6px 10px;
    font-size: 12px;
  }
}
