/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Meiryo', sans-serif;
  line-height: 1.7;
  color: #333;
  background: #f5f5f5;
}
a { color: #2d5fa8; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.site-header__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 68px;
}
.site-header__logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.site-header__logo:hover { color: #2d5fa8; text-decoration: none; }

.site-nav { flex: 1; overflow: hidden; display: flex; align-items: center; }
.site-nav__list {
  display: flex;
  list-style: none;
  flex: 1;
}
.site-nav__list li a {
  display: block;
  padding: 0.45rem 0.8rem;
  color: #444;
  font-size: 0.875rem;
  white-space: nowrap;
}
.site-nav__list li a:hover { color: #2d5fa8; text-decoration: none; }

.site-search { display: flex; gap: 0.25rem; flex-shrink: 0; }
.site-search input {
  padding: 0.3rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.875rem;
  width: 170px;
  outline: none;
}
.site-search input:focus { border-color: #2d5fa8; }
.site-search button {
  padding: 0.3rem 0.8rem;
  background: #2d5fa8;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}
.site-search button:hover { background: #1e4690; }

/* ============================================================
   Main wrapper
   ============================================================ */
.site-main {
  max-width: 1140px;
  margin: 3rem auto;
  padding: 0 2rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #1a1a2e;
  color: #aaa;
  margin-top: 4rem;
}
.site-footer__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  list-style: none;
  margin-bottom: 2rem;
}
.footer-nav li a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  color: #bbb;
  font-size: 0.85rem;
  border-right: 1px solid #333;
}
.footer-nav li:last-child a { border-right: none; }
.footer-nav li a:hover { color: #fff; text-decoration: none; }
.footer-copy { font-size: 0.8rem; color: #666; }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 2rem;
}
.breadcrumb a { color: #777; }
.breadcrumb a:hover { color: #2d5fa8; }
.breadcrumb .sep { color: #ccc; }
.breadcrumb .current { color: #555; }

/* ============================================================
   Archive layout (2-column)
   ============================================================ */
.archive-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}

/* ============================================================
   Category nav (tabs)
   ============================================================ */
.category-nav { margin-bottom: 2rem; }
.category-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}
.category-nav li a {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 0.825rem;
  color: #555;
  background: #fff;
}
.category-nav li a:hover,
.category-nav li.is-current a {
  background: #2d5fa8;
  border-color: #2d5fa8;
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   Post cards
   ============================================================ */
.post-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.post-cards--3col { grid-template-columns: repeat(3, 1fr); }

.post-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.post-card > a {
  display: block;
  color: inherit;
}
.post-card > a:hover { text-decoration: none; }
.post-card__media {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f0f3f9;
}
.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.post-card:hover .post-card__media img {
  transform: scale(1.03);
}
.post-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #eef2fb 0%, #f8f9fc 50%, #e4ebf8 100%);
}
.post-card__placeholder-svg {
  width: 75%;
  height: auto;
  color: #7a9fd4;
  transition: color .2s ease;
}
.post-card:hover .post-card__placeholder-svg {
  color: #2d5fa8;
}
.post-card__body { padding: 1.1rem 1.25rem 1.25rem; }
.post-card__category {
  margin: 0 0 0.45rem;
  line-height: 1.2;
}
.post-card__category a {
  display: inline-block;
  font-size: 0.75rem;
  color: #2d5fa8;
  background: #eef2fb;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
}
.post-card__category a:hover {
  background: #2d5fa8;
  color: #fff;
  text-decoration: none;
}
.post-card h2,
.post-card h3 {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card time {
  font-size: 0.775rem;
  color: #aaa;
  display: block;
  margin-bottom: 0.4rem;
}
.post-card p {
  font-size: 0.825rem;
  color: #777;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.no-posts { color: #aaa; font-size: 0.9rem; padding: 1rem 0; }

/* ============================================================
   Home sections
   ============================================================ */
.home-section { margin-bottom: 4.5rem; }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid #2d5fa8;
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
}
.section-header h2 { font-size: 1.25rem; }
.section-header h2 a { color: #111; }
.section-header h2 a:hover { color: #2d5fa8; text-decoration: none; }
.more-link { font-size: 0.85rem; color: #2d5fa8; flex-shrink: 0; }
.more-link:hover { text-decoration: underline; }

.home-pages .page-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
}
.home-pages .page-list li a {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border: 1px solid #2d5fa8;
  border-radius: 4px;
  color: #2d5fa8;
  font-size: 0.9rem;
}
.home-pages .page-list li a:hover {
  background: #2d5fa8;
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   Single post
   ============================================================ */
.single-post { background: #fff; border-radius: 8px; padding: 2.5rem; }
.single-post header { margin-bottom: 2rem; }
.single-post h1 {
  font-size: 1.6rem;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #999;
}
.post-meta time { }
.post-meta .category a {
  background: #eef2fb;
  color: #2d5fa8;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.post-meta .category a:hover { background: #2d5fa8; color: #fff; text-decoration: none; }
.post-thumbnail { margin-bottom: 2rem; border-radius: 6px; overflow: hidden; }

.post-content { line-height: 1.85; }
.post-content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 4px solid #2d5fa8;
}
.post-content h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.post-content h4 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }
.post-content p { margin-bottom: 1rem; }
.post-content ul, .post-content ol { margin-bottom: 1rem; padding-left: 1.5rem; list-style: revert; }
.post-content li { margin-bottom: 0.25rem; }
.post-content a { color: #2d5fa8; text-decoration: underline; }
.post-content img { max-width: 100%; border-radius: 4px; margin: 1rem 0; }
.post-content blockquote {
  border-left: 4px solid #ddd;
  padding: 0.6rem 1rem;
  margin: 1.25rem 0;
  color: #666;
  background: #fafafa;
}
.post-content pre {
  background: #f4f4f4;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.875rem;
}
.post-content code {
  background: #f0f0f0;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.875em;
}
.post-content pre code { background: none; padding: 0; }
.post-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.post-content th, .post-content td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}
.post-content th { background: #f5f5f5; }

/* Custom fields */
.custom-fields {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
}
.custom-fields dl { }
.custom-field-item {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted #eee;
  font-size: 0.875rem;
}
.custom-field-item:last-child { border-bottom: none; }
.custom-field-item dt { width: 150px; color: #888; flex-shrink: 0; font-weight: 500; }
.custom-field-item dd { color: #444; }
.custom-field-item img { max-width: 200px; border-radius: 4px; }

/* Post prev/next navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.post-navigation a {
  display: block;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  color: #333;
  font-size: 0.875rem;
  line-height: 1.45;
  transition: border-color .15s;
}
.post-navigation a:hover { border-color: #2d5fa8; text-decoration: none; }
.post-navigation .prev { text-align: left; }
.post-navigation .next { text-align: right; }
.nav-label { font-size: 0.75rem; color: #aaa; display: block; margin-bottom: 0.25rem; }
.nav-title { color: #333; display: block; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar { }
.sidebar section {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.sidebar h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.75rem;
}
.sidebar ul { list-style: none; }
.sidebar ul li { }
.sidebar ul li a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: #555;
  border-bottom: 1px dotted #f0f0f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar ul li:last-child > a { border-bottom: none; }
.sidebar ul li a:hover { color: #2d5fa8; text-decoration: none; }
.sidebar ul li.is-current > a { color: #2d5fa8; font-weight: 600; }
/* Subcategories in sidebar */
.sidebar ul ul {
  margin: 0.25rem 0 0.5rem 0.75rem;
  border-left: 2px solid #eee;
  padding-left: 0.5rem;
}
.sidebar ul ul li a { font-size: 0.825rem; padding: 0.25rem 0; }

/* ============================================================
   Page content
   ============================================================ */
.page-content {
  background: #fff;
  border-radius: 8px;
  padding: 2.5rem;
  max-width: 800px;
}
.page-content h1 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #eee;
}
.page-body { line-height: 1.85; }
.page-body h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 4px solid #2d5fa8;
}
.page-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.page-body p { margin-bottom: 1rem; }
.page-body ul, .page-body ol { margin-bottom: 1rem; padding-left: 1.5rem; list-style: revert; }
.page-body a { color: #2d5fa8; text-decoration: underline; }
.child-pages {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}
.child-pages h3 { font-size: 0.9rem; color: #888; margin-bottom: 0.75rem; }
.child-pages ul { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; }
.child-pages ul li a {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid #2d5fa8;
  border-radius: 4px;
  color: #2d5fa8;
  font-size: 0.875rem;
}
.child-pages ul li a:hover { background: #2d5fa8; color: #fff; text-decoration: none; }

/* ============================================================
   Category heading with parent
   ============================================================ */
.parent-cat { font-size: 0.75em; font-weight: 400; color: #888; }
.parent-cat a { color: #888; }

/* ============================================================
   Search results
   ============================================================ */
.search-results h1 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.result-count {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 1.25rem;
}
.search-notice {
  color: #888;
  padding: 2rem 0;
}

/* ============================================================
   404 page
   ============================================================ */
.error-page {
  text-align: center;
  padding: 5rem 1rem;
}
.error-code {
  font-size: 5rem;
  font-weight: 700;
  color: #ddd;
  line-height: 1;
  margin-bottom: 1rem;
}
.error-page h1 { font-size: 1.5rem; color: #555; margin-bottom: 0.75rem; }
.error-page > p { color: #888; margin-bottom: 2rem; }
.back-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.back-links a {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 1px solid #2d5fa8;
  border-radius: 4px;
  color: #2d5fa8;
  font-size: 0.9rem;
}
.back-links a:hover { background: #2d5fa8; color: #fff; text-decoration: none; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  margin: 2.5rem 0 1rem;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #555;
  background: #fff;
}
.pagination a:hover { border-color: #2d5fa8; color: #2d5fa8; text-decoration: none; }
.pagination .current { background: #2d5fa8; border-color: #2d5fa8; color: #fff; }
.pagination .ellipsis { border-color: transparent; background: none; color: #ccc; }

/* ============================================================
   Author list (index & home section)
   ============================================================ */
.author-index { }
.author-index-heading {
  font-size: 1.6rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #2d5fa8;
}

.author-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.author-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: block;
  color: inherit;
}
.author-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.author-card-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.author-card-body { padding: 1rem 1.1rem 1.25rem; }
.author-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #111;
}
.author-card-title {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.4rem;
}
.author-card-bio {
  font-size: 0.825rem;
  color: #666;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   Author profile (single)
   ============================================================ */
.author-profile {
  background: #fff;
  border-radius: 8px;
  padding: 2.5rem;
}
.author-profile-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #eee;
}
.author-profile-image { flex-shrink: 0; width: 140px; }
.author-profile-image img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #f0f0f0;
  display: block;
}
.author-profile-meta { flex: 1; min-width: 0; }
.author-profile-meta h1 {
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}
.author-profile-title {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.75rem;
}
.author-profile-bio {
  font-size: 0.925rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.author-sns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.author-sns a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #555;
  background: #fafafa;
  transition: background .15s, border-color .15s, color .15s;
}
.author-sns a:hover {
  background: #2d5fa8;
  border-color: #2d5fa8;
  color: #fff;
  text-decoration: none;
}

.author-profile-content {
  line-height: 1.85;
  color: #444;
  margin-bottom: 2.5rem;
}
.author-profile-content h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.6rem;
  padding-left: 0.75rem;
  border-left: 4px solid #2d5fa8;
}
.author-profile-content h3 { font-size: 1.05rem; margin: 1.25rem 0 0.4rem; }
.author-profile-content p { margin-bottom: 1rem; }
.author-profile-content a { color: #2d5fa8; text-decoration: underline; }

.author-posts { margin-top: 2rem; }
.author-posts h2 {
  font-size: 1.1rem;
  color: #555;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #eee;
  margin-bottom: 1.5rem;
}

/* ============================================================
   Hamburger menu toggle button
   ============================================================ */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #444;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .archive-layout { grid-template-columns: 1fr; }
  .post-cards--3col { grid-template-columns: repeat(2, 1fr); }
  .author-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .site-header__inner {
    height: 56px;
    padding: 0 1rem;
    flex-wrap: nowrap;
    gap: 0.75rem;
  }
  .nav-toggle { display: flex; margin-left: auto; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
    z-index: 99;
    padding: 0.5rem 0 0;
    overflow: visible;
  }
  .site-nav.is-open { display: flex; flex-direction: column; }
  .site-nav__list {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
  }
  .site-nav__list li a {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    border-bottom: 1px solid #f5f5f5;
    white-space: normal;
  }
  .site-nav__list li:last-child a { border-bottom: none; }
  .site-search {
    width: 100%;
    padding: 0.875rem 1.5rem 1rem;
    border-top: 1px solid #f0f0f0;
    gap: 0.5rem;
  }
  .site-search input { flex: 1; width: auto; }
  .post-cards,
  .post-cards--3col { grid-template-columns: 1fr; }
  .post-navigation { grid-template-columns: 1fr; gap: 0.75rem; }
  .site-main { margin: 1.5rem auto; padding: 0 1rem; }
  .single-post { padding: 1.5rem; overflow-x: hidden; }
  .page-content { padding: 1.5rem; overflow-x: hidden; }
  .post-content img,
  .page-body img { max-width: 100%; height: auto; }
  .post-content table { display: block; overflow-x: auto; max-width: 100%; }
  .author-list { grid-template-columns: 1fr; }
  .author-profile { padding: 1.5rem; }
  .author-profile-header { flex-direction: column; align-items: center; text-align: center; }
  .author-profile-meta h1 { font-size: 1.3rem; }
  .author-sns { justify-content: center; }
}
