/* ============================================
   月城れいな - Global Stylesheet
   世界観：月明かり、静かな夜のトーン
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* カラースキーム（設計書 Section 9 準拠） */
  --color-main: #2D2040;
  --color-accent: #6B4C8A;
  --color-bg: #FAF8F5;
  --color-text: #333333;
  --color-subtext: #777777;
  --color-gold: #C9A96E;

  /* 派生カラー */
  --color-main-light: #3D3055;
  --color-accent-light: #8B6CAA;
  --color-border: #E8E4DF;
  --color-card-bg: #FFFFFF;
  --color-gold-light: #E8D5A8;

  /* フォント */
  --font-heading: 'Noto Serif JP', serif;
  --font-body: 'Noto Sans JP', sans-serif;

  /* スペーシング */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* レイアウト */
  --content-width: 720px;
  --site-width: 1080px;
  --sidebar-width: 300px;
  --header-height: 60px;

  /* トランジション */
  --transition: 0.3s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.9;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-gold);
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-main);
  line-height: 1.5;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: 1.35rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-gold);
  position: relative;
}

h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--color-accent);
  position: absolute;
  bottom: -2px;
  left: 0;
}

h3 {
  font-size: 1.15rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  padding-left: 0.8rem;
  border-left: 3px solid var(--color-gold);
}

p {
  margin-bottom: 1.2rem;
}

/* --- Layout --- */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.content-area {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-sm);
}

/* 2カラムレイアウト（PC） */
.layout-with-sidebar {
  display: flex;
  gap: var(--space-lg);
  max-width: var(--site-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-sm);
}

.layout-with-sidebar .main-content {
  flex: 1;
  min-width: 0;
}

.layout-with-sidebar .sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* --- Header --- */
.site-header {
  background: var(--color-main);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(45, 32, 64, 0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.site-logo .moon-icon {
  font-size: 1.4rem;
}

.site-logo .logo-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* --- Navigation --- */
.nav-desktop {
  display: none;
}

.nav-desktop ul {
  display: flex;
  gap: 1.5rem;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0;
  position: relative;
}

.nav-desktop a::after {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width var(--transition);
  position: absolute;
  bottom: 0;
  left: 0;
}

.nav-desktop a:hover {
  color: var(--color-gold);
}

.nav-desktop a:hover::after {
  width: 100%;
}

/* ハンバーガーメニュー */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-gold);
  border-radius: 1px;
  transition: var(--transition);
}

.hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* モバイルメニュー */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(45, 32, 64, 0.97);
  z-index: 99;
  padding: var(--space-lg) var(--space-sm);
  overflow-y: auto;
}

.nav-mobile.is-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: var(--space-xl);
}

.nav-mobile ul {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.nav-mobile a {
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.nav-mobile a:hover {
  color: var(--color-gold);
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(
    135deg,
    var(--color-main) 0%,
    var(--color-main-light) 50%,
    var(--color-accent) 100%
  );
  padding: var(--space-xl) var(--space-sm);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 169, 110, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(107, 76, 138, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.hero-profile-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--color-gold);
  margin: 0 auto var(--space-md);
  object-fit: cover;
  background: var(--color-main-light);
}

.hero-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--color-gold);
  margin-bottom: 0.3rem;
  letter-spacing: 0.1em;
}

.hero-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.hero-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 2;
}

/* --- Section --- */
.section {
  padding: var(--space-xl) 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-main);
  text-align: center;
  margin-bottom: var(--space-lg);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background: var(--color-gold);
  margin: 0.8rem auto 0;
}

/* --- Card --- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.card {
  background: var(--color-card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(45, 32, 64, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(45, 32, 64, 0.1);
}

.card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-border);
}

.card-body {
  padding: var(--space-sm) var(--space-md);
}

.card-category {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--color-accent);
  background: rgba(107, 76, 138, 0.08);
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-main);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.card-excerpt {
  font-size: 0.85rem;
  color: var(--color-subtext);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date {
  font-size: 0.75rem;
  color: var(--color-subtext);
  margin-top: 0.5rem;
}

/* --- Category Navigation --- */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.category-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--color-main);
  background: var(--color-card-bg);
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.category-nav a:hover,
.category-nav a.is-active {
  background: var(--color-main);
  color: var(--color-gold);
  border-color: var(--color-main);
}

/* --- Profile Card (Sidebar / About) --- */
.profile-card {
  background: var(--color-card-bg);
  border-radius: 8px;
  padding: var(--space-md);
  text-align: center;
  box-shadow: 0 2px 8px rgba(45, 32, 64, 0.06);
}

.profile-card .profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  margin: 0 auto var(--space-sm);
  object-fit: cover;
  background: var(--color-border);
}

.profile-card .profile-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--color-main);
  margin-bottom: 0.3rem;
}

.profile-card .profile-bio {
  font-size: 0.85rem;
  color: var(--color-subtext);
  line-height: 1.8;
}

.profile-card .profile-link {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-gold);
  border-bottom: 1px solid var(--color-gold);
}

/* --- Sidebar --- */
.sidebar-section {
  margin-bottom: var(--space-lg);
}

.sidebar-section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-main);
  margin-bottom: var(--space-sm);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-gold);
}

.sidebar-list li {
  margin-bottom: 0.6rem;
}

.sidebar-list a {
  font-size: 0.85rem;
  color: var(--color-text);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  line-height: 1.6;
}

.sidebar-list a::before {
  content: '\203B';
  color: var(--color-gold);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.sidebar-list a:hover {
  color: var(--color-accent);
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-main) 0%, var(--color-accent) 100%);
  border-radius: 8px;
  padding: var(--space-md);
  text-align: center;
}

.cta-banner p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  margin-bottom: var(--space-sm);
}

.cta-btn {
  display: inline-block;
  background: var(--color-gold);
  color: var(--color-main);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 2rem;
  border-radius: 30px;
  text-decoration: none;
  transition: all var(--transition);
  letter-spacing: 0.05em;
}

.cta-btn:hover {
  background: var(--color-gold-light);
  color: var(--color-main);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.3);
}

/* --- About Page --- */
.about-hero {
  background: linear-gradient(135deg, var(--color-main) 0%, var(--color-accent) 100%);
  padding: var(--space-xl) var(--space-sm);
  text-align: center;
}

.about-hero .hero-profile-img {
  width: 140px;
  height: 140px;
}

.about-section {
  margin-bottom: var(--space-xl);
}

.about-section .lead-text {
  font-size: 1.05rem;
  line-height: 2.1;
  color: var(--color-text);
}

.about-section .story-text {
  font-size: 0.95rem;
  line-height: 2.1;
  color: var(--color-text);
}

.about-section .story-text .emphasis {
  color: var(--color-accent);
  font-weight: 500;
}

.about-section .story-text .whisper {
  color: var(--color-subtext);
  font-size: 0.9rem;
}

.about-quote {
  background: rgba(107, 76, 138, 0.05);
  border-left: 3px solid var(--color-gold);
  padding: var(--space-md) var(--space-md);
  margin: var(--space-lg) 0;
  border-radius: 0 6px 6px 0;
}

.about-quote p {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--color-main);
  line-height: 1.9;
  margin-bottom: 0;
}

/* --- Article (記事ページテンプレート用) --- */
.article-header {
  margin-bottom: var(--space-lg);
}

.article-header .article-category {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--color-accent);
  background: rgba(107, 76, 138, 0.08);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  margin-bottom: var(--space-xs);
}

.article-header .article-date {
  font-size: 0.8rem;
  color: var(--color-subtext);
  margin-top: var(--space-xs);
}

.article-eyecatch {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: var(--space-lg);
  background: var(--color-border);
}

.article-body p {
  font-size: 0.95rem;
  line-height: 2.1;
  margin-bottom: 1.4rem;
}

.article-body .voice-box {
  background: rgba(201, 169, 110, 0.06);
  border-left: 3px solid var(--color-gold);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) 0;
  border-radius: 0 6px 6px 0;
  font-size: 0.93rem;
  line-height: 2;
}

/* 関連記事 */
.related-articles {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-main);
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-lg) var(--space-sm);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: var(--space-md);
}

.footer-nav a {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-nav a:hover {
  color: var(--color-gold);
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-gold { color: var(--color-gold); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Responsive --- */

/* タブレット */
@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 2rem;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .hero {
    padding: var(--space-xl) var(--space-md);
  }
}

/* PC */
@media (min-width: 960px) {
  .hamburger {
    display: none;
  }

  .nav-desktop {
    display: block;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 5rem var(--space-lg);
  }

  .hero-profile-img {
    width: 140px;
    height: 140px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .about-hero .hero-profile-img {
    width: 160px;
    height: 160px;
  }
}

/* 大画面 */
@media (min-width: 1200px) {
  .container {
    padding: 0;
  }
}
