/* =========================
  body / common
========================= */
body {
  background: #f3f3f3;
  color: #333;
  font-family:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo",
    sans-serif;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

/* =========================
  header
========================= */

.site-header {
  height: 64px;
  display: flex;
  align-items: center;
}

.site-header__inner a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo__icon img {
  width: 32px;
}

.site-logo__text {
  font-size: 24px;
  font-weight: 600;
}

/* =========================
  fv
========================= */

.fv {
  padding: 32px 0 40px;
  background: linear-gradient(
    90deg,
    #ff4fb3 0%,
    #ff7a00 28%,
    #39efb7 58%,
    #7b7cf6 100%
  );
}

.fv__inner {
  position: relative;
}

.fv__heading {
  text-align: center;
  color: #fff;
}

.fv__title {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
}

.fv__lead {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
}

/* =========================
  FV cards layout
========================= */
.fv__cards {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* SPでは中央カードのみ表示 */
.fv-card--left,
.fv-card--right {
  display: none;
}

.fv-card--center {
  display: block;
}

/* =========================
  FV card base
========================= */
.gallery-card--fv {
  width: 100%;
  max-width: 260px;
}

.gallery-card--fv {
  aspect-ratio: 200 / 340;
}

.gallery-card--fv .gallery-card__body {
  padding: 12px 12px 14px;
}

.gallery-card--fv .gallery-card__tags {
  margin-bottom: 20px;
}

.gallery-card--fv .gallery-card__tags li {
  min-height: 22px;
  padding: 4px 10px;
  font-size: 11px;
}

.gallery-card--fv .gallery-card__site-types {
  font-size: 12px;
  line-height: 1.45;
}

/* FVではパレットは高さ固定寄り */
.gallery-card--fv .gallery-card__palette {
  height: 36px;
}

.gallery-card--fv .gallery-card__palette span {
  aspect-ratio: 1 / 1;
}

/******** 検索UI ********/
/* =========================
  control bar
========================= */
.control-bar {
  padding: 40px 0 24px;
}

.control-bar__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =========================
  control form
========================= */
.control-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-form__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.control-form__row--top {
  justify-content: flex-start;
}

.control-form__row--bottom {
  justify-content: space-between;
}

/* =========================
  search box
========================= */
.search-box {
  width: 100%;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #bfbfbf;
  border-radius: 12px;
  background: #fff;
  color: #333;
  font-size: 16px;
  line-height: 1;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.search-box input::placeholder {
  color: #9d9d9d;
}

.search-box input:focus {
  border-color: #c9b9ff;
  box-shadow: 0 0 0 4px rgba(201, 185, 255, 0.18);
  background: #fff;
}

/* =========================
  buttons common
========================= */
.search-button,
.reset-button,
.favorite-filter-button,
.sort-box select,
.search-mode__item span {
  min-height: 44px;
  border: 1px solid #bfbfbf;
  border-radius: 12px;
  background: #fff;
  color: #333;
  font-size: 16px;
  line-height: 1;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

/* =========================
  search button
========================= */
.search-button {
  min-width: 88px;
  padding: 0 20px;
  font-weight: 500;
}

.search-button:hover {
  background: #f7f7f7;
}

/* =========================
  search mode
========================= */
.search-mode {
  padding: 0;
  border: 0;
}

.search-mode__switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 148px;
  height: 44px;
  padding: 6px;
  border: 1px solid #bfbfbf;
  border-radius: 12px;
  background: #e9e9e9;
}

.search-mode__slider {
  position: absolute;
  top: 2.5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 5px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
}

.search-mode.search-mode--or .search-mode__slider {
  transform: translateX(100%);
}

.search-mode__option {
  position: relative;
  z-index: 1;
}

.search-mode__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.search-mode__option span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  color: #555;
  font-size: 16px;
  line-height: 1;
  font-weight: 500;
}

.search-mode__option input:checked + span {
  color: #111;
}

/* =========================
  reset button
========================= */
.reset-button {
  min-width: 116px;
  padding: 0 18px;
  font-weight: 500;
}

.reset-button:hover {
  background: #f7f7f7;
}

/* =========================
  favorite filter button
========================= */
.favorite-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  font-weight: 500;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.favorite-filter-button.is-active {
  background: #fff5f8;
  border-color: #e94b7b;
  color: #a82d57;
  box-shadow: 0 0 0 3px rgba(233, 75, 123, 0.12);
}

.favorite-filter-button__icon {
  font-size: 18px;
  line-height: 1;
}

.favorite-filter-button.is-active .favorite-filter-button__icon {
  color: #e94b7b;
}

.favorite-filter-button:hover {
  background: #f7f7f7;
}

/* =========================
  sort box
========================= */
.sort-box {
  min-width: 160px;
}

.sort-box__inner {
  position: relative;
}

.sort-box select {
  width: 100%;
  min-height: 44px;
  padding: 0 48px 0 16px;
  border: 1px solid #bfbfbf;
  border-radius: 12px;
  background: #fff;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.sort-box__icon {
  position: absolute;
  top: 50%;
  right: 16px; /* この値を大きくすると左へ寄る */
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  pointer-events: none;
}

/* =========================
  result status
========================= */
.search-result-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-status__count {
  color: #7d7d7d;
  font-size: 16px;
  line-height: 1.5;
}

.search-result-status__count span {
  margin-right: 2px;
}

/* =========================
  layout
========================= */
.l-container {
  width: min(100% - 32px, 1200px);
  margin-inline: auto;
}

/* =========================
  gallery grid
========================= */
.gallery {
  padding: 40px 0 80px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* =========================
  gallery card
========================= */
.gallery-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.gallery-card__link {
  display: block;
}

.gallery-card__image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #ddd;
}

.gallery-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card__palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.gallery-card__palette span {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.gallery-card__body {
  padding: 14px 14px 16px;
  background: #f7f7f7;
}

.gallery-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gallery-card__tags li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ebebeb;
  color: #8a8a8a;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.gallery-card__site-types {
  color: #4f4f4f;
  font-size: 14px;
  line-height: 1.5;
}

/* =========================
  favorite button
========================= */
.gallery-card__favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #cfcfcf;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #555;
  font-size: 20px;
  line-height: 1;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  cursor: pointer;
}

.gallery-card__favorite:hover {
  background: #fff;
  border-color: #333;
  transform: scale(1.04);
}

.gallery-card__favorite.is-active {
  color: #e94b7b;
  border-color: #e94b7b;
  background: #fff5f8;
}

/* =========================
  pagination
========================= */
.pagination-section {
  padding: 40px 0 56px;
}

.pagination {
  margin-top: 0;
}

.pagination__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.pagination__numbers {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination__arrow,
.pagination__number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #bfbfbf;
  border-radius: 999px;
  background: #fff;
  color: #555;
  line-height: 1;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.pagination__number {
  font-size: 16px;
  font-weight: 500;
}

.pagination__number.is-active {
  border-color: #222;
  color: #111;
  font-weight: 700;
}

.pagination__arrow {
  font-size: 20px;
  font-weight: 400;
  position: relative;
  overflow: visible;
  display: grid;
  place-items: center;
}

.pagination__arrow-icon {
  display: inline-block;
  line-height: 1;
  transition: transform 0.25s ease;
}

.pagination__prev .pagination__arrow-icon {
  transform: translateX(12px);
}

.pagination__next .pagination__arrow-icon {
  transform: translateX(-12px);
}

.pagination__prev:hover .pagination__arrow-icon {
  transform: translateX(-4px);
}

.pagination__next:hover .pagination__arrow-icon {
  transform: translateX(4px);
}

.pagination__arrow:disabled .pagination__arrow-icon {
  transform: none;
}

.pagination__arrow:disabled {
  cursor: default;
  opacity: 0.35;
  pointer-events: none;
}

.pagination__arrow:hover,
.pagination__number:hover {
  background: #f7f7f7;
}

/* =========================
  footer
========================= */
.site-footer {
  margin-top: 0;
}

.site-footer__gradient {
  height: 72px;
  background: linear-gradient(
    90deg,
    #ff4fb3 0%,
    #ff7a00 28%,
    #39efb7 58%,
    #7b7cf6 100%
  );
}

.site-footer__inner {
  margin-top: -72px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer__copy {
  color: #111;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
}

/* =========================
  modal
========================= */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal__header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: 12px 12px 0;
  background: #fff;
}

.modal__content {
  display: grid;
  gap: 24px;
  padding: 16px 40px 40px;
}

.modal__image-area {
  width: 100%;
}

.modal__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.modal__info-area {
  display: grid;
  gap: 20px;
}

.modal__close {
  width: 40px;
  height: 40px;
  border: 2px solid #4e4e4e;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.modal__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
}

.modal__display-tags,
.modal__color-codes,
.modal__impressions,
.modal__site-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modal__display-tags li,
.modal__impressions li,
.modal__site-types li {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 14px;
  line-height: 1.4;
}

.modal__section {
  display: grid;
  gap: 10px;
}

.modal__section-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e5e5;
}

.modal__description {
  font-size: 16px;
  line-height: 1.8;
}

.modal__palette-color {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid #e3e3e3;
}

.modal__color-codes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modal__color-codes li {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f7f7;
  border: 1px solid #e8e8e8;
  font-size: 14px;
  line-height: 1.5;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.modal__palette-list {
  display: grid;
  gap: 12px;
}

.modal__palette-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  background: #fafafa;
}

.modal__palette-color {
  display: block;
  width: 56px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid #dedede;
}

.modal__palette-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal__palette-code {
  font-size: 14px;
  line-height: 1.5;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  word-break: break-all;
}

.modal__copy-button {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.modal__copy-button:hover {
  background: #f5f5f5;
  border-color: #999;
}

/* =========================
  tablet
========================= */
@media (min-width: 600px) {
  /*** header ***/

  .site-header {
    height: 72px;
  }

  .site-logo__icon img {
    width: 40px;
  }

  .site-logo__text {
    font-size: 32px;
    font-weight: bold;
  }

  /*** fv ***/
  .fv {
    padding: 36px 0 48px;
  }

  .fv__title {
    font-size: 24px;
  }

  .fv__lead {
    font-size: 16px;
  }

  .fv__cards {
    align-items: flex-start;
    justify-content: center;
    gap: 80px;
    margin-top: 32px;
  }

  /* TBでは左＋右の2枚表示 */
  .fv-card--left,
  .fv-card--right {
    display: block;
  }

  .fv-card--center {
    display: none;
  }

  .gallery-card--fv {
    max-width: 200px;
  }

  /*** 検索UI ***/
  .control-bar {
    padding: 44px 0 28px;
  }

  .control-form {
    gap: 18px;
  }

  .control-form__row--top {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px;
    align-items: center;
  }

  .control-form__row--bottom {
    justify-content: flex-start;
    gap: 18px;
  }

  .search-box {
    min-width: 0;
  }

  .search-button {
    min-width: 72px;
    padding-inline: 18px;
  }

  .reset-button {
    min-width: 110px;
    padding-inline: 16px;
  }

  .favorite-filter-button {
    min-width: 180px;
  }

  .sort-box {
    min-width: 120px;
  }

  /*** gallery ***/
  .l-container {
    width: min(100% - 64px, 1200px);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* =========================
  pc
========================= */
@media (min-width: 1080px) {
  /*** header ***/

  .site-header {
    height: 80px;
  }

  .site-logo__icon img {
    width: 48px;
    height: auto;
  }

  /*** fv ***/
  .fv {
    padding: 40px 0 56px;
  }

  .fv__title {
    font-size: 32px;
    line-height: 1.3;
  }

  .fv__lead {
    margin-top: 24px;
    font-size: 18px;
  }

  .fv__cards {
    justify-content: space-between;
    margin-top: 40px;
  }

  /* PCでは3枚表示 */
  .fv-card--left,
  .fv-card--right,
  .fv-card--center {
    display: block;
  }

  .gallery-card--fv {
    max-width: 240px;
    aspect-ratio: 240 / 380;
  }

  .gallery-card--fv .gallery-card__body {
    padding-top: 28px;
  }

  .fv-card--center {
    max-width: 280px;
    aspect-ratio: 280 / 440;
  }

  .fv-card--center .gallery-card__body {
    padding-top: 42px;
  }

  .fv-card--left,
  .fv-card--right {
    margin-top: 60px;
  }

  /*** 検索UI ***/
  .control-bar {
    padding: 48px 0 32px;
  }

  .control-bar__inner {
    gap: 18px;
  }

  .control-form {
    gap: 16px;
  }

  .control-form__row--top {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 16px;
  }

  .control-form__row--bottom {
    gap: 20px;
  }

  .search-box input {
    height: 50px;
  }

  .search-button,
  .reset-button,
  .favorite-filter-button,
  .sort-box select,
  .search-mode__item span {
    min-height: 46px;
  }

  /*** gallery ***/
  .l-container {
    width: min(100% - 240px, 1200px);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }

  /* ページネーション */
  .pagination__prev .pagination__arrow-icon {
    transform: translateX(18px);
  }

  .pagination__next .pagination__arrow-icon {
    transform: translateX(-18px);
  }

  .pagination__prev:hover .pagination__arrow-icon {
    transform: translateX(-4px);
  }

  .pagination__next:hover .pagination__arrow-icon {
    transform: translateX(4px);
  }
}
