/* ============================================================
   LEARN ARTICLE — 言語学習記事用スタイル上書き
   このCSSを読み込んだ記事ページだけに教室風デザインが適用される
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;700&display=swap');

/* ── 記事カード全体 → クリーム色・教室風に ── */
.article-card-page {
  background: rgba(245, 242, 234, 0.98) !important;
  border: 1px solid rgba(200, 150, 90, 0.3) !important;
  border-top: 4px solid #3d6b52 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* ── 戻るリンク ── */
.article-back {
  color: #3d6b52 !important;
}
.article-back:hover { opacity: 0.6; }

/* ── カテゴリバッジ（緑に） ── */
.badge-diary, .badge-blog {
  background: rgba(61, 107, 82, 0.12) !important;
  color: #3d6b52 !important;
}

/* ── 日付 ── */
.article-page-date {
  color: #8a7a60 !important;
}

/* ── タイトル ── */
.article-page-title {
  font-family: 'Shippori Mincho', serif !important;
  color: #2c2416 !important;
  -webkit-text-fill-color: #2c2416 !important;
  text-shadow: none !important;
  letter-spacing: 0.05em;
}

/* ── サブタイトル ── */
.article-page-subtitle {
  color: #8a7a60 !important;
  border-bottom-color: rgba(200, 150, 90, 0.25) !important;
}

/* ── 本文 ── */
.article-body {
  color: #2c2416 !important;
}
.article-body p {
  color: #5a4e3a;
}

/* ── H2見出し → 黒板風 ── */
.article-body h2 {
  font-family: 'Shippori Mincho', serif !important;
  background: #3d6b52;
  color: #f0ede4 !important;
  border-left: none !important;
  padding: 10px 18px !important;
  border-radius: 3px;
  font-size: 17px !important;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  margin: 40px 0 14px !important;
}

/* ── H3見出し → 木目アクセント ── */
.article-body h3 {
  font-family: 'Shippori Mincho', serif !important;
  color: #a67840 !important;
  border-left: 3px solid #c8965a !important;
  padding-left: 10px;
}

/* ── 区切り線 ── */
.article-footer-divider {
  border-top-color: rgba(200, 150, 90, 0.2) !important;
}

/* ── タグ ── */
.tag {
  color: #3d6b52 !important;
  background: rgba(61, 107, 82, 0.08) !important;
  border-color: rgba(61, 107, 82, 0.25) !important;
}

/* ── ホーム記事：カテゴリカード ── */
.learn-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.learn-card-thumb {
  width: calc(100% + 40px);
  margin: -22px -20px 16px;
  height: 140px;
  border-radius: 5px 5px 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, #3d6b52, #2d5040);
}
.learn-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.learn-category-card {
  background: rgba(245,242,234,1);
  border: 1px solid rgba(200,150,90,0.25);
  border-top: 3px solid #3d6b52;
  border-radius: 6px;
  padding: 22px 20px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.learn-category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(44,36,22,0.12);
}
.learn-category-card.coming-soon {
  opacity: 0.6;
  cursor: default;
}
.learn-category-card.coming-soon:hover { transform: none; box-shadow: none; }
.learn-card-lang {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #3d6b52;
  margin-bottom: 6px;
}
.learn-card-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 20px;
  font-weight: 700;
  color: #2c2416;
  margin-bottom: 8px;
}
.learn-card-desc {
  font-size: 13px;
  color: #8a7a60;
  line-height: 1.8;
  margin-bottom: 14px;
}
.learn-card-articles { list-style: none; padding: 0; margin: 0; }
.learn-card-articles li {
  border-radius: 4px;
  transition: background 0.15s;
}
.learn-card-articles li:hover {
  background: rgba(61, 107, 82, 0.07);
}
.learn-card-articles a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  color: #3d6b52;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.5;
}
.learn-card-articles a::before {
  content: '▷';
  font-size: 8px;
  flex-shrink: 0;
  opacity: 0.75;
}
.learn-card-articles a::after {
  content: '→';
  margin-left: auto;
  font-size: 12px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.learn-card-articles li:hover a::after {
  opacity: 0.6;
  transform: translateX(0);
}
.learn-card-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #3d6b52;
  color: #f0ede4;
  border-radius: 2px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* ── 記事内 まとめノートエリア ── */
.note-section {
  margin: 40px 0 8px;
  padding: 20px;
  background: rgba(61, 107, 82, 0.05);
  border: 1px solid rgba(61, 107, 82, 0.15);
  border-radius: 6px;
}
.note-section-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #3d6b52;
  margin-bottom: 14px;
}

/* ── ノートギャラリー タブ ── */
.note-gallery-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.note-tab {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 16px;
  border: 1px solid rgba(61, 107, 82, 0.35);
  border-radius: 3px;
  background: transparent;
  color: #3d6b52;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.note-tab:hover {
  background: rgba(61, 107, 82, 0.08);
}
.note-tab.active {
  background: #3d6b52;
  color: #f0ede4;
  border-color: #3d6b52;
}

/* ── ノートギャラリー ── */
.note-gallery-grid {
  display: flex;
  flex-direction: row;
  gap: 14px;
  margin: 20px 0 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  /* スクロールバーをシンプルに */
  scrollbar-width: thin;
  scrollbar-color: rgba(61, 107, 82, 0.35) rgba(200, 150, 90, 0.1);
}
.note-gallery-grid::-webkit-scrollbar {
  height: 5px;
}
.note-gallery-grid::-webkit-scrollbar-track {
  background: rgba(200, 150, 90, 0.1);
  border-radius: 3px;
}
.note-gallery-grid::-webkit-scrollbar-thumb {
  background: rgba(61, 107, 82, 0.35);
  border-radius: 3px;
}

.note-gallery-item {
  flex-shrink: 0;
  width: 160px;
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(200, 150, 90, 0.25);
  background: linear-gradient(135deg, #e8e4d9, #d8d3c5);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.note-gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(44, 36, 22, 0.18);
}
.note-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ギャラリーアイテム ラッパー（画像＋ラベルをセットにする） */
.note-gallery-item-wrap {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 画像下のEPラベル */
.note-gallery-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #8a7a60;
  text-align: center;
  line-height: 1.4;
}

/* 空タブメッセージ */
.note-gallery-empty {
  flex-shrink: 0;
  width: 100%;
  min-width: 200px;
  text-align: center;
  padding: 40px 20px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #c8b49a;
}

/* 画像がまだない時のプレースホルダー */
.note-gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c8b49a;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.note-gallery-placeholder::before {
  content: '✏';
  font-size: 24px;
  opacity: 0.4;
}

/* ── ライトボックス ── */
.learn-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 8, 4, 0.92);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
  animation: lb-fade-in 0.15s ease;
}
.learn-lightbox.open {
  display: flex;
}
@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.learn-lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.7);
  cursor: default;
  animation: lb-zoom-in 0.18s ease;
}
@keyframes lb-zoom-in {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.learn-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  font-family: 'Share Tech Mono', monospace;
  transition: color 0.15s, border-color 0.15s;
}
.learn-lightbox-close:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.learn-lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Shippori Mincho', serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ── プロフィールテーブル（記事内に使う場合） ── */
.article-card-page .profile-table td {
  color: #2c2416 !important;
  border-bottom-color: rgba(200, 150, 90, 0.15) !important;
}
.article-card-page .profile-table td:first-child {
  color: #3d6b52 !important;
}
