/*
Theme Name: 終活ナビ
Theme URI: https://shukatsu-ansin.com/
Author: 株式会社Nexa
Author URI: https://nexa-corp.jp/
Description: 終活ナビ - 墓じまい・葬儀・相続の総合情報メディア用カスタムテーマ
Version: 1.0.0
Text Domain: shukatsu-navi
*/

/* === リセット・ベース === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; }
body {
  font-family: 'Helvetica Neue', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* === ヘッダー === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #1a1a1a;
}
.logo span { color: #4a8c5c; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  transition: color 0.2s;
}
.nav a:hover { color: #4a8c5c; }
.nav-dropdown { position: relative; cursor: pointer; }
.nav-dropdown::after {
  content: '▾';
  font-size: 11px;
  margin-left: 4px;
  color: #999;
}
.header-cta { display: flex; gap: 12px; align-items: center; }
.btn-outline {
  padding: 10px 22px;
  border: 1.5px solid #1a1a1a;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-outline:hover { background: #1a1a1a; color: #fff; }
.btn-primary {
  padding: 10px 22px;
  background: #1a1a1a;
  color: #fff;
  border: 1.5px solid #1a1a1a;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-primary:hover { background: #333; }

/* === ヒーローセクション === */
.hero {
  background: linear-gradient(135deg, #f8faf9 0%, #eef5f0 100%);
  padding: 80px 24px;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-text h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero-text h1 em {
  font-style: normal;
  color: #4a8c5c;
}
.hero-text p {
  font-size: 18px;
  color: #666;
  line-height: 1.9;
  margin-bottom: 32px;
}
.hero-search {
  max-width: 500px;
}
.hero-search form {
  display: flex;
  gap: 0;
}
.hero-search input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid #ddd;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 17px;
  outline: none;
  transition: border-color 0.2s;
}
.hero-search input:focus { border-color: #4a8c5c; }
.hero-search button {
  padding: 16px 28px;
  background: #4a8c5c;
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.hero-search button:hover { background: #3d7a4e; }
.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hero-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.hero-card-icon { font-size: 36px; margin-bottom: 12px; }
.hero-card-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.hero-card-desc { font-size: 14px; color: #888; line-height: 1.6; }

/* === セクション共通 === */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.section-title { font-size: 28px; font-weight: 800; }
.section-more { font-size: 16px; color: #4a8c5c; font-weight: 600; }
.section-more:hover { text-decoration: underline; }

/* === 記事カード === */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.article-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.article-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
}
.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card-body { padding: 20px; }
.article-card-cat {
  font-size: 13px;
  font-weight: 600;
  color: #4a8c5c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.article-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-meta { font-size: 14px; color: #999; }

/* === カテゴリセクション === */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.category-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid transparent;
  display: block;
}
.category-card:hover { border-color: #4a8c5c; background: #f0f7f2; }
.category-icon { font-size: 40px; margin-bottom: 12px; }
.category-name { font-size: 16px; font-weight: 700; }
.category-count { font-size: 13px; color: #999; margin-top: 4px; }

/* === ランキング === */
.ranking-section { background: #fafafa; }
.ranking-list { display: flex; flex-direction: column; gap: 16px; }
.ranking-item {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 22px 24px;
  border: 1px solid #eee;
  transition: all 0.2s;
}
.ranking-item:hover { border-color: #4a8c5c; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.ranking-number { font-size: 32px; font-weight: 800; color: #ddd; min-width: 44px; }
.ranking-item:nth-child(1) .ranking-number { color: #d4a745; }
.ranking-item:nth-child(2) .ranking-number { color: #a0a0a0; }
.ranking-item:nth-child(3) .ranking-number { color: #b87333; }
.ranking-content { flex: 1; }
.ranking-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.ranking-meta { font-size: 14px; color: #999; }

/* === CTA セクション === */
.cta-section {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  color: #fff;
  padding: 64px 24px;
  text-align: center;
}
.cta-section h2 { font-size: 32px; font-weight: 800; margin-bottom: 16px; }
.cta-section p { color: #aaa; margin-bottom: 32px; font-size: 17px; }
.cta-section .cta-button {
  display: inline-block;
  padding: 18px 52px;
  background: #4a8c5c;
  color: #fff;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  transition: background 0.2s;
}
.cta-section .cta-button:hover { background: #3d7a4e; }

/* === フッター === */
.footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 48px 24px 32px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-logo { font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-logo span { color: #4a8c5c; }
.footer-desc { font-size: 15px; line-height: 1.8; color: #888; }
.footer-heading { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 15px; color: #888; }
.footer-links a:hover { color: #4a8c5c; }
.footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid #333;
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* === パンくず === */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  font-size: 15px;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
}
.breadcrumb a { color: #666; }
.breadcrumb a:hover { color: #4a8c5c; }
.breadcrumb .sep { margin: 0 8px; color: #ccc; }

/* === 記事ページ レイアウト === */
.main-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 60px;
}

/* === 記事メタ情報 === */
.article-meta-date {
  font-size: 16px;
  color: #888;
  margin-bottom: 16px;
  font-feature-settings: 'tnum';
}
.article-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  color: #1a1a1a;
}
.article-tags { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.tag {
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  transition: all 0.2s;
}
.tag:hover { border-color: #4a8c5c; color: #4a8c5c; }
.article-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  margin-bottom: 48px;
  overflow: hidden;
}
.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 50%, #3a3a3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.article-hero-text {
  color: #fff;
  padding: 40px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.6;
  z-index: 1;
}

/* === 記事本文 === */
.article-body h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1a1a1a;
  line-height: 1.4;
}
.article-body h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 16px;
  padding-left: 14px;
  border-left: 3px solid #4a8c5c;
  line-height: 1.4;
}
.article-body p {
  font-size: 18px;
  line-height: 2.0;
  margin-bottom: 24px;
  color: #333;
}
.article-body ul, .article-body ol {
  margin: 16px 0 24px;
  padding-left: 28px;
}
.article-body li {
  font-size: 18px;
  line-height: 2.0;
  margin-bottom: 10px;
  color: #333;
}
.article-body a {
  color: #4a8c5c;
  text-decoration: underline;
}
.article-body a:hover { color: #3d7a4e; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 17px;
}
.article-body th {
  background: #1a1a1a;
  color: #fff;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
}
.article-body td {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}
.article-body tr:nth-child(even) td { background: #fafafa; }
.article-body tr:hover td { background: #f0f7f2; }
.article-body blockquote {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 24px 28px;
  margin: 24px 0;
  border-left: 4px solid #4a8c5c;
  font-size: 17px;
}

/* ポイントボックス（ブロックエディタのカスタム対応） */
.point-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 24px 28px;
  margin: 24px 0;
  border-left: 4px solid #4a8c5c;
}
.point-box-title {
  font-size: 17px;
  font-weight: 700;
  color: #4a8c5c;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.point-box p { margin-bottom: 8px; font-size: 17px; }

/* CTAボックス（記事内） */
.cta-box {
  background: linear-gradient(135deg, #f0f7f2, #e8f4eb);
  border-radius: 12px;
  padding: 36px;
  margin: 40px 0;
  text-align: center;
}
.cta-box h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  border: none;
  padding: 0;
  color: #1a1a1a;
}
.cta-box p { color: #555; margin-bottom: 20px; font-size: 17px; }
.cta-button {
  display: inline-block;
  padding: 16px 44px;
  background: #4a8c5c;
  color: #fff;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  transition: background 0.2s;
  text-decoration: none;
}
.cta-button:hover { background: #3d7a4e; color: #fff; }

/* === サイドバー === */
.sidebar { position: relative; }
.toc {
  position: sticky;
  top: 100px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 24px;
}
.toc-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}
.toc-list { list-style: none; padding: 0; }
.toc-list li { margin-bottom: 0; }
.toc-list a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  color: #555;
  border-bottom: 1px solid #f5f5f5;
  line-height: 1.6;
  transition: color 0.2s;
}
.toc-list a:hover { color: #4a8c5c; }
.toc-list li:last-child a { border-bottom: none; }

/* === ナビゲーションメニュー（WordPress） === */
.nav .menu { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; }
.nav .menu li a {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  transition: color 0.2s;
}
.nav .menu li a:hover { color: #4a8c5c; }
.footer-links .menu { list-style: none; padding: 0; margin: 0; }
.footer-links .menu li { margin-bottom: 10px; }
.footer-links .menu li a { font-size: 15px; color: #888; }
.footer-links .menu li a:hover { color: #4a8c5c; }

/* === アーカイブページ === */
.archive-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 0;
}
.archive-title { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.archive-desc { font-size: 17px; color: #666; }

/* === ページネーション === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}
.pagination a, .pagination span {
  padding: 10px 18px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  color: #333;
  transition: all 0.2s;
}
.pagination a:hover { border-color: #4a8c5c; color: #4a8c5c; }
.pagination .current {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* === WP管理バー対応 === */
.admin-bar .header { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .header { top: 46px; }
}

/* === レスポンシブ === */
@media (max-width: 768px) {
  html { font-size: 17px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-text h1 { font-size: 32px; }
  .hero-visual { grid-template-columns: 1fr 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .nav { display: none; }
  .header-cta { gap: 8px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .main-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 60px;
    gap: 32px;
  }
  .article-title { font-size: 26px; }
  .article-body h2 { font-size: 22px; }
  .toc { position: static; }
  .section-title { font-size: 24px; }
}
