/* 印刷ボタンのスタイル */
.print-button-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.print-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.print-button:hover {
  opacity: 0.8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.print-button svg {
  width: 20px;
  height: 20px;
}

/* 印刷時のスタイル */
@media print {
  /* 印刷ボタンを非表示 */
  .print-button-container {
    display: none !important;
  }
  
  /* ヘッダー・フッター・ナビゲーションを非表示 */
  .md-header,
  .md-footer,
  .md-sidebar,
  .md-search,
  .md-tabs,
  .md-nav__link--active,
  .md-source {
    display: none !important;
  }
  
  /* メインコンテンツを最適化 */
  .md-content {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .md-content__inner {
    margin: 0 !important;
    padding: 1cm !important;
    max-width: 100% !important;
  }
  
  /* リンクのURL表示 */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* 改ページの最適化 */
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  pre, blockquote, table {
    page-break-inside: avoid;
  }
  
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
  
  /* コードブロックの調整 */
  .highlight {
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
  
  /* 数式の調整 */
  .MathJax {
    font-size: 100% !important;
  }
  
  /* 背景色を白に */
  body {
    background: white !important;
    color: black !important;
  }
  
  /* テーブルの境界線 */
  table {
    border-collapse: collapse;
  }
  
  table, th, td {
    border: 1px solid #000;
  }
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .print-button-text {
    display: none;
  }
  
  .print-button {
    padding: 0.5rem;
    min-width: 40px;
    justify-content: center;
  }
}
