/**
 * ひびのば・コネクト カスタムCSS
 *
 * Next.js プロジェクト（hibinoba-connect）の globals.css から移植。
 * Tailwind CDN でカバーできないカスタムスタイルのみ定義。
 *
 * 依存: Tailwind CSS CDN (header.php で読み込み済み)
 */

/* ==========================================================================
   ベーススタイル
   ========================================================================== */

html {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* 日本語テキスト最適化ユーティリティ */
.text-ja-body {
  font-feature-settings: "palt" 1;
  letter-spacing: 0.05em;
  line-height: 1.8;
}

/* ==========================================================================
   ガラスモーフィズムヘッダー（Safari のベンダープレフィックス対応）
   ========================================================================== */

.glass-header {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ==========================================================================
   Prose 記事スタイル（@tailwindcss/typography の代替）
   single.php で <article class="prose"> として使用
   ========================================================================== */

.prose {
  overflow-x: visible;
}

/* --------------------------------------------------------------------------
   テーブル
   -------------------------------------------------------------------------- */

.prose .table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  max-width: 100%;
}

.prose table {
  display: table;
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 0.95rem;
  border-radius: 0.75rem;
  table-layout: auto;
  border: 1px solid #e5e7eb;
}

.prose thead {
  background: linear-gradient(135deg, #d97706, #ea580c);
}

.prose th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: #ffffff;
  border-bottom: 2px solid #b45309;
  white-space: nowrap;
  background: linear-gradient(135deg, #d97706, #ea580c);
  min-width: 100px;
}

.prose thead tr:first-child th:first-child {
  border-top-left-radius: 0.75rem;
}

.prose thead tr:first-child th:last-child {
  border-top-right-radius: 0.75rem;
}

.prose td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  background-color: #ffffff;
  min-width: 100px;
}

.prose td:first-child {
  font-weight: 600;
  color: #1f2937;
  background-color: #f8fafc;
}

.prose tbody tr:nth-child(even) td {
  background-color: #f9fafb;
}

.prose tbody tr:hover td {
  background-color: #f3f4f6;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:last-child td:first-child {
  border-bottom-left-radius: 0.75rem;
}

.prose tbody tr:last-child td:last-child {
  border-bottom-right-radius: 0.75rem;
}

/* --------------------------------------------------------------------------
   リスト（ul / ol）— アンバーグラデーションマーカー
   -------------------------------------------------------------------------- */

.prose ul {
  list-style-type: none;
  padding-left: 0;
}

.prose ul > li {
  position: relative;
  padding-left: 1.75rem;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.5rem;
  height: 0.5rem;
  background: linear-gradient(135deg, #d97706, #ea580c);
  border-radius: 50%;
}

.prose ol {
  counter-reset: list-counter;
  list-style-type: none;
  padding-left: 0;
}

.prose ol > li {
  position: relative;
  padding-left: 2.25rem;
  counter-increment: list-counter;
}

.prose ol > li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(135deg, #d97706, #ea580c);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   見出し
   -------------------------------------------------------------------------- */

.prose h2 {
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.prose h3 {
  padding-left: 1rem;
  border-left: 3px solid #d97706;
}

.prose h4 {
  font-weight: 600;
  color: #374151;
}

/* --------------------------------------------------------------------------
   コードブロック（Prism.js シンタックスハイライト）
   -------------------------------------------------------------------------- */

.prose pre {
  background: #1a1f2e !important;
  border: 1px solid #2d3548;
  border-radius: 0.75rem;
}

.prose pre code {
  color: #e2e8f0;
  background: transparent !important;
  padding: 0 !important;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* インラインコード */
.prose :not(pre) > code {
  color: #d97706;
  background: #fffbeb;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

/* Prism トークン色 */
.prose pre .token.comment,
.prose pre .token.prolog,
.prose pre .token.doctype,
.prose pre .token.cdata {
  color: #6b7b9e;
  font-style: italic;
}

.prose pre .token.punctuation {
  color: #8b95a8;
}

.prose pre .token.property,
.prose pre .token.tag,
.prose pre .token.boolean,
.prose pre .token.number,
.prose pre .token.constant,
.prose pre .token.symbol {
  color: #7dd3fc;
}

.prose pre .token.selector,
.prose pre .token.attr-name,
.prose pre .token.string,
.prose pre .token.char,
.prose pre .token.builtin {
  color: #38bdf8;
}

.prose pre .token.operator,
.prose pre .token.entity,
.prose pre .token.url,
.prose pre .token.variable {
  color: #5eead4;
}

.prose pre .token.atrule,
.prose pre .token.attr-value,
.prose pre .token.function,
.prose pre .token.class-name {
  color: #67e8f9;
}

.prose pre .token.keyword {
  color: #a78bfa;
}

.prose pre .token.regex,
.prose pre .token.important {
  color: #fbbf24;
}

.prose pre .token.important,
.prose pre .token.bold {
  font-weight: bold;
}

.prose pre .token.italic {
  font-style: italic;
}

/* rehype-prism-plus 行番号 */
.prose pre .code-line {
  padding-left: 0.25rem;
  padding-right: 1rem;
  border-left: 2px solid transparent;
}

.prose pre .code-line.line-number::before {
  color: #4a5568;
  margin-right: 1rem;
}

.prose pre .code-highlight {
  background: rgba(217, 119, 6, 0.15);
  border-left-color: #d97706;
}

/* --------------------------------------------------------------------------
   引用（blockquote）
   -------------------------------------------------------------------------- */

.prose blockquote {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #92400e;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: normal;
}

.prose blockquote p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   リンク
   -------------------------------------------------------------------------- */

.prose a {
  color: #d97706;
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
  color: #b45309;
}

/* --------------------------------------------------------------------------
   画像
   -------------------------------------------------------------------------- */

.prose img {
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   スクロールバーカスタマイズ（Webkit）
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #d97706;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b45309;
}
