/* ============================================
   satory074.hatenablog.com - Total Design CSS
   Theme: Minimalism base + custom overrides
   ============================================ */

/* --- Color Variables --- */
:root {
  --bg: #fafafa;
  --text: #333333;
  --heading: #1a1a1a;
  --accent: #4a90d9;
  --accent-hover: #2a70b9;
  --border: #e0e0e0;
  --code-bg: #f5f5f5;
  color-scheme: light;
}

/* --- Base / Typography --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI",
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo",
    "Noto Sans JP", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.8;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;

}

/* Japanese italic override — bold is more readable */
.entry-content em {
  font-style: normal;
  font-weight: 700;
}

/* Text selection */
::selection {
  background: rgba(74, 144, 217, 0.2);
  color: var(--heading);
}

/* Keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Header --- */
#blog-title {
  padding: 3rem 1rem 1.5rem;
  background: transparent;
  max-width: 1100px;
  margin: 0 auto;
}

#title a {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 0.02em;
}

#blog-description {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.3rem;
}

/* --- Global Navigation --- */
.global-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.global-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.global-nav li a {
  display: block;
  padding: 0.7rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.global-nav li a:hover {
  color: var(--accent);
  background-color: rgba(74, 144, 217, 0.05);
}

/* --- Content Area --- */
#content-inner {
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden; /* clearfix for floated children */
  padding: 0 1rem;
}

#wrapper {
  width: 760px;
  float: left;
}

#box2 {
  width: 280px;
  float: right;
  font-size: 0.9rem;
}

#main {
  border-right-color: var(--border);
}

/* --- Article List / Entry --- */
.entry {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.entry:last-child {
  border-bottom: none;
}

.entry-title {
  margin-bottom: 0.5rem;
}

.entry-title a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
  line-height: 1.4;
}

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

.date {
  margin-bottom: 0.5rem;
}

.date a {
  font-size: 0.8rem;
  color: #666;
  text-decoration: none;
}

.entry-content {
  font-size: 1rem;
  line-height: 1.8;
  max-width: 680px;
}

/* --- Headings (h1-h4) --- */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  scroll-margin-top: 1rem;
}

.entry-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);
  padding-bottom: 0.6rem;
  margin: 3rem 0 1.5rem;
  border-bottom: 3px solid var(--accent);
}

.entry-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading);
  padding: 0.4rem 0 0.4rem 0.8rem;
  margin: 2.5rem 0 1.2rem;
  border-left: 4px solid var(--accent);
  background: none;
}

.entry-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading);
  padding-bottom: 0.4rem;
  margin: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

.entry-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
  margin: 1.5rem 0 0.8rem;
}

/* --- Links --- */
.entry-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.entry-content a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* --- Images --- */
.entry-content img {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 100%;
  height: auto;
}

/* --- Code Blocks --- */
.entry-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.entry-content pre code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  background: none;
  padding: 0;
  border: none;
  font-size: inherit;
}

.entry-content code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
  color: #c7254e;
}

/* --- Blockquote --- */
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.8rem 1.2rem;
  color: #666;
  background: rgba(74, 144, 217, 0.03);
  border-radius: 0 4px 4px 0;
}

.entry-content blockquote p {
  margin: 0;
}

/* --- Horizontal Rule --- */
.entry-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* --- Lists --- */
.entry-content ul,
.entry-content ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.entry-content li {
  margin-bottom: 0.4rem;
}

/* --- Tables --- */
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  font-size: 0.92rem;
}

.entry-content th {
  background: var(--code-bg);
  font-weight: 600;
}

/* --- Sidebar --- */
.hatena-module-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 0.05em;
  padding-bottom: 0.5rem;
  margin-bottom: 0.8rem;
  border-bottom: 2px solid var(--heading);
}

/* Profile Module */
.hatena-module-profile .profile-icon {
  border-radius: 50%;
  width: 80px;
  height: 80px;
}

.hatena-module-profile .id {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Links Module (hatena built-in) */
.hatena-module-links .hatena-module-body ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hatena-module-links .hatena-module-body li {
  margin: 0;
}

.hatena-module-links .hatena-module-body li a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--code-bg);
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.hatena-module-links .hatena-module-body li a:hover {
  background: var(--accent);
  color: #fff;
}

/* Recent Entries (Latest) Module */
.hatena-module-recent-entries .hatena-module-body ul {
  list-style: none;
  padding: 0;
}

.hatena-module-recent-entries .hatena-module-body li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.hatena-module-recent-entries .hatena-module-body li:last-child {
  border-bottom: none;
}

.hatena-module-recent-entries .hatena-module-body li a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.hatena-module-recent-entries .hatena-module-body li a:hover {
  color: var(--accent);
}

/* Archive Module - Compact */
.hatena-module-archive .hatena-module-body ul {
  list-style: none;
  padding: 0;
}

.hatena-module-archive .hatena-module-body li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.hatena-module-archive .hatena-module-body li a {
  color: var(--text);
  text-decoration: none;
}

.hatena-module-archive .hatena-module-body li a:hover {
  color: var(--accent);
}

/* --- Pager --- */
.pager {
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pager a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

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

/* --- Footer --- */
#footer {
  background: var(--heading);
  color: #ccc;
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.82rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.footer-copyright {
  color: #999;
}

/* Hide default Hatena footer content */
#footer-inner {
  display: none;
}

/* --- Entry Footer (categories, social) --- */
.entry-footer .entry-footer-section {
  font-size: 0.82rem;
  color: #666;
}

.categories a {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin: 0.2rem;
  background: var(--code-bg);
  border-radius: 3px;
  font-size: 0.78rem;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s;
}

.categories a:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Hatena Star --- */
.hatena-star-comment-container {
  margin-top: 0.5rem;
}

/* --- Read More Link --- */
.entry-see-more a {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.entry-see-more a:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  #blog-title {
    padding: 2rem 1rem 1rem;
  }

  #title a {
    font-size: 1.3rem;
  }

  .global-nav ul {
    flex-wrap: wrap;
  }

  .global-nav li a {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }

  .entry {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
  }

  .entry-title a {
    font-size: 1.25rem;
  }

  .entry-content h2 {
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
  }

  .entry-content h3 {
    font-size: 1.05rem;
  }

  .entry-content pre {
    padding: 0.8rem;
    font-size: 0.82rem;
  }

  #wrapper {
    width: 100%;
    float: none;
  }

  #box2 {
    width: 100%;
    float: none;
    margin-top: 2rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
    line-height: 1.75;
  }

  .global-nav li a {
    padding: 0.75rem 0.8rem;
    font-size: 0.78rem;
  }

  .entry-content {
    line-height: 1.8;
  }
}


/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Print
   ============================================ */
@media print {
  .global-nav,
  #box2,
  #footer,
  .hatena-star-comment-container,
  .entry-footer,
  .pager {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .entry-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .entry-content img {
    box-shadow: none;
  }
}
