/* 5안 공용 규칙. 포털 portal-v5.css 와 같은 값을 쓴다. */
:root {
  /* 글자 크기 단계. 다섯 CSS(포털·웹툰·웹소설·영상·비주얼)가 같은 값을 쓴다. */
  --fs-micro: 11px;
  --fs-caption: 12px;
  --fs-small: 13px;
  --fs-body: 14px;
  --fs-lead: 15px;
  --fs-title-sm: 16px;
  --fs-title: 18px;
  --fs-logo: 21px;
  --fs-h3: 22px;
  --fs-h2: 26px;
  --fs-h1-sm: 34px;
  --fs-h1: 46px;
  /* 큰 제목 자간. 더 좁히면 글자가 겹친다. */
  --tracking-title: -0.02em;
  --paper: #fff;
  --sunken: #f2f6f8;
  --ink: #0b1215;
  --ink-2: #4b575e;
  --ink-3: #8a959b;
  --line: #e4eaed;
  --line-2: #c9d3d8;
  --accent: #16d0f0;
  --accent-d: #0084a8;
  --tint: #e7fafe;
  --r: 4px;
  --wrap: 1400px; /* 위 메뉴·홈과 같은 너비 [599] */
}
html { background: var(--paper); color-scheme: light; scrollbar-color: var(--line-2) var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  font-size: var(--fs-lead);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-x: hidden;
}
/* 일본어·중국어는 공백이 적어 keep-all 이면 줄이 바뀌지 않고 잘린다. */
html:lang(ja) :is(body, .bubble-talk, .bubble-narration, .bubble-thought, .bubble-shout, .bubble-dialogue-text, .narration-dialogue-text, .thought-dialogue-text, .shout-dialogue-text),
html:lang(zh) :is(body, .bubble-talk, .bubble-narration, .bubble-thought, .bubble-shout, .bubble-dialogue-text, .narration-dialogue-text, .thought-dialogue-text, .shout-dialogue-text) {
  word-break: normal;
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
svg.ic { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 26px; border-radius: var(--r);
  font-size: var(--fs-lead); font-weight: 700; white-space: nowrap;
}
.btn.pri { background: var(--accent); color: var(--ink); }
.btn.sec { box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.sec:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn.sm { height: 38px; padding: 0 14px; font-size: var(--fs-small); }
.btn.ix { padding: 0 16px; }
.eyebrow { font-size: var(--fs-small); font-weight: 700; color: var(--accent-d); }

.gnb { height: 68px; border-bottom: 1px solid var(--line); background: var(--paper); }
.gnb .wrap { display: flex; align-items: center; gap: 44px; height: 100%; }
.logo { font-size: var(--fs-logo); font-weight: 800; letter-spacing: .04em; }
.menu { display: flex; gap: 30px; height: 100%; font-weight: 600; }
.menu a { display: flex; align-items: center; position: relative; color: var(--ink-2); }
.menu a.on { color: var(--ink); }
.menu a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--accent); }
.gnb-r { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: var(--fs-body); font-weight: 600; }
.gnb-search { display: flex; align-items: center; gap: 8px; width: 220px; height: 38px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.gnb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: var(--fs-body); }
.gnb-lang { display: flex; align-items: center; gap: 5px; }
.gnb-lang select, .sel select { appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: none; cursor: pointer; font-weight: 600; }
html.is-embedded .gnb { display: none; }

.sel { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: var(--fs-body); font-weight: 600; flex: none; }
.sel select { padding-right: 20px; }
.sel svg { position: absolute; right: 0; pointer-events: none; }

.sh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; padding-top: 18px; border-top: 1px solid var(--ink); }
.sh h2 { margin: 0; font-size: var(--fs-h2); font-weight: 700; letter-spacing: var(--tracking-title); }
.sh small { font-size: var(--fs-body); color: var(--ink-3); }
.sh .r { margin-left: auto; align-self: center; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }

.posters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 36px 16px; }
@media (min-width: 901px) {
  #works-grid[data-cards-per-row] { grid-template-columns: repeat(var(--cards-per-row), minmax(0, 1fr)); }
}
.poster { display: block; min-width: 0; position: relative; }
.poster .th { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--sunken); }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.age { position: absolute; left: 6px; top: 6px; display: flex; align-items: center; height: 19px; padding: 0 5px; border-radius: 2px; background: rgba(11, 18, 21, .78); color: #fff; font-size: var(--fs-micro); font-weight: 600; line-height: 1; }
.t { display: -webkit-box; margin-top: 11px; min-height: 2.7em; font-size: var(--fs-lead); font-weight: 600; line-height: 1.35; letter-spacing: -.01em; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m { margin-top: 3px; font-size: var(--fs-small); color: var(--ink-3); }

.empty { padding: 56px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; color: var(--ink-2); font-size: var(--fs-body); }
.empty h3 { margin: 0 0 6px; font-size: var(--fs-title); font-weight: 700; color: var(--ink); }
.empty p { margin: 0; }
.empty .btn { margin-top: 18px; }

.foot { margin-top: 56px; padding: 24px 0 28px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--ink-3); }
.foot .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.foot .logo { font-size: var(--fs-title-sm); color: var(--ink); }
.foot .r { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 0 16px; width: min(380px, calc(100vw - 32px)); height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 6px; background: #F0F9FF; border: 1.5px solid #0284C7; box-shadow: 0 8px 24px rgba(11, 18, 21, .2); color: #0C4A6E; font-size: var(--fs-small); font-weight: 700; }

.gnb-mob-tabs { display: none; }

@media (min-width: 701px) and (max-width: 1240px) {
  .gnb .wrap { gap: 14px; }
  .menu { gap: 14px; font-size: var(--fs-body); }
  .gnb-r { gap: 8px; flex: 0 1 auto; min-width: 0; }
  .gnb-search { flex: 1 1 88px; width: auto; max-width: 190px; min-width: 68px; }
}
@media (min-width: 701px) and (max-width: 960px) {
  .gnb .wrap { gap: 10px; padding: 0 16px; }
  .menu { gap: 10px; font-size: var(--fs-small); }
  .menu a { white-space: nowrap; }
  .gnb-search { display: none; }
}

@media (max-width: 700px) {
  html:not(.is-embedded) body:has(#gnb-nav-tabs) {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }
  .wrap { padding: 0 16px; }
  .gnb { height: 40px; }
  .gnb .wrap { gap: 8px; }
  .menu, .gnb-search { display: none; }
  .gnb-r { gap: 12px; }
  .btn.sm { height: 34px; padding: 0 10px; font-size: var(--fs-caption); }
  html:not(.is-embedded) .gnb-mob-tabs {
    position: fixed;
    inset: auto 0 0;
    z-index: 900;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    height: calc(40px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: var(--paper);
    border-top: 1px solid var(--line);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.04em;
  }
  html:not(.is-embedded) .gnb-mob-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0 2px;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html:not(.is-embedded) .gnb-mob-tabs a.on {
    color: var(--ink);
    font-weight: 700;
  }
  .sh { margin-bottom: 16px; padding-top: 14px; }
  .sh h2 { font-size: var(--fs-h3); }
  .posters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; }
  .foot { margin-top: 40px; padding: 20px 0 24px; }
  .foot .r { margin: 0; }
}

/* C안: 구역 사이 검은 선 대신 제목 앞 청록 막대 */
.sh {
  padding-top: 0;
  border-top: 0;
}

.sh h2 {
  position: relative;
  padding-left: 14px;
}

.sh h2::before {
  content: '';
  position: absolute;
  inset: 3px auto 3px 0;
  width: 5px;
  background: var(--accent);
  border-radius: 1px;
}

/* 표지는 7:10 이다. 칸을 표지 비율로 맞추고, 큰 그림은 위쪽 기준으로 잘라 얼굴이 잘리지 않게 한다 */
.poster .th {
  aspect-ratio: 7 / 10;
}

.poster .th img,
.reel img,
.dt .cv {
  object-position: center top;
}

/* 스크롤바가 생기고 없어질 때 화면이 좌우로 흔들리지 않게 하고, 상단 메뉴와 좌우 끝을 맞춘다 */
@media (min-width: 701px) {
  html { overflow-y: scroll; scrollbar-gutter: stable both-edges; }
}
