:root {
  color-scheme: light;
  --navy: #0b356d;
  --blue: #1767d6;
  --cyan: #2fb5dc;
  --sage: #4d6f5c;
  --ink: #1d2a35;
  --muted: #68747d;
  --line: #dce4e9;
  --paper: #ffffff;
  --wash: #f3f7fb;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #edf5fb 0, #f8fafb 300px, #f5f4ef 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", "Noto Sans Thai", "Segoe UI", sans-serif;
  line-height: 1.72;
}

button, a { font: inherit; }

.overview-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.overview-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(16, 53, 88, .1);
  position: sticky;
  top: 10px;
  z-index: 10;
}

.overview-header img { width: 58px; height: 58px; object-fit: cover; border-radius: 13px; }
.overview-header p { margin: 0; color: var(--sage); font-size: 13px; font-weight: 800; }
.overview-header h1 { margin: 1px 0 0; color: var(--navy); font-size: clamp(20px, 3vw, 30px); line-height: 1.25; }

.back-link,
#languageButton {
  display: grid;
  min-width: 44px;
  height: 44px;
  place-items: center;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, color 150ms ease;
}

#languageButton { padding: 0 14px; }

.back-link:hover,
.back-link:focus-visible,
#languageButton:hover,
#languageButton:focus-visible {
  color: var(--blue);
  border-color: rgba(23, 103, 214, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(16, 53, 88, 0.14);
  outline: none;
}

.overview-intro {
  padding: 54px 32px 32px;
  text-align: center;
}

.overview-intro h2 { margin: 0 0 10px; color: var(--navy); font-size: clamp(26px, 5vw, 42px); line-height: 1.25; }
.overview-intro p { max-width: 780px; margin: 0 auto; color: var(--muted); }

.selector-section,
.intro-reader {
  margin-top: 24px;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(22, 43, 63, .07);
}

.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.section-heading > span {
  display: grid;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 15px;
  font-size: 21px;
  font-weight: 900;
}
.section-heading h2 { margin: 0; color: var(--navy); font-size: 23px; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.overview-button-grid { display: grid; gap: 9px; }
.section-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.book-grid { grid-template-columns: repeat(11, minmax(0, 1fr)); }

.overview-select-button {
  min-height: 50px;
  padding: 9px 7px;
  color: #29495e;
  background: #f8fbfd;
  border: 1px solid #d7e3ea;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  transition: 150ms ease;
}

.overview-select-button:hover,
.overview-select-button:focus-visible,
.overview-select-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-color: transparent;
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(23, 103, 214, .2);
}

.testament-label {
  margin: 20px 0 9px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
}

.intro-reader { scroll-margin-top: 100px; }
.reader-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 2px solid #e4edf3; }
.reader-heading > div:first-child { min-width: 0; }
.reader-heading p { margin: 0 0 3px; color: var(--blue); font-size: 13px; font-weight: 900; }
.reader-heading h2 { margin: 0; color: var(--navy); font-size: clamp(25px, 4vw, 36px); }
.overview-share-panel { display: grid; justify-items: end; margin-top: 18px; }
.overview-share-buttons { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; }
.overview-share-buttons button {
  display: grid;
  min-height: 40px;
  place-items: center;
  padding: 7px 12px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.overview-share-buttons button:first-child { min-width: 82px; padding-inline: 11px; }
.overview-share-buttons .share-icon-button { width: 68px; padding: 3px 7px; }
.overview-share-buttons svg { display: block; width: 100%; height: 32px; margin: auto; }
#shareStatus { margin: 5px 0 0; color: var(--sage); font-size: 12px; text-align: right; }
.intro-body { max-width: 850px; margin: 0 auto; padding: 18px 0 4px; }
.intro-section { padding: 13px 0; }
.intro-section + .intro-section { border-top: 1px solid #edf1f3; }
.intro-section h3 { margin: 0 0 7px; color: var(--navy); font-size: 18px; }
.intro-section p { margin: 0; font-size: 16px; white-space: pre-line; }
.intro-section.is-special { margin: 14px 0; padding: 18px; background: #f0f6fb; border: 1px solid #cfe0ee; border-radius: 14px; }

.top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(11, 53, 109, .25);
  cursor: pointer;
}

@media (max-width: 850px) {
  .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .overview-shell { width: min(100% - 18px, 1180px); padding-top: 9px; }
  .overview-header { top: 5px; gap: 8px; padding: 10px; border-radius: 15px; }
  .overview-header img { width: 42px; height: 42px; border-radius: 11px; }
  .overview-header p { display: none; }
  .overview-header h1 { font-size: 17px; }
  .back-link, #languageButton { min-width: 38px; height: 38px; border-radius: 11px; }
  #languageButton { padding: 0 9px; font-size: 13px; }
  .overview-intro { padding: 34px 14px 18px; }
  .overview-intro h2 { font-size: 27px; }
  .overview-intro p { font-size: 14px; text-align: left; }
  .selector-section, .intro-reader { margin-top: 14px; padding: 18px 14px; border-radius: 16px; }
  .section-heading { align-items: flex-start; }
  .section-heading > span { flex-basis: 42px; width: 42px; height: 42px; font-size: 18px; }
  .section-heading h2 { font-size: 19px; }
  .section-heading p { font-size: 13px; line-height: 1.5; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .overview-select-button { min-height: 46px; font-size: 13px; }
  .intro-section p { font-size: 15px; line-height: 1.85; }
  .reader-heading { align-items: flex-start; flex-direction: column; }
  .overview-share-panel { width: 100%; }
  .overview-share-buttons { width: auto; max-width: 100%; }
  #shareStatus { text-align: right; }
}
