/* -------------------------------------------------
   Easy Running Modern Style with Dark Mode
   Ver.2025-11-07 (Organized)
   ------------------------------------------------- */

/* ========== CSS Variables ========== */
:root {
  /* Light Mode Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-gradient-start: #ffffff;
  --bg-gradient-end: #f0f4f8;
  --text-primary: #1a202c;
  --text-secondary: #2d3748;
  --text-muted: #718096;
  --accent-primary: #5b8fd8;
  --accent-secondary: #4a7fc0;
  --accent-hover: #3d6ba8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 6px 12px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 10px 20px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.1);
  --table-odd: #ffffff;
  --table-even: #f7fafc;
  --table-header: #e2e8f0;
  --table-body-th: #f0f4f8;
  --nav-bg: rgba(255, 255, 255, 0.98);
  --backdrop: rgba(0, 0, 0, 0.5);
}

/* Dark Mode Colors - System preference & Manual toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-gradient-start: #1a202c;
    --bg-gradient-end: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --accent-primary: #6fa3e8;
    --accent-secondary: #5b8fd8;
    --accent-hover: #8bb9f0;
    --border-color: #4a5568;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 8px 16px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 12px 24px rgba(0, 0, 0, 0.7), 0 6px 12px rgba(0, 0, 0, 0.5);
    --table-odd: #2d3748;
    --table-even: #374151;
    --table-header: #374151;
    --table-body-th: #334155;
    --nav-bg: rgba(45, 55, 72, 0.98);
    --backdrop: rgba(0, 0, 0, 0.7);
  }
}

/* Manual Dark Mode Toggle */
[data-theme="dark"] {
  --bg-primary: #1a202c;
  --bg-secondary: #2d3748;
  --bg-gradient-start: #1a202c;
  --bg-gradient-end: #2d3748;
  --text-primary: #f7fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
  --accent-primary: #6fa3e8;
  --accent-secondary: #5b8fd8;
  --accent-hover: #8bb9f0;
  --border-color: #4a5568;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 16px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 12px 24px rgba(0, 0, 0, 0.7), 0 6px 12px rgba(0, 0, 0, 0.5);
  --table-odd: #2d3748;
  --table-even: #374151;
  --table-header: #374151;
  --table-body-th: #334155;
  --nav-bg: rgba(45, 55, 72, 0.98);
  --backdrop: rgba(0, 0, 0, 0.7);
}

/* ========== Base Styles ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: "Folk Regular", "Hiragino Maru Gothic W4 JIS2004", "游ゴシック体", "Yu Gothic", "Hiragino Sans", sans-serif;
  line-height: 1.9;
  font-size: 1.0rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ========== Header ========== */
header {
  position: relative;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  padding: 3rem 1rem 2.5rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

header h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-family: "Shin Go Medium", "Hiragino Sans", "游ゴシック体", "Yu Gothic", "メイリオ", sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.3;
}

.site-name {
  display: block;
  font-size: clamp(1.0rem, 3vw, 1.3rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

/* ========== Dark Mode Toggle Button ========== */
.theme-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  width: 50px;
  height: 50px;
  background: var(--nav-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: var(--text-primary);
  transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

/* ========== Navigation ========== */
#main-nav {
  font-family: "Shin Go Medium", "Hiragino Sans", "游ゴシック体", "Yu Gothic", "メイリオ", sans-serif;
  text-align: center;
  margin: 1rem auto;
  padding: 0 1rem;
}

#main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#main-nav ul li {
  margin: 0;
}

#main-nav ul li a {
  display: inline-block;
  text-decoration: none;
  color: var(--accent-primary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

#main-nav ul li a:hover {
  background: var(--bg-primary);
  color: var(--accent-hover);
  border-color: var(--border-color);
}

/* ========== Hamburger Menu ========== */
.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  right: 15px;
  width: 50px;
  height: 60px;
  cursor: pointer;
  z-index: 1100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  padding-bottom: 4px;
}

.menu-toggle:hover {
  box-shadow: var(--shadow-lg);
}

.menu-toggle::before {
  content: "MENU";
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.menu-toggle.active::before {
  content: "CLOSE";
  color: var(--accent-primary);
  font-weight: 700;
}

.menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.35s ease;
}

.menu-toggle span:not(:last-child) {
  margin-bottom: 5px;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========== Article ========== */
article {
  max-width: 900px;
  margin: 1rem auto 2rem;
  background: var(--bg-primary);
  padding: 1rem 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.3s ease;
}

article:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

article a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

article a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

#time {
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

#time .author {
  font-weight: 600;
  color: var(--text-primary);
}

/* entryのヘッダーにはサイトヘッダー用の装飾を当てない */
.entry-header {
  margin-bottom: 1.5rem;
  padding: 0;
  background: none;
  border-bottom: none;
  box-shadow: none;
  text-align: left;
}

/* ========== Typography ========== */
h2, h3, h4, h5, h6 {
  font-family: "Shin Go Medium", "Hiragino Sans", "游ゴシック体", "Yu Gothic", "メイリオ", sans-serif;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* h2: グラデーション下線 + 左アクセント */
h2 {
  font-size: clamp(1.5rem, 4vw, 1.8rem);
  padding: 0.6rem 0 0.6rem 1rem;
  margin: 2.5rem 0 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, transparent 100%);
  border-left: 4px solid var(--accent-primary);
  border-bottom: 1px solid var(--border-color);
  border-radius: 0 4px 4px 0;
  position: relative;
  transition: all 0.3s ease;
  font-weight: 600;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 30%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
}

h2:hover {
  border-left-color: var(--accent-hover);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-secondary) 50%, transparent 100%);
}

/* h3: 左ボーダー + ドットアクセント */
h3 {
  font-size: clamp(1.1rem, 2.8vw, 1.25rem);
  padding: 0.4rem 0 0.4rem 1.2rem;
  margin: 2rem 0 1.25rem;
  background: transparent;
  border-left: 3px solid var(--accent-primary);
  transition: all 0.3s ease;
  position: relative;
  font-weight: 600;
}

h3::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  background: var(--accent-primary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

h3:hover {
  padding-left: 1.5rem;
  color: var(--accent-primary);
}

h3:hover::before {
  background: var(--accent-hover);
  transform: translateY(-50%) scale(1.2);
}

/* h4: シンプルなアンダーライン */
h4 {
  font-size: clamp(0.95rem, 2.3vw, 1.1rem);
  color: var(--text-primary);
  padding: 0.3rem 0;
  margin: 1.5rem 0 1rem;
  font-weight: 600;
  position: relative;
  display: inline-block;
  transition: all 0.3s ease;
}

h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2em;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}

h4:hover::after {
  width: 100%;
}

/* h5: h4同等サイズ（装飾なし） */
h5 {
  font-size: clamp(0.95rem, 2.3vw, 1.1rem);
  color: var(--text-primary);
  margin: 1.5rem 0 0.8rem;
  font-weight: 600;
}

/* h6: 本文同等サイズ（装飾なし） */
h6 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 1.25rem 0 0.6rem;
  font-weight: 600;
}

p {
  margin: 1.25rem 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 太字（Webフォントでも太字に見えるように） */
strong, b {
  font-weight: 700;
  text-shadow: 0.3px 0 0 currentColor;
}

/* ========== Lists ========== */
/* 箇条書きリスト */
article ul {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
  color: var(--text-secondary);
}

article ul li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.8;
  transition: transform 0.2s ease;
}

article ul li::before {
  content: "▸";
  position: absolute;
  left: 0.5rem;
  color: var(--accent-primary);
  font-size: 1.1em;
  font-weight: bold;
  transition: transform 0.3s ease;
}

article ul li:hover {
  transform: translateX(4px);
}

article ul li:hover::before {
  transform: scale(1.2);
  color: var(--accent-hover);
}

/* ネストされたリスト */
article ul ul {
  margin: 0.5rem 0;
}

article ul ul li::before {
  content: "◦";
  font-size: 1.2em;
}

/* 番号付きリスト */
article ol {
  list-style: none;
  counter-reset: item;
  padding-left: 0;
  margin: 1.5rem 0;
  color: var(--text-secondary);
}

article ol li {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 0.75rem;
  line-height: 1.8;
  counter-increment: item;
  transition: transform 0.2s ease;
}

article ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85em;
  transition: all 0.3s ease;
}

article ol li:hover {
  transform: translateX(4px);
}

article ol li:hover::before {
  background: var(--accent-hover);
  transform: scale(1.1);
}

/* ネストされた番号付きリスト */
article ol ol {
  margin: 0.5rem 0;
}

article ol ol li::before {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}

/* 定義リスト */
article dl {
  margin: 1.5rem 0;
  color: var(--text-secondary);
}

article dt {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-primary);
  font-size: 1.05em;
  transition: all 0.3s ease;
}

article dt:first-child {
  margin-top: 0;
}

article dt:hover {
  border-left-color: var(--accent-hover);
  padding-left: 1.25rem;
}

article dd {
  margin-left: 2rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  line-height: 1.8;
  border-left: 2px solid var(--border-color);
  color: var(--text-secondary);
}

article dd:last-child {
  margin-bottom: 0;
}

/* ========== Blockquote ========== */
blockquote {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-primary);
  margin: 2rem 0;
  padding: 1.25rem 1.75rem;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

blockquote footer {
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: normal;
}

/* ========== Code Block ========== */
pre {
  background: var(--bg-secondary);
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Courier New", monospace;
  font-size: 0.9em;
  color: var(--accent-primary);
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* ========== Images ========== */
.photo img,
article img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  margin: 1.0rem 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo img:hover,
article img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* ========== Horizontal Rule ========== */
hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 2.5rem 0;
}

/* ========== Table ========== */
.table-wrapper {
  max-width: 100%;
  max-height: 80vh;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.table-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 5px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.table-wrapper table {
  width: 100%;
  border-spacing: 0;
  white-space: nowrap;
}

.table-wrapper table tr:nth-child(odd) {
  background: var(--table-odd);
}

.table-wrapper table tr:nth-child(even) {
  background: var(--table-even);
}

.table-wrapper table tr:hover {
  background: var(--accent-primary);
  color: white;
}

.table-wrapper table th,
.table-wrapper table td {
  min-width: 5rem;
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.table-wrapper table th {
  background: var(--table-header);
  font-weight: 700;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-wrapper table tbody th {
  position: sticky;
  left: 0;
  background: var(--table-body-th);
  font-weight: 600;
  z-index: 9;
}

.table-wrapper table thead th:first-child {
  left: 0;
  z-index: 11;
}

.table-wrapper table :is(th.japanese-text, td.japanese-text) {
  text-align: left;
  min-width: 5rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ========== Footer ========== */
footer {
  text-align: center;
  margin: 3rem 0;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--accent-hover);
}

footer hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 2rem auto;
  max-width: 600px;
}

/* ========== Access Counter ========== */
.access-counter {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 999;
}

.access-counter p {
  margin: 0;
  padding: 0 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 50px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.access-counter:hover p {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  background: var(--bg-secondary);
}

.counter-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.access-counter:hover .counter-number {
  color: var(--accent-primary);
}

/* ========== Scroll to Top Button ========== */
#scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(100px);
}

#scroll-to-top.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

#scroll-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

#scroll-to-top svg {
  width: 24px;
  height: 24px;
  fill: white;
}

/* ========== Footer address - PC: inline / Mobile: line break ========== */
address br {
  display: none;
}

address::after {
  content: " ";
  white-space: pre;
}

/* ========== Responsive - Tablet & Mobile (max-width: 768px) ========== */
@media screen and (max-width: 768px) {
  body > header {
    padding-top: 80px !important;
  }

  header h1 {
    text-align: left !important;
    margin-left: 15px !important;
    padding-right: 70px !important;
  }

  /* Hamburger Menu */
  .menu-toggle {
    display: flex !important;
  }

  /* Navigation */
  #main-nav {
    position: fixed !important;
    top: 0 !important;
    right: -280px !important;
    width: 280px !important;
    height: 100% !important;
    background: var(--nav-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-left: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
    z-index: 1000 !important;
    margin: 0 !important;
    padding-top: 80px !important;
    overflow-y: auto !important;
    transition: right 0.3s ease !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  #main-nav.active {
    right: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  #main-nav ul {
    flex-direction: column !important;
    gap: 0 !important;
  }

  #main-nav ul li {
    border-bottom: 1px solid var(--border-color) !important;
  }

  #main-nav ul li a {
    display: block !important;
    padding: 1.2rem 1.5rem !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  #main-nav ul li a:hover {
    background: var(--accent-primary) !important;
    color: white !important;
    transform: none !important;
  }

  #main-nav ul li a,
  #main-nav ul li a:focus,
  #main-nav ul li a:active {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .menu-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  /* Article */
  article {
    margin: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
  }

  /* Table */
  .table-wrapper table th,
  .table-wrapper table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Access Counter */
  .access-counter {
    bottom: 20px;
    left: 20px;
  }
  
  .access-counter p {
    min-width: 70px;
    height: 45px;
    padding: 0 15px;
    opacity: 0.9;
  }
  
  .counter-number {
    font-size: 1.1rem;
  }
  
  .access-counter:active p {
    transform: scale(0.95);
  }

  /* Scroll to Top */
  #scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    opacity: 0.9;
  }
  
  #scroll-to-top.show {
    display: flex !important;
    opacity: 0.9 !important;
  }
  
  #scroll-to-top:active {
    background: var(--accent-hover);
    transform: scale(0.95);
  }

  /* Address - enable line break */
  address br {
    display: inline;
  }

  address::after {
    content: none;
  }

  /* Race & Practice Notes List */
  #race + ul li,
  #practice-notes + ul li {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
  }

  #race + ul li time,
  #practice-notes + ul li time {
    display: block;
    font-size: 0.94rem;
    color: var(--text-muted);
    font-weight: 600;
  }

  #race + ul li a,
  #practice-notes + ul li a {
    color: var(--accent-primary) !important;
    font-weight: 600;
    font-size: 1.0rem;
    line-height: 1.4;
    text-decoration: none;
  }

  #race + ul li a:hover,
  #practice-notes + ul li a:hover {
    color: var(--accent-hover) !important;
    text-decoration: underline;
  }
}

/* ========== Responsive - Small Mobile (max-width: 640px) ========== */
@media screen and (max-width: 640px) {
  body {
    font-size: 0.95rem;
  }

  article {
    padding: 1rem 1rem;
  }
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
}

.pagination a {
  background: var(--accent-subtle, #e3f2fd);
  color: var(--accent, #1976d2);
}

.pagination a:hover {
  background: var(--accent, #1976d2);
  color: white;
}

.pagination .current {
  background: var(--accent, #1976d2);
  color: white;
  font-weight: bold;
}

.pagination .disabled {
  color: var(--text-muted, #999);
  cursor: not-allowed;
}

.pagination .dots {
  padding: 0.5rem 0.25rem;
}

.pagination .page-numbers {
  display: flex;
  gap: 0.25rem;
}

/* ========== Read More ========== */
.read-more {
  margin-top: 1rem;
}

.read-more a {
  color: var(--accent, #1976d2);
}

/* ========== Entry Meta ========== */
.entry-meta {
  font-size: 0.9em;
  color: var(--text-muted, #666);
  margin: 0 0 0.3rem;
  text-align: right;
}

.entry-meta .date {
  margin-right: 1em;
}

/* 一覧表示（日付のみ）のときは右マージンを消す */
.entry-meta .date:last-child {
  margin-right: 0;
}

.entry-meta .author {
  color: var(--text-muted, #666);
}

/* ========== Entry Title ========== */
.entry-title {
  font-size: 1.8em;
  margin: 0.3em 0 0;
  text-align: left;
  font-weight: bold;
}

/* ========== Entry Body ========== */
.entry-body {
  margin-top: 0;
  clear: both;
}

.entry-title a {
  text-decoration: none;
  color: inherit;
}

.entry-title a:hover {
  color: var(--accent, #1976d2);
}

/* ========== Entry Navigation ========== */
.entry-nav {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border, #ddd);
  border-bottom: 1px solid var(--border, #ddd);
}

.entry-nav a {
  text-decoration: none;
  color: var(--accent, #1976d2);
  max-width: 45%;
}

.entry-nav a:hover {
  text-decoration: underline;
}

.entry-nav .prev::before {
  content: "← ";
}

.entry-nav .next::after {
  content: " →";
}

/* ========== AdSense ========== */
.adsense_lower {
  margin: 2rem 0;
  text-align: center;
}

/* ========== Google Search ========== */
.search-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.gcse-searchbox-only {
  max-width: 100%;
}

/* ========== Latest Posts Widget ========== */
.latest-posts {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.latest-posts h3 {
  font-size: 0.9em;
  margin: 0 0 0.8rem;
  color: var(--text-muted, #666);
}

.latest-posts ul {
  margin: 0;
  padding-left: 1.5em;
}

.latest-posts li {
  margin-bottom: 0.3em;
  line-height: 1.4;
}

.latest-posts .post-date {
  font-size: 0.85em;
  color: var(--text-muted, #888);
  margin-right: 0.5em;
}

.latest-posts a {
  color: var(--accent, #1976d2);
  text-decoration: none;
  font-size: 0.95em;
}

.latest-posts a:hover {
  text-decoration: underline;
}

.latest-posts .eyecatch {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 0.5em;
  vertical-align: middle;
}

/* ========== All Posts Link ========== */
.all-posts-link {
  margin: 0.8rem 0 0;
  text-align: right;
  font-size: 0.85em;
}

.all-posts-link a {
  color: var(--accent-primary, #5b8fd8);
  text-decoration: none;
}

.all-posts-link a:hover {
  text-decoration: underline;
}

/* ========== All Posts List Page ========== */
.all-posts-list {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.all-posts-category {
  margin-bottom: 1.2rem;
}

.all-posts-category:last-child {
  margin-bottom: 0;
}

.all-posts-category h3 {
  font-size: 0.9em;
  margin: 0 0 0.8rem;
  color: var(--text-muted, #666);
}

.all-posts-category .post-count {
  font-weight: normal;
  font-size: 0.9em;
  color: var(--text-muted, #718096);
}

.all-posts-category ul {
  margin: 0;
  padding-left: 1.5em;
}

.all-posts-category li {
  margin-bottom: 0.3em;
  line-height: 1.4;
}

.all-posts-category .post-date {
  font-size: 0.85em;
  color: var(--text-muted, #888);
  margin-right: 0.5em;
}

.all-posts-category a {
  color: var(--accent-primary, #5b8fd8);
  text-decoration: none;
  font-size: 0.95em;
}

.all-posts-category a:hover {
  text-decoration: underline;
}

.back-to-home {
  margin-top: 1rem;
  font-size: 0.9em;
}

.back-to-home a {
  color: var(--accent-primary, #5b8fd8);
  text-decoration: none;
}

.back-to-home a:hover {
  text-decoration: underline;
}

/* ========== SP Only (Mobile) ========== */
.sp-only {
  display: none;
}

/* ========== Entry Eyecatch (List) ========== */
.entry-eyecatch {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  float: left;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

/* ========== Google Search ========== */
.amazon-card {
  display: block;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-primary, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  max-width: 100%;
}

.amazon-card:hover {
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
  transform: translateY(-2px);
}

.amazon-card a {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.amazon-card-image {
  flex-shrink: 0;
  width: 120px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.amazon-card-image img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.amazon-card-body {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.amazon-card-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #1a202c);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.amazon-card-price {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e47911;
}

.amazon-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
  border: 1px solid #a88734;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #111;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.amazon-btn:hover {
  background: linear-gradient(to bottom, #f5d78e, #eeb933);
}

.amazon-card.amazon-error {
  background: var(--bg-secondary, #f8f9fa);
  padding: 1rem;
}

.amazon-card.amazon-error p {
  margin: 0;
  color: var(--text-muted, #718096);
  font-size: 0.9rem;
}

/* Amazon Card レスポンシブ */
@media screen and (max-width: 480px) {
  .amazon-card a {
    flex-direction: column;
  }
  
  .amazon-card-image {
    width: 100%;
    padding: 1rem;
  }
  
  .amazon-card-image img {
    max-height: 150px;
  }
}

/* Amazon Text Card（画像なし） */
.amazon-text-card {
  background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
  border-left: 4px solid #f0c14b;
}

.amazon-text-card a {
  align-items: center;
  padding: 0.5rem;
}

.amazon-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  margin: 0.5rem 1rem 0.5rem 0.5rem;
  color: #ff9900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amazon-card-icon svg {
  width: 100%;
  height: 100%;
}

.amazon-text-card .amazon-card-body {
  padding: 0.75rem 0.75rem 0.75rem 0;
}

.amazon-text-card .amazon-card-title {
  margin-bottom: 0.75rem;
  -webkit-line-clamp: 3;
  color: #111;  /* 背景が明るいので常に黒文字 */
}

/* Amazon Fallback Card */
.amazon-fallback {
  background: var(--bg-secondary, #f8f9fa);
}

.amazon-fallback .amazon-card-body {
  align-items: flex-start;
}

@media screen and (max-width: 480px) {
  .amazon-text-card a {
    flex-direction: row;
  }
  
  .amazon-card-icon {
    width: 40px;
    height: 40px;
  }
}

/* ========== Responsive - Mobile (max-width: 768px) - Additional ========== */
@media screen and (max-width: 768px) {
  .sp-only {
    display: inline;
  }

  .search-area {
    padding: 0 1rem;
  }

  .footer-contact {
    display: block;
  }

  .footer-contact .arrow {
    display: block;
    margin-top: 0.3em;
  }
}
