/* テンプレート一覧 + プレビュー (style.css のトークンを利用) */
.g-hero { position: relative; padding: clamp(40px, 6vw, 80px) 0 clamp(36px, 5vw, 64px); background: linear-gradient(120deg, #fff 0%, var(--red-tint) 100%); overflow: hidden; }
.g-hero::after { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 140px; background: linear-gradient(100deg, var(--red), var(--red-d)); transform: skewX(-18deg); opacity: .9; }
.g-hero-inner { position: relative; z-index: 1; }
.crumb { display: flex; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumb a { color: var(--muted); }
.g-hero h1 { display: flex; flex-direction: column; gap: 12px; }
.g-ja { font-size: clamp(22px, 2.8vw, 34px); font-weight: 900; color: var(--navy); }
.g-lead { margin-top: 18px; max-width: 46em; font-weight: 500; }
.g-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.g-points li { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.g-points b { color: var(--red); margin-right: 4px; }

.g-list { padding-block: clamp(32px, 4vw, 56px) clamp(56px, 7vw, 96px); }
.g-filter { display: grid; gap: 14px; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 28px; position: sticky; top: calc(var(--header-h) + 8px); z-index: 10; }
.g-filter-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); align-items: center; gap: 12px; }
.g-filter-label { font-weight: 900; color: var(--navy); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 700 14px/1.4 var(--jp); cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.chip small { font: 800 italic 12px/1 var(--en); color: var(--muted); }
.chip:hover { border-color: var(--red); }
.chip[aria-pressed=true] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed=true] small { color: #c7cfe2; }
.g-filter-search { grid-template-columns: 6.5em minmax(0, 360px) auto; }
.g-filter-search input { padding: 9px 14px; }
.g-count { justify-self: end; font-size: 14px; color: var(--muted); }
.g-count b { font: 900 italic 24px/1 var(--en); color: var(--red); margin-right: 4px; }

.g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.g-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s; }
.g-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-h); }
.g-shot { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background-color: var(--gray); background-size: 100% auto; background-position: center top; background-repeat: no-repeat; border-bottom: 1px solid var(--line); transition: background-position 4s ease-in-out; }
.g-card:hover .g-shot { background-position: center bottom; }
.g-shot-hover { position: absolute; inset: auto 16px 16px auto; padding: 8px 16px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
.g-card:hover .g-shot-hover { opacity: 1; transform: none; }
.g-body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; }
.g-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.g-id { font: 900 italic 15px/1 var(--en); color: var(--red); }
.g-ind { font-weight: 700; color: var(--navy); background: var(--gray); padding: 2px 10px; border-radius: 4px; }
.g-colors { margin-left: auto; display: flex; gap: 4px; }
.g-colors i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .1); }
.g-body h3 { font-size: 18px; font-weight: 900; color: var(--navy); line-height: 1.5; }
.g-sample { font-size: 13px; color: var(--muted); }
.g-desc { font-size: 14px; color: var(--ink); line-height: 1.8; }
.g-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.g-tags li { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.g-tags li.is-taste { border-color: var(--red); color: var(--red); font-weight: 700; }
.g-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 12px; }
.g-actions .btn { padding-inline: 10px; }
.g-empty { padding: 40px; text-align: center; color: var(--muted); background: var(--gray); border-radius: var(--radius); }
.g-more { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-top: 40px; padding: 26px 30px; border-radius: var(--radius); background: var(--navy); color: #d7dcea; }
.g-more-title { color: #fff; font-weight: 900; font-size: 18px; }
.g-footer { padding-top: 26px; border-top: 0; color: #cfd6e6; }
.g-note { font-size: 12px; color: #9aa6c2; padding-bottom: 26px; }
.page-gallery .site-footer { padding-top: 0; }

@media (max-width: 1100px) {
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .g-hero::after { width: 60px; right: -30px; }
  .g-filter { position: static; padding: 16px; }
  .g-filter-row, .g-filter-search { grid-template-columns: 1fr; gap: 8px; }
  .g-count { justify-self: start; }
  .g-grid { grid-template-columns: 1fr; }
  .g-more { grid-template-columns: 1fr; text-align: left; }
}

/* preview page */
.pv { height: 100%; margin: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #e9ecf2; }
html.pv-html { height: 100%; }
.pv-bar { display: flex; align-items: center; gap: 16px; padding: 10px max(2vw, 12px); background: var(--navy); color: #fff; }
.pv-back { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.pv-back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.pv-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pv-title b { font: 900 italic 16px/1 var(--en); color: #ff6b81; }
.pv-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.pv-devices { display: flex; gap: 4px; margin-left: auto; padding: 4px; border-radius: 8px; background: rgba(255, 255, 255, .1); }
.pv-devices button { min-height: 36px; padding: 4px 14px; border: 0; border-radius: 6px; background: transparent; color: #cfd6e6; font: 700 13px/1 var(--jp); cursor: pointer; }
.pv-devices button[aria-pressed=true] { background: #fff; color: var(--navy); }
.pv-bar .btn { min-height: 40px; padding: 6px 18px; font-size: 14px; white-space: nowrap; }
.pv-stage { display: grid; justify-items: center; overflow: auto; padding: 16px; }
.pv-frame { width: 100%; height: 100%; min-height: 600px; border: 0; background: #fff; box-shadow: 0 20px 50px rgba(20, 33, 61, .18); border-radius: 8px; transition: width .4s var(--ease); }
.pv-stage[data-device=tablet] .pv-frame { width: 820px; }
.pv-stage[data-device=sp] .pv-frame { width: 390px; border-radius: 26px; border: 10px solid #1d2129; }
@media (max-width: 860px) {
  .pv-devices, .pv-title span { display: none; }
  .pv-stage { padding: 0; }
  .pv-frame { border-radius: 0; box-shadow: none; }
}
