﻿/* ============================
   Stardew Valley Guide v2
   Unified Stylesheet
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --green-dark: #2d5a27;
  --green-primary: #4a8c3f;
  --green-light: #6db35a;
  --green-bg: #f0f7ec;
  --gold: #e8b84b;
  --gold-light: #f5d97a;
  --wood: #8b6f47;
  --wood-light: #c4a87a;
  --cream: #fdf8f0;
  --card-bg: #ffffff;
  --text-dark: #2c2c2c;
  --text-muted: #6b6b6b;
  --text-light: #f5f0e8;
  --border: #e0d8cc;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max-width: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: white;
  text-decoration: none;
}

.logo img {
  height: 36px;
  width: 36px;
  filter: brightness(0) invert(1);
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.lang-switch {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.3);
}

.lang-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: rgba(255,255,255,0.7);
  color: white;
}

.lang-btn.active {
  background: white;
  color: var(--green-dark);
  border-color: white;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 4px;
}

/* ===== Mobile Nav ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--green-dark);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; width: 100%; }
  .lang-switch { border-left: none; padding-left: 0; margin-left: 0; margin-top: 8px; }
  .mobile-toggle { display: block; }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  height: 420px;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.7));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 60px;
}

.hero-overlay h1 {
  color: white;
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-overlay p {
  color: rgba(255,255,255,0.9);
  font-size: 18px;
  max-width: 600px;
}

/* ===== Main Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--green-light);
}

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

.card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-body {
  padding: 20px;
}

.card-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 8px;
}

.card-body p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.card-body .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  background: var(--green-bg);
  color: var(--green-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

/* ===== Feature List ===== */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.feature-item img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.feature-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== Content Section (for subpages) ===== */
.content-section {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.content-section h2 {
  font-size: 24px;
  color: var(--green-dark);
  margin-bottom: 16px;
}

.content-section h3 {
  font-size: 18px;
  color: var(--wood);
  margin: 20px 0 10px;
}

.content-section p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.content-section ul, .content-section ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.content-section li {
  margin-bottom: 6px;
  line-height: 1.6;
}

/* ===== Data Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.data-table thead {
  background: var(--green-dark);
  color: white;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:nth-child(even) {
  background: #fafaf5;
}

.data-table tr:hover {
  background: var(--green-bg);
}

/* ===== Lang: hide by default, show via JS ===== */
[data-lang="zh"] { display: none; }
.lang-zh [data-lang="en"] { display: none; }
.lang-zh [data-lang="zh"] { display: inline; }
.lang-zh [data-lang="zh"][style*="block"] { display: block !important; }

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(135deg, var(--green-dark), #1a3a15);
  color: rgba(255,255,255,0.8);
  padding: 32px 20px;
  text-align: center;
  margin-top: auto;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--gold);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  font-size: 13px;
  max-width: 700px;
  margin: 0 auto 12px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer-copyright {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

/* ===== Language-specific span helpers ===== */
span[data-lang] { display: inline; }

/* ===== Utility ===== */
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.btn {
  display: inline-block;
  background: var(--green-primary);
  color: white;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}
.btn:hover { background: var(--green-dark); }
