/* Markdown→HTML変換ツール
 * レイアウト・タブ・コピーボタンのスタイルは
 * src/pages/markdown-table/index.astro のインラインstyleを踏襲しつつ、
 * common.cssのレガシーグローバル（header{width:900px}・*{font-size:14px}・*{list-style:none}等）を
 * 打ち消すため外部CSSファイルとして分離している（markdown-to-wordの対処方針を踏襲）。
 */

.md2html-tool {
  max-width: 1100px;
  margin: 30px auto;
}

.md2html-tool .options-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.md2html-tool .option-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
}

.md2html-tool .option-field label {
  font-weight: 600;
  white-space: nowrap;
}

.md2html-tool .option-field select {
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #222;
}

.md2html-tool .panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 800px) {
  .md2html-tool .panes {
    grid-template-columns: 1fr;
  }
}

.md2html-tool .pane-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.md2html-tool textarea#inputMd {
  width: 100%;
  box-sizing: border-box;
  height: 420px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: vertical;
  color: #222;
}

.md2html-tool .output-column {
  display: flex;
  flex-direction: column;
}

.md2html-tool .tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--accent, #3b82f6);
  margin-bottom: 12px;
}

.md2html-tool .tab {
  background: #f1f3f5;
  color: #555;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.md2html-tool .tab:hover {
  background: #e9ecef;
}

.md2html-tool .tab.active {
  background: var(--accent, #3b82f6);
  color: #fff;
  border-color: var(--accent, #3b82f6);
}

.md2html-tool .tab-panel {
  display: block;
  height: 420px;
}

.md2html-tool .tab-panel.hidden {
  display: none;
}

.md2html-tool #preview {
  height: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-size: 15px;
  line-height: 1.7;
  overflow-y: auto;
}

.md2html-tool #preview .preview-placeholder {
  color: #999;
  margin: 0;
}

.md2html-tool #preview h1 {
  font-size: 1.7em;
  font-weight: 700;
  margin: 0.6em 0 0.4em;
}

.md2html-tool #preview h1:first-child {
  margin-top: 0;
}

.md2html-tool #preview h2 {
  font-size: 1.4em;
  font-weight: 700;
  margin: 0.9em 0 0.4em;
}

.md2html-tool #preview h3 {
  font-size: 1.2em;
  font-weight: 700;
  margin: 0.9em 0 0.4em;
}

.md2html-tool #preview h4,
.md2html-tool #preview h5,
.md2html-tool #preview h6 {
  font-size: 1.05em;
  font-weight: 700;
  margin: 0.9em 0 0.4em;
}

.md2html-tool #preview p {
  margin: 0 0 0.8em;
}

.md2html-tool #preview ul,
.md2html-tool #preview ol {
  margin: 0 0 0.8em;
  padding-left: 1.6em;
}

.md2html-tool #preview ul {
  list-style: disc;
}

.md2html-tool #preview ol {
  list-style: decimal;
}

.md2html-tool #preview li {
  margin-bottom: 0.2em;
}

.md2html-tool #preview table {
  border-collapse: collapse;
  margin: 0 0 1em;
}

.md2html-tool #preview th,
.md2html-tool #preview td {
  border: 1px solid #b6bec7;
  padding: 5px 10px;
  text-align: left;
}

.md2html-tool #preview th {
  background: #eef2f6;
}

.md2html-tool #preview pre {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px;
  overflow-x: auto;
  margin: 0 0 1em;
}

.md2html-tool #preview code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 1px 4px;
  border-radius: 3px;
}

.md2html-tool #preview pre code {
  background: none;
  padding: 0;
}

.md2html-tool #preview blockquote {
  margin: 0 0 1em;
  padding: 4px 16px;
  border-left: 4px solid #ccc;
  color: #555;
}

.md2html-tool #preview a {
  color: #0563c1;
  text-decoration: underline;
}

.md2html-tool #preview hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 1.2em 0;
}

.md2html-tool #htmlSource {
  display: block;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 16px 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f8f9fa;
  color: #222;
  font-size: 13px;
  line-height: 1.6;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
}

.md2html-tool .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.md2html-tool .actions button {
  background: var(--accent, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.md2html-tool .actions button:hover:not(:disabled) {
  opacity: 0.85;
}

.md2html-tool .actions button:disabled {
  background: #ccc;
  cursor: default;
}

.md2html-tool .actions button.copied {
  background: #28a745;
}

.md2html-tool .actions .stats {
  font-size: 13px;
  color: #666;
  margin-left: auto;
}
