/*
Theme Name: ToolStack
Description: ソフトウェアの比較・レビューサイト向けテーマ。比較表とレビューを、テキスト中心の読みやすい画面で表示します。
Version: 1.4.69
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stackproof
Tags: custom-menu, custom-logo, blog, one-column, translation-ready
*/

/* ============================================================
   Design tokens — 方向性「Clean SaaS」: 高密度・低モーション
   比較表そのものが装飾。色・角丸・影はここだけが定義元。
   ============================================================ */
:root {
  --sp-background: #fafafa;
  --sp-foreground: #0f172a;
  --sp-card: #ffffff;
  --sp-muted: #64748b;
  --sp-border: #e2e8f0;
  --sp-primary: #1e40af;
  --sp-primary-fg: #ffffff;
  --sp-accent: #f59e0b;
  --sp-accent-fg: #0f172a;

  --sp-radius-sm: 0.375rem;
  --sp-radius-md: 0.625rem;
  --sp-radius-lg: 1rem;

  --sp-shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);

  --sp-font-heading: "Sora", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --sp-font-body: "Inter", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --sp-container: 72rem;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--sp-background);
  color: var(--sp-foreground);
  font-family: var(--sp-font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sp-font-heading);
  color: var(--sp-foreground);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--sp-primary); }
a:hover { color: var(--sp-primary); }

/* 日本語は語の途中で折り返さない。Chromium 以外では無視され、上の text-wrap が効く。 */
:where(:lang(ja)) { word-break: auto-phrase; line-break: strict; }
:where(:lang(ja)) :is(p, li) { line-height: 1.8; }

img, svg, video, iframe { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

:where([id]) { scroll-margin-top: 5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.sp-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.sp-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--sp-card); color: var(--sp-foreground);
  border: 1px solid var(--sp-border); border-radius: var(--sp-radius-md);
  padding: 0.5rem 1rem; z-index: 100;
}
.sp-skip:focus { left: 0.5rem; top: 0.5rem; }

/* ============================================================
   Layout
   ============================================================ */
.sp-container {
  max-width: var(--sp-container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.sp-container--narrow { max-width: 56rem; }

.sp-section {
  border-bottom: 1px solid var(--sp-border);
  padding-block: 3.5rem;
}
.sp-section--card { background: var(--sp-card); }
.sp-section--tight { padding-block: 2.5rem; }

@media (min-width: 640px) {
  .sp-container { padding-inline: 1.5rem; }
  .sp-section { padding-block: 4rem; }
}

/* 1.3.8: 暗い帯（チートシートCTA）と、その上のメール登録フォームのための
   .sp-section--dark / .sp-form--dark は、帯ごと外したので削除しました。 */

/* ============================================================
   Type helpers
   ============================================================ */
.sp-eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sp-primary);
}

.sp-h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.sp-h2 { font-size: clamp(1.4rem, 2.4vw, 1.5rem); }
.sp-h3 { font-size: 1.125rem; }

.sp-lead { color: var(--sp-muted); font-size: 1rem; line-height: 1.75; }
.sp-small { font-size: 0.875rem; line-height: 1.6; color: var(--sp-muted); }
.sp-xs { font-size: 0.75rem; line-height: 1.5; color: var(--sp-muted); }

.sp-link-underline { text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.sp-link-plain { text-decoration: none; }

/* ============================================================
   Buttons / chips
   ============================================================ */
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--sp-radius-md);
  font-family: var(--sp-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sp-btn--primary { background: var(--sp-primary); color: var(--sp-primary-fg); }
.sp-btn--primary:hover { background: #1b3a9c; color: var(--sp-primary-fg); }
.sp-btn--secondary {
  background: var(--sp-card);
  border-color: var(--sp-border);
  color: var(--sp-foreground);
}
.sp-btn--secondary:hover { border-color: var(--sp-primary); color: var(--sp-primary); }
.sp-btn--accent { background: var(--sp-accent); color: var(--sp-accent-fg); }
.sp-btn--accent:hover { background: #e08c07; color: var(--sp-accent-fg); }

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  background: var(--sp-card);
  color: var(--sp-muted);
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.sp-chip:hover { border-color: var(--sp-primary); color: var(--sp-foreground); }
.sp-chip.is-active {
  background: var(--sp-primary);
  border-color: var(--sp-primary);
  color: var(--sp-primary-fg);
}
.sp-chip.is-active:hover { color: var(--sp-primary-fg); }
.sp-chip__count { font-size: 0.75rem; opacity: 0.75; }

/* ============================================================
   Header / nav
   ============================================================ */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 250, 250, 0.96);
  border-bottom: 1px solid var(--sp-border);
  backdrop-filter: blur(8px);
}
.sp-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.sp-header__brand { display: inline-flex; align-items: center; text-decoration: none; }
.sp-header__brand img,
.sp-header__bar .custom-logo-link img,
.sp-header__bar .custom-logo { height: 1.5rem; width: auto; }
.sp-header__bar .custom-logo-link { display: inline-flex; align-items: center; }
.sp-header__brand-text {
  font-family: var(--sp-font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sp-foreground);
  text-decoration: none;
}

.sp-nav__list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}
.sp-nav__list a { color: var(--sp-muted); text-decoration: none; }
.sp-nav__list a:hover { color: var(--sp-foreground); }
.sp-nav__list .current-menu-item > a,
.sp-nav__list .current_page_item > a { color: var(--sp-foreground); font-weight: 600; }

.sp-nav--desktop { display: none; }

/* 日本語ラベルは英語より幅が広いので、モバイルは折り返して見切れを防ぐ */
.sp-nav--mobile {
  border-top: 1px solid var(--sp-border);
  padding: 0.5rem 1.25rem;
}
.sp-nav--mobile .sp-nav__list {
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.sp-nav--mobile .sp-nav__list a { display: inline-block; padding-block: 0.25rem; white-space: nowrap; }

@media (min-width: 900px) {
  .sp-nav--desktop { display: flex; }
  .sp-nav--mobile { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.sp-hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-block: 3rem;
}
.sp-hero__title { margin-top: 1.25rem; }
.sp-hero__lead { margin-top: 1.5rem; max-width: 36rem; }
.sp-hero__actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.sp-hero__note { margin-top: 1.5rem; }
.sp-hero__figure { margin: 0; }
.sp-hero__figure img {
  width: 100%;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-soft);
}

@media (min-width: 1024px) {
  .sp-hero {
    grid-template-columns: 1.05fr 1fr;
    gap: 3rem;
    padding-block: 4.5rem;
  }
}

/* ============================================================
   Method lists
   ============================================================ */
.sp-grid-4 { display: grid; gap: 2rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .sp-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .sp-grid-4 { grid-template-columns: repeat(4, 1fr); } }

.sp-item-top { border-top: 1px solid var(--sp-border); padding-top: 1rem; }
.sp-item-top--accent { border-top-color: var(--sp-accent); }
.sp-item__title { font-size: 1rem; }
.sp-item__body { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.6; color: var(--sp-muted); }

.sp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.sp-head__lead { margin-top: 0.75rem; max-width: 42rem; }

/* ============================================================
   Tool marks + cards
   ============================================================ */
.sp-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-sm);
  background: var(--sp-card);
  overflow: hidden;
}
.sp-mark img { width: 18px; height: 18px; object-fit: contain; }
.sp-mark--lg { width: 48px; height: 48px; }
.sp-mark--lg img { width: 32px; height: 32px; }
.sp-mark--sm { width: 22px; height: 22px; }
.sp-mark--sm img { width: 14px; height: 14px; }

.sp-row-list { margin: 2rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--sp-border); border-bottom: 1px solid var(--sp-border); }
.sp-row {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--sp-border);
}
.sp-row:last-child { border-bottom: 0; }
@media (min-width: 640px) {
  .sp-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 1.6fr);
    align-items: center;
  }
}
.sp-row__name { display: flex; align-items: center; gap: 0.75rem; }
.sp-row__name a {
  font-family: var(--sp-font-heading);
  font-weight: 600;
  color: var(--sp-foreground);
  text-decoration: none;
}
.sp-row__name a:hover { color: var(--sp-primary); text-decoration: underline; text-underline-offset: 4px; }
.sp-row__meta { font-size: 0.875rem; color: var(--sp-muted); }

.sp-cards { display: grid; gap: 1.5rem; margin: 2rem 0 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .sp-cards { grid-template-columns: repeat(3, 1fr); } }
.sp-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  background: var(--sp-card);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.sp-card:hover { border-color: var(--sp-primary); }
.sp-card__meta { font-size: 0.75rem; color: var(--sp-muted); }
.sp-card__title { margin-top: 0.75rem; font-size: 1rem; color: var(--sp-foreground); }
.sp-card__body { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.6; color: var(--sp-muted); }

.sp-stack {
  display: grid;
  gap: 1.5rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--sp-border);
}
.sp-stack:first-child { border-top: 1px solid var(--sp-border); }
@media (min-width: 1024px) {
  .sp-stack { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}
.sp-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }

/* ============================================================
   Tables — デスクトップは表、モバイルは1行=1ブロック
   ============================================================ */
.sp-table-wrap { margin-top: 1.5rem; }
.sp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.sp-table th,
.sp-table td { padding: 1rem 1rem 1rem 0; vertical-align: top; }
.sp-table thead th {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp-muted);
  border-bottom: 1px solid var(--sp-border);
}
.sp-table tbody tr { border-bottom: 1px solid var(--sp-border); }
.sp-table tbody td { font-size: 0.875rem; line-height: 1.6; color: var(--sp-muted); }
.sp-table .sp-cell-name {
  font-family: var(--sp-font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sp-foreground);
}
.sp-cell-name a { color: inherit; text-decoration: none; }
.sp-cell-name a:hover { color: var(--sp-primary); text-decoration: underline; text-underline-offset: 4px; }
.sp-cell-inner { display: flex; align-items: center; gap: 0.75rem; }

@media (max-width: 767px) {
  .sp-table thead { display: none; }
  .sp-table tbody tr { display: block; padding-block: 1.25rem; }
  .sp-table tbody th,
  .sp-table tbody td { display: block; padding: 0; margin-top: 0.75rem; width: auto; }
  .sp-table tbody th:first-child,
  .sp-table tbody td:first-child { margin-top: 0; }
  .sp-table tbody th::before,
  .sp-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sp-muted);
  }
}

.sp-empty {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  background: var(--sp-card);
  font-size: 0.875rem;
  color: var(--sp-muted);
}

/* ============================================================
   Tool detail
   ============================================================ */
.sp-verdict {
  margin-top: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--sp-accent);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--sp-foreground);
}
.sp-tool-head { display: flex; align-items: flex-start; gap: 1rem; margin-top: 1.5rem; }
.sp-tool-head__meta { margin-top: 0.5rem; font-size: 0.875rem; color: var(--sp-muted); }
.sp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 2rem; }
.sp-actions__note { font-size: 0.75rem; line-height: 1.5; color: var(--sp-muted); max-width: 32rem; }

/* 向いている人・メリット・注意点は横3列ではなく縦1列で積む（見出し→本文の順）。
   箇条書きが長いため、狭い列に割ると折り返しが増えて読みにくい。 */
.sp-defs { display: grid; gap: 1.5rem; margin: 0; padding: 0; }
.sp-defs__body { margin: 0.5rem 0 0; font-size: 1rem; line-height: 1.7; color: var(--sp-muted); }

.sp-pair-grid { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .sp-pair-grid { grid-template-columns: 1fr 1fr; } }
.sp-pair {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  background: var(--sp-background);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.sp-pair:hover { border-color: var(--sp-primary); }
.sp-pair span { font-family: var(--sp-font-heading); font-size: 0.875rem; font-weight: 600; color: var(--sp-foreground); }

/* ============================================================
   Prose（固定ページ・投稿）
   ============================================================ */
.sp-prose { max-width: 46rem; }
.sp-prose > * + * { margin-top: 1.25rem; }
.sp-prose h2 { margin-top: 2.75rem; font-size: 1.5rem; }
.sp-prose h3 { margin-top: 2rem; font-size: 1.125rem; }
.sp-prose p, .sp-prose li { font-size: 0.9375rem; line-height: 1.8; color: var(--sp-foreground); }
.sp-prose ul, .sp-prose ol { padding-left: 1.25rem; }
.sp-prose li + li { margin-top: 0.5rem; }
/* 1行＝1つの段落（sp_paragraphs()）。段落どうしの間隔は、本文の段落（1.25rem）より少し狭くする。 */
.sp-prose .sp-para > * + * { margin-top: 0.75rem; }
.sp-prose a { text-decoration: underline; text-underline-offset: 4px; }
.sp-prose code {
  font-size: 0.85em;
  background: var(--sp-card);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-sm);
  padding: 0.1rem 0.35rem;
}
.sp-prose blockquote {
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--sp-border);
  color: var(--sp-muted);
}
.sp-prose img { border-radius: var(--sp-radius-md); }
.sp-prose .wp-block-image { margin: 2rem 0; }
.sp-prose .sp-grid-4 { padding-left: 0; list-style: none; }
.sp-prose .sp-item__body { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.6; color: var(--sp-muted); }
@media (min-width: 1024px) {
  .sp-prose .sp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sp-page-head { border-bottom: 1px solid var(--sp-border); background: var(--sp-card); padding-block: 3rem; }

/* ============================================================
   Forms
   ============================================================ */
.sp-form { max-width: 40rem; margin: 0; }
.sp-form__row { display: flex; flex-direction: column; gap: 0.75rem; }
.sp-form__row--split { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 768px) {
  .sp-form__row--split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sp-field { min-width: 0; }
.sp-label { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; color: var(--sp-muted); }
.sp-input, .sp-textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  background: var(--sp-background);
  color: var(--sp-foreground);
  font-family: var(--sp-font-body);
  font-size: 0.875rem;
}
.sp-input::placeholder, .sp-textarea::placeholder { color: var(--sp-muted); }
.sp-input:focus, .sp-textarea:focus { outline: none; border-color: var(--sp-primary); }
.sp-form__note { margin-top: 1rem; font-size: 0.75rem; line-height: 1.5; color: var(--sp-muted); }
.sp-form__message { margin-top: 0.75rem; font-size: 0.875rem; color: var(--sp-primary); font-weight: 600; }
.sp-form__error { margin-top: 0.75rem; font-size: 0.875rem; color: var(--sp-primary); }

.sp-panel {
  padding: 1.5rem;
  border: 1px solid rgba(250, 250, 250, 0.2);
  border-radius: var(--sp-radius-lg);
  background: rgba(250, 250, 250, 0.05);
}

/* ============================================================
   Footer
   ============================================================ */
.sp-footer {
  border-top: 1px solid var(--sp-border);
  background: var(--sp-card);
  padding-block: 3.5rem;
}
.sp-footer__grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .sp-footer__grid { grid-template-columns: 1.6fr 1fr; } }
.sp-footer__brand img,
.sp-footer__brand .custom-logo { height: 1.5rem; width: auto; }
.sp-footer__blurb { margin-top: 1rem; max-width: 24rem; font-size: 0.875rem; line-height: 1.6; color: var(--sp-muted); }
.sp-footer .sp-nav__list { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.sp-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sp-border);
  font-size: 0.75rem;
  color: var(--sp-muted);
}
@media (min-width: 640px) {
  .sp-footer__bottom { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .sp-footer__bottom p:last-child { max-width: 28rem; text-align: right; }
}

/* ============================================================
   404
   ============================================================ */
.sp-404 { padding-block: 5rem; }

/* ============================================================
   Utility / pagination
   ============================================================ */
.is-hidden { display: none !important; }

.sp-pagination { margin-top: 2.5rem; }
.sp-pagination ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.sp-pagination a,
.sp-pagination span {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  background: var(--sp-card);
  color: var(--sp-muted);
  font-size: 0.875rem;
  text-decoration: none;
}
.sp-pagination a:hover { border-color: var(--sp-primary); color: var(--sp-primary); }
.sp-pagination .current { border-color: var(--sp-primary); color: var(--sp-primary); font-weight: 600; }

/* ============================================================
   Print（比較表を紙やPDFに落とせるように）
   ============================================================ */
@media print {
  .sp-header, .sp-footer, .sp-skip, .sp-no-print { display: none !important; }
  body { background: #fff; }
  .sp-section { border: 0; padding-block: 1rem; }
  .sp-table thead { display: table-header-group; }
  .sp-table tbody tr { display: table-row; }
  .sp-table tbody td { display: table-cell; }
  .sp-table tbody td::before { display: none; }
  .sp-prose, .sp-table { max-width: none; }
  a { color: inherit; text-decoration: none; }
}
