/* ===========================================================
   양평 조례웹툰 — 공통 스타일
   =========================================================== */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css");

:root {
  --brand: #00b76b;
  --brand-dark: #009a59;
  --brand-soft: #e8f8f0;
  --accent: #2f8ec4;

  --bg: #ffffff;
  --bg-sub: #f6f7f8;
  --surface: #ffffff;
  --line: #e9ebee;
  --line-strong: #d8dce0;

  --text: #16181a;
  --text-sub: #6b7178;
  --text-dim: #9aa0a6;

  --star: #ffb400;
  --danger: #e2574c;

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow: 0 2px 10px rgba(16, 20, 24, 0.06);
  --shadow-lg: 0 10px 30px rgba(16, 20, 24, 0.12);

  --header-h: 58px;
  --max: 1120px;
  --toon-w: 690px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315;
    --bg-sub: #17191c;
    --surface: #1b1e21;
    --line: #2a2e33;
    --line-strong: #3a3f45;
    --text: #eceef0;
    --text-sub: #a3abb3;
    --text-dim: #7d858d;
    --brand-soft: #0e2c20;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #111315;
  --bg-sub: #17191c;
  --surface: #1b1e21;
  --line: #2a2e33;
  --line-strong: #3a3f45;
  --text: #eceef0;
  --text-sub: #a3abb3;
  --text-dim: #7d858d;
  --brand-soft: #0e2c20;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 헤더 ---------- */
.gnb {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.gnb__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.logo__mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.logo__sub {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
}

/* 평안이 캐릭터 소개 링크 */
.charlink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.charlink:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.charlink img {
  display: block;
  width: 20px;
  height: 20px;
}

.gnb__nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.gnb__nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
}

.gnb__nav a:hover {
  background: var(--bg-sub);
  color: var(--text);
}

.gnb__nav a[aria-current="page"] {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--bg-sub);
  color: var(--text);
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-dark);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-sub);
}

.btn--ghost:hover {
  background: var(--bg-sub);
  color: var(--text);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- 히어로 ---------- */
.hero {
  padding: 26px 0 8px;
}

.hero__card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--bg-sub);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
  min-height: 320px;
}

.hero__body {
  padding: 38px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
}

.hero__title {
  margin: 0;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero__desc {
  margin: 0;
  color: var(--text-sub);
  font-size: 15px;
}

.hero__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.hero__visual {
  position: relative;
}

.hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

/* ---------- 섹션 ---------- */
.section {
  padding: 34px 0;
}

/* 상단 "연재" 메뉴로 건너뛸 때 고정 헤더에 제목이 가리지 않게 */
.section[id] {
  scroll-margin-top: var(--header-h);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.section__title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section__desc {
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- 작품 카드 그리드 ---------- */
.toon-grid {
  display: grid;
  gap: 20px 16px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.toon-card {
  display: block;
}

.toon-card__thumb {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-sub);
  box-shadow: var(--shadow);
}

.toon-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.toon-card:hover .toon-card__thumb img {
  transform: scale(1.045);
}

.toon-card__badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 7px;
}

.toon-card__title {
  margin: 10px 2px 2px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.toon-card__meta {
  margin: 0 2px;
  color: var(--text-dim);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toon-card--empty .toon-card__thumb {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  box-shadow: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 14px;
}

/* ---------- 작품 상세 ---------- */
.detail {
  padding: 28px 0 10px;
}

.detail__grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

.detail__poster {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 2 / 3;
}

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

.detail__title {
  margin: 6px 0 4px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.detail__ordinance {
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
}

.detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-sub);
  color: var(--text-sub);
}

.chip--brand {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.detail__summary {
  color: var(--text-sub);
  margin: 0 0 16px;
  font-size: 14.5px;
}

.detail__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.score-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.score-box__num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.score-box__num small {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.score-box__label {
  color: var(--text-dim);
  font-size: 12.5px;
}

/* ---------- 조례 개요 ---------- */
.ord-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.ord-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ord-card__head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ord-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.ord-list > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: start;
}

.ord-list dt {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-dark);
  padding-top: 1px;
}

.ord-list dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
}

.ord-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---------- 회차 목록 ---------- */
.ep-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--text);
}

.ep-item {
  border-bottom: 1px solid var(--line);
}

.ep-item a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 8px;
  transition: background 0.15s ease;
}

.ep-item a:hover {
  background: var(--bg-sub);
}

.ep-item__thumb {
  width: 94px;
  height: 60px;
  flex: none;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--bg-sub);
}

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

.ep-item__body {
  flex: 1 1 auto;
  min-width: 0;
}

.ep-item__no {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-dark);
}

.ep-item__title {
  margin: 1px 0 2px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ep-item__sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ep-item__right {
  flex: none;
  text-align: right;
  display: grid;
  gap: 3px;
}

.ep-item__score {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--star);
  white-space: nowrap;
}

.ep-item__date {
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- 별점 ---------- */
.stars {
  display: inline-flex;
  gap: 2px;
  line-height: 1;
}

.stars svg {
  width: 18px;
  height: 18px;
}

.stars--lg svg {
  width: 34px;
  height: 34px;
}

.star-empty {
  fill: var(--line-strong);
}

.star-full {
  fill: var(--star);
}

.rate-picker {
  display: flex;
  gap: 4px;
}

.rate-picker button {
  background: none;
  border: 0;
  padding: 2px;
  line-height: 0;
  border-radius: 6px;
  transition: transform 0.12s ease;
}

.rate-picker button:hover {
  transform: scale(1.14);
}

.rate-picker button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.rate-picker svg {
  width: 34px;
  height: 34px;
  fill: var(--line-strong);
  transition: fill 0.12s ease;
}

.rate-picker button.on svg {
  fill: var(--star);
}

/* ---------- 뷰어 ---------- */
body.viewer-page {
  background: #141618;
}

.viewer-bar {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(20, 22, 24, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.viewer-bar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  position: relative;
}

.viewer-bar__back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
}

.viewer-bar__back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.viewer-bar__text {
  min-width: 0;
}

.viewer-bar__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-bar__sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
  width: 0;
  transition: width 0.1s linear;
}

.toon {
  max-width: var(--toon-w);
  margin: 0 auto;
  background: #fff;
}

.toon img {
  width: 100%;
  height: auto;
  display: block;
}

.viewer-nav {
  max-width: var(--toon-w);
  margin: 0 auto;
  padding: 18px 16px 10px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  background: #141618;
}

.viewer-nav .btn {
  background: #232629;
  color: #e8eaec;
  border-color: #2e3236;
}

.viewer-nav .btn:hover {
  background: #2c3034;
}

.viewer-nav .btn--primary {
  background: var(--brand);
  color: #fff;
}

.viewer-foot {
  background: var(--bg);
  padding-top: 4px;
}

/* ---------- 평점·소감 ---------- */
.review {
  padding: 30px 0 60px;
}

.review__inner {
  max-width: 760px;
  margin: 0 auto;
}

.review__head {
  text-align: center;
  margin-bottom: 20px;
}

.review__head h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.review__head p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.rate-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}

.rate-card__top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.rate-card__avg {
  text-align: center;
}

.rate-card__avg strong {
  display: block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.rate-card__avg span {
  font-size: 12px;
  color: var(--text-dim);
}

.rate-card__divider {
  width: 1px;
  align-self: stretch;
  background: var(--line);
}

.rate-card__mine {
  text-align: center;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.rate-card__mine b {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 700;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row .form-name,
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="file"],
.form-row select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.form-row textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.form-row .form-name:focus,
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: transparent;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-foot__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.counter {
  font-size: 12px;
  color: var(--text-dim);
}

.form-msg {
  font-size: 13px;
  margin: 10px 0 0;
  min-height: 19px;
}

.form-msg--err {
  color: var(--danger);
  font-weight: 600;
}

.form-msg--ok {
  color: var(--brand-dark);
  font-weight: 600;
}

.cmt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}

.cmt-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.cmt-head h3 em {
  font-style: normal;
  color: var(--brand-dark);
}

.cmt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.cmt {
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.cmt__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cmt__name {
  font-size: 13px;
  font-weight: 700;
}

.cmt__date {
  font-size: 12px;
  color: var(--text-dim);
}

.cmt__text {
  margin: 0;
  font-size: 14.5px;
  white-space: pre-wrap;
}

.cmt__mine {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.empty {
  padding: 36px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
}

/* ---------- 안내 페이지 ---------- */
.prose {
  max-width: 760px;
}

.prose h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 28px 0 8px;
}

.prose p,
.prose li {
  color: var(--text-sub);
  font-size: 14.5px;
}

.prose ul {
  padding-left: 18px;
}

/* ---------- 푸터 ---------- */
/* 제작 주체 안내 — 최상단 띠 */
.madeby {
  background: var(--brand-soft);
  border-bottom: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  padding: 7px 0;
}

.madeby strong {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 520px) {
  .madeby {
    font-size: 11.5px;
    padding: 6px 0;
  }
}

.foot .foot__madeby {
  color: var(--text-sub);
  font-weight: 600;
}

.foot {
  border-top: 1px solid var(--line);
  background: var(--bg-sub);
  padding: 26px 0 40px;
  margin-top: 20px;
}

.foot__inner {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.foot p {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.foot strong {
  color: var(--text-sub);
  font-size: 13px;
}

/* ---------- 반응형 ---------- */
@media (max-width: 860px) {
  .hero__card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero__visual {
    order: -1;
    aspect-ratio: 16 / 9;
  }

  .hero__body {
    padding: 22px 20px 26px;
  }

  .hero__title {
    font-size: 23px;
  }

  .detail__grid {
    grid-template-columns: 124px 1fr;
    gap: 16px;
  }

  .detail__title {
    font-size: 20px;
  }

  .ord-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 560px) {
  .toon-grid {
    gap: 16px 12px;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .gnb__nav a {
    padding: 7px 9px;
    font-size: 13px;
  }

  .logo {
    font-size: 15px;
  }

  .logo__sub {
    display: none;
  }

  .charlink span {
    display: none;
  }

  .charlink {
    padding: 4px;
  }

  .ep-item__thumb {
    width: 72px;
    height: 48px;
  }

  .ep-item__sub {
    display: none;
  }

  .ord-card {
    padding: 18px 16px;
  }

  .rate-card {
    padding: 18px 14px;
  }

  .rate-picker svg {
    width: 30px;
    height: 30px;
  }
}

/* ---------- 푸터 관리자 링크 ---------- */

.foot a {
  color: var(--text-dim);
  text-decoration: none;
}

.foot a:hover {
  color: var(--text-sub);
  text-decoration: underline;
}
