*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: #eef3f8;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 18px;
  line-height: 1.7;
}

/* =========================================
   ヘッダー（上段ロゴ・下段右寄せメニューの2段構成）
   ========================================= */
.site-header {
  background-color: #ffffff;
  padding: 1.8rem 0 1.2rem;
  margin-bottom: 2.2rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.site-header .site-wrapper {
  padding-bottom: 0;
}

/* メイン幅（左側エリア）の縦並びラッパー */
.header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* 1段目：ロゴ（左寄せ） */
.site-logo {
  margin: 0;
  text-align: left;
}

.site-logo a {
  display: inline-block;
  text-decoration: none;
}

.site-logo img {
  display: block;
  margin: 0;
  height: 55px;
  max-height: 140px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.site-title {
  margin: 0;
  font-size: 1.8rem;
  text-align: left;
  color: #0f172a;
}

.site-title a {
  color: #0f172a;
  text-decoration: none;
}

/* 2段目：メニュー（メインエリアの右寄せ・サイドバーにかからない） */
.site-nav {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.site-nav ul,
.nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.8rem;
}

.site-nav li,
.nav-menu li {
  margin: 0;
  padding: 0;
}

.site-nav a,
.nav-menu a {
  color: #1e293b;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.nav-menu a:hover {
  color: #2563eb;
}

/* 右側のサイドバーと同じ幅（320px）のガード空間 */
.header-sidebar-space {
  width: 320px;
  flex-shrink: 0;
}

/* =========================================
   全体レイアウト・各パーツ
   ========================================= */
.site-wrapper {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.layout-container {
  display: flex;
  gap: 2.2rem;
  align-items: flex-start;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

/* トップ自由欄・お知らせボックス & レスポンシブ動画対応 */
.notice-box {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #cbd5e1;
  padding: 1.6rem;
  margin-bottom: 2rem;
}

.notice-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.notice-body {
  color: #334155;
  line-height: 1.8;
  word-break: break-word;
  overflow-wrap: break-word;
}

.notice-body iframe {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 16 / 9;
  height: auto !important;
  border: none;
  border-radius: 6px;
  display: block;
  margin: 1rem 0;
}

.notice-body img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 4px;
  display: block;
  margin: 1rem 0;
}

/* ページ見出し */
.page-header-box {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.8rem;
}

.page-description {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0;
}

/* 一覧カード */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.post-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #cbd5e1;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  overflow: hidden;
}

.post-card-thumb {
  flex-shrink: 0;
  width: 130px;
}

.post-card-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.post-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-card-title {
  margin: 0 0 0.8rem;
  font-size: 1.3rem;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-card-title a {
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
}

.post-card-title a:hover {
  color: #2563eb;
}

/* 抜粋文の枠突き破り防止 */
.post-card-excerpt {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  word-break: break-all;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.post-card-action {
  margin-top: auto;
  text-align: right;
}

.post-card-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

/* 固定ページおよび投稿詳細ページ */
.page-detail,
.post-detail {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #cbd5e1;
  padding: 2rem;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.entry-content {
  color: #1e293b;
  line-height: 1.85;
  word-break: break-word;
  overflow-wrap: break-word;
}

.entry-content img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 4px;
  margin: 1.2rem auto;
  display: block;
}

.entry-content pre,
.post-card-excerpt pre {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 1rem;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.9rem;
}

/* ページ送り */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 2.5rem 0 1rem;
  font-size: 1rem;
}

.pagination a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.pagination-current {
  color: #64748b;
}

/* サイドバー各ボックス */
.sidebar-box {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #cbd5e1;
  padding: 1.4rem;
}

.sidebar-title {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sidebar-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem;
  background: #ffffff;
}

.sidebar-item:hover {
  background: #f8fafc;
}

.sidebar-item-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #1e293b;
}

.sidebar-thumb {
  width: 46px;
  height: 64px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.sidebar-thumb-placeholder {
  width: 46px;
  height: 64px;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border-radius: 3px;
  flex-shrink: 0;
  font-weight: bold;
}

.sidebar-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar-custom-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #334155;
}

.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #64748b;
  font-size: 0.9rem;
  border-top: 1px solid #cbd5e1;
  background-color: #eef3f8;
}

/* =========================================
   レスポンシブ対応（スマホ・タブレット向け）
   ========================================= */
@media (max-width: 900px) {
  .site-header {
    margin-bottom: 1.5rem;
  }
  .header-sidebar-space {
    display: none;
  }
  .header-main {
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .site-logo {
    text-align: center;
  }
  .site-logo img {
    margin: 0 auto;
  }
  .site-title {
    text-align: center;
  }
  .site-nav {
    justify-content: center;
  }
  .site-nav ul, .nav-menu ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
  }
  
  .layout-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .post-card {
    flex-direction: column;
  }
  .post-card-thumb {
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
  }
}
