/*
Main stylesheet for My Custom Theme
*/

body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  margin: 0;
}

a {
  color: #e67e22;
  text-decoration: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.8;
}

.site {
  max-width: 960px;
  margin: 2em auto;
  background-color: #fff;
  padding: 2em;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 1em;
  margin-bottom: 2em;
}

.site-branding {
  margin-right: 2em; /* ロゴとナビゲーションの間に余白を追加 */
}

.site-description {
  font-size: 0.9em;
  color: #777;
  margin: 0.5em 0 0;
  padding: 0;
}

.site-title a {
  display: block;
}

.site-title img {
  display: block;
  max-height: 100px; /* ロゴの最大の高さを指定。必要に応じて調整してください */
  width: auto;
  transition: opacity 0.3s ease;
}

.site-title a:hover img {
  opacity: 0.8; /* マウスホバーで少し透明にする */
}

/* トップページのウェルカムヘッダー */
.home-welcome-header {
  text-align: center; /* 中央表示 */
}

.home-welcome-title {
  font-size: 1.6em; /* 文字サイズを大きく */
  font-weight: bold;
  color: #333;
  margin-bottom: 1em;
  margin-top: 3.5em;
}

.home-welcome-message {
  font-size: 1.6em;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin-top: 1em;
  margin-bottom: 3.5em;
  line-height: 1.5;
}

.entry-title a {
  color: #e67e22;
}

.site-footer {
  background-color: #f1f1f1; /* フッターの背景色 */
  color: #555; /* フッターの文字色 */
  padding: 2.5em 1em;
  text-align: center;
  margin-top: 3em;
}
.site-footer .site-info {
  font-size: 0.9em;
}

/* フッターナビゲーション */
.footer-navigation {
  margin-top: 1.5em;
  padding-top: 1.5em;
  border-top: 1px solid #e0e0e0;
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-menu li {
  margin: 0.5em 1em;
}

.footer-menu a {
  color: #e67e22;
  font-weight: 500;
  transition: color 0.3s ease;
}

/* ナビゲーションメニュー */
.main-navigation ul {
  display: flex; /* メニュー項目を横並びにする */
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation li {
  margin: 0 0 0 1.5em; /* 各メニュー項目の左側に余白を追加 */
}

.main-navigation a {
  display: block;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  position: relative;
  padding-bottom: 0.3em; /* 下線のためのスペース */
  transition: color 0.3s ease;
}

body.menu-open {
  overflow: hidden; /* 背景のスクロールを禁止 */
}

/* 下線アニメーション用の擬似要素 */
.main-navigation a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #e67e22;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease-out;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: #e67e22; /* マウスを乗せたときの色 */
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
  transform: scaleX(1); /* ホバー時と現在ページで下線を表示 */
}

/* ハンバーガーメニューボタン */
.menu-toggle {
  display: none; /* デフォルトでは非表示 */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  width: 40px;
  height: 40px;
  position: relative;
}

.menu-toggle .hamburger-icon {
  display: block;
  position: relative;
  width: 24px;
  height: 2px;
  background-color: #333;
  transition: background-color 0s 0.3s;
  margin: 0 auto;
}

.menu-toggle .hamburger-icon::before,
.menu-toggle .hamburger-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #333;
  transition: transform 0.3s ease-in-out, top 0.3s ease-in-out,
    bottom 0.3s ease-in-out;
}

.menu-toggle .hamburger-icon::before {
  top: -8px;
}

.menu-toggle .hamburger-icon::after {
  bottom: -8px;
}

/* 投稿のアイキャッチ画像 */
.post-thumbnail {
  margin-bottom: 1.5em;
}

.post-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px; /* 角を少し丸くする */
  transition: opacity 0.3s ease;
}

.post-thumbnail a:hover img {
  opacity: 0.8; /* マウスホバーで少し透明にする */
}

/* ページ上部の装飾画像 */
.post-decoration-image {
  text-align: center;
}

.post-decoration-image img {
  max-width: 45%;
  height: auto;
  display: inline-block;
}

/* 新着記事タイトル */
.latest-posts-title {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.8em;
  color: #333;
  position: relative;
  padding-bottom: 0.6em;
}

.latest-posts-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: #e67e22;
}

/* アーカイブページのタイトル */
.page-header {
  text-align: center;
  margin-bottom: 2em;
}

.page-title {
  font-size: 2.2em;
  font-weight: bold;
  color: #333;
  position: relative;
  display: inline-block;
  padding-bottom: 0.6em;
  margin-bottom: 0.5em;
}

.page-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: #e67e22;
}

/* カード型レイアウト */
.posts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 2em;
}

.posts-container article.post {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  height: 405px;
}

.posts-container article.post:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.posts-container article.post .post-thumbnail {
  margin-bottom: 0;
  overflow: hidden; /* はみ出した部分を隠す */
  position: relative;
  padding-top: 75%; /* アスペクト比 4:3 (3 / 4 = 0.75) */
  height: 0;
}

.posts-container article.post .post-thumbnail img {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  height: 100%;
  object-fit: cover; /* 縦横比を維持したままコンテナを覆う */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.posts-container article.post .entry-container {
  padding: 1.5em;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.posts-container article.post .entry-header {
  margin-bottom: 0.5em;
}

.posts-container article.post .entry-content {
  margin-top: auto;
}

.posts-container article.post .entry-meta {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 1em;
}

/* カテゴリーラベル */
.posts-container article.post .cat-links a {
  display: inline-block;
  background-color: #fdf2e2;
  color: #e67e22;
  padding: 0.2em 0.7em;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
  margin-bottom: 0.3em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.posts-container article.post .cat-links a:hover {
  background-color: #e67e22;
  color: #fff;
}

/* 続きを読むリンク */
.read-more {
  font-weight: 600;
  text-decoration: none;
  color: #e67e22;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.read-more:hover {
  color: #333;
}

/* シングルページ & 固定ページ */
#single .entry-header,
#page-content .entry-header {
  text-align: center;
  margin-bottom: 2em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid #eee;
}

#single .entry-title,
#page-content .entry-title {
  font-size: 2.8em;
  margin-bottom: 0.5em;
}

#single .entry-meta {
  font-size: 0.9em;
  color: #666;
}

#single .entry-meta a {
  color: #666;
  text-decoration: none;
}

#single .entry-meta a:hover {
  color: #e67e22;
}

#single .entry-meta .cat-links a {
  font-weight: 500;
}

#single .entry-content,
#page-content .entry-content {
  font-size: 1.1em;
  line-height: 1.7;
  max-width: 720px; /* 読みやすいように最大幅を設定 */
  margin-left: auto;
  margin-right: auto;
}

/* 投稿・固定ページ内のコンテンツスタイル */
#single .entry-content img,
#page-content .entry-content img {
  border-radius: 8px; /* 角を丸くする */
  margin-top: 10px;
  margin-bottom: 10px;
}

#single .entry-content p,
#page-content .entry-content p,
#single .entry-content ul,
#page-content .entry-content ul,
#single .entry-content ol,
#page-content .entry-content ol,
#single .entry-content blockquote,
#page-content .entry-content blockquote {
  margin-bottom: 1.5em;
}

#single .entry-content h2,
#page-content .entry-content h2 {
  margin: 2.5em 0 1em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid #f0f0f0;
  font-size: 1.6em;
}

#single .entry-content h3,
#page-content .entry-content h3 {
  margin: 2em 0 1em;
  padding-left: 0.5em;
  border-left: 4px solid #e67e22;
  font-size: 1.4em;
}

/* カテゴリーオーバーレイ */
.category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9); /* 半透明の白い背景 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
  border-radius: 8px; /* 親要素の角丸に合わせる */
}

.posts-container article.post:hover .category-overlay {
  opacity: 1;
  visibility: visible;
}

.category-overlay img {
  max-width: 240px;
  max-height: 240px;
  width: auto;
  height: auto;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.overlay-category-name {
  font-size: 1.2em;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.overlay-read-more {
  display: inline-block;
  background-color: #e67e22;
  color: #fff;
  padding: 0.8em 1.5em;
  border-radius: 5px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.overlay-read-more:hover {
  background-color: #333;
  color: #fff;
}

/* メニューオープン時のオーバーレイ */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* TOPへ戻るボタン */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  transform: translateY(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  font-size: 12px;
  font-weight: bold;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top img {
  width: 50px;
  height: 50px;
  border-radius: 50%; /* 画像を円形にする場合 */
  margin-bottom: 0.4em;
}

.back-to-top span {
  display: block;
}

/* single.php アイキャッチ画像を1:1にする */
#single .post-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 100%; /* アスペクト比 1:1 */
  height: 0;
  overflow: hidden;
}

#single .post-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 画像をコンテナに合わせてトリミング */
}

/* 記事フッターの関連カテゴリー情報 */
.entry-footer {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid #eee;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.related-category-content {
  display: flex;
  align-items: center;
  background-color: #fdf2e2;
  padding: 2em;
  border-radius: 8px;
}

.related-category-content img {
  max-width: 100px;
  height: auto;
  margin-right: 2em;
  opacity: 0.7;
}

.related-category-text h3 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-size: 1.4em;
  color: #333;
}

.related-category-text p {
  margin-top: 0;
  margin-bottom: 1.5em;
  color: #555;
}

.related-category-text .button {
  display: inline-block;
  background-color: #e67e22;
  color: #fff;
  padding: 0.8em 1.5em;
  border-radius: 5px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.related-category-text .button:hover {
  background-color: #d35400;
  color: #fff;
  opacity: 1; /* a:hoverのopacityを上書き */
}

/* ========================================
  ページネーション
======================================== */
.pagination {
  margin-top: 3em;
  text-align: center;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  background-color: #fff;
}

.nav-links .page-numbers {
  display: inline-block;
  padding: 0.8em 1.2em;
  text-decoration: none;
  color: #e67e22;
  border-left: 1px solid #e0e0e0;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-weight: 500;
}

.nav-links .page-numbers:first-child {
  border-left: none;
}

.nav-links .page-numbers:hover,
.nav-links .page-numbers.current {
  background-color: #e67e22;
  color: #fff;
}

/* ========================================
  レスポンシブデザイン
======================================== */
/* ----------------------------------------
  タブレット (1024px以下)
---------------------------------------- */
@media (max-width: 1024px) {
  .posts-container article.post {
    height: 405px;
  }
}
/* ----------------------------------------
  タブレット (820px以下)
---------------------------------------- */
@media (max-width: 820px) {
  .posts-container article.post {
    height: 450px;
  }
}

/* ----------------------------------------
  タブレット (768px以下)
---------------------------------------- */
@media (max-width: 768px) {
  .site {
    margin: 0 auto;
    padding: 1.5em;
  }

  .menu-toggle {
    display: block; /* 768px以下で表示 */
  }

  /* メニューオープン時のバツ印 */
  .menu-open .menu-toggle {
    position: fixed; /* メニューが開いている時は画面右上に固定 */
    top: 20px;
    right: 1.5em;
  }

  .menu-open .menu-toggle .hamburger-icon {
    background-color: transparent;
  }

  .menu-open .menu-toggle .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .menu-open .menu-toggle .hamburger-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
  }

  .menu-open .menu-overlay {
    display: block;
    opacity: 1;
  }

  .site-header {
    /* display: flex; は維持 */
    justify-content: space-between;
    /* align-items: center; は維持 */
  }

  .site-branding {
    margin-right: 1em; /* ロゴとハンバーガーメニューの間に少し余白 */
  }

  .site-title img {
    max-height: 80px;
  }

  .main-navigation {
    display: block; /* display:flexを上書き */
    position: fixed;
    top: 0;
    right: -100%; /* 初期状態では画面右外に隠す */
    width: 300px; /* メニューの幅 */
    max-width: 80%;
    height: 100vh;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding-top: 80px; /* 固定したボタンと被らないように */
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
  }

  .menu-open .main-navigation {
    right: 0; /* メニューオープン時に表示 */
  }

  .main-navigation ul {
    flex-direction: column; /* 縦並びにする */
    align-items: flex-start;
  }

  .main-navigation li {
    margin: 0;
    width: 100%;
  }

  .main-navigation a {
    padding: 1em 1.5em;
    border-bottom: 1px solid #eee;
  }

  .main-navigation a::after {
    display: none; /* 下線アニメーションは不要 */
  }

  .posts-container article.post {
    height: 435px;
  }
}

/* ----------------------------------------
  モバイル (640px以下)
---------------------------------------- */
@media (max-width: 640px) {
  .site {
    margin: 0 auto;
    padding: 1em;
  }

  .site-title img {
    max-height: 80px;
  }

  .main-navigation li {
    margin: 0.5em 0.8em;
  }

  .home-welcome-title,
  .home-welcome-message {
    font-size: 1.2em;
    margin-top: 2em;
    margin-bottom: 2em;
  }

  .latest-posts-title {
    font-size: 1.8em;
  }

  .posts-container {
    grid-template-columns: 1fr; /* 1列表示 */
    gap: 1.5em;
  }

  .posts-container article.post .post-thumbnail {
    height: 200px; /* モバイルでは画像を少し大きく */
  }

  #single .entry-title {
    font-size: 1.8em;
  }

  #single .entry-content {
    font-size: 0.95em;
  }

  .post-decoration-image img {
    max-width: 70%; /* モバイルでは画像を大きく表示 */
  }

  .category-overlay img {
    max-width: 180px;
    max-height: 180px;
  }

  .overlay-category-name {
    font-size: 1em;
  }

  .overlay-read-more {
    padding: 0.6em 1.2em;
    font-size: 0.9em;
  }

  .posts-container article.post {
    height: 450px;
  }
  .related-category-content {
    flex-direction: column;
    text-align: center;
  }

  .related-category-content img {
    margin-bottom: 20px; /* 画像とテキストの間に余白を追加 */
    margin-right: 0;
  }
}

/* ----------------------------------------
  モバイル (375px以下)
---------------------------------------- */
@media (max-width: 375px) {
  .site-title img {
    max-height: 80px;
  }

  .main-navigation li {
    margin: 0.5em 0.5em;
  }

  .home-welcome-title,
  .home-welcome-message {
    font-size: 1em;
  }

  .latest-posts-title {
    font-size: 1.4em;
  }
}

/* ========================================
  表示件数制御
======================================== */
@media (min-width: 769px) {
  /* PC表示では投稿を3件のみ表示（4件目以降を非表示） */
  .home .posts-container article.post:nth-child(n + 4) {
    display: none;
  }
}
/* 吹き出しのデザイン
-------------------------------------------------------------- */
.voice-container {
  display: flex;
  align-items: flex-start; /* アイコンと吹き出しの上端を揃える */
  max-width: 720px; /* 本文の幅に合わせる */
  margin: 2em auto; /* 上下のマージンと、左右autoで中央寄せ */
}

.voice-icon {
  margin-right: 20px; /* アイコンと吹き出しの間隔 */
  flex-shrink: 0; /* アイコンが縮まないようにする */
}

.voice-icon img {
  width: 100px; /* アイコンの幅 */
  height: 100px; /* アイコンの高さ */
  object-fit: cover;
}

.entry-voice-content {
  position: relative; /* 吹き出しのしっぽを配置するための基準 */
  background-color: #f5f5f5; /* 吹き出しの背景色 */
  border-radius: 12px; /* 吹き出しの角丸 */
  padding: 20px; /* 吹き出し内の余白 */
  width: 100%;
}

/* 吹き出しのしっぽ（三角形） */
.entry-voice-content::before {
  content: "";
  position: absolute;
  top: 25px; /* しっぽの縦位置 */
  left: -20px; /* しっぽを吹き出しの外に配置 */

  /* 三角形を作成 */
  border-style: solid;
  border-width: 10px 20px 10px 0;
  border-color: transparent #f5f5f5 transparent transparent;
}

/* スマートフォン向けの調整 */
@media screen and (max-width: 767px) {
  .voice-icon img {
    width: 60px;
    height: 60px;
  }
  .entry-voice-content::before {
    top: 15px;
  }
  .entry-voice-content {
    font-size: 0.95em;
  }
}
