/* ============================================================
   同級生 (Dōkyūsei) — Classmate Vintage Romance Theme
   Palette: School-desk browns, blackboard greens, chalk-dust gold
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;

  /* School-desk browns & blackboard greens */
  --bg: #faf6ed;
  --bg-card: #fffdf7;
  --bg-dark: #2c1810;
  --bg-header: #1f110a;

  --accent-green: #5a8a4a;
  --accent-green-dark: #3d6b30;
  --accent-brown: #8b6914;
  --accent-gold: #c4953a;
  --accent-tan: #d4c5a0;

  --text: #3a2a1a;
  --text-soft: #6b5a4a;
  --text-muted: #9a8a7a;
  --text-light: #f5e6c8;

  --border: #d4c5a0;
  --border-light: #e8dcc8;

  --shadow: 0 2px 8px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 4px 20px rgba(44, 24, 16, 0.12);

  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  min-height: 100vh;
  position: relative;
}

/* Chalk-dust background motif */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(circle at 10% 20%, rgba(139,105,20,0.03) 0%, transparent 50%),
    radial-gradient(circle at 85% 60%, rgba(90,138,74,0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(196,149,58,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

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

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

/* ---------- Screen Reader Only ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  border-bottom: 3px solid var(--accent-gold);
  padding: 0;
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-light);
  text-decoration: none;
}
.site-logo:hover { color: var(--accent-gold); }

.site-logo img {
  width: 24px;
  height: 24px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  color: var(--accent-tan);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.header-nav a:hover,
.header-nav a.active {
  color: var(--accent-gold);
}

.header-cta {
  display: inline-block;
  background: var(--accent-gold);
  color: var(--bg-dark) !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
}
.header-cta:hover {
  background: #dca844;
  transform: translateY(-1px);
  color: var(--bg-dark) !important;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #3a2a1a 0%, #5a3a2a 40%, #3a5030 100%);
  padding: 60px 24px 80px;
  text-align: center;
  color: var(--text-light);
  overflow: hidden;
}

/* Chalk-dust effect on hero */
.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(245,230,200,0.04) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(212,184,150,0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(180,160,130,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: 4px;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--accent-tan);
  max-width: 600px;
  margin: 0 auto 8px;
}

/* Sub-page hero — compact variant */
.hero-subpage {
  padding: 40px 24px 48px;
}
.hero-subpage-title {
  font-size: 2rem;
  font-weight: 700;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.content-section h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-brown);
  margin-bottom: 12px;
  margin-top: 28px;
}

.content-section p {
  margin-bottom: 16px;
  color: var(--text-soft);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  margin-top: -8px;
}

/* ---------- Chapter Title (story.html) ---------- */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-green);
  margin-bottom: 8px;
  margin-top: 28px;
}
.chapter-title:first-of-type { margin-top: 8px; }

/* ---------- Section Subheading (characters.html) ---------- */
.section-subheading {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-brown);
  margin: 40px 0 24px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-green);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-brown);
  margin-bottom: 8px;
  margin-top: 0;
}

.card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Feature cards — smaller icon cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.feature-card {
  text-align: center;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent-gold);
}

.feature-card .card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.feature-card h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Character cards */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.character-card:hover {
  transform: translateY(-3px);
}

.character-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.character-info {
  padding: 16px 20px;
}

.character-info h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  margin-top: 0;
}

.character-info .char-role {
  font-size: 0.85rem;
  color: var(--accent-green);
  margin-bottom: 8px;
}

.character-info p {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 0;
}

/* ============================================================
   SCREENSHOT GALLERY (index.html)
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(28,16,8,0.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: var(--text-light);
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1;
}
.lightbox-close:hover { color: var(--accent-gold); }

/* ============================================================
   CTA BANNER (index.html only)
   ============================================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--accent-brown), var(--accent-gold));
  text-align: center;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  color: var(--bg-dark);
  margin-bottom: 12px;
}

.cta-banner p {
  color: #5a3820;
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.cta-button {
  display: inline-block;
  background: var(--bg-dark);
  color: var(--accent-gold) !important;
  padding: 14px 40px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.15s;
}
.cta-button:hover {
  background: #3a2212;
  transform: translateY(-2px);
  color: var(--accent-gold) !important;
}

/* ============================================================
   REVIEWS / QUOTES (index.html)
   ============================================================ */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  position: relative;
}

.review-card::before {
  content: "\201C";
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--accent-gold);
  position: absolute;
  top: 8px;
  left: 14px;
  line-height: 1;
}

.review-card p {
  font-style: italic;
  color: var(--text-soft);
  margin-bottom: 12px;
  padding-left: 8px;
}

.review-card .reviewer {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   ACCORDION (faq.html)
   ============================================================ */
.accordion {
  margin-top: 24px;
}

.accordion-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--bg-card);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  transition: background 0.2s;
}
.accordion-header:hover {
  background: rgba(139,105,20,0.05);
}

.accordion-header .arrow {
  font-size: 1.2rem;
  color: var(--accent-gold);
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 12px;
}
.accordion-item.open .accordion-header .arrow {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-item.open .accordion-body {
  max-height: 600px;
}

.accordion-body-inner {
  padding: 0 20px 20px;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

table th {
  background: var(--bg-header);
  color: var(--text-light);
  font-weight: 600;
}

table tr:hover td {
  background: rgba(139,105,20,0.03);
}

.td-highlight {
  color: var(--accent-green);
  font-weight: 700;
}

/* System requirements headings */
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-brown);
  margin-top: 24px;
  margin-bottom: 12px;
}
.sys-reqs-h3:first-of-type {
  margin-top: 8px;
}

/* Spacing utility */
.section-heading-mt {
  margin-top: 48px;
}

/* ============================================================
   CONTENT LISTS (avoid inline styles)
   ============================================================ */
.content-list {
  list-style: disc;
  padding-left: 20px;
}

.content-list-num {
  list-style: decimal;
  padding-left: 24px;
}

.content-li {
  margin-bottom: 5px;
  color: var(--text-soft);
}

.content-li-sm {
  margin-bottom: 4px;
  color: var(--text-soft);
}

.content-li-md {
  margin-bottom: 8px;
  color: var(--text-soft);
}

.content-li-lg {
  margin-bottom: 10px;
  color: var(--text-soft);
}

/* ============================================================
   COLORED STRONG TAGS
   ============================================================ */
.strong-pink { color: #c94a6a; }
.strong-red { color: #c94a3a; }
.strong-gold { color: var(--accent-gold); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: #3a5a6a; }
.strong-green { color: var(--accent-green); }

/* ============================================================
   GUIDE PAGE CLASSES
   ============================================================ */
.guide-intro {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.route-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.route-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-green-dark);
  margin-top: 24px;
  margin-bottom: 8px;
}

/* ============================================================
   TIP BOXES (guide.html)
   ============================================================ */
.tip-box {
  background: rgba(90,138,74,0.08);
  border-left: 4px solid var(--accent-green);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}

.tip-box strong {
  color: var(--accent-green-dark);
}

/* ============================================================
   STORY PAGE CLASSES
   ============================================================ */
.story-block {
  margin-bottom: 36px;
}

.story-block h3 {
  color: var(--accent-brown);
}

/* ============================================================
   FOOTER — copyright only, NO MENU, NO CTA
   ============================================================ */
.site-footer {
  background: var(--bg-header);
  color: var(--text-muted);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}
.site-footer p {
  margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .hero-subpage-title { font-size: 1.6rem; }
  .hero { padding: 40px 20px 56px; }

  .header-inner { flex-wrap: wrap; gap: 10px; }
  .header-nav { gap: 14px; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .character-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: 1fr; }

  .content-section { padding: 32px 20px; }
  .content-section h2 { font-size: 1.6rem; }
  .cta-banner h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; letter-spacing: 2px; }
  .hero-subpage-title { font-size: 1.3rem; }
  .hero { padding: 32px 16px 44px; }
  .hero-subpage { padding: 28px 16px 36px; }

  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-nav { flex-wrap: wrap; gap: 10px; }

  .gallery-grid { grid-template-columns: 1fr; }
  .character-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }

  .header-cta { padding: 6px 14px; font-size: 0.85rem; }
  .cta-button { padding: 12px 28px; font-size: 1rem; }
}
