/* ヘッダー全体（画面幅） */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;

  background-color: #fffffff3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* ★ latex.css の本文幅に合わせる */
.header-inner {
  width: 60%;
  margin: 0 auto;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0.1em;
  /* latex風の余白 */
}


.logo img {
  height: 75px;
  position: fixed;
  top: 0;
  left: 20px;
  background-color: rgba(255, 251, 251, 0);
  z-index: 1000;
  /* 他の要素より前に出す */
}

.header-right {
  font-size: 30px;
}

.navbar {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 10px 0;
}

.navbar a {
  color: white !important;
  /* latex系の色変更に勝つために !important */
  text-decoration: none;
  font-size: 18px;
}

.navbar a:hover {
  background: #444;
  border-radius: 4px;
}

body {
  padding-top: 100px;
}

.content-img {
  max-width: 100%;
  height: auto;
  margin: 1.5em auto;
  display: block;
}

.shorts-wrapper {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9 / 16;
  margin: 2em auto;
}

.shorts-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* すべての本文画像に適用してOK */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: .1em auto;
}

@media (max-width: 768px) {

  .logo img {
    height: 10%;
  }

  .header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 10%;

    background-color: #fffffff3;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  /* ★ latex.css の本文幅に合わせる */
  .header-inner {
    width: 60%;
    margin: 0 auto;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.1em;
    /* latex風の余白 */
  }
  .header-right {
  font-size: 18px;
}
body {
  padding-top: 60px;
}
}

.navbar {
  gap: 16px;
  font-size: 14px;
  flex-wrap: wrap;
  /* 横に入りきらなければ折り返す */
}
/* コード全体のラッパー */
div.code-toolbar {
  position: relative;
}

/* 上部のツールバー（コピーボタン） */
div.code-toolbar > .toolbar {
  position: relative;
  top: auto;
  right: auto;
  width: 99.9%;
  box-sizing: border-box;

  background: rgba(53, 54, 54, 0.79);          /* 白背景 */
  border-bottom: 1px solid #ddd;
  padding: 6px 10px;
  text-align: right;
  z-index: 2;
}

/* ボタンの見た目調整（任意） */
div.code-toolbar > .toolbar .toolbar-item button {
  background: #f5f5f5;
  border: 1px solid #e5e3e3;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* コードの1行目が白帯に隠れないようにする */
pre[class*="language-"] {
  padding-top: .2em;
}
div.code-toolbar > pre {
  margin-top: 0;
  padding-top: 3em;        /* ← 白帯の高さより少し大きく */
}