/* ============================================
   ShutterLoop Rental Fields — Frontend Styles
   ============================================ */

/* === アーカイブ全体 === */
.sl-archive {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sl-archive__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e0e0;
}

.sl-archive__title {
  font-size: 1.3em;
  margin: 0;
}

.sl-archive__title small {
  font-size: 0.7em;
  color: #666;
  margin-left: 6px;
  font-weight: normal;
}

.sl-archive__sort {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sl-archive__sort-pill {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  white-space: nowrap;
}

.sl-archive__sort-pill:hover {
  border-color: #888;
  color: #111;
}

.sl-archive__sort-pill.is-active {
  border-color: #111;
  color: #111;
  font-weight: 700;
  background: #f5f5f5;
}

.sl-archive__body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.sl-archive__main {
  min-width: 0;
}

/* === サイドバー === */
.sl-archive__filter-toggle {
  display: none;
}

.sl-archive__sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sl-filter-reset {
  display: block;
  padding: 8px 12px;
  background: #fff0f0;
  border: 1px solid #fcc;
  border-radius: 6px;
  font-size: 13px;
  color: #c0392b;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
}

.sl-filter-reset:hover {
  background: #ffe0e0;
  color: #a93226;
}

.sl-keyword-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}

.sl-keyword-input:focus {
  outline: none;
  border-color: #888;
}

.sl-filter-group {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.sl-filter-group__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 8px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  user-select: none;
}

.sl-filter-group__icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.sl-filter-group.is-collapsed .sl-filter-group__icon {
  transform: rotate(-90deg);
}

.sl-filter-group.is-collapsed .sl-filter-group__list {
  display: none;
}

.sl-filter-group__list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.sl-filter-group__item a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #444;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sl-filter-group__item a:hover {
  color: #111;
  background: #f9f9f9;
}

.sl-filter-group__item a.is-active {
  border-left-color: #111;
  color: #111;
  font-weight: 700;
  background: #f9f9f9;
}

.sl-filter-group__count {
  color: #999;
  font-size: 12px;
}

/* === ページネーション === */
.sl-no-results {
  padding: 40px;
  text-align: center;
  color: #666;
}

.sl-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.sl-pagination__btn {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #444;
  text-decoration: none;
  font-size: 14px;
}

.sl-pagination__btn.is-current {
  border-color: #111;
  color: #111;
  font-weight: 700;
  background: #f5f5f5;
}

/* === カードグリッド === */
.sl-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px;
}

.sl-grid__item {
  display: flex;
  min-width: 0;
}

.sl-grid__item.is-hidden {
  display: none;
}

/* === カード本体（共通：横並び） === */
.sl-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 16px;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.sl-card__image {
  display: block;
  flex-shrink: 0;
  width: 140px;
  background: transparent;
  border-radius: 6px;
  text-decoration: none;
}

.sl-card__image img {
  width: 100%;
  height: auto;
  display: block;
}

.sl-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sl-card__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
}

.sl-card__name a {
  color: inherit;
  text-decoration: none;
}

.sl-card__name a:hover {
  opacity: 0.75;
}

.sl-card__prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.sl-card__prices--single {
  grid-template-columns: 1fr;
}

.sl-card__price {
  display: block;
  padding: 10px 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #fff;
  line-height: 1.3;
  box-sizing: border-box;
}

.sl-card__price--short {
  background: #0073aa;
}

.sl-card__price--short:hover {
  background: #005a87;
  color: #fff;
}

.sl-card__price--long {
  background: #e67e22;
}

.sl-card__price--long:hover {
  background: #c96a15;
  color: #fff;
}

.sl-card__link {
  display: block;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
  text-align: center;
  color: #555;
  background: #f5f5f5;
  text-decoration: none;
  box-sizing: border-box;
}

.sl-card__link:hover {
  background: #eaeaea;
  color: #555;
}

/* === スタンドアロン（記事内の単体カード） === */
.sl-card--standalone {
  max-width: 680px;
  margin: 8px auto 16px !important;
}

/* === rental_item 個別ページの余白調整 === */
body.single-rental_item .p-entry__content > .sl-card--standalone:first-child,
body.single-rental_item .p-entry_content > .sl-card--standalone:first-child {
  margin-top: 0 !important;
}

body.single-rental_item .p-entry__head {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body.single-rental_item .p-entry__content,
body.single-rental_item .p-entry_content {
  margin-top: 8px !important;
  padding-top: 0 !important;
}

body.single-rental_item .w-single-top,
body.single-rental_item .w-single-top p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1.5 !important;
}

body.single-rental_item .sl-card--standalone {
  margin-top: 4px !important;
}

/* === ランキングカード === */
.ranking-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
}

.ranking-card.has-campaign {
  border-color: #e74c3c;
}

.campaign-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}

.campaign-original {
  font-size: 12px;
  color: #e74c3c;
  margin-bottom: 4px;
}

.rank-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #f0826c;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.card-left {
  flex: 1;
  min-width: 0;
}

.service-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.service-link {
  color: inherit;
  text-decoration: none;
}

.service-link:hover {
  opacity: 0.75;
}

.price-section {
  margin-bottom: 8px;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price {
  font-size: 24px;
  font-weight: 700;
  color: #e74c3c;
}

.price-type {
  font-size: 14px;
  color: #666;
}

.sub-info {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
}

.sub-info::before {
  content: "\2713 ";
  color: #2196f3;
}

.card-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 200px !important;
  flex: 0 0 200px !important;
}

.btn-detail {
  display: block;
  padding: 12px 16px;
  background: #f0826c !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
  border-radius: 6px;
  box-sizing: border-box;
}

.btn-detail:hover {
  background: #e06b55 !important;
  color: #fff !important;
}

.btn-review {
  display: block;
  padding: 12px 16px;
  background: #4a9fd9 !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
  border-radius: 6px;
  box-sizing: border-box;
}

.btn-review:hover {
  background: #3a8bc4 !important;
  color: #fff !important;
}

/* === PC対応（769px以上）：ランキングカード横幅・中央余白の調整 === */
@media (min-width: 769px) {
  .ranking-card {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }

  .card-right {
    width: 240px !important;
    flex: 0 0 240px !important;
  }
}

/* === SP対応（768px以下） === */
@media (max-width: 768px) {
  .sl-archive__body {
    grid-template-columns: 1fr;
  }

  .sl-archive__sidebar {
    display: none;
  }

  .sl-archive__sidebar.is-open {
    display: flex;
  }

  .sl-archive__filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin-bottom: 8px;
  }

  .sl-archive__filter-toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
  }

  .sl-archive__filter-toggle.is-open .sl-archive__filter-toggle-icon {
    transform: rotate(180deg);
  }

  .sl-grid {
    grid-template-columns: 1fr !important;
  }

  .sl-card {
    flex-direction: column;
    align-items: stretch;
  }

  .sl-card__body {
    width: 100%;
  }

  .sl-card__image {
    width: 100%;
    text-align: center;
  }

  .sl-card__image img {
    max-height: 120px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
  }

  .ranking-card {
    flex-direction: column;
    align-items: stretch !important;
  }

  .card-right {
    width: 100% !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
  }

  .btn-detail,
  .btn-review {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}
