/**
 * 月詠だより - 陰陽師の手記スタイル
 * 和紙・墨・朱色・手書き感
 */

/* ==================== Variables ==================== */
:root {
  --washi-bg: #F5F1E8;
  --ink-black: #1A1A1A;
  --vermillion: #D84315;
  --indigo: #1A237E;
  --moon-gold: #C9A961;
  --border-light: #D0C4B0;
  --shadow-ink: rgba(26, 26, 26, 0.15);
}

/* ==================== Background ==================== */
.record-page {
  background: var(--washi-bg);
  min-height: 100vh;
  position: relative;
}

/* 和紙のテクスチャ（ノイズで表現） */
.record-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.01) 2px, rgba(0,0,0,0.01) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.01) 2px, rgba(0,0,0,0.01) 4px);
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

/* 紙の端の影 */
.record-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.05);
  pointer-events: none;
  z-index: 0;
}

/* ==================== Header Section ==================== */
.record-hero {
  text-align: center;
  padding: 60px 20px 40px;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* 五芒星（桔梗紋）- 控えめに */
.record-hero::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 L60 40 L90 40 L65 60 L75 90 L50 70 L25 90 L35 60 L10 40 L40 40 Z" fill="none" stroke="%23C9A961" stroke-width="2" opacity="0.3"/></svg>') no-repeat center;
  background-size: contain;
  opacity: 0.4;
}

.record-moon-icon {
  width: 140px;
  height: 140px;
  margin: 0 auto 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, var(--moon-gold) 0%, #8A7050 100%);
  box-shadow:
    0 0 0 3px var(--washi-bg),
    0 0 0 4px var(--moon-gold),
    0 8px 20px var(--shadow-ink);
  position: relative;
}

/* 月のクレーター（墨絵風） */
.record-moon-icon::after {
  content: '';
  position: absolute;
  top: 25%;
  left: 30%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  box-shadow:
    15px 20px 0 -5px rgba(0, 0, 0, 0.08),
    -10px 30px 0 -8px rgba(0, 0, 0, 0.06);
}

.record-moon-icon.phase-new-moon {
  background: radial-gradient(circle at 40% 40%, #2A2A3E 0%, #0A0A0A 100%);
  box-shadow:
    0 0 0 3px var(--washi-bg),
    0 0 0 4px #2A2A3E,
    0 8px 20px var(--shadow-ink);
}

.record-moon-icon.phase-full-moon {
  background: radial-gradient(circle at 40% 40%, #FFFFFF 0%, var(--moon-gold) 100%);
}

.record-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  font-size: 14px;
  color: var(--ink-black);
  opacity: 0.7;
  flex-wrap: wrap;
}

.record-meta-item {
  position: relative;
  padding: 0 10px;
}

.record-meta-sep {
  color: var(--vermillion);
}

.record-category {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--vermillion);
  border-radius: 2px;
  font-size: 12px;
  color: var(--vermillion);
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* 縦書きタイトル */
.record-hero h1 {
  writing-mode: vertical-rl;
  font-size: 48px;
  line-height: 1.5;
  color: var(--ink-black);
  margin: 0 auto 30px;
  font-weight: 500;
  letter-spacing: 0.15em;
  position: relative;
  display: inline-block;
  padding: 20px;
}

/* タイトルの右側に朱色の縦線 */
.record-hero h1::before {
  content: '';
  position: absolute;
  right: -15px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--vermillion);
  opacity: 0.6;
}

.record-reading-time {
  font-size: 13px;
  color: var(--ink-black);
  opacity: 0.6;
  display: inline-flex;
  gap: 15px;
}

/* ==================== Content Sections ==================== */
.record-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 30px 80px;
  position: relative;
  z-index: 1;
}

.record-section {
  margin-bottom: 50px;
  padding: 0;
  position: relative;
}

/* セクションの区切り（結界の線） */
.record-section::before {
  content: '';
  position: absolute;
  top: -25px;
  left: 0;
  width: 60px;
  height: 4px;
  background:
    linear-gradient(90deg,
      var(--ink-black) 0%, var(--ink-black) 20%,
      transparent 20%, transparent 40%,
      var(--ink-black) 40%, var(--ink-black) 60%,
      transparent 60%, transparent 80%,
      var(--ink-black) 80%, var(--ink-black) 100%
    );
  opacity: 0.3;
}

.record-section:first-of-type::before {
  display: none;
}

.record-section-title {
  font-size: 22px;
  color: var(--ink-black);
  margin-bottom: 25px;
  padding-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  position: relative;
  display: inline-block;
}

/* 手書き風の朱色下線 */
.record-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--vermillion);
  opacity: 0.6;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.record-section p {
  font-size: 16px;
  line-height: 2.2;
  color: var(--ink-black);
  margin-bottom: 20px;
  text-align: justify;
}

/* 最初の段落の最初の文字を大きく（墨絵風） */
.record-section:first-of-type p:first-of-type::first-letter {
  font-size: 2.8em;
  line-height: 1;
  float: left;
  margin: 0.1em 0.15em 0 0;
  color: var(--ink-black);
  font-weight: 700;
}

.record-section p:last-child {
  margin-bottom: 0;
}

/* ==================== Quote Block ==================== */
.record-quote {
  margin: 40px 0 40px 30px;
  padding: 25px 30px;
  border-left: 4px solid var(--vermillion);
  position: relative;
  background: rgba(217, 67, 21, 0.05);
}

.record-quote::before {
  content: '※';
  position: absolute;
  left: -25px;
  top: 15px;
  font-size: 20px;
  color: var(--vermillion);
  font-weight: 700;
  writing-mode: vertical-rl;
}

.record-quote p {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-black);
  margin: 0;
  line-height: 2;
}

/* ==================== Point Box ==================== */
.record-point-box {
  margin: 40px 0;
  padding: 30px;
  border: 2px solid var(--ink-black);
  position: relative;
  background: var(--washi-bg);
}

/* 四隅の装飾 */
.record-point-box::before,
.record-point-box::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid var(--vermillion);
}

.record-point-box::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.record-point-box::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

.record-point-title {
  font-size: 16px;
  color: var(--vermillion);
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
}

.record-point-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.record-point-box li {
  padding: 12px 0 12px 20px;
  position: relative;
  font-size: 15px;
  line-height: 2;
  color: var(--ink-black);
}

.record-point-box li::before {
  content: '・';
  position: absolute;
  left: 0;
  color: var(--vermillion);
  font-size: 18px;
}

/* ==================== Practice Guide ==================== */
.record-practice {
  margin: 40px 0;
}

.record-practice-steps {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.record-practice-step {
  padding: 25px 25px 25px 60px;
  border: 2px solid var(--ink-black);
  border-left: 5px solid var(--vermillion);
  position: relative;
  background: var(--washi-bg);
}

.record-practice-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  border: 3px solid var(--ink-black);
  border-radius: 50%;
  background: var(--washi-bg);
}

.record-practice-step::after {
  content: attr(data-step);
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink-black);
}

.record-practice-step-title {
  font-size: 17px;
  color: var(--vermillion);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.record-practice-step p {
  font-size: 15px;
  line-height: 2;
  color: var(--ink-black);
  margin: 0;
}

/* ==================== Tags ==================== */
.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 50px 0;
  padding: 25px;
  border-top: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-light);
}

.record-tag {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--ink-black);
  font-size: 13px;
  color: var(--ink-black);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.record-tag::before {
  content: '#';
  color: var(--vermillion);
  margin-right: 4px;
}

.record-tag:hover {
  background: var(--ink-black);
  color: var(--washi-bg);
  border-color: var(--ink-black);
}

/* ==================== Related Moon Phases ==================== */
.record-related-phases {
  margin: 60px 0;
  padding: 30px;
  border: 2px solid var(--ink-black);
  text-align: center;
  position: relative;
}

.record-related-phases::before,
.record-related-phases::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--vermillion);
}

.record-related-phases::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.record-related-phases::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

.record-related-title {
  font-size: 18px;
  color: var(--ink-black);
  margin-bottom: 25px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.record-phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 20px;
  max-width: 500px;
  margin: 0 auto;
}

.record-phase-item {
  text-align: center;
  text-decoration: none;
  padding: 20px 10px;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.record-phase-item:hover {
  background: rgba(217, 67, 21, 0.05);
  border-color: var(--vermillion);
}

.record-phase-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px solid var(--ink-black);
}

.record-phase-name {
  font-size: 13px;
  color: var(--ink-black);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ==================== 落款（印鑑） ==================== */
.record-seal {
  margin: 60px 0 40px;
  text-align: right;
  padding-right: 30px;
}

.record-seal-stamp {
  display: inline-block;
  width: 60px;
  height: 60px;
  background: var(--vermillion);
  border: 2px solid var(--vermillion);
  border-radius: 4px;
  position: relative;
  box-shadow: 0 4px 10px var(--shadow-ink);
  transform: rotate(3deg);
}

.record-seal-stamp::after {
  content: '朔夜';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--washi-bg);
  font-size: 18px;
  font-weight: 900;
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .record-hero {
    padding: 40px 20px 30px;
  }

  .record-hero h1 {
    font-size: 36px;
    letter-spacing: 0.1em;
  }

  .record-moon-icon {
    width: 100px;
    height: 100px;
  }

  .record-content {
    padding: 0 20px 60px;
  }

  .record-section {
    margin-bottom: 40px;
  }

  .record-section-title {
    font-size: 19px;
  }

  .record-section p {
    font-size: 15px;
  }

  .record-quote {
    margin: 30px 0 30px 20px;
    padding: 20px;
  }

  .record-point-box {
    padding: 25px 20px;
  }

  .record-practice-step {
    padding: 20px 20px 20px 55px;
  }

  .record-practice-step::before,
  .record-practice-step::after {
    left: 10px;
    width: 32px;
    height: 32px;
  }

  .record-practice-step::after {
    font-size: 16px;
  }

  .record-tags {
    padding: 20px 15px;
  }

  .record-related-phases {
    padding: 25px 20px;
  }

  .record-phase-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .record-seal {
    padding-right: 20px;
  }

  .record-seal-stamp {
    width: 50px;
    height: 50px;
  }

  .record-seal-stamp::after {
    font-size: 16px;
  }
}
