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

:root {
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface-alt: #efede6;
  --ink: #141414;
  --muted: #6b6a65;
  --border: #e2e0d7;
  --cobalt: #1e22d4;
  --cobalt-hover: #171ab3;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.theme-sepia {
  --bg: #f3ecde;
  --surface: #fbf7ee;
  --surface-alt: #e7decb;
  --ink: #2a2118;
  --muted: #6c5e4e;
  --border: #d9ceb9;
}

body.theme-dark {
  --bg: #111216;
  --surface: #191b22;
  --surface-alt: #232630;
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --border: #2c2f3b;
  --cobalt: #4b50f7;
  --cobalt-hover: #3b40e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.brand-quote {
  width: 30px;
  height: 24px;
  color: var(--cobalt);
  display: block;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-wordmark strong {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-wordmark span {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 100%;
}

.nav-link {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 2px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover { color: var(--ink); }
.nav-link.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--cobalt);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 155px;
  padding: 7px 10px 7px 30px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.88rem;
  outline: none;
  transition: width 0.2s, background 0.15s, border-color 0.15s;
}

.search-box input:focus {
  width: 220px;
  background: var(--surface);
  border-color: var(--border);
}

.search-box .search-ico {
  position: absolute;
  left: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  pointer-events: none;
}

.lang-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cobalt {
  background: var(--cobalt);
  color: #fff;
}
.btn-cobalt:hover { background: var(--cobalt-hover); }

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

/* Editorial Hero */
.hero-editorial {
  padding: 34px 0 28px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.hero-editorial h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin: 0;
}

.hero-sub-wrap {
  border-left: 1px solid var(--border);
  padding-left: 24px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

/* Featured Editorial Cards (2-col asymmetric) */
.featured-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  margin-bottom: 42px;
}

.feat-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: #141414;
}

.feat-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.35s ease;
}

.feat-card:hover img { transform: scale(1.03); }

.feat-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 28px 26px 22px;
  background: linear-gradient(180deg, rgba(10, 10, 14, 0) 0%, rgba(10, 10, 14, 0.72) 48%, rgba(10, 10, 14, 0.92) 100%);
}

.feat-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.88;
  margin-bottom: 6px;
  display: block;
}

.feat-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 10px;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--cobalt);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 3px;
}

.feat-desc {
  margin: 10px 0 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  opacity: 0.92;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 520px;
}

.feat-meta {
  font-size: 0.78rem;
  opacity: 0.78;
}

/* Section Controls */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-bar h2 {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cobalt);
  cursor: pointer;
}

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--ink);
  cursor: pointer;
}

/* 5-Column Poster Grid */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px 18px;
}

.poster-card {
  display: flex;
  flex-direction: column;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 3px;
  overflow: hidden;
  background: #1f2430;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.poster-card:hover .poster-wrap img { transform: scale(1.04); }

.poster-fallback {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

.poster-wrap .rating-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  font-size: 0.78rem;
  padding: 3px 7px;
}

.poster-title {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.28;
  margin-bottom: 3px;
}

.poster-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 34px 0 48px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 32px;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a:hover, .footer-links button:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
}

.footer-langs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-langs a.active {
  color: var(--cobalt);
  font-weight: 700;
  text-decoration: underline;
}

.footer-themes {
  display: flex;
  gap: 6px;
  align-items: center;
}

.theme-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--muted);
  cursor: pointer;
}

.theme-btn.active {
  color: var(--cobalt);
  font-weight: 600;
}

/* Detail Page */
.detail-wrap {
  padding: 28px 0 60px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 30px;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: #1f2430;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  margin: 6px 0 8px;
}

.reactions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.react-btn:hover {
  border-color: var(--cobalt);
  transform: translateY(-1px);
}

.react-btn.active {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}

.react-count {
  font-weight: 700;
  font-size: 0.8rem;
  opacity: 0.85;
}

.mode-tabs {
  display: inline-flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  margin-bottom: 24px;
}

.mode-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.mode-tab.active {
  color: var(--cobalt);
  border-bottom-color: var(--cobalt);
}

.editorial-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 26px 28px;
  margin-bottom: 22px;
}

.editorial-panel h2, .editorial-panel h3 {
  font-family: var(--serif);
  margin: 0 0 14px;
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.pc-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
}

.pc-box h4 { margin: 0 0 8px; font-size: 0.9rem; }
.pc-box ul { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.pc-box li { margin-bottom: 5px; }

.episode-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.episode-row:first-of-type { border-top: none; padding-top: 0; }

.spoiler-banner {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.review-card {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.review-card:first-of-type { border-top: none; padding-top: 0; }
.spoiler-hidden { filter: blur(6px); user-select: none; }

/* Forms & Modals */
.form-grid { display: grid; gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 140px; gap: 12px; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--muted);
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
}
.field textarea { min-height: 92px; resize: vertical; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 22, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 60;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.close-x {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero-editorial { grid-template-columns: 1fr; gap: 14px; }
  .hero-sub-wrap { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
  .featured-grid { grid-template-columns: 1fr; }
  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-poster { max-width: 220px; }
  .pros-cons, .form-row-2 { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}

@media (max-width: 540px) {
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
