/*
Theme Name: ToyDex v2
Theme URI: https://toydex.jp/
Author: ToyDex
Description: ToyDex専用データベーステーマ
Version: 2.1.0
Text Domain: toydex
*/

:root {
  --td-bg: #f7f7f9;
  --td-surface: #ffffff;
  --td-text: #17171b;
  --td-muted: #72727a;
  --td-line: #e8e8ed;
  --td-accent: #ff3b7f;
  --td-accent-dark: #e62d6c;
  --td-soft: #fff0f5;
  --td-positive: #1d9b63;
  --td-negative: #dc4753;
  --td-radius: 22px;
  --td-shadow: 0 14px 45px rgba(20, 20, 30, .07);
  --td-max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--td-bg);
  color: var(--td-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.td-container {
  width: min(calc(100% - 40px), var(--td-max));
  margin-inline: auto;
}

.td-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid rgba(232,232,237,.85);
  backdrop-filter: blur(18px);
}
.td-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.td-logo {
  color: var(--td-accent);
  font-size: 27px;
  font-weight: 850;
  letter-spacing: -.04em;
}
.td-nav { display: flex; align-items: center; gap: 26px; }
.td-nav a {
  color: #45454d;
  font-size: 14px;
  font-weight: 650;
}
.td-nav a:hover { color: var(--td-accent); }

.td-main { min-height: calc(100vh - 160px); }

.td-hero {
  padding: 105px 0 95px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,59,127,.11), transparent 39%),
    var(--td-surface);
}
.td-eyebrow {
  margin: 0 0 10px;
  color: var(--td-accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.td-hero h1 {
  margin: 0;
  font-size: clamp(39px, 7vw, 72px);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.td-hero p {
  margin: 22px auto 34px;
  max-width: 660px;
  color: var(--td-muted);
  font-size: clamp(16px, 2vw, 19px);
}
.td-search {
  display: flex;
  width: min(100%, 680px);
  margin: auto;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: 18px;
  box-shadow: var(--td-shadow);
}
.td-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 13px 16px;
  color: var(--td-text);
  background: transparent;
}
.td-search button {
  border: 0;
  border-radius: 13px;
  padding: 0 23px;
  background: var(--td-accent);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.td-search button:hover { background: var(--td-accent-dark); }

.td-section { padding: 72px 0; }
.td-section-head { margin-bottom: 28px; }
.td-section-head h2 {
  margin: 0;
  font-size: clamp(27px, 4vw, 40px);
  letter-spacing: -.04em;
}
.td-section-head p { margin: 7px 0 0; color: var(--td-muted); }

.td-site-footer {
  padding: 40px 0;
  color: var(--td-muted);
  background: #fff;
  border-top: 1px solid var(--td-line);
  font-size: 13px;
}

/* Product detail */
.td-product-page { padding: 34px 0 84px; }
.td-breadcrumb {
  margin-bottom: 22px;
  color: var(--td-muted);
  font-size: 13px;
}
.td-breadcrumb a:hover { color: var(--td-accent); }

.td-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: clamp(34px, 6vw, 76px);
  padding: clamp(24px, 4vw, 48px);
  background: var(--td-surface);
  border: 1px solid var(--td-line);
  border-radius: 30px;
  box-shadow: var(--td-shadow);
}
.td-gallery { min-width: 0; }
.td-gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fafafa;
  border: 1px solid var(--td-line);
  border-radius: 22px;
}
.td-gallery-main img {
  width: 100%;
  height: 100%;
  padding: 24px;
  object-fit: contain;
}
.td-gallery-placeholder {
  color: #a0a0a8;
  font-weight: 700;
}
.td-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.td-thumb {
  aspect-ratio: 1;
  padding: 5px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: 12px;
  cursor: pointer;
}
.td-thumb[aria-current="true"] {
  border-color: var(--td-accent);
  box-shadow: 0 0 0 2px rgba(255,59,127,.13);
}
.td-thumb img { width: 100%; height: 100%; object-fit: contain; }

.td-product-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.td-product-maker {
  margin-bottom: 11px;
  color: var(--td-accent);
  font-size: 14px;
  font-weight: 800;
}
.td-product-title {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.18;
  letter-spacing: -.045em;
}
.td-product-brand {
  margin-top: 11px;
  color: var(--td-muted);
  font-size: 14px;
}
.td-score-line {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 23px;
}
.td-stars {
  position: relative;
  display: inline-block;
  color: #d9d9df;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 2px;
}
.td-stars-fill {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
  white-space: nowrap;
  color: #ffb400;
}
.td-score-number { font-weight: 850; font-size: 20px; }
.td-score-caption { color: var(--td-muted); font-size: 13px; }
.td-product-price {
  margin-top: 24px;
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 850;
  letter-spacing: -.035em;
}
.td-price-note { color: var(--td-muted); font-size: 12px; }

.td-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 23px 0 0;
}
.td-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  color: #4d3a43;
  background: var(--td-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.td-buy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  margin-top: 30px;
  padding: 14px 22px;
  color: #fff;
  background: var(--td-accent);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(255,59,127,.24);
  font-weight: 800;
  transition: transform .18s ease, background .18s ease;
}
.td-buy-button:hover {
  color: #fff;
  background: var(--td-accent-dark);
  transform: translateY(-2px);
}
.td-affiliate-note {
  margin: 10px 0 0;
  color: var(--td-muted);
  text-align: center;
  font-size: 11px;
}

.td-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 24px;
  margin-top: 24px;
}
.td-card {
  padding: clamp(24px, 4vw, 38px);
  background: var(--td-surface);
  border: 1px solid var(--td-line);
  border-radius: var(--td-radius);
}
.td-card + .td-card { margin-top: 24px; }
.td-card h2 {
  margin: 0 0 19px;
  font-size: 25px;
  letter-spacing: -.035em;
}
.td-card p:first-child { margin-top: 0; }
.td-card p:last-child { margin-bottom: 0; }
.td-prose { color: #35353c; }
.td-prose ul, .td-prose ol { padding-left: 1.3em; }

.td-rating-row + .td-rating-row { margin-top: 18px; }
.td-rating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
}
.td-rating-label { font-size: 14px; font-weight: 720; }
.td-rating-value { font-size: 13px; color: var(--td-muted); font-weight: 700; }
.td-rating-track {
  height: 8px;
  overflow: hidden;
  background: #ededf1;
  border-radius: 99px;
}
.td-rating-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6a9c, var(--td-accent));
  border-radius: inherit;
}

.td-verdict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.td-verdict-card {
  padding: clamp(24px, 4vw, 36px);
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: var(--td-radius);
}
.td-verdict-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 17px;
  font-size: 22px;
}
.td-verdict-card--good h2 { color: var(--td-positive); }
.td-verdict-card--bad h2 { color: var(--td-negative); }

.td-recommend {
  margin-top: 24px;
  padding: clamp(28px, 5vw, 46px);
  background: linear-gradient(135deg, #fff1f6, #fff);
  border: 1px solid #ffd6e4;
  border-radius: var(--td-radius);
}
.td-recommend h2 { margin: 0 0 14px; font-size: 25px; }

.td-empty {
  color: var(--td-muted);
  font-size: 14px;
}
.td-article {
  width: min(calc(100% - 40px), 800px);
  margin: 70px auto;
  padding: 36px;
  background: #fff;
  border-radius: var(--td-radius);
}
.td-article h1 { line-height: 1.25; }

@media (max-width: 850px) {
  .td-nav { display: none; }
  .td-product-page { padding-top: 18px; }
  .td-product-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    border-radius: 22px;
  }
  .td-product-summary { display: block; }
  .td-content-grid { grid-template-columns: 1fr; }
  .td-verdict { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .td-container { width: min(calc(100% - 24px), var(--td-max)); }
  .td-header-inner { min-height: 62px; }
  .td-logo { font-size: 24px; }
  .td-hero { padding: 72px 0 65px; }
  .td-search { border-radius: 15px; }
  .td-search button { padding-inline: 16px; }
  .td-product-hero { padding: 16px; }
  .td-gallery-main img { padding: 14px; }
  .td-gallery-thumbs { gap: 7px; }
  .td-product-title { font-size: 30px; }
  .td-card, .td-verdict-card { border-radius: 18px; }
}


/* Search results */
.td-search-page {
  padding: 52px 0 88px;
}
.td-search-header {
  margin-bottom: 30px;
}
.td-search-header h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.2;
  letter-spacing: -.045em;
}
.td-search-header p {
  margin: 10px 0 0;
  color: var(--td-muted);
}
.td-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.td-product-card {
  overflow: hidden;
  background: var(--td-surface);
  border: 1px solid var(--td-line);
  border-radius: 22px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.td-product-card:hover {
  transform: translateY(-5px);
  border-color: #dddde4;
  box-shadow: var(--td-shadow);
}
.td-product-card-link {
  display: block;
  height: 100%;
}
.td-product-card-image {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fafafa;
  border-bottom: 1px solid var(--td-line);
}
.td-product-card-image img {
  width: 100%;
  height: 100%;
  padding: 18px;
  object-fit: contain;
  transition: transform .25s ease;
}
.td-product-card:hover .td-product-card-image img {
  transform: scale(1.035);
}
.td-product-card-placeholder {
  color: #aaaab3;
  font-size: 13px;
  font-weight: 700;
}
.td-product-card-body {
  padding: 18px;
}
.td-product-card-maker {
  margin-bottom: 7px;
  color: var(--td-accent);
  font-size: 12px;
  font-weight: 800;
}
.td-product-card-title {
  margin: 0;
  min-height: 3.1em;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -.02em;
}
.td-product-card-score {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
}
.td-product-card-score .td-stars {
  font-size: 16px;
  letter-spacing: 1px;
}
.td-product-card-score strong {
  font-size: 14px;
}
.td-product-card-price {
  margin-top: 13px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -.025em;
}
.td-product-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width: 100%;
  margin-top: 16px;
  color: #fff;
  background: var(--td-accent);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}
.td-search-empty {
  padding: 48px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: 22px;
}
.td-search-empty h2 {
  margin: 0 0 10px;
}
.td-pagination {
  margin-top: 34px;
}
.td-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.td-pagination .page-numbers {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: 10px;
}
.td-pagination .current {
  color: #fff;
  background: var(--td-accent);
  border-color: var(--td-accent);
}

@media (max-width: 1000px) {
  .td-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .td-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .td-product-card-body {
    padding: 14px;
  }
  .td-product-card-title {
    font-size: 15px;
  }
}
@media (max-width: 420px) {
  .td-product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .td-product-card-image img {
    padding: 10px;
  }
  .td-product-card-body {
    padding: 12px;
  }
  .td-product-card-action {
    min-height: 38px;
  }
}
