/**
 * 公開ブログ（Smarty: blog_index / blog_category / blog_detail）
 * templates/blog/_header.html より読込
 */

/* ----- 一覧・カテゴリ共通 ----- */
.blog-list-wrap {
  margin: 40px auto;
}

.blog-page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  border-bottom: 3px solid #113f67;
  padding-bottom: 12px;
}

/* カテゴリページ: 直下に .blog-page-sub があるとき詰める */
.blog-page-title.blog-page-title--category {
  margin-bottom: 8px;
}

.blog-page-sub {
  font-size: 14px;
  color: #787c82;
  margin-bottom: 32px;
}

.blog-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.blog-cat-nav a {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid #113f67;
  border-radius: 20px;
  font-size: 13px;
  color: #113f67;
  text-decoration: none;
}

.blog-cat-nav a:hover {
  background: #113f67;
  color: #fff;
}

.blog-items {
  display: grid;
  gap: 28px;
}

.blog-item {
  display: flex;
  align-items: stretch;
  gap: 20px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
  text-decoration: none;
  color: inherit;
}

.blog-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.blog-item-thumb {
  position: relative;
  width: 180px;
  min-width: 180px;
  min-height: 120px;
  flex-shrink: 0;
  align-self: stretch;
  overflow: hidden;
  background: #f0f0f0;
}

.blog-item-thumb img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-item-thumb .no-img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 12px;
}

.blog-item-body {
  padding: 14px 20px 14px 0;
  flex: 1;
  min-width: 0;
}

.blog-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.blog-item-cat {
  font-size: 11px;
  background: #e8f0fe;
  color: #113f67;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.blog-item-date {
  font-size: 12px;
  color: #787c82;
}

.blog-item-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5;
  color: #1d2327;
}

.blog-item-excerpt {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  font-size: 14px;
  color: #113f67;
  text-decoration: none;
}

.pagination a:hover {
  background: #113f67;
  color: #fff;
  border-color: #113f67;
}

.pagination .current {
  background: #113f67;
  color: #fff;
  border-color: #113f67;
}

@media (max-width: 600px) {
  .blog-item {
    flex-direction: column;
  }

  .blog-item-thumb {
    width: 100%;
    min-width: unset;
    min-height: 180px;
  }

  .blog-item-body {
    padding: 14px;
  }
}

/* ----- 記事詳細 ----- */
.blog-detail-wrap {
  margin: 40px auto;
}

.blog-breadcrumb {
  font-size: 12px;
  color: #787c82;
  margin-bottom: 24px;
}

.blog-breadcrumb a {
  color: #113f67;
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-breadcrumb span {
  margin: 0 6px;
}

.blog-eyecatch {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 32px;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.blog-cat {
  font-size: 12px;
  background: #e8f0fe;
  color: #113f67;
  padding: 3px 12px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
}

.blog-cat:hover {
  background: #113f67;
  color: #fff;
}

.blog-date {
  font-size: 13px;
  color: #787c82;
}

.blog-author {
  font-size: 13px;
  color: #787c82;
}

.blog-h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 32px;
  color: #1d2327;
}

/* 記事2カラム（PC）：左＝本文・右＝おすすめ */
.blog-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px 40px;
  align-items: start;
}

.blog-detail-main {
  min-width: 0;
}

.blog-detail-sidebar {
  min-width: 0;
}

.blog-sidebar-widget {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 18px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.blog-sidebar-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #113f67;
  color: #1d2327;
}

.blog-sidebar-articles {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-sidebar-card {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #ececec;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
  transition: background 0.15s ease;
}

.blog-sidebar-card:first-child {
  padding-top: 0;
}

.blog-sidebar-card:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.blog-sidebar-card:hover {
  background: #f9fafb;
}

.blog-sidebar-card-thumb {
  width: 88px;
  min-width: 88px;
  height: 66px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
  flex-shrink: 0;
}

.blog-sidebar-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-sidebar-card-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 10px;
  color: #bbb;
}

.blog-sidebar-card-body {
  min-width: 0;
  flex: 1;
}

.blog-sidebar-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #1d2327;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sidebar-card-date {
  font-size: 11px;
  color: #787c82;
  margin-top: 6px;
}

.blog-detail-sidebar {
  position: sticky;
  top: 96px;
}

.blog-body {
  line-height: 1.9;
  font-size: 16px;
  background: #fff;
  color: #333;
  padding: 20px;
  border-radius: 8px;
  box-sizing: border-box;
}

.blog-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #113f67;
  color: #1d2327;
}

.blog-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-left: 10px;
  border-left: 4px solid #113f67;
  color: #1d2327;
}

.blog-body p {
  margin-bottom: 20px;
}

.blog-body ul {
  margin: 0 0 20px 24px;
}

.blog-body li {
  margin-bottom: 6px;
}

.blog-body a {
  color: #113f67;
  text-decoration: underline;
}

.blog-body img {
  max-width: 100%;
  border-radius: 6px;
  margin: 8px 0;
}

.blog-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}

.blog-body table th,
.blog-body table td {
  padding: 10px 14px;
  border: 1px solid #dcdcde;
}

.blog-body table th {
  background: #f6f7f7;
  font-weight: 600;
}

.blog-body blockquote {
  border-left: 4px solid #dcdcde;
  padding: 12px 20px;
  background: #f9f9f9;
  margin: 20px 0;
  color: #555;
}

.blog-body pre {
  background: #1d2327;
  color: #f8f8f2;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
  margin-bottom: 20px;
}

.mokuji {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px !important;
}

.anchor-menu {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.mokuji-menu {
  padding-left: 20px;
}

.mokuji-menu li {
  margin-bottom: 8px;
  font-size: 15px;
}

.mokuji-menu a {
  color: #113f67;
  text-decoration: none;
}

.mokuji-menu a:hover {
  text-decoration: underline;
}

.sub-menu {
  padding-left: 20px;
  margin-top: 6px;
}

.sub-menu-text {
  font-size: 13px;
  margin-bottom: 4px;
}

.faq-section {
  margin-top: 48px;
}

.faq-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid #113f67;
}

.faq-item {
  margin-bottom: 20px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  overflow: hidden;
}

.faq-q {
  background: #f6f7f7;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  gap: 10px;
}

.faq-q::before {
  content: "Q";
  color: #113f67;
  font-weight: 900;
  flex-shrink: 0;
}

.faq-a {
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  display: flex;
  gap: 10px;
}

.faq-a::before {
  content: "A";
  color: #e74c3c;
  font-weight: 900;
  flex-shrink: 0;
}

.related-section {
  margin-top: 48px;
}

.related-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 2px solid #113f67;
  padding-bottom: 8px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.related-item {
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  overflow: hidden;
  display: block;
}

.related-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.related-item-noimg {
  height: 120px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 12px;
}

.related-item-body {
  padding: 12px;
}

.related-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #1d2327;
}

.related-item-date {
  font-size: 11px;
  color: #787c82;
  margin-top: 6px;
}

.blog-back-nav {
  margin-top: 40px;
}

.blog-back-nav a {
  color: #113f67;
  text-decoration: none;
  font-size: 14px;
}

.blog-back-nav a:hover {
  text-decoration: underline;
}

.blog-category-back {
  margin-top: 32px;
}

.blog-category-back a {
  color: #113f67;
  text-decoration: none;
  font-size: 14px;
}

.blog-category-back a:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  .blog-detail-layout {
    grid-template-columns: 1fr;
  }

  .blog-detail-sidebar {
    position: static;
  }

  /* 狭い画面ではおすすめを本文の下に（DOM順のまま） */
  .blog-sidebar-widget {
    margin-bottom: 8px;
  }
}

@media (max-width: 640px) {
  .blog-h1 {
    font-size: 22px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- 著者プロフィール（記事下部） ----- */
.author-section {
  margin-top: 48px;
}

.author-section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #113f67;
}

.author-card {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 20px 24px;
}

.author-name {
  font-size: 16px;
  font-weight: 700;
  color: #1d2327;
  margin-bottom: 10px;
}

.author-bio {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  /* nl2br と併用しないこと（pre-line だと \n がそのまま残り、br と二重改行になる） */
}
