/* ═══════════════════════════════════════════════════════════════
   サーバー手帖 — メインスタイルシート
   ターゲット: /assets/style.css
   Loaded by: inc/header.php (absolute URL + filemtime cache-bust)
═══════════════════════════════════════════════════════════════ */

/* ── カスタムプロパティ ─────────────────────────────────────── */
:root {
  --clr-primary:    #2563eb;
  --clr-primary-dk: #1d4ed8;
  --clr-text:       #1f2937;
  --clr-muted:      #5f6b7a;  /* #6b7280 → 4.34:1 FAIL AA; #5f6b7a → 4.86:1 PASS */
  --clr-border:     #e5e7eb;
  --clr-bg:         #f9fafb;
  --clr-header-bg:  #1e293b;
  --clr-header-fg:  #f1f5f9;
  --clr-good-bg:    #d1fae5;
  --clr-good-bd:    #10b981;
  --clr-caution-bg: #fef3c7;
  --clr-caution-bd: #f59e0b;
  --radius:         8px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --max-w:          800px;
  --font:           system-ui, -apple-system, 'Hiragino Kaku Gothic ProN',
                    'Noto Sans JP', sans-serif;
}

/* ── リセット ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── アクセシビリティ: focus-visible / reduced-motion ─────── */
:focus-visible {
  outline:        3px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius:  3px;
}
:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration:       0.01ms !important;
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  html { scroll-behavior: auto; }
}

/* ── ベーススタイル ─────────────────────────────────────────── */
body {
  font-family: var(--font);
  font-size:   16px;
  line-height: 1.78;
  color:       var(--clr-text);
  background:  #fff;
}

a                  { color: var(--clr-primary); text-decoration: none; }
a:hover            { text-decoration: underline; }
strong             { font-weight: 700; }
small              { font-size: .85em; color: var(--clr-muted); }
p                  { margin-bottom: 1.1em; }
ul, ol             { padding-left: 1.5em; margin-bottom: 1.1em; }
li                 { margin-bottom: .35em; }

h1, h2, h3        { line-height: 1.4; font-weight: 700; }
h1 {
  font-size:     clamp(1.25rem, 4vw, 1.7rem);
  margin-bottom: 1.25rem;
}
h2 {
  font-size:     clamp(1.05rem, 3vw, 1.3rem);
  margin:        2.5rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 3px solid var(--clr-primary);
}
h3 { font-size: 1.05rem; margin: 1.75rem 0 .6rem; }

.mk { background: #fef08a; padding: 0 3px; border-radius: 2px; }
p.lead { font-size: 1.05rem; font-weight: 500; color: var(--clr-text); margin-bottom: .75rem; }

/* ══════════════════════════════════════════════════════════════
   ページ骨格 (header / main / footer)
══════════════════════════════════════════════════════════════ */
header {
  background:      var(--clr-header-bg);
  color:           var(--clr-header-fg);
  padding:         0 1.25rem;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             .5rem;
  min-height:      56px;
}
header > a {
  color:           var(--clr-header-fg);
  font-weight:     700;
  font-size:       1.05rem;
  text-decoration: none;
  padding:         .75rem 0;
  flex-shrink:     0;
}
header > a:hover { opacity: .8; }

nav { display: flex; flex-wrap: wrap; gap: .2rem; }
nav a {
  color:           var(--clr-header-fg);
  font-size:       .82rem;
  padding:         .4rem .65rem;
  border-radius:   4px;
  text-decoration: none;
  transition:      background .15s;
  opacity:         .88;
}
nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }

main {
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   2rem 1.25rem 3.5rem;
}

footer {
  background:  var(--clr-bg);
  border-top:  1px solid var(--clr-border);
  text-align:  center;
  padding:     1.5rem 1.25rem;
  font-size:   .82rem;
  color:       var(--clr-muted);
}
footer a { color: var(--clr-muted); }
footer a:hover { color: var(--clr-primary); }

/* ══════════════════════════════════════════════════════════════
   広告・著者ボックス
══════════════════════════════════════════════════════════════ */
.pr-note {
  background:    #fffbeb;
  border:        1px solid #fcd34d;
  border-radius: var(--radius);
  padding:       .5rem .9rem;
  font-size:     .78rem;
  color:         #92400e;
  margin-bottom: 1.5rem;
}

.author-box {
  background:    var(--clr-bg);
  border-left:   4px solid var(--clr-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding:       1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.author-label  { font-size: .72rem; color: var(--clr-muted); margin-bottom: .2rem; }
.author-name   { font-size: .97rem; margin-bottom: .3rem; }
.author-since  { font-size: .85em; color: var(--clr-muted); font-weight: 400; }
.author-bio    { font-size: .86rem; color: var(--clr-muted); margin: 0; }

/* ══════════════════════════════════════════════════════════════
   リードテキスト
══════════════════════════════════════════════════════════════ */
.lead {
  font-size:     1.02rem;
  color:         #374151;
  border-left:   3px solid var(--clr-primary);
  padding-left:  1rem;
  margin-bottom: 2rem;
  line-height:   1.8;
}

/* ══════════════════════════════════════════════════════════════
   比較早見表
══════════════════════════════════════════════════════════════ */
.table-scroll {
  overflow-x:                auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: .75rem;
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
}

.comparison-table {
  width:           100%;
  border-collapse: collapse;
  font-size:       .9rem;
  min-width:       580px;
}
.comparison-table th {
  background:  var(--clr-header-bg);
  color:       var(--clr-header-fg);
  padding:     .6rem .75rem;
  text-align:  center;
  font-size:   .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.comparison-table th:first-child { text-align: left; }
.comparison-table td {
  padding:       .65rem .75rem;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
  text-align:    center;
}
.comparison-table td:first-child { text-align: left; }
.comparison-table tbody tr:nth-child(even) { background: var(--clr-bg); }
.comparison-table tbody tr:hover           { background: #eff6ff; }
.comparison-table tbody tr:last-child td   { border-bottom: none; }
.comparison-table small { display: block; margin-top: .2rem; }

.swipe-hint {
  display:     none;
  font-size:   .73rem;
  color:       var(--clr-muted);
  text-align:  center;
  padding:     .3rem 0 .2rem;
  user-select: none;
  letter-spacing: .02em;
}

.table-note {
  font-size:    .78rem;
  color:        var(--clr-muted);
  margin-top:   .5rem;
  margin-bottom: .5rem;
  padding:       0 .25rem;
}

.hikaku-note {
  font-size:     .78rem;
  color:         var(--clr-muted);
  background:    var(--clr-bg);
  border:        1px solid var(--clr-border);
  border-radius: 4px;
  padding:       .5rem .9rem;
  margin-bottom: 2rem;
}

/* ══════════════════════════════════════════════════════════════
   ボタン・バッジ
══════════════════════════════════════════════════════════════ */
.btn-apply {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  min-height:      48px;
  min-width:       48px;
  background:      var(--clr-primary);
  color:           #fff !important;
  padding:         .5rem 1.25rem;
  border-radius:   4px;
  font-size:       .88rem;
  font-weight:     600;
  white-space:     nowrap;
  text-decoration: none !important;
  transition:      background .15s;
}
.btn-apply:hover { background: var(--clr-primary-dk); text-decoration: none !important; }

.badge-soon {
  display:       inline-block;
  background:    var(--clr-bg);
  color:         var(--clr-muted);
  border:        1px solid var(--clr-border);
  padding:       .25rem .65rem;
  border-radius: 4px;
  font-size:     .78rem;
}

.badge {
  display:        inline-block;
  background:     #ede9fe;
  color:          #5b21b6;
  border:         1px solid #c4b5fd;
  padding:        .2rem .55rem;
  border-radius:  4px;
  font-size:      .75rem;
  font-weight:    600;
  vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════════
   各社レビューカード
══════════════════════════════════════════════════════════════ */
#reviews { margin-top: 1.5rem; }
#reviews > h2 { margin-top: 0; }

.review-card {
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
  padding:       1.5rem;
  margin-bottom: 2rem;
  box-shadow:    var(--shadow-sm);
}
.review-card h3 {
  margin-top:    0;
  font-size:     1.1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--clr-border);
  margin-bottom: 1rem;
}

.review-tagline {
  background:    var(--clr-bg);
  border-radius: 4px;
  padding:       .6rem .9rem;
  font-size:     .88rem;
  margin-bottom: 1rem;
}

.review-good {
  background:    var(--clr-good-bg);
  border-left:   4px solid var(--clr-good-bd);
  border-radius: 0 4px 4px 0;
  padding:       .75rem 1rem;
  margin-bottom: .85rem;
  font-size:     .9rem;
}

.review-caution {
  background:    var(--clr-caution-bg);
  border-left:   4px solid var(--clr-caution-bd);
  border-radius: 0 4px 4px 0;
  padding:       .75rem 1rem;
  margin-bottom: .85rem;
  font-size:     .9rem;
}

.review-verdict {
  font-size:   .86rem;
  color:       #374151;
  border-top:  1px solid var(--clr-border);
  padding-top: .75rem;
  margin-top:  .75rem;
  margin-bottom: .75rem;
}

/* ══════════════════════════════════════════════════════════════
   ホームページ カードグリッド
══════════════════════════════════════════════════════════════ */
.card-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:                   1.25rem;
  margin:                1.75rem 0;
}

.card {
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
  padding:       1.5rem;
  box-shadow:    var(--shadow-sm);
}
.card h2 {
  margin-top:    0;
  font-size:     1.05rem;
  border-bottom: 2px solid var(--clr-primary);
  margin-bottom: .85rem;
  padding-bottom: .4rem;
}
.card--soon { background: var(--clr-bg); }
.card--soon h2 { border-color: var(--clr-border); color: var(--clr-muted); }

.card-summary {
  list-style: none;
  padding:    0;
  margin:     0 0 1.1rem;
}
.card-summary li {
  padding:       .45rem 0;
  border-bottom: 1px solid var(--clr-border);
  font-size:     .88rem;
}
.card-summary li:last-child { border-bottom: none; }

.card-link {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  min-height:      48px;
  background:      var(--clr-primary);
  color:           #fff !important;
  padding:         .5rem 1.1rem;
  border-radius:   4px;
  font-size:       .88rem;
  font-weight:     600;
  text-decoration: none !important;
  transition:      background .15s;
}
.card-link:hover { background: var(--clr-primary-dk); }

.card-nav { font-size: .85rem; margin-top: .75rem; }

/* ══════════════════════════════════════════════════════════════
   比較方針セクション (ホーム)
══════════════════════════════════════════════════════════════ */
.policy {
  background:    var(--clr-bg);
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
  padding:       1.5rem 1.75rem;
  margin-top:    2.5rem;
}
.policy h2 { margin-top: 0; border-bottom-color: var(--clr-border); }

/* ══════════════════════════════════════════════════════════════
   運営者情報テーブル (about)
══════════════════════════════════════════════════════════════ */
.info-table {
  display:               grid;
  grid-template-columns: auto 1fr;
  border:                1px solid var(--clr-border);
  border-radius:         var(--radius);
  overflow:              hidden;
  margin-bottom:         1.75rem;
}
.info-table dt {
  background:    var(--clr-bg);
  border-bottom: 1px solid var(--clr-border);
  padding:       .65rem .9rem;
  font-weight:   600;
  font-size:     .85rem;
  color:         var(--clr-muted);
  white-space:   nowrap;
}
.info-table dd {
  border-bottom: 1px solid var(--clr-border);
  padding:       .65rem .9rem;
  margin:        0;
  font-size:     .92rem;
  word-break:    break-all;
}
.info-table dt:last-of-type,
.info-table dd:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   お問い合わせ
══════════════════════════════════════════════════════════════ */
.contact-email {
  font-size:     1.1rem;
  margin:        1.5rem 0;
}
.contact-email a {
  display:       inline-block;
  background:    var(--clr-bg);
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
  padding:       .8rem 1.4rem;
  font-weight:   600;
  color:         var(--clr-primary);
}
.contact-email a:hover { background: #eff6ff; text-decoration: none; }

/* ══════════════════════════════════════════════════════════════
   共通ユーティリティ
══════════════════════════════════════════════════════════════ */
.page-meta {
  font-size:  .78rem;
  color:      var(--clr-muted);
  margin-top: 2rem;
  text-align: right;
}

.crosslink {
  margin-top:    2.5rem;
  padding:       .9rem 1.25rem;
  background:    #eff6ff;
  border:        1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size:     .9rem;
}

/* ══════════════════════════════════════════════════════════════
   固定下部CTA (sticky-cta)
   JS: IntersectionObserver が body.sticky-active をトグル
══════════════════════════════════════════════════════════════ */
.sticky-cta {
  position:   fixed;
  bottom:     0;
  left:       0;
  right:      0;
  background: #fff;
  border-top: 2px solid var(--clr-border);
  padding:    .75rem 1.25rem;
  z-index:    200;
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.sticky-cta-inner {
  max-width:       var(--max-w);
  margin:          0 auto;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1rem;
}
.sticky-cta-label {
  font-size:     .88rem;
  font-weight:   600;
  color:         var(--clr-text);
  flex-shrink:   1;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}
body.sticky-active { padding-bottom: 76px; }

/* ══════════════════════════════════════════════════════════════
   レスポンシブ — mobile 375px
══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .swipe-hint { display: block; }

  header { padding: .5rem .75rem; }
  header > a { font-size: .95rem; }
  nav a { font-size: .75rem; padding: .3rem .5rem; }

  main { padding: 1.25rem .85rem 2.5rem; }

  h1 { font-size: 1.2rem; }
  h2 { font-size: 1.05rem; }
  h3 { font-size: 1rem; }

  .comparison-table { font-size: .82rem; min-width: 520px; }
  .comparison-table th, .comparison-table td { padding: .5rem .55rem; }

  .card-grid { grid-template-columns: 1fr; }

  .review-card { padding: 1.1rem; }
  .review-good, .review-caution { padding: .65rem .85rem; }

  .info-table { grid-template-columns: 1fr; }
  .info-table dt { border-bottom: none; padding-bottom: .15rem; }
  .info-table dt + dd { padding-top: .15rem; }

  .policy { padding: 1.1rem 1.25rem; }
}
