/*
 * docs.css — transer.io ドキュメントページ専用スタイル
 * 共通スタイルは app.css を参照
 */

html { scroll-behavior: smooth; }

body { background: var(--bg); }

/* ── レイアウト ── */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 60px 1fr;
  min-height: 100vh;
}

/* ── トップナビ ── */
.docs-nav {
  grid-column: 1 / -1;
  height: 60px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.docs-nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  text-decoration: none;
  font-family: 'Syne', sans-serif;
}
.docs-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.docs-nav-links a {
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  text-decoration: none;
  transition: color .2s;
}
.docs-nav-links a:hover { color: #fff; }
.docs-nav-cta {
  background: var(--blue);
  color: #fff !important;
  padding: .4rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .85rem !important;
}
.docs-nav-cta:hover { background: var(--blue-h) !important; }

/* ── サイドナビ（目次） ── */
.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-section-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 0 1.25rem;
  margin-bottom: .4rem;
}
.sidebar-link {
  display: block;
  padding: .4rem 1.25rem;
  font-size: .85rem;
  color: var(--txt2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1.4;
}
.sidebar-link:hover {
  color: var(--blue);
  background: var(--blue-lite);
}
.sidebar-link.active {
  color: var(--blue);
  border-left-color: var(--blue);
  background: var(--blue-lite);
  font-weight: 600;
}
.sidebar-link.indent {
  padding-left: 2rem;
  font-size: .82rem;
}

/* ── メインコンテンツ ── */
.docs-main {
  padding: 3rem 3.5rem 6rem;
  max-width: 860px;
  min-width: 0;
}

/* ── セクション ── */
.doc-section {
  margin-bottom: 4rem;
  scroll-margin-top: 80px;
}

.doc-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border);
}
.doc-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2rem 0 .75rem;
}
.doc-section h4 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--txt);
  margin: 1.5rem 0 .5rem;
}
.doc-section p {
  font-size: .95rem;
  color: var(--txt2);
  line-height: 1.85;
  margin-bottom: .9rem;
}
.doc-section ul, .doc-section ol {
  padding-left: 1.4rem;
  margin-bottom: .9rem;
}
.doc-section li {
  font-size: .93rem;
  color: var(--txt2);
  line-height: 1.75;
  margin-bottom: .3rem;
}

/* ── コードブロック ── */
.code-block {
  position: relative;
  background: #0D1B2A;
  border-radius: 10px;
  margin: 1rem 0 1.5rem;
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 1rem;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.code-lang {
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.code-copy {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.5);
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.code-copy:hover { background: rgba(255,255,255,.1); color: #fff; }
.code-copy.copied { color: #4ADE80; border-color: #4ADE80; }

.code-block pre {
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.code-block code {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: .84rem;
  line-height: 1.7;
  color: #E2E8F0;
  white-space: pre;
}

/* シンタックスハイライト（CSSのみ） */
.tok-comment  { color: #64748B; }
.tok-keyword  { color: #7DD3FC; }
.tok-string   { color: #86EFAC; }
.tok-number   { color: #FCD34D; }
.tok-func     { color: #C4B5FD; }
.tok-tag      { color: #F9A8D4; }
.tok-attr     { color: #7DD3FC; }
.tok-var      { color: #FDE68A; }
.tok-op       { color: #94A3B8; }

/* ── インラインコード ── */
code:not(.code-block code) {
  background: #EFF6FF;
  color: #1D4ED8;
  font-family: 'Courier New', monospace;
  font-size: .82em;
  padding: .15em .4em;
  border-radius: 4px;
}

/* ── コールアウト（注意・ヒント） ── */
.callout {
  display: flex;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin: 1.25rem 0;
  font-size: .9rem;
  line-height: 1.7;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.callout-body { color: var(--txt2); }
.callout-body strong { color: var(--txt); }
.callout.info    { background: #EFF6FF; border-left: 3px solid var(--blue); }
.callout.warn    { background: #FFFBEB; border-left: 3px solid var(--amber); }
.callout.success { background: #ECFDF3; border-left: 3px solid var(--green); }

/* ── テーブル ── */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: .88rem;
}
.doc-table th {
  text-align: left;
  padding: .7rem 1rem;
  background: #F8FAFF;
  border: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 700;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.doc-table td {
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  color: var(--txt2);
  vertical-align: top;
  line-height: 1.6;
}
.doc-table tr:hover td { background: #FAFBFF; }
.required-badge {
  display: inline-block;
  background: #FEF2F2;
  color: var(--red);
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 4px;
  margin-left: .3rem;
}
.optional-badge {
  display: inline-block;
  background: var(--bg);
  color: var(--txt3);
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 4px;
  margin-left: .3rem;
}

/* ── 言語バッジ ── */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .9rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
}
.lang-item .flag { font-size: 1.2rem; }
.lang-name { font-weight: 500; color: var(--txt); }
.lang-code { font-size: .75rem; color: var(--txt3); font-family: monospace; }
.lang-item.recommended { border-color: var(--blue); background: var(--blue-lite); }
.lang-item.recommended .lang-name { color: var(--blue); }

/* ── ステップ ── */
.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.steps-list li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.steps-list li::before {
  content: counter(step);
  width: 28px;
  height: 28px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .1rem;
}
.steps-list li > div { flex: 1; }
.steps-list li strong { color: var(--navy); display: block; margin-bottom: .3rem; }

/* ── FAQ ── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: .75rem;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: inherit;
  font-size: .93rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background .15s;
}
.faq-q:hover { background: var(--bg); }
.faq-q.open { background: var(--blue-lite); color: var(--blue); }
.faq-chevron {
  font-size: .75rem;
  color: var(--txt3);
  transition: transform .25s;
  flex-shrink: 0;
}
.faq-q.open .faq-chevron { transform: rotate(180deg); color: var(--blue); }
.faq-a {
  display: none;
  padding: 0 1.25rem 1rem;
  font-size: .9rem;
  color: var(--txt2);
  line-height: 1.8;
  border-top: 1px solid var(--border);
}
.faq-a.open { display: block; }

/* ── レスポンシブ ── */
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .docs-main { padding: 2rem 1.5rem 4rem; }
}
