/* 全体の横幅を制限して中央寄せ */
#container,
#container-inner,
#blog-title-inner,
#top-editarea-inner,
#content,
#content-inner,
#bottom-editarea-inner {
  box-sizing: border-box;
}

#blog-title-inner,
#top-editarea-inner,
#content-inner,
#bottom-editarea-inner {
  max-width: 1040px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px;
  padding-right: 24px;
}

/* ブログヘッダー */
#blog-title {
  text-align: center;
  padding-top: 24px;
  padding-bottom: 20px;
}

/* ブログ名 */
#title,
#title a {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

/* 説明文 */
#blog-description {
  max-width: 920px;
  margin: 8px auto 0;
  padding: 0 16px;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.8;
  font-weight: 500;
  color: #333;
}

/* ヘッダー下カテゴリメニュー */
.global-nav {
  width: 100% !important;
  max-width: 920px !important;
  margin: 14px auto 28px !important;
  padding: 0 16px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px 10px !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

.global-nav a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 14px !important;
  border: 1px solid #d6e2ee !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #0f3557 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.global-nav a:hover {
  background: #eef6fb !important;
  border-color: #8bb8d6 !important;
  text-decoration: none !important;
}

/* 左寄りを強制的に解除して中央寄せ */
#content,
#content-inner,
#wrapper,
#main {
  float: none !important;
  clear: both;
}

#content-inner {
  display: block !important;
  max-width: 1040px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* 本文・記事一覧の読みやすい横幅 */
#wrapper {
  width: 100% !important;
  max-width: 820px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#main {
  width: 100% !important;
  max-width: 820px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: 16px;
  line-height: 1.85;
}

/* サイドバーが下に回る場合も中央寄せ */
#box2,
#box2-inner {
  float: none !important;
  clear: both;
  max-width: 820px;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 記事タイトル */
.entry-title,
.entry-title a,
.archive-entry-title,
.archive-entry-title a {
  font-size: clamp(1.75rem, 3.4vw, 2.45rem);
  line-height: 1.35;
  color: #0b2a5b;
  text-decoration: none;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.entry-title a:hover,
.archive-entry-title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* 日付 */
.date,
.date a,
.archive-date,
.archive-date a {
  font-size: 0.9rem;
  color: #666;
  text-decoration: none;
}

/* 記事一覧の余白 */
.archive-entry,
.entry {
  margin-bottom: 40px;
}

/* 記事一覧をカード風に軽く区切る */
.archive-entry {
  padding-top: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e9ecf2;
}

/* カテゴリをラベル風にする */
.categories a,
.entry-categories a,
.archive-entry .categories a {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid #d8dce6;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #4b2a86;
  text-decoration: none;
  background: #fff;
}

/* 記事本文の段落間 */
.entry-content p {
  margin-top: 0;
  margin-bottom: 1.35em;
}

/* 画像・埋め込みが本文幅からはみ出さないようにする */
.entry-content img,
.entry-content iframe,
.entry-content blockquote {
  max-width: 100%;
}

/* サムネイルが大きすぎる場合の調整 */
.archive-entry .entry-thumb,
.entry-thumb {
  max-width: 120px;
  height: auto;
}

/* スマートフォン表示 */
@media screen and (max-width: 767px) {
  #blog-title-inner,
  #top-editarea-inner,
  #content-inner,
  #bottom-editarea-inner {
    max-width: none !important;
    padding-left: 16px;
    padding-right: 16px;
  }

  #title,
  #title a {
    font-size: 1.75rem;
  }

  #blog-description {
    padding: 0 12px;
    font-size: 0.94rem;
    line-height: 1.7;
  }

  .global-nav {
    max-width: none !important;
    margin: 12px auto 24px !important;
    padding: 0 12px !important;
    gap: 8px !important;
  }

  .global-nav a {
    flex: 1 1 40% !important;
    min-width: 7.5em !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    text-align: center !important;
  }

  #wrapper,
  #main {
    max-width: none !important;
    width: auto !important;
  }

  #main {
    font-size: 16px;
    line-height: 1.8;
  }

  .entry-title,
  .entry-title a,
  .archive-entry-title,
  .archive-entry-title a {
    font-size: 1.65rem;
  }
}