:root {
  --bg-color: #050505;
  --surface-color: #121212;
  --text-color: #f0f0f0;
  --text-muted: #a0a0a0;
  --accent-color: #00d1ff;
  --border-color: #222222;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scroll Progress Bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(to right, var(--accent-color), #00ffaa);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* Header & Nav */
header.site-header {
  position: sticky;
  top: 0;
  background-color: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-color);
  z-index: 900;
  padding: 2.5rem 2rem;
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.header-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0.5rem;
}

.site-title a {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-color);
  text-decoration: none;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}

.site-title a:hover {
  color: var(--accent-color);
}

.site-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.nav-row {
  display: flex;
  justify-content: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.nav-links a i {
  margin-right: 0.6rem;
  color: var(--accent-color);
  font-size: 1.1em;
}

.nav-links a:hover {
  color: var(--accent-color);
}

/* Social Bar Below Menu */
.social-links-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.social-links-row a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.social-links-row a:hover {
  color: var(--accent-color);
}

.social-links-row a i {
  margin-right: 0.4rem;
}

/* Hamburger Menu Button */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.menu-toggle span {
  width: 2rem;
  height: 0.25rem;
  background: var(--text-color);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

.menu-toggle.is-active span:first-child { transform: rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: rotate(-45deg); }

/* Main Content */
main {
  max-width: 850px;
  margin: 6rem auto;
  padding: 0 2rem;
}

/* Post Listings */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

.post-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 1, 0.3, 1), transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.post-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.post-item h2 {
  margin: 0 0 1.2rem 0;
  font-size: 2.8rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

/* Global Links and Taxonomy */
a {
  color: var(--accent-color); /* 未読: テーマのシアン */
  text-decoration: none;
  transition: all 0.2s ease;
}

a:visited {
  color: #70a1ad; /* 既読: 少し落ち着いたシアン・グレー */
}

a:hover {
  color: #80eaff; /* ホバー: より明るいシアン */
  text-decoration: underline;
}

.post-item h2 a {
  color: var(--accent-color);
  text-decoration: none;
}

.post-item h2 a:visited {
  color: #70a1ad;
}

.post-item h2 a:hover {
  color: #80eaff;
  text-decoration: none; /* タイトルは下線なしで色の変化のみ */
}

.post-meta {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
}

.post-meta i {
  color: var(--accent-color);
  margin-right: 0.5rem;
}

.post-summary {
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1.6;
}

/* Article Styling */
article.post-single header {
  margin-bottom: 6rem;
}

article.post-single h1 {
  font-size: 4.5rem;
  margin: 1rem 0;
  letter-spacing: -0.05em;
  line-height: 1;
}

.article-content {
  font-size: 1.35rem;
  line-height: 1.8;
}

/* Force Image 500px everywhere in main content */
#main img {
  width: 500px !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 12px;
  margin: 4rem auto;
  display: block;
  cursor: zoom-in;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#main img:hover {
  transform: scale(1.05);
}

#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.98);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#lightbox.active {
  opacity: 1;
  visibility: visible;
}

#lightbox img {
  width: auto !important;
  max-width: 95% !important;
  max-height: 95% !important;
  object-fit: contain;
  box-shadow: 0 0 120px rgba(0,0,0,1);
  cursor: zoom-out;
}

/* Footer */
footer.site-footer {
  margin-top: 15rem;
  padding: 10rem 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.copyright {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 10rem;
}

.pagination a {
  padding: 1.2rem 2.5rem;
  background-color: var(--surface-color);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 800;
  border: 3px solid var(--border-color);
  transition: all 0.4s;
}

.pagination a:hover {
  background-color: var(--accent-color);
  color: var(--bg-color);
  border-color: var(--accent-color);
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 209, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  article.post-single h1 { font-size: 2.5rem; }
  .post-item h2 { font-size: 1.8rem; }
  header.site-header { padding: 1.5rem 1rem; }
  
  .header-top { justify-content: space-between; }
  .site-title a { font-size: 1.8rem; letter-spacing: 0.1em; }
  
  .menu-toggle { display: flex; }
  
  .mobile-menu-content {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    max-height: calc(100vh - 100px); /* 画面からはみ出さないように制限 */
    overflow-y: auto; /* スクロール可能にする */
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5rem; /* 最後の項目が隠れないよう、下部に十分な余白を確保 */
  }
  
  .mobile-menu-content.is-active { display: flex; }
  
  .nav-row { border-top: none; padding-top: 0; }
  .nav-links { flex-direction: column; gap: 1rem; }
  .nav-links a { font-size: 1.2rem; }
  
  .social-links-row { flex-direction: column; gap: 0.8rem; margin-top: 1rem; border-top: 1px solid var(--border-color); padding-top: 1.5rem;}
  
  #main img { width: 100% !important; }
}
