:root {
  --nav-bg: #1e293b;
  --nav-text: #f8fafc;
  --nav-accent: #89BDD6;
  --nav-border: #334155;
  --badge-pro: #d97706;
}

/* ヘッダー全体 */
.site-header {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 左上の「ScriptTrek」文字は消してメニューに統合するため、非表示にするかヘッダーから除外します */
.site-logo {
  display: none; /* メニュー内に移動するため非表示 */
}

/* メニュー開閉ボタン：カードの右上、あるいはメインコンテンツの右上に配置 */
.menu-toggle-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1500;
  width: 40px;
  height: 40px;
  border: 1px solid var(--nav-border);
  border-radius: 50%;
  background-color: #2E374A;
  color: var(--nav-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.menu-toggle-btn:hover {
  background: var(--nav-border);
  border-color: var(--nav-accent);
}

.menu-toggle-btn .btn-text {
  display: none;
}

/* ハンバーガーアイコン (三本ライン) */
.nav-icon,
.nav-icon::before,
.nav-icon::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--nav-accent);
  position: relative;
}
.nav-icon::before { position: absolute; top: -5px; left: 0; }
.nav-icon::after { position: absolute; top: 5px; left: 0; }

/* ドロワーナビゲーション (右側からスライドイン) */
/* ドロワーナビゲーション (右側、または左側からのスライドイン) */
.drawer {
  position: fixed;
  top: 0;
  right: -320px; /* 初期状態は画面外 */
  width: 300px; /* デフォルトの幅 */
  max-width: 80vw; /* スマホで画面を完全に覆わないよう、最大でも画面幅の80%までに制限 */
  height: 100vh;
  background-color: var(--nav-bg);
  color: var(--nav-text);
  z-index: 2000;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.drawer.is-active,
.drawer.open {
  right: 0; /* 開いたとき */
}
.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nav-accent);
}

.close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #ffffff;
}

/* メニュー内の文字を小さくするクラス */
.menu-small-text {
  font-size: 0.75em; /* お好みで 0.65em 〜 0.75em に微調整してください */
}

/* メニューコンテンツ */
.menu-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section h3,
.nav-section > summary {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--nav-border);
}

/* 折りたたみ可能なメニューセクション (<details>/<summary>) */
.nav-section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
}

.nav-section > summary::-webkit-details-marker {
  display: none;
}

.nav-section > summary::after {
  content: "\25BE"; /* ▾ */
  font-size: 0.75rem;
  color: var(--nav-accent);
  margin-left: 8px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details.nav-section[open] > summary::after {
  transform: rotate(180deg);
}

.nav-section > summary:hover {
  color: var(--nav-accent);
}

.nav-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-section li {
  margin-bottom: 4px;
}

.nav-section a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.nav-section a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--nav-accent);
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 800px;
  margin: 30px auto;
  padding: 0 15px;
}

.utility-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 10px;
  background-color: #2E374A;
  color: #F4F6F9;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.utility-grid a:hover {
  background-color: #3B475E;
  transform: translateY(-2px);
}

.utility-grid a.free-link {
  background-color: #DCFCE7;
  color: #166534;
  font-weight: bold;
  border: 1px solid #86EFAC;
}

.utility-grid a.free-link:hover {
  background-color: #BBF7D0;
  color: #14532D;
}

.utility-grid a.etsy-link {
  background-color: #BFE8F5;
  color: #16324F;
  font-weight: bold;
}

.utility-grid a.etsy-link:hover {
  background-color: #8DD3E8;
  color: #102A43;
}



/* オーバーレイ背景 */
#drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#drawer-overlay.is-active,
#drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.post-header--small-title h1 {
  font-size: 1.1rem; /* 現状のおよそ半分目安。お好みで調整してください */
}


/* =========================================
   Mobile drawer
   ========================================= */

@media screen and (max-width: 768px) {

  .drawer {
    width: min(300px, 82vw);
    max-width: 82vw;

    /* 初期状態：画面外 */
    right: -100%;
    left: auto;

    transition: right 0.3s ease;
  }

  .drawer.is-active,
  .drawer.open {
    right: 0;
    left: auto;
  }

}
