/* ==========================================================================
   1. Post Cards - 記事カード（アーカイブ・検索結果）
   ========================================================================== */

/* 1. カードの基本デザインと初期状態（非表示） */
:is(.blog, .archive, .search) .site-main article {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem;
  margin-bottom: 0 !important;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  background: var(--color-bg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;

  /* アニメーション準備：最初は透明で少し下に */
  opacity: 0;
  transform: translateY(30px);
  /* 0.8sは表示用、0.3sはホバー用としてtransitionを分離 */
  transition: 
    opacity 0.8s ease-out, 
    transform 0.8s ease-out,
    border-color 0.3s var(--ease-default),
    box-shadow 0.3s var(--ease-default);
  will-change: opacity, transform;
}

/* 2. JSで画面内に入った時に付与されるクラス */
:is(.blog, .archive, .search) .site-main article.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* 3. ホバー時の動き（表示された後のみ有効に） */
:is(.blog, .archive, .search) .site-main article.is-visible:hover {
  border-color: #ddd;
  transform: translateY(-8px) !important; /* 表示時の translateY(0) を上書き */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* 4. 出現時の時間差（stagger） */
:is(.blog, .archive, .search) .site-main article:nth-of-type(1) { transition-delay: 0.1s; }
:is(.blog, .archive, .search) .site-main article:nth-of-type(2) { transition-delay: 0.2s; }
:is(.blog, .archive, .search) .site-main article:nth-of-type(3) { transition-delay: 0.3s; }
:is(.blog, .archive, .search) .site-main article:nth-of-type(n+4) { transition-delay: 0.4s; }

.card-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: block !important;
  width: 100%;
  height: 100%;
}

/* サムネイル（16:9） */
.post-thumbnail-169 {
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: #eee;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-thumbnail-169 img,
.no-image-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s var(--ease-default);
}

.post-card:hover .post-thumbnail-169 img {
  transform: scale(1.05);
}

/* カードコンテンツ */
.card-content-wrapper {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 1rem;
}

.entry-category-icon {
  display: flex;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f9f9f9;
  justify-content: center;
  align-items: center;
}

.entry-category-icon svg {
  width: 28px;
  height: 28px;
  stroke: #555;
  stroke-width: 1.5;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

article:hover .entry-category-icon svg {
  stroke: var(--color-main);
  transform: scale(1.2) rotate(10deg);
}

.entry-text-group {
  flex-grow: 1;
  text-align: left;
}

.entry-title {
  margin: 0 0 0.5rem 0;
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.4;
  transition: all 0.3s var(--ease-default);
  transform-origin: left center;
}

article:hover .entry-title {
  color: var(--color-main);
}

/* メタバッジ */
.entry-meta {
  display: flex;
  margin-top: auto;
  padding-top: 10px;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 20px;
  background-color: var(--color-main);
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  opacity: 0.7;
  transition: all 0.3s ease;
}

article:hover .meta-badge {
  opacity: 1;
  transform: scale(1.05);
}

/* ==========================================================================
   2. Buttons - ボタン
   ========================================================================== */

.button, .btn-minimal {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--color-main);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s var(--ease-default);
  cursor: pointer;
}

.button:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.btn-minimal {
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: transparent;
  color: #333;
  font-size: 11px;
}

.btn-minimal:hover {
  border-color: #333;
  background: #333;
  color: #fff;
}

/* ==========================================================================
   3. Sidebar Widgets - サイドバーウィジェット
   ========================================================================== */

.widget-area { padding: 0 10px; }

.widget {
  margin-bottom: 12px !important;
  padding: 25px 25px 15px;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  background: var(--color-bg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.widget h3 {
  position: relative;
  display: flex;
  padding: 5px 0 5px 18px;
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  align-items: center;
}

.widget h3::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 100%;
  border-radius: 3px;
  background: var(--color-main);
  transform: translateY(-50%);
}

.widget h3::after {
  content: 'LOG BOZU 354';
  position: absolute;
  right: 0;
  bottom: -5px;
  z-index: 0;
  color: rgba(0, 0, 0, 0.03);
  font-family: 'Arial Black', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  pointer-events: none;
}

.widget .wp-block-search { margin-bottom: 10px; }
.widget ul { margin: 0; padding: 0; list-style: none; }

.widget ul li {
  padding: 12px 0;
  border-bottom: 1px dashed #eee;
  font-size: 0.9rem;
  line-height: 1.4;
}

.widget ul li:last-child { border-bottom: none; }

.widget ul li a {
  display: block;
  color: #555;
  transition: all 0.3s ease;
}

.widget ul li a:hover {
  padding-left: 5px;
  color: var(--color-main);
}

/* Search Form */
.search-form { position: relative; }

.search-field {
  width: 100%;
  padding: 12px 40px 12px 15px;
  outline: none;
  border: 1px solid #eee;
  border-radius: 30px;
  background: #f7f7f7;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.search-field:focus {
  border-color: var(--color-main);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.search-submit {
  position: absolute;
  top: 50%;
  right: 5px;
  padding: 10px;
  border: none;
  background: none;
  color: #999;
  transform: translateY(-50%);
  cursor: pointer;
}

/* Tag Cloud */
.tagcloud a {
  display: inline-block;
  margin: 0 5px 10px 0;
  padding: 4px 12px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
  font-size: 0.7rem !important;
  transition: all 0.3s;
}

.tagcloud a:hover {
  background: var(--color-main);
  color: #fff;
}

/* ==========================================================================
   4. Related Posts - 関連記事
   ========================================================================== */

.related-posts {
  max-width: 900px;
  margin: 40px auto;
  padding: 40px 20px 30px;
  border-radius: 20px;
  background-color: var(--color-bg);
}

.related-title {
  display: flex;
  margin-bottom: 12px;
  color: #333;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  justify-content: center;
  align-items: center;
}

.related-title::before, .related-title::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: #ddd;
}
.related-title::before { margin-right: 20px; }
.related-title::after { margin-left: 20px; }

.related-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(3, 1fr);
}

.related-item { transition: transform 0.3s ease; }

.related-thumb {
  position: relative;
  margin-bottom: 15px;
  border-radius: 8px;
  background: #eee;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  aspect-ratio: 16 / 9;
}

.related-thumb::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 124, 186, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.related-item a:hover .related-thumb::after { opacity: 1; }

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-default);
}

.related-item a:hover img { transform: scale(1.1); }

.related-item-title {
  display: -webkit-box;
  margin-bottom: 8px;
  overflow: hidden;
  color: #333;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.6;
  transition: color 0.3s ease;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.related-item a:hover .related-item-title { color: var(--color-main); }

.related-meta { display: flex; align-items: center; gap: 10px; }
.related-date { color: #bbb; font-size: 11px; }

@media (max-width: 768px) {
  .related-grid { gap: 20px; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   5. Author Profile & Comments - プロフィールとコメント
   ========================================================================== */

/* Author Profile */
.author-profile { 
  max-width: 800px;
  margin: 80px auto; 
  padding: 40px; 
  border-radius: 12px;
  background: #f9fbfd; 
  text-align: left;
}

.author-inner { display: flex; align-items: center; gap: 30px; }

.author-avatar img { 
  width: 100px;
  height: 100px;
  border: 3px solid #fff; 
  border-radius: 50%; 
  object-fit: cover; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}

.author-label { 
  display: block;
  margin-bottom: 5px;
  color: var(--color-main); 
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.author-name { margin-bottom: 10px; color: #333; font-size: 1.2rem; font-weight: 800; }
.author-description { color: #666; font-size: 14px; line-height: 1.6; margin-bottom: 15px; }

@media (max-width: 767px) {
  .author-profile { padding: 30px 20px; }
  .author-inner { flex-direction: column; text-align: center; }
}

/* Comments Area */
.comments-area {
  max-width: 800px;
  margin: 60px auto;
  padding: 60px 20px;
  border-top: 1px solid #eee;
}

.comments-title, .comment-reply-title {
  display: flex;
  margin-bottom: 40px;
  color: #333;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  justify-content: center;
  align-items: center;
}

.comments-title::before, .comment-reply-title::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 12px;
  background-color: var(--color-main);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>') no-repeat center / contain;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>') no-repeat center / contain;
}

.comment-list { margin-bottom: 60px; margin-left: 12px; padding: 0; list-style: none; }

.comment-list .comment {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px dashed #666;
}

.comment-list .children {
  margin: 30px 0 0 40px;
  padding-left: 20px;
  border-left: 2px solid var(--color-main);
  list-style: none;
}

.comment-body { display: flex; align-items: flex-start; gap: 20px; }
.comment-author .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.comment-content { color: #444; font-size: 0.8rem; line-height: 1.7; }

.comment-author .fn { color: var(--color-main); font-weight: bold; font-style: normal; }
.comment-author .says { display: none !important; }
.comment-author .fn::after {
  content: ' さん';
  margin-left: 5px;
  color: #666;
  font-size: 0.8rem;
  font-weight: normal;
}

.comment-metadata time { font-size: 0.7rem; }

.reply a {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  border: 1px solid var(--color-main);
  border-radius: 20px;
  color: var(--color-main);
  font-size: 0.7rem;
  font-weight: 700;
  transition: all 0.3s;
}

.reply a:hover { background: var(--color-main); color: #fff; }
.comment-edit-link { font-size: 0.7rem; }

@media (max-width: 767px) {
  .comment-body { flex-direction: column; gap: 12px; }
  .comment-author { display: flex; align-items: center; gap: 12px; }
  .comment-list .children { margin: 20px 0 0 15px; padding-left: 15px; }
  .comment-metadata { margin-top: 5px; }
}

/* Comment Form */
#respond { padding: 40px; border-radius: 12px; background: #f9fbfd; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  margin-bottom: 15px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.3s;
}

.comment-form textarea { min-height: 150px; }

.comment-form input:focus, .comment-form textarea:focus {
  outline: none;
  border-color: var(--color-main);
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-submit { text-align: center; }
.comment-form-comment { margin-bottom: 0; }

.comment-respond .submit {
  padding: 14px 40px;
  border: none;
  border-radius: 30px;
  background: #333;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.3s var(--ease-default);
  cursor: pointer;
}

.comment-respond .submit:hover {
  background: var(--color-main);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 124, 186, 0.2);
}

/* ==========================================================================
   6. Ads - 広告レイアウト（AdSense用）
   ========================================================================== */

.ad-space{
  display: none !important;
}

.ad-container { margin: 40px auto; overflow: hidden; text-align: center; }

.ad-label {
  display: block;
  margin-bottom: 8px;
  color: #999;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.ad-bottom {
  margin: 60px 0;
  padding: 20px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}

.ad-card { display: flex; flex-direction: column; }

.ad-container-bottom {
  grid-column: 1 / -1; 
  width: 100%;
  margin: 40px 0;
}

/* In-feed Ad Card */
.post-card .ad-card {
  display: flex;
  min-height: 300px;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

@media (min-width: 768px) {
  .ad-double { display: flex; gap: 20px; justify-content: center; }
  .ad-double > div { flex: 1; }
}

.footer-ad-area { margin-bottom: 36px; }

/* ==========================================================================
   7. Footer Menu Accordion - フッターメニュー開閉（JS連動）
   ========================================================================== */

.site-footer .sub-menu {
  display: none; 
  margin-top: 10px;
  padding-left: 15px;
}

/* PC表示では初期状態で表示しない設定（JSで制御する場合） */
@media (min-width: 768px) {
  .site-footer .sub-menu { display: none; }
}

.footer-navigation { margin-bottom: 30px; }

.footer-navigation ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.footer-navigation li a {
  color: #666;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.footer-navigation li a:hover { color: var(--color-main); }

/* 開閉ボタンのアイコン設定 */
.footer-navigation .menu-item-has-children > a {
  position: relative;
  display: inline-flex;
  padding-right: 25px;
}

.footer-navigation .menu-item-has-children > a .pc-arrow { display: none; }

.footer-navigation .menu-item-has-children > a::before,
.footer-navigation .menu-item-has-children > a::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 5px;
  width: 12px;
  height: 2px;
  background-color: #666;
  transition: all 0.3s ease;
  transform-origin: center;
}

.footer-navigation .menu-item-has-children > a::before { transform: translateY(-50%); }
.footer-navigation .menu-item-has-children > a::after { transform: translateY(-50%) rotate(90deg); }

/* アクティブ時のアニメーション（is-activeが付与されたとき） */
.footer-navigation .menu-item-has-children.is-active > a::before {
  background-color: var(--color-main);
  transform: translateY(-50%) rotate(90deg);
}

.footer-navigation .menu-item-has-children.is-active > a::after {
  background-color: var(--color-main);
  transform: translateY(-50%) rotate(225deg);
}

/* 表示切り替え用クラス */
.site-footer .sub-menu.is-open { display: block; }