/*
Theme Name: Monestly - 正直なお金の話
Theme URI: https://monestly.com
Description:ゼロから始める資産形成の学習サイトです。現役トレーダーが、売り込みなし・アフィリエイトなしで書いた、正直なお金の話。
Author: aY
Version: 1.0
*/

:root {
  --bg: #faf9f6;
  --text: #1a1a1a;
  --text-sub: #666;
  --accent: #2c5f2e;
  --accent-light: #e8f0e8;
  --border: #e0ddd8;
  --aside-bg: #f3f0eb;
  --dark-bg: #1a1a1a;
  --max: 680px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 17px;
  line-height: 2;
}

/* ===== HEADER ===== */
.site-header {
  background: rgba(250, 249, 246, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site-header.hidden {
  transform: translateY(-100%);
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.site-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.site-logo span { color: var(--accent); }

/* Nav */
.site-nav-wrap { position: relative; }

.site-nav {
  display: flex;
  gap: 0.2rem;
  list-style: none;
  align-items: center;
}

.nav-item { position: relative; }

.nav-link {
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
  letter-spacing: 0.5px;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--aside-bg);
}

.nav-arrow {
  font-size: 10px;
  opacity: 0.5;
  transition: transform 0.2s;
}

.nav-item.has-mega:hover .nav-arrow {
  transform: rotate(180deg);
}

/* Mega menu */
.mega-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  min-width: 260px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  transform: translateX(-50%) translateY(-6px);
  z-index: 200;
}

.nav-item.has-mega:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* 矢印 */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 6px;
  background: #fff;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-top: 1px solid var(--border);
}

.mega-inner { padding: 1.2rem 1.4rem; }

.mega-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.mega-list { list-style: none; }

.mega-list li { margin-bottom: 0.2rem; }

.mega-list a {
  font-size: 13px;
  color: #444;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  display: block;
  line-height: 1.5;
  transition: background 0.15s, color 0.15s;
}

.mega-list a:hover {
  background: var(--aside-bg);
  color: var(--accent);
}

.site-main {
  padding-top: 80px;
  min-height: 80vh;
}

/* ===== ARTICLE ===== */
.article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem 8rem;
}

.chapter-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.article h1 {
  font-family: 'Noto Serif JP', serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 2.5rem;
}

.lead {
  font-size: 18px;
  line-height: 2;
  color: #333;
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  margin-bottom: 3rem;
}

.article p { margin-bottom: 1.8rem; color: #2a2a2a; }

.article h2 {
  font-family: 'Noto Serif JP', serif;
  font-size: 22px;
  font-weight: 700;
  margin: 4rem 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1.5px solid var(--border);
}

.article h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 2.8rem 0 1.2rem;
  color: #222;
}

/* ===== COMPONENTS ===== */
.aside {
  background: var(--aside-bg);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin: 2.5rem 0;
  font-size: 15px;
  line-height: 1.9;
  color: #444;
}

.aside-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: block;
}

.highlight {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.2rem 1.5rem;
  margin: 2.5rem 0;
  font-size: 16px;
  line-height: 1.9;
}

.scene {
  background: var(--dark-bg);
  border-radius: 12px;
  padding: 1.8rem 2rem;
  margin: 2.5rem 0;
  font-size: 15px;
  line-height: 2.2;
  color: #fff;
}

.scene-note {
  margin-top: 1.2rem;
  font-size: 13px;
  color: #aaa;
  line-height: 1.8;
}

.era-header {
  margin: 4rem 0 1.5rem;
  padding: 1.2rem 1.6rem;
  background: var(--aside-bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.era-period {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.era-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.question {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin: 2.5rem 0;
  font-size: 16px;
  line-height: 1.9;
  background: #fff;
  color: #333;
}

.example {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
  font-size: 15px;
  line-height: 1.9;
  background: #fff;
}

.example-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-sub);
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: block;
}

.section-divider {
  text-align: center;
  color: #ccc;
  font-size: 20px;
  letter-spacing: 6px;
  margin: 4rem 0 0;
}

/* ===== TOC ===== */
.toc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.8rem;
  margin: 2.5rem 0;
  font-size: 15px;
}

.toc-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.8rem;
  display: block;
}

.toc ol { padding-left: 1.4rem; margin: 0; }
.toc li { margin-bottom: 0.4rem; color: #444; line-height: 1.7; }
.toc li a { color: var(--accent); text-decoration: none; }
.toc li a:hover { text-decoration: underline; }
.toc ul { padding-left: 1.2rem; margin-top: 0.3rem; }
.toc ul li { font-size: 14px; color: #666; margin-bottom: 0.2rem; }

/* ===== NAV ===== */
.prev-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
}
.prev-link:hover { color: var(--accent); }

.next-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4rem;
  padding: 1.5rem 1.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s;
}
.next-link:hover { background: var(--aside-bg); }
.next-link-label { font-size: 11px; letter-spacing: 2px; color: var(--text-sub); margin-bottom: 0.3rem; }
.next-link-title { font-size: 16px; font-weight: 700; }
.next-link-arrow { font-size: 22px; color: var(--accent); }

/* ===== TOP PAGE TOC ===== */
.top-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 1.5rem 8rem;
}

.top-section-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.top-h1 {
  font-family: 'Noto Serif JP', serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.top-intro {
  font-size: 16px;
  color: #555;
  line-height: 1.9;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.chapter-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.chapter-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.15s;
  text-decoration: none;
}

.chapter-btn.active {
  background: #3d2b1f;
  color: #e8d5b0;
  border-color: #3d2b1f;
}

.toc-list { list-style: none; }

.toc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.toc-link {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  width: 100%;
  padding: 1.6rem 1.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.toc-link:hover {
  background: var(--aside-bg);
  border-color: #c8c4bc;
}

.badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: #3d2b1f;
  color: #e8d5b0;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.toc-body { flex: 1; }

.toc-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.toc-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
}

.toc-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  gap: 2px;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark-bg);
  color: #aaa;
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 13px;
  line-height: 1.8;
}

.site-footer a {
  color: #aaa;
  text-decoration: none;
}

.site-footer a:hover { color: #fff; }

.footer-note {
  margin-top: 1rem;
  font-size: 12px;
  color: #666;
}

/* ===== UTILITY ===== */
strong { font-weight: 700; }
em { font-style: normal; color: var(--accent); font-weight: 700; }

.footnote {
  font-size: 13px;
  color: var(--text-sub);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-top: 1.5rem;
  line-height: 1.8;
}
.mega-menu--left {
  left: 0;
  transform: translateX(0) translateY(-6px);
}

.nav-item.has-mega:hover .mega-menu--left {
  transform: translateX(0) translateY(0);
}

/* ===== FRONT PAGE ===== */
.front-wrap {
  max-width: 100%;
}

/* ヒーロー */
.front-hero {
  text-align: center;
  padding: 8rem 2rem 6rem;
  max-width: 680px;
  margin: 0 auto;
}

.front-hero-label {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.front-hero-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.front-hero-sub {
  font-size: 16px;
  color: var(--text-sub);
  line-height: 1.9;
  margin-bottom: 2.5rem;
}

.front-hero-btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: background 0.2s;
}

.front-hero-btn:hover {
  background: #1e4220;
}

/* 章カード */
.front-chapters {
  background: var(--aside-bg);
  padding: 5rem 2rem;
}

.front-chapters-inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.front-card {
  perspective: 1000px;
  height: 220px;
  cursor: pointer;
}

.front-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.front-card:hover .front-card-inner {
  transform: rotateY(180deg);
}

.front-card-front,
.front-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.front-card-front {
  background: #fff;
  border: 1px solid var(--border);
}

.front-card-back {
  background: var(--accent);
  color: #fff;
  transform: rotateY(180deg);
}

.front-card-num {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.front-card-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.front-card-back p {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.9);
  margin-bottom: 1.2rem;
}

.front-card-back a {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 2px;
}

/* 筆者 */
.front-author {
  padding: 6rem 2rem;
  max-width: 680px;
  margin: 0 auto;
}

.front-author-label {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
}

.front-author-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.front-author-body {
  font-size: 16px;
  color: #444;
  line-height: 2;
}
/* ===== RESPONSIVE ===== */
/* 章カード：縦1列 */
  .front-chapters-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .front-card {
    height: auto;
    perspective: none;
    cursor: default;
  }

  .front-card-inner {
    position: relative;
    transform: none !important;
    transform-style: flat;
    height: auto;
  }

  .front-card-front {
    position: relative;
    backface-visibility: visible;
    border-radius: 12px;
    height: auto;
    padding: 1.4rem;
    background: #fff;
    border: 1px solid var(--border);
  }

  .front-card-back {
    display: none;
  }

  .front-card-front .front-card-num { color: var(--accent); }
  .front-card-front .front-card-title { color: var(--text); }

@media (max-width: 1024px) and (min-width: 769px) {
  /* タブレット：2列 */
  .front-chapters-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .front-card { height: 200px; }
}