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

:root {
  --navy: #1a1a2e;
  --navy-light: #16213e;
  --gold: #e0d4b8;
  --gold-dark: #c4b48a;
  --white: #fff;
  --bg: #fafafa;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #e5e5e5;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: 'Playfair Display', 'Noto Serif KR', Georgia, serif;
  font-weight: 700;
  line-height: 1.3;
}

:lang(ko) h1, :lang(ko) h2, :lang(ko) h3 {
  font-family: 'Noto Serif KR', 'Playfair Display', Georgia, serif;
}

/* ===== Header ===== */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.site-logo {
  font-family: 'Playfair Display', 'Noto Serif KR', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.site-logo span {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  margin-top: -2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 8px 14px;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  border-radius: 6px;
  transition: all var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 3px;
}

.dropdown-arrow {
  font-size: 10px;
  opacity: 0.6;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
  padding: 6px 0;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.lang-toggle {
  margin-left: 12px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--gold);
  border: 1px solid rgba(224,212,184,0.3);
  border-radius: 4px;
  transition: all var(--transition);
}

.lang-toggle:hover {
  background: rgba(224,212,184,0.1);
  border-color: var(--gold);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 40px 24px;
  margin-top: 80px;
  text-align: center;
  font-size: 14px;
}

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

.site-footer .copyright {
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Hero (Home) ===== */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: 80px 24px;
  text-align: center;
}

.hero h1 {
  font-size: 40px;
  margin-bottom: 16px;
  color: var(--gold);
}

.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto;
  white-space: pre-line;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 40px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--navy);
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Section ===== */
.section {
  padding: 60px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 8px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-light);
}

/* ===== Page Header ===== */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 48px 24px;
  text-align: center;
}

.page-header h1 {
  font-size: 32px;
  color: var(--gold);
  margin-bottom: 8px;
}

.page-header p {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.card a { display: block; }

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

.card-body {
  padding: 12px 14px;
}

.card-id {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.card-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-maker {
  font-size: 13px;
  color: var(--text-light);
}

.card-year {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Collection Page ===== */
.collection-toolbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.category-tab {
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
  white-space: nowrap;
}

.category-tab:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.category-tab.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.category-tab .count {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
}

.search-box {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  width: 260px;
  outline: none;
  transition: border-color var(--transition);
}

.search-box:focus {
  border-color: var(--navy);
}

.collection-count {
  font-size: 14px;
  color: var(--text-muted);
  padding: 0 0 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 16px;
}

/* ===== Item Detail Page ===== */
.item-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}

.item-back {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color var(--transition);
}

.item-back:hover {
  color: var(--navy);
}

.item-title {
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 4px;
}

.item-id {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.item-photos {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.item-photos img {
  max-width: 400px;
  width: 100%;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity var(--transition);
}

.item-photos img:hover {
  opacity: 0.85;
}

.item-info-table {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  font-size: 15px;
  margin-bottom: 24px;
}

.item-info-label {
  color: var(--text-muted);
  font-weight: 600;
}

.item-note {
  padding: 20px;
  background: #f9f7f2;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.8;
  color: #555;
}

/* ===== Highlights Page ===== */
.highlight-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  display: flex;
  gap: 0;
}

.highlight-card .card-img-side {
  width: 360px;
  min-height: 280px;
  object-fit: cover;
  flex-shrink: 0;
}

.highlight-card .highlight-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.highlight-section {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.highlight-card h3 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 4px;
}

.highlight-card .highlight-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.highlight-card .highlight-story {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-light);
}

.highlight-card .highlight-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--navy);
  font-weight: 600;
  transition: color var(--transition);
}

.highlight-card .highlight-link:hover {
  color: var(--gold-dark);
}

/* ===== About Page ===== */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

.about-content h2 {
  font-size: 24px;
  color: var(--navy);
  margin: 40px 0 16px;
}

.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* ===== Timeline Page ===== */
.timeline-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

.timeline-chart {
  text-align: center;
  margin-bottom: 48px;
}

.timeline-chart img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.era-block {
  margin-bottom: 40px;
  padding-left: 32px;
  border-left: 3px solid var(--gold);
}

.era-period {
  font-size: 14px;
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.era-block h3 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 8px;
}

.era-block p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-light);
}

.era-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.era-stat {
  font-size: 13px;
  padding: 4px 12px;
  background: #f5f3ee;
  border-radius: 12px;
  color: var(--text-light);
}

.era-stat strong {
  color: var(--navy);
}

/* ===== Stories Page ===== */
.stories-intro {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-light);
  margin-bottom: 48px;
  text-align: center;
  font-style: italic;
}

.story-card {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.story-card:last-child {
  border-bottom: none;
}

.story-header {
  margin-bottom: 20px;
}

.story-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.story-country,
.story-years {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f5f3ee;
  color: var(--text-muted);
  font-weight: 600;
}

.story-card h2 {
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 6px;
}

.story-tagline {
  font-size: 15px;
  color: var(--gold-dark);
  font-weight: 600;
  font-style: italic;
}

.story-body p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-light);
  margin-bottom: 12px;
}

.story-collection {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f9f7f2;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-light);
}

.story-collection strong {
  color: var(--navy);
}

/* Stories index grid */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.story-link-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.story-link-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.story-link-body {
  padding: 20px;
}

.story-link-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.story-link-card h2 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 6px;
}

.story-link-tagline {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Individual story page */
.story-page-meta {
  margin-bottom: 16px;
}

.back-link {
  color: var(--text-muted);
  font-size: 14px;
}

.back-link:hover {
  color: var(--text);
}

.story-page-info {
  font-size: 15px;
  color: var(--text-light);
  margin-top: 8px;
}

.story-page-tagline {
  font-size: 16px;
  color: var(--gold-dark);
  font-weight: 600;
  font-style: italic;
  margin-top: 12px;
}

.story-page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.story-article p {
  font-size: 16px;
  line-height: 2;
  color: var(--text);
  margin-bottom: 20px;
}

/* ===== Story Timeline ===== */
.story-timeline {
  margin-top: 48px;
  margin-bottom: 48px;
}

.story-timeline h2 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 28px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gold-dark);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
  padding-left: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-dark);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--gold-dark);
}

.timeline-year {
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
  min-width: 50px;
  display: inline-block;
  margin-right: 8px;
}

.timeline-event {
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.story-gallery {
  margin-top: 48px;
}

.story-gallery h2 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 24px;
}

/* ===== Contact Page ===== */
.contact-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.contact-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-light);
  margin-bottom: 32px;
}

.contact-email {
  display: inline-block;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  padding: 16px 32px;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.contact-email:hover {
  background: var(--navy);
  color: var(--white);
}

.inquiry-types {
  text-align: left;
  margin-top: 40px;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.inquiry-types h3 {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 16px;
}

.inquiry-types li {
  font-size: 14px;
  color: var(--text-light);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}

.inquiry-types li:last-child {
  border-bottom: none;
}

/* ===== CTA Button ===== */
.cta-row {
  text-align: center;
  padding: 32px 0;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

.btn-outline {
  border: 2px solid var(--navy);
  color: var(--navy);
  margin-left: 12px;
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 300;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  background: none;
  border: none;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  padding: 20px;
  user-select: none;
  opacity: 0.7;
  background: none;
  border: none;
}

.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner { height: 56px; }

  .main-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .main-nav.open { display: flex; }

  .main-nav a {
    padding: 12px 16px;
    width: 100%;
  }

  .nav-dropdown { width: 100%; }
  .nav-dropdown > a { width: 100%; }
  .dropdown-menu {
    position: static;
    display: none;
    border: none;
    box-shadow: none;
    padding-left: 16px;
  }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .dropdown-menu a { padding: 8px 16px; }

  .stories-grid { grid-template-columns: 1fr; }

  .lang-toggle { margin-left: 0; width: 100%; text-align: center; }

  .menu-toggle { display: block; }

  .hero { padding: 48px 20px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }

  .stats-bar {
    gap: 24px;
    flex-wrap: wrap;
    padding: 24px;
  }

  .stat-number { font-size: 28px; }

  .page-header { padding: 32px 20px; }
  .page-header h1 { font-size: 24px; }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .collection-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box { width: 100%; }

  .category-tabs { gap: 4px; }
  .category-tab { padding: 5px 10px; font-size: 12px; }

  .item-detail { padding: 24px 16px; }
  .item-title { font-size: 22px; }
  .item-photos img { max-width: 100%; }
  .item-info-table { grid-template-columns: 100px 1fr; font-size: 14px; }

  .highlight-card {
    flex-direction: column;
  }

  .highlight-card .card-img-side {
    width: 100%;
    min-height: 200px;
  }

  .highlight-card .highlight-body {
    padding: 20px;
  }

  .about-content,
  .timeline-content,
  .contact-content {
    padding: 32px 16px;
  }

  .btn-outline { margin-left: 0; margin-top: 8px; }
}
