/* =========================================
   Article Layout & Layout Components
   ========================================= */

/* 記事コンテナ */
.cf-container-narrow {
  max-width: 896px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 記事ヒーロー（タイトルエリア） */
.cf-article-hero {
  position: relative;
  height: 60vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--cf-color-brand-navy);
  color: white;
  text-align: center;
}

.cf-article-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cf-article-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.cf-article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(14, 58, 89, 0.6), rgba(14, 58, 89, 1));
}

.cf-article-hero-content {
  position: relative;
  z-index: 10;
  color: white;
  width: 100%;
}

/* メタ情報・タグ */
.cf-article-meta-tags {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cf-article-header-tag {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
}

.cf-article-hero-title {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 32px;
  color: white;
}

/* 著者ブロック */
.cf-article-author-block {
  display: inline-flex;
  align-items: center;
  text-align: left;
}

.cf-article-author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  margin-right: 12px;
  object-fit: cover;
}

.cf-article-author-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  margin-right: 12px;
  background-color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 14px;
}

/* 本文セクション外枠 */
.cf-article-detail-section {
  position: relative;
  padding: 64px 0 96px;
  margin-top: -40px;
  z-index: 20;
}

.cf-article-detail-card {
  background: white;
  border-radius: 40px;
  padding: 32px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255,255,255,0.5);
}

@media (min-width: 768px) {
  .cf-article-detail-card { padding: 64px; }
}

/* アニメーション復旧 */
.cf-article-detail-card.cf-reveal {
  opacity: 0 !important;
  transform: translateY(30px) !important;
  transition: opacity 0.8s ease, transform 0.8s ease !important;
  visibility: visible !important;
}

.cf-article-detail-card.cf-reveal.active {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* =========================================
   Gem Specific Styles (Inside .entry-content)
   ========================================= */

/* H2: 紺棒背景スタイル */
.cf-article-body .entry-content h2 {
  all: unset !important;
  display: block !important;
  border-left: 5px solid var(--cf-color-brand-navy) !important;
  background-color: var(--cf-color-bg-surface) !important;
  padding: 0.8em 1em !important;
  margin: 2.5em 0 1.2em !important;
  font-size: 20px !important;
  font-weight: bold !important;
  color: var(--cf-color-primary) !important;
  box-sizing: border-box !important;
}

/* H3: 通常のオレンジ縦棒 */
.cf-article-body .entry-content h3 {
  all: unset !important;
  display: block !important;
  border-left: 5px solid var(--cf-color-brand-orange) !important;
  padding: 0.4em 0.8em !important;
  margin: 2em 0 1em !important;
  font-size: 18px !important;
  font-weight: bold !important;
  line-height: 1.4 !important;
  color: var(--cf-color-brand-navy) !important;
  box-sizing: border-box !important;
}

/* テーブル & モバイルスクロールヒント */
.cf-article-body .cf-table-wrapper {
  position: relative;
  margin: 32px 0;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.cf-article-body .cf-table-wrapper table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--cf-color-primary) !important;
}

.cf-article-body .cf-table-wrapper th {
  background-color: var(--cf-color-brand-navy) !important;
  color: #ffffff !important;
  padding: 12px !important;
  text-align: left !important;
}

.cf-article-body .cf-table-wrapper td {
  padding: 12px !important;
  border: 1px solid #e5e7eb !important;
}

@media (max-width: 767px) {
  .cf-article-body .cf-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cf-article-body .cf-table-wrapper table { min-width: 500px !important; font-size: 13px !important; }
  .cf-article-body .cf-table-wrapper::after {
    content: "Scroll ➔";
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(14, 58, 89, 0.9); color: #fff;
    padding: 3px 8px; border-radius: 4px; font-size: 9px;
    animation: fadeOutHint 3s forwards; pointer-events: none; z-index: 10;
  }
}

@keyframes fadeOutHint { 0%, 70% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* CTA Box & Button (オレンジ棒なしH3を含む) */
.cf-article-body .entry-content .cta-box {
  all: unset !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 32px 24px !important;
  margin: 48px 0 !important;
  background-color: #f4fdf9 !important;
  border: 2px solid #008060 !important;
  border-radius: 24px !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.cf-article-body .entry-content .cta-box h3 {
  border-left: none !important;
  padding-left: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 16px !important;
}

.cf-article-body .entry-content .cta-box a.cta-button {
  all: unset !important;
  display: inline-block !important;
  background-color: #008060 !important;
  color: #ffffff !important;
  padding: 16px 48px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  margin-top: 16px !important;
  box-shadow: 0 4px 12px rgba(0, 128, 96, 0.3) !important;
}

@media (max-width: 767px) {
  .cf-article-body .entry-content .cta-box a.cta-button { width: 100% !important; max-width: 280px !important; }
}

/* コードブロック */
.cf-article-body .entry-content .code-block {
  all: unset !important;
  display: block !important;
  background-color: #282c34 !important;
  color: #abb2bf !important;
  padding: 24px !important;
  border-radius: 12px !important;
  overflow-x: auto !important;
  font-family: monospace !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  margin: 32px 0 !important;
  white-space: pre !important;
}

/* 画像プレースホルダー */
.cf-article-body .entry-content .image-placeholder {
  display: block !important;
  background: #f8f9fa !important;
  border: 3px dashed #cbd5e1 !important;
  padding: 40px 20px !important;
  text-align: center !important;
  margin: 32px 0 !important;
  color: #64748b !important;
  border-radius: 16px !important;
  font-weight: bold !important;
  font-size: 14px !important;
}

/* その他共通スタイル（リスト・リンク・引用） */
.cf-article-body p { margin-bottom: 24px; }
.cf-article-body ul, .cf-article-body ol { margin-bottom: 24px; padding-left: 24px; }
.cf-article-body li { margin-bottom: 8px; }
.cf-article-body blockquote {
  border-left: 4px solid var(--cf-color-brand-orange);
  background-color: #fff7ed;
  padding: 24px; border-radius: 0 16px 16px 0;
  font-style: italic; color: #6b7280; margin: 24px 0;
}
.cf-article-body a { color: var(--cf-color-brand-orange); text-decoration: underline; }

/* 戻るリンク */
.cf-article-back-link { margin-top: 48px; text-align: center; }
.cf-article-back-link a {
  display: inline-flex; align-items: center;
  font-weight: 700; color: var(--cf-color-secondary);
  text-decoration: none !important; transition: color 0.2s;
}
.cf-article-back-link a:hover { color: var(--cf-color-brand-orange); }

.cf-article-cta-block {
    text-align: center;
}
.cf-btn-article-cta {
  display: inline-block;
  background-color: var(--cf-color-brand-navy);
  color: white !important;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  font-size: 16px;
}
.cf-btn-article-cta:hover {
  background-color: black;
  transform: scale(1.05);
}