/* フォントとベーステキストスタイル */
:root {
  --md-text-font: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif; /*実際のnoteのフォント*/
  /* --md-text-font: "YakuHanJPs", "Segoe UI", "Arial", Meiryo, sans-serif; */
  --md-code-font: "Source Code Pro", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --note-accent-color: #6200ee;
  --note-border-color: #e0e0e0;
  --note-nav-height: 48px;
  --note-nav-background: #ffffff;
  --note-nav-text: #333333;
  --note-nav-hover: #f5f5f5;
  --note-nav-active: #ede7f6;
  --note-breadcrumb-height: 40px;
  --note-breadcrumb-background: #f5f5f5;
  --note-breadcrumb-color: #666666;
}

[data-md-color-scheme="slate"] {
  --note-accent-color: #bb86fc;
  --note-border-color: #424242;
  --note-nav-background: #202020;
  --note-nav-text: #e0e0e0;
  --note-nav-hover: #333333;
  --note-nav-active: #3a2a57;
  --note-breadcrumb-background: #2a2a2a;
  --note-breadcrumb-color: #bbbbbb;
}

/* ベースフォントサイズを大きくする */
body {
  font-feature-settings: "palt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-size: 16px; /* 追加: 基本フォントサイズを設定 */
  -webkit-text-size-adjust: 100%; /* iOS用フォントサイズ自動調整を無効化 */
}

/* 本文のフォントサイズと行間 */
.md-typeset {
  font-size: 0.9rem; /* noteライクに大きく設定 */
  line-height: 1.8;
}

/* モバイル用サイズ調整 */
@media screen and (max-width: 480px), 
       only screen and (max-device-width: 480px),
       only screen and (max-device-width: 568px) {
  body {
    font-size: 15px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
  }
  
  .md-typeset {
    font-size: 0.75rem;
    line-height: 1.7;
  }
}

/* 見出しスタイル */
.md-content__inner h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.3;
  color: #333;
}

[data-md-color-scheme="slate"] .md-content__inner h1 {
  color: #e0e0e0;
}

.md-content__inner h2 {
  font-weight: 600;
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--note-border-color);
  font-size: 1.4rem;
}

.md-content__inner h3 {
  font-weight: 600;
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

/* モバイル用見出しサイズ調整 */
@media screen and (max-width: 480px) {
  .md-content__inner h1 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }
  
  .md-content__inner h2 {
    font-size: 0.9rem;
    margin-top: 1.4rem;
    margin-bottom: 0.2rem;
  }
  
  .md-content__inner h3 {
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 0.2rem;
  }
}

/* 引用 */
.md-typeset blockquote {
  border-left: 4px solid var(--note-accent-color);
  padding: 0.8rem 1.2rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 0 4px 4px 0;
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
  background-color: rgba(255, 255, 255, 0.05);
}

/* タグ */
.md-typeset .tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  margin: 0 0.3rem 0.3rem 0;
  font-size: 0.75rem;
  border-radius: 3px;
  background: #f0f0f0;
  color: #606060;
  text-decoration: none;
  transition: background 0.2s;
}

[data-md-color-scheme="slate"] .md-typeset .tag {
  background: #3a3a3a;
  color: #d0d0d0;
}

.md-typeset .tag:hover {
  background: var(--note-accent-color);
  color: white;
}

/* 日付表示 */
.note-date {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

[data-md-color-scheme="slate"] .note-date {
  color: #aaa;
}

.note-created-date, .note-updated-date {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.note-created-date svg, .note-updated-date svg {
  width: 18px;
  height: 18px;
}

.note-divider {
  color: #ccc;
}

[data-md-color-scheme="slate"] .note-divider {
  color: #666;
}

.note-updated-date {
  color: #0077cc;
}

[data-md-color-scheme="slate"] .note-updated-date {
  color: #88ccff;
}

/* フッターリンク */
.note-footer-links {
  margin: 0.5rem 0;
}

.note-footer-links a {
  margin-right: 1rem;
  color: inherit;
  text-decoration: none;
}

.note-footer-links a:hover {
  text-decoration: underline;
  color: var(--note-accent-color);
}

/* テーブル */
.md-typeset table th {
  background: #f2f2f2;
  font-weight: 600;
  padding: 0.8rem;
  border-bottom: 1px solid var(--note-border-color);
}

[data-md-color-scheme="slate"] .md-typeset table th {
  background: #323232;
  border-bottom: 1px solid var(--note-border-color);
}

/* ソーシャルシェアボタン */
.social-share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  transition: transform 0.2s, opacity 0.2s;
}

.share-button:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

.share-button svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.twitter-share {
  background-color: #1DA1F2;
}

.facebook-share {
  background-color: #4267B2;
}

.linkedin-share {
  background-color: #0077B5;
}

.share-link {
  background-color: #0088cc;
}

/* 筆者プロフィール */
.author-profile {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  margin: 2rem 0;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] .author-profile {
  background-color: #2a2a2a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.author-avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  margin-right: 1rem;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.author-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: var(--note-accent-color);
  color: white;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: bold;
}

.author-info {
  flex-grow: 1;
}

.author-name {
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.author-bio {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
}

[data-md-color-scheme="slate"] .author-bio {
  color: #aaa;
}

.author-social {
  display: flex;
  gap: 0.5rem;
}

.author-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.author-social-link svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.author-social-link:hover svg {
  transform: scale(1.2);
}

/* Twitter共通スタイル */
.twitter-follow-button,
.twitter-button {
  display: inline-flex;
  align-items: center;
  background-color: #1DA1F2;
  color: white;
  border-radius: 9999px;
  padding: 0.4rem 0.8rem;
  margin-left: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s;
}

.twitter-follow-button:hover,
.twitter-button:hover {
  background-color: #1a91da;
  transform: translateY(-2px);
}

.twitter-follow-inner,
.twitter-button {
  display: flex;
  align-items: center;
}

.twitter-icon {
  width: 16px;
  height: 16px;
  fill: white;
  margin-right: 0.4rem;
}

/* Twitter埋め込みコンテナ */
.twitter-integration-section {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] .twitter-integration-section {
  background-color: #2a2a2a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.twitter-section-title {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 1rem;
  text-align: center;
}

.twitter-embed-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.twitter-engagement-container {
  text-align: center;
  margin-top: 1rem;
}

.twitter-engagement-text {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.twitter-engagement-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Twitter各ボタンのカラー */
.twitter-tweet-button {
  background-color: #1DA1F2;
}

.twitter-like-button {
  background-color: #E0245E;
}

.twitter-retweet-button {
  background-color: #17BF63;
}

.twitter-reply-button {
  background-color: #794BC4;
}

/* モバイル対応 */
@media screen and (max-width: 480px) {
  .twitter-engagement-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .twitter-button {
    margin-left: 0;
    margin-bottom: 0.5rem;
    width: 100%;
    justify-content: center;
  }
  
  .twitter-embed-container {
    overflow-x: auto;
    max-width: 100%;
  }
}

/* 右サイドバーのTwitterタイムライン */
.twitter-timeline-sidebar {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

[data-md-color-scheme="slate"] .twitter-timeline-sidebar {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.twitter-timeline-header {
  margin-bottom: 0.5rem;
}

.twitter-timeline-title {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.twitter-icon-small {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 0.4rem;
}

.twitter-icon-small svg {
  width: 100%;
  height: 100%;
  fill: #1DA1F2;
}

.twitter-timeline-container {
  border-radius: 8px;
  overflow: hidden;
  max-height: 600px;
}

/* タイムラインのスクロールバー */
.twitter-timeline-container::-webkit-scrollbar {
  width: 4px;
}

.twitter-timeline-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.twitter-timeline-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

[data-md-color-scheme="slate"] .twitter-timeline-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

[data-md-color-scheme="slate"] .twitter-timeline-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}

/* モバイル表示対応 */
@media screen and (max-width: 480px) {
  .twitter-follow-button {
    margin-top: 0.5rem;
    margin-left: 0;
  }
}

/* カード型ナビゲーション */
.note-post-nav-cards {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
}

.note-post-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: #f5f5f5;
  border-radius: 8px;
  flex: 1;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] .note-post-card {
  background-color: #2a2a2a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.note-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

[data-md-color-scheme="slate"] .note-post-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.post-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.post-card-icon svg {
  width: 24px;
  height: 24px;
}

.post-card-content {
  flex-grow: 1;
  overflow: hidden;
}

.previous-card .post-card-content {
  margin-left: 0.5rem;
}

.next-card .post-card-content {
  margin-right: 0.5rem;
  text-align: right;
}

.post-card-label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.25rem;
}

[data-md-color-scheme="slate"] .post-card-label {
  color: #aaa;
}

.post-card-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* モバイル対応 */
@media screen and (max-width: 76.1875em) {
  .note-post-nav-cards {
    flex-direction: column;
  }
  
  .next-card .post-card-content {
    text-align: left;
  }
  
  .author-profile {
    flex-direction: column;
    text-align: center;
  }
  
  .author-avatar {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .author-social {
    justify-content: center;
  }
}

/* モバイルでの余白調整 */
@media screen and (max-width: 480px) {
  .md-grid {
    max-width: initial;
    margin: 0 0.0rem;
  }
  
  .md-sidebar--primary {
    padding: 0.3rem;
  }
  
  .md-main__inner {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
}

/* 小型モバイル用の追加対応 */
@media screen and (max-width: 480px) {
  /* コンテンツ余白の調整 */
  .md-content__inner {
    padding: 0.2rem 0.1rem;
  }
  
  /* リストの行間調整 */
  .md-typeset ul li,
  .md-typeset ol li {
    margin-bottom: 0.25em;
  }
  
  /* 引用の余白調整 */
  .md-typeset blockquote {
    padding: 0.6rem 1rem;
  }
  
  /* テーブル調整 */
  .md-typeset table {
    font-size: 0.85em;
  }
  
  /* コードブロック調整 */
  .md-typeset pre {
    font-size: 0.8rem;
    line-height: 1.5;
  }
  
  /* インラインコード調整 */
  .md-typeset code {
    font-size: 0.85em;
  }
}

/* グローバルナビゲーション */
.note-global-nav-container {
  background-color: var(--note-nav-background);
  border-bottom: 1px solid var(--note-border-color);
  height: var(--note-nav-height);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: none; /* モバイルでは非表示 */
}

@media (min-width: 76.25em) {
  .note-global-nav-container {
    display: block; /* PCでのみ表示 */
  }
  
  /* PCの場合、ヘッダーとナビの高さを考慮して調整 */
  .md-main {
    margin-top: calc(var(--note-nav-height) + 0px);
  }
}

.note-global-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.note-global-nav-menu {
  display: flex;
  align-items: center;
  height: 100%;
}

.note-global-nav-item {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  color: var(--note-nav-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.note-global-nav-item:hover {
  background-color: var(--note-nav-hover);
  color: var(--note-accent-color);
}

.note-global-nav-item.active {
  background-color: var(--note-nav-active);
  color: var(--note-accent-color);
  font-weight: 600;
}

/* パンくずリスト */
.note-breadcrumb {
  margin: 0 0 1rem 0;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--note-breadcrumb-color);
  display: none; /* モバイルでは非表示 */
}

@media (min-width: 76.25em) {
  .note-breadcrumb {
    display: block; /* PCでのみ表示 */
  }
}

.note-breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.note-breadcrumb-item {
  display: flex;
  align-items: center;
}

.note-breadcrumb-separator {
  margin: 0 0.5rem;
  color: var(--note-breadcrumb-color);
  opacity: 0.7;
}

.breadcrumb-link {
  color: var(--note-breadcrumb-color);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-link:hover {
  color: var(--note-accent-color);
  text-decoration: underline;
}

.note-breadcrumb-current {
  color: var(--note-accent-color);
  font-weight: 600;
}

/* 下半分だけマーカー強調スタイル */
mark, .highlight-bottom {
  background-color: transparent !important; /* 標準の背景色を無効化 */
  background-image: linear-gradient(transparent 60%, #ffe066 40%);
  /* padding: 0.1em 0.4em; */
  padding: 0;
  box-decoration-break: clone;
  border-radius: 0;
}

/* ダークモード対応 */
[data-md-color-scheme="slate"] mark,
[data-md-color-scheme="slate"] .highlight-bottom {
  background-image: linear-gradient(transparent 60%, rgba(255, 224, 102, 0.5) 40%);
}

/* タブ */
.md-typeset .tabbed-set {
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

[data-md-color-scheme="slate"] .md-typeset .tabbed-set {
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.md-typeset .tabbed-set .tabbed-content {
  padding: 1rem;
  background-color: #fafafa;
}

[data-md-color-scheme="slate"] .md-typeset .tabbed-set .tabbed-content {
  background-color: #2a2a2a;
}

/* Mermaid図表 */
.mermaid {
  text-align: center;
  margin: 1.5rem 0;
}

/* インタラクティブコンテンツ */
.interactive-container {
  border: 1px solid var(--note-border-color);
  border-radius: 6px;
  padding: 1rem;
  margin: 1.5rem 0;
  background-color: #fcfcfc;
}

[data-md-color-scheme="slate"] .interactive-container {
  background-color: #2a2a2a;
}

/* ブログ投稿カード */
.blog-post-card {
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  border-radius: 8px;
  box-shadow: var(--note-card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

[data-md-color-scheme="slate"] .blog-post-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.blog-post-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.blog-post-meta {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 1rem;
}

[data-md-color-scheme="slate"] .blog-post-meta {
  color: #aaa;
}

.blog-post-excerpt {
  margin-bottom: 1rem;
}

.blog-post-readmore {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background-color: var(--note-accent-color);
  color: white;
  border-radius: 4px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: background-color 0.2s;
}

.blog-post-readmore:hover {
  background-color: #7e57c2;
}

/* 数式スタイル */
.arithmatex {
  overflow-x: auto;
  overflow-y: hidden;
}

/* SVG コンテナ */
.svg-container {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

/* iframe コンテナ */
.iframe-container {
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
  padding-bottom: 56.25%; /* 16:9 アスペクト比 */
  height: 0;
  overflow: hidden;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

/* 音声プレイヤー */
.audio-player {
  width: 100%;
  margin: 1.5rem 0;
}

/* カスタムコントロール */
.custom-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--note-accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.custom-button:hover {
  background-color: #7e57c2;
}

.custom-input {
  padding: 0.5rem;
  border: 1px solid var(--note-border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

/* タグの設定 */
.md-typeset .tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  margin: 0 0.3rem 0.3rem 0;
  font-size: 0.75rem;
  border-radius: 3px;
  background: #f0f0f0;
  color: #606060;
  text-decoration: none;
  transition: background 0.2s;
}

[data-md-color-scheme="slate"] .md-typeset .tag {
  background: #3a3a3a;
  color: #d0d0d0;
}

.md-typeset .tag:hover {
  background: var(--note-accent-color);
  color: white;
}
