:root {
  /* Colors - Compassion & Happiness (Washi & Ink) */
  --bg-color: #fcfaf2;
  /* Washi (Japanese Paper) */
  --text-color: #333333;
  /* Ink */
  --accent-color: #b38b4d;
  /* Muted Gold */
  --accent-hover: #8e6b36;
  /* Darker Gold */
  --vermilion: #e65244;
  /* Traditional Vermilion */
  --nav-bg: rgba(252, 250, 242, 0.95);
  --border-color: #e6e2d3;
  /* Soft border matching washi */

  /* Typography */
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Noto Serif JP", "Noto Serif KR", "Noto Serif", serif;

  /* Spacing & Radius */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
  --spacing-xl: 64px;
  --radius-lg: 12px;
  --radius-md: 8px;

  /* Shadows */
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.08);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin-bottom: var(--spacing-md);
  color: var(--text-color);
}

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

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

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

header {
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  list-style: none;
  display: flex;
  gap: var(--spacing-md);
  margin: 0;
  padding: 0;
}

/* Ruby Toggle Button */
.ruby-toggle-btn {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 6px 16px;
  border-radius: 30px;
  /* More rounded */
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-serif);
  /* Elegant font for button */
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.ruby-toggle-btn:hover {
  background-color: var(--accent-color);
  color: white;
}

.ruby-toggle-btn.active {
  background-color: var(--accent-color);
  color: white;
}

/* Ruby Visibility Control */
/* When .hide-ruby is present on body, hide rt elements but keep layout stable */
body.hide-ruby rt {
  visibility: hidden;
  /* Use visibility:hidden instead of display:none to prevent layout shift */
}

/* Ruby styling */
rt {
  color: var(--vermilion);
  /* Distinct color */
  font-size: 0.75em;
  /* Larger size (default is usually 0.5em) */
  font-weight: normal;
}

/* Ensure line-height accommodates ruby text */
p {
  line-height: 2.8;
  /* Increased from default to prevent overlapping/cramping */
}

/* Footer */
footer {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9rem;
  color: #777;
}

/* Utility */
.text-center {
  text-align: center;
}

.card {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: var(--spacing-lg);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  border: none;
  /* Ensure no border */

  /* Animation */
  opacity: 0;
  animation: fadeIn 1.2s ease-out forwards;
}

.card:nth-child(1) {
  animation-delay: 0.1s;
}

.card:nth-child(2) {
  animation-delay: 0.3s;
}

.card:nth-child(3) {
  animation-delay: 0.5s;
}

.card:nth-child(4) {
  animation-delay: 0.7s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }

}

/* News Section */
.news-card {
  background-color: #fffafb;
  /* Very pale pink/white */
  border: 1px solid #fce4ec;
  /* Soft pink border */
  border-radius: 16px;
  /* More rounded */
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 4px 20px rgba(233, 30, 99, 0.05);
  /* Subtle pinkish shadow */
}

.news-date {
  font-size: 0.85rem;
  color: #c2185b;
  /* Dark pink */
  margin-bottom: 2px;
}

.news-item {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #f8bbd0;
}

.news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-link {
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s;
}

.news-link:hover {
  color: #c2185b;
}



/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(255, 250, 250, 0.95);
  /* Light pinkish white overlay */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  animation: zoomIn 0.3s;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #880e4f;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.lightbox-close:hover {
  color: #c2185b;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* General Course Hero */
.general-course-hero {
  background-image: url('../images/general-course/hero_bg.png');
  background-size: cover;
  background-position: center;
  /* Negative margins to pull image to card edges */
  margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1) var(--spacing-lg) calc(var(--spacing-lg) * -1);
  padding: var(--spacing-xl) var(--spacing-md);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.general-course-hero img {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
  margin-bottom: var(--spacing-md);
}

.general-course-hero h2 {
  margin: 0;
  font-weight: 700;
  color: #5d4037;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Article Hub Hero */
.article-hero {
  background-image: url('../images/article_hero.png');
  background-size: cover;
  background-position: center;
  /* Negative margins to pull image to card edges */
  margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1) var(--spacing-lg) calc(var(--spacing-lg) * -1);
  padding: var(--spacing-xl) var(--spacing-md);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  color: #fff;
  /* Light text for dark/rich background */
}

.article-hero h1 {
  margin: 0;
  font-weight: 700;
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--spacing-sm);
}

.article-hero p {
  font-size: 1.1rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}