/*
  小さな会社のデジタル集客ノート 共通スタイル
  shadcn/ui の配色・角丸・カードの考え方を、ふつうのCSSで再現したもの。
  色はすべて下の「変数」で決めているので、色を変えたいときは :root だけ直せばよい。
*/

/* ===== 色・文字・角丸の変数 ===== */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --brand: 173 80% 28%;
  --bad: 0 72% 46%;
  --radius: 10px;
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
/* 端末がダークモードのときの色 */
@media (prefers-color-scheme: dark) {
  :root {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 8% 6.5%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --border: 240 3.7% 17%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --brand: 172 62% 50%;
    --bad: 0 85% 68%;
    color-scheme: dark;
  }
}

/* ===== 土台 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.4; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a:focus-visible { outline: 2px solid hsl(var(--brand)); outline-offset: 2px; border-radius: 4px; }

/* 左右の余白（スマホでも最低16px） */
.gutter {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.container { max-width: 1024px; margin: 0 auto; }
.container-narrow { max-width: 768px; margin: 0 auto; }
.muted { color: hsl(var(--muted-foreground)); }

/* ===== ヘッダー ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.85);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; font-size: 15px; }
.logo-mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 13px;
}
.nav { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.nav-link { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: hsl(var(--muted-foreground)); }
.nav-link:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

/* ===== ボタン・バッジ ===== */
.btn {
  display: inline-flex; align-items: center; height: 40px; padding: 0 20px;
  border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
}
.btn-sm { height: 36px; padding: 0 16px; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { border-color: hsl(var(--border)); background: hsl(var(--background)); }
.btn-outline:hover { background: hsl(var(--muted)); }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.badge-brand { background: hsl(var(--brand) / 0.1); color: hsl(var(--brand)); }
.badge-outline { border: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); }
.badge-soft { border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.6); color: hsl(var(--muted-foreground)); padding: 4px 12px; }
.dot { width: 6px; height: 6px; border-radius: 999px; background: hsl(var(--brand)); }

/* ===== カード ===== */
.card {
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px);
  background: hsl(var(--card)); padding: 24px;
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.05);
}
.card-dashed { border-style: dashed; background: transparent; box-shadow: none; }
.card-muted { background: hsl(var(--muted) / 0.5); box-shadow: none; }

/* ===== トップページ ===== */
.page { padding-block: 56px 72px; }
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; max-width: 768px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; line-height: 1.3; }
.hero-lead { font-size: 1.05rem; line-height: 1.8; max-width: 640px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.section { margin-top: 80px; }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.section-head h2 { font-size: 1.5rem; font-weight: 700; }
.section-head p { font-size: 14px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.step-card { display: flex; flex-direction: column; gap: 12px; }
.step-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: hsl(var(--brand)); }
.step-card h3 { font-size: 1.1rem; font-weight: 600; }
.step-card p { font-size: 14px; line-height: 1.75; }

.article-card {
  display: flex; flex-direction: column; gap: 14px; text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.article-card:hover { border-color: hsl(var(--brand) / 0.5); box-shadow: 0 4px 12px hsl(0 0% 0% / 0.08); }
.article-card:hover h3 { color: hsl(var(--brand)); }
.article-card h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.5; }
.article-card p { font-size: 14px; line-height: 1.75; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.read-more { margin-top: auto; font-size: 14px; font-weight: 500; }

.contact { display: flex; flex-direction: column; gap: 12px; padding: 40px; }
.contact h2 { font-size: 1.5rem; font-weight: 700; }
.contact > p { max-width: 640px; line-height: 1.8; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  border: 1px solid hsl(var(--border)); background: hsl(var(--background));
  border-radius: 6px; padding: 6px 12px; font-size: 14px; color: hsl(var(--muted-foreground));
}

/* ===== 記事ページ ===== */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: hsl(var(--muted-foreground)); margin-bottom: 32px; list-style: none; padding: 0; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: hsl(var(--foreground)); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; }
.article-header { display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; border-bottom: 1px solid hsl(var(--border)); }
.article-header h1 { font-size: clamp(1.75rem, 4.5vw, 2.4rem); font-weight: 800; line-height: 1.35; }
.toc { margin-top: 32px; padding: 20px; }
.toc-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.check-list li { display: flex; gap: 8px; }
.check-list li::before { content: "✓"; color: hsl(var(--brand)); }

/* 記事本文（Tailwind Typography の prose に近い組み方） */
.prose { margin-top: 40px; font-size: 17px; line-height: 1.95; color: hsl(var(--foreground) / 0.86); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 {
  margin-top: 2.4em; padding-top: 0.6em; border-top: 1px solid hsl(var(--border));
  font-size: 1.45rem; font-weight: 700; color: hsl(var(--foreground));
}
.prose strong { color: hsl(var(--foreground)); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.5em; }
.prose ul li::marker { color: hsl(var(--brand) / 0.7); }
.prose ol li::marker { color: hsl(var(--muted-foreground)); font-weight: 600; }
.prose blockquote {
  margin-left: 0; margin-right: 0; padding-left: 1em;
  border-left: 3px solid hsl(var(--brand)); color: hsl(var(--foreground)); font-weight: 500;
}
.prose .note { font-size: 14px; color: hsl(var(--muted-foreground)); }
.hl { background: linear-gradient(transparent 60%, hsl(var(--brand) / 0.22) 60%); font-weight: 600; color: hsl(var(--foreground)); }

/* グラフ */
.figure { margin: 2em 0 0; }
.chart-box { overflow-x: auto; padding: 16px; }
.chart { display: block; width: 100%; min-width: 360px; height: auto; }
.chart text { fill: hsl(var(--muted-foreground)); font-size: 13px; font-family: var(--font-sans); }
.chart .val { fill: hsl(var(--foreground)); font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.chart .bar-main { fill: hsl(var(--brand)); }
.chart .bar-sub { fill: hsl(var(--muted-foreground) / 0.45); }
.chart .axis { stroke: hsl(var(--border)); stroke-width: 1; }
.chart .grid-line { stroke: hsl(var(--border)); stroke-width: 1; stroke-dasharray: 3 4; }
.figure figcaption { margin-top: 8px; font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.6; }

/* 表 */
.table-box { overflow-x: auto; padding: 0; }
.table-box table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.table-box th { text-align: left; font-weight: 500; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / 0.5); }
.table-box th, .table-box td { padding: 12px 16px; border-bottom: 1px solid hsl(var(--border)); }
.table-box tr:last-child td { border-bottom: 0; }
.table-box .r { text-align: right; }
.table-box tbody { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.bad { color: hsl(var(--bad)); background: hsl(var(--bad) / 0.1); border-radius: 6px; padding: 2px 8px; font-weight: 600; }

.article-cta { margin-top: 48px; padding: 32px; display: flex; flex-direction: column; gap: 10px; }
.article-cta h2 { font-size: 1.25rem; font-weight: 700; }
.article-cta .btn-row { align-items: center; margin-top: 6px; }

.author-box { margin-top: 24px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.author-box strong { font-size: 15px; }

/* ===== フッター ===== */
.site-footer { border-top: 1px solid hsl(var(--border)); }
.site-footer .container {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  padding-block: 32px; font-size: 14px; color: hsl(var(--muted-foreground));
}
.site-footer .name { font-weight: 500; color: hsl(var(--foreground)); }

/* ===== スマホ幅 ===== */
@media (max-width: 760px) {
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .contact, .article-cta { padding: 24px; }
  .nav-link.hide-sm { display: none; }
  .logo-text { font-size: 13px; white-space: nowrap; }
  .logo-mark { width: 24px; height: 24px; font-size: 12px; }
  .prose { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .article-card { transition: none; }
}
