/* ==========================================================================
   DBEW inner — 안쪽 쪽 (dbew-page 템플릿 전용, 어두운 테마)

   PC (900px~)   [레일 1][왼쪽 길잡이 칸 4, 제자리][오른쪽 본문 칸 7]
   ~899px        한 단. 제목 묶음(제목·요약·줄무늬)은 머리줄 밑에 고정, 하위 메뉴 없음

   줄무늬 .bars
     CSS로 정지 모양을 그리고, inner.js 가 돌면 .inner.is-live 에서 <i> 줄로 바꿔 스크롤에 반응시킨다.
   색
     --st  왼쪽 칸 색 (기본 노랑 → 읽는 구역 색, inner.js)
     --c   줄무늬 색. 구역은 템플릿이 <section style="--c: …"> 로 준다
   ========================================================================== */

.inner {
  --st: var(--stripe-yellow);
  max-width: var(--page-max);
  margin-inline: auto;
  overflow-x: clip;
}

/* 줄무늬 ------------------------------------------------------------------- */
.bars {
  position: relative;
  overflow: hidden;
  background: repeating-linear-gradient(var(--c) 0 6px, transparent 6px 18px);
}
.is-live .bars { background: none; }
/* JS가 있으면 inner.js 가 첫 모양을 그릴 때까지 줄무늬를 숨긴다 (정지 줄무늬가 먼저 보였다 바뀌는 깜빡임 방지).
   inner.js 가 실패해도 2초 뒤에는 정지 줄무늬가 보인다. JS가 없으면 처음부터 정지 줄무늬 */
.js .inner:not(.is-live) .bars { visibility: hidden; animation: bars-fallback 0s 2s forwards; }
@keyframes bars-fallback { to { visibility: visible; } }
.bars > i {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 16px;                  /* inner.js BASE */
  background: var(--c);
  transform-origin: 0 0;
  will-change: transform, opacity;
}

/* 레일 */
.inner__rail { display: none; }
.bars--rail {
  --c: var(--stripe-green);
  position: absolute;
  inset: 0 0 0 24%;
  mask-image: linear-gradient(#000, rgb(0 0 0 / 0.35));
}
.is-live .bars--rail { mask-image: none; }

/* 왼쪽 칸 (한 단: 제목 묶음, 머리줄 밑에 고정) ------------------------------- */
.inner__left {
  --crumb-h: 1.25rem;
  position: sticky;
  /* 경로 줄만 머리줄 뒤로 올라가고 제목부터 고정된다 */
  top: calc(var(--header-h) - var(--space-5) - var(--crumb-h));
  z-index: 5;
  background: var(--bg);
}

.inner__head { padding: var(--space-5) var(--space-4) var(--space-4); }

.breadcrumb ol {
  display: flex;
  gap: var(--space-2);
  height: var(--crumb-h);
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  line-height: var(--crumb-h);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg-muted);
}
.breadcrumb li:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb li + li::before { content: "›"; margin-right: var(--space-2); }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--fg); text-decoration: underline; }

.inner__title {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(2rem, 1rem + 2.6vw, 4rem);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.inner__summary {
  max-width: 40ch;
  margin-top: var(--space-3);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

.inner__zone { --c: var(--st); height: 4rem; }
.inner__zone--b,
.subnav { display: none; }

/* 본문 칸 ------------------------------------------------------------------ */
.inner__body {
  --gut: var(--space-4);
  min-width: 0;
  padding: var(--space-6) var(--gut) var(--space-8);
}

/* #구역 주소로 왔을 때 고정된 머리줄·제목 묶음에 가리지 않게 (--stick: inner.js 가 잰 값) */
.section { scroll-margin-top: var(--stick, calc(var(--header-h) + 12rem)); }

/* 1 구역 여는 묶음 · 2 소제목 아래 띠: 칸 끝에서 끝까지 */
.section__bundle,
.section__band { margin-inline: calc(-1 * var(--gut)); }

.section__bundle {
  height: 3.5rem;
  margin-block: 2.75rem var(--space-3);
  /* 정지 모양: 위는 가늘고 옅게, h2 쪽으로 굵고 진하게 */
  background: linear-gradient(to top,
    var(--c) 0 15px, transparent 15px 18px,
    color-mix(in srgb, var(--c) 85%, #fff) 18px 30px, transparent 30px 34px,
    color-mix(in srgb, var(--c) 65%, #fff) 34px 42px, transparent 42px 46px,
    color-mix(in srgb, var(--c) 50%, #fff) 46px 51px, transparent 51px 56px,
    color-mix(in srgb, var(--c) 35%, #fff) 56px 58px, transparent 58px);
}
.section:first-child > .section__bundle { margin-top: 0; }

.section__band {
  height: 6px;
  margin-block: 0.625rem 1.375rem;
  background: var(--c);
}

/* 본문 글 */
.content > * { max-width: 60ch; }
.content > * + * { margin-top: var(--space-4); }
.content > .section__band { max-width: none; }
.content > .section__band + *,
.content > hr + * { margin-top: 0; }
.content > .table-wrap { max-width: 720px; }

.content h2,
.content h3,
.content h4,
.next__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}
.content h2 { font-size: var(--fs-xl); line-height: 1.15; }
.content h3 { font-size: var(--fs-lg); }
.content h4 { font-size: var(--fs-base); }
.content > * + h3 { margin-top: var(--space-6); }

.content ul,
.content ol { padding-left: 1.25em; }
.content li + li { margin-top: var(--space-2); }
.content li::marker { color: var(--c); }
.content ol > li::marker { font-weight: var(--fw-bold); }

.content a { color: var(--fg); text-underline-offset: 0.2em; }
.content a:hover { text-decoration-color: var(--c); text-decoration-thickness: 2px; }

.content blockquote {
  padding-left: var(--space-5);
  border-left: var(--space-1) solid var(--c);
  font-size: var(--fs-lg);
}

.content figure img { width: 100%; }
.content figcaption { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--fg-muted); }

/* 3 덩어리 사이 줄 (Line 블록) */
.content > hr {
  height: 2px;
  margin: 1.125rem 0;
  border: 0;
  background: var(--c);
}

/* 4 표 줄: 흰 가는 선. 넓은 표는 표만 옆으로 */
.table-wrap { overflow-x: auto; }
.content table { width: 100%; border-collapse: collapse; }
.content th,
.content td {
  padding: 0.625rem var(--space-4) 0.625rem 0;
  border-top: 1px solid color-mix(in srgb, var(--fg) 45%, transparent);
  text-align: left;
  vertical-align: top;
}
.content thead th {
  padding-top: 0;
  border-top: 0;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.content td:first-child { font-weight: var(--fw-bold); }

/* 버튼 블록 (접수 기간이 아니면 .content__status 글) */
.content > .content__button,
.content > .content__status { margin-top: var(--space-5); }
.content__status { font-weight: var(--fw-bold); }

/* 본문 아래 목록 (Panel "본문 아래 목록") ------------------------------------ */
/* 카드: 하위 쪽. 휴대폰 1열, 720px~ 2열 */
.cards {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.card__link {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-4) 0 var(--space-5);
  border-top: 6px solid var(--c);
  color: var(--fg);
  text-decoration: none;
}
.card__no { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.08em; color: var(--fg); }   /* 번호는 글과 같은 흰색 (11/29, 첫 화면 Design Fields 와 통일) */
.card__title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.card__text { color: var(--fg-muted); }
.card__photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: var(--space-2); }
.cards--people .card__link { border-top-width: 2px; }
.card__link:hover .card__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

/* 줄 목록: 질문 펼침·파일. 줄 사이 선은 구역 색 */
.content > .faq { max-width: 60ch; border-top: 2px solid var(--c); }
.content > .faq + .faq { margin-top: 0; }
.content > .faq:not(:has(+ .faq)) { border-bottom: 2px solid var(--c); }
.faq summary {
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: baseline;
  padding-block: 0.875rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--c); }
.faq[open] summary::after { content: "–"; }
.faq summary h3 { font-size: var(--fs-base); }
.faq summary:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; }
.faq__a { padding-bottom: var(--space-4); }
.faq__a > * + * { margin-top: var(--space-3); }

.rows { margin: 0; padding: 0; list-style: none; border-bottom: 2px solid var(--c); max-width: 720px; }
.rows > li { border-top: 2px solid var(--c); }
.files__link {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  justify-content: space-between;
  padding-block: 0.875rem;
  color: var(--fg);
  font-weight: var(--fw-bold);
  text-decoration: none;
}
.files__meta { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--fg-muted); }
.files__link:hover .files__name { text-decoration: underline; text-underline-offset: 0.2em; }
.section:has(> .rows) { margin-top: var(--space-6); }

/* 다음 행동 */
.next__apply {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}
.next__period { font-weight: var(--fw-bold); }
.section--next > .section__band { margin-top: var(--space-5); }
.next__page {
  display: inline-grid;
  gap: var(--space-1);
  color: var(--fg);
  text-decoration: none;
}
.next__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.next__title { font-size: var(--fs-xl); }
.next__page:hover .next__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
}

/* PC (900px~) ---------------------------------------------------------------- */
@media (min-width: 900px) {
  .inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 4fr) minmax(0, 7fr);
    align-items: start;
  }
  .inner__rail,
  .inner__left {
    position: sticky;
    top: var(--header-h);
    height: calc(100dvh - var(--header-h));
  }
  /* 하위 메뉴가 길어 화면보다 높으면 칸이 늘어난다 (바닥글 위로 넘치지 않게) */
  .inner__left { height: auto; min-height: calc(100dvh - var(--header-h)); }
  .inner__rail { display: block; }
  .inner__left {
    display: flex;
    flex-direction: column;
    padding-top: var(--space-5);
  }
  .inner__head { padding: 0 var(--space-5) var(--space-5); }
  .breadcrumb ol { flex-wrap: wrap; height: auto; white-space: normal; }

  .inner__zone { flex: 1 1 0; height: auto; min-height: 1.75rem; }
  .inner__zone--b {
    display: block;
    flex-grow: 1.5;
    border-top: 2px solid var(--st);
    transition: border-color 0.35s;
  }

  /* 하위 메뉴: 구분선은 왼쪽 칸 색, 현재 쪽은 그 색으로 채움 */
  .subnav { display: block; }
  .subnav ul { margin: 0; padding: 0; list-style: none; }
  .subnav a {
    display: block;
    padding: 0.6875rem var(--space-5);
    border-top: 2px solid var(--st);
    color: var(--fg);
    font-weight: var(--fw-bold);
    text-decoration: none;
    transition: background-color 0.35s, color 0.35s, border-color 0.35s;
  }
  .subnav a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
  .subnav a[aria-current="page"] { background: var(--st); color: var(--c-black); }
  .subnav a:focus-visible { outline-color: var(--fg); outline-offset: calc(-1 * var(--focus-width)); }
  .subnav a[aria-current="page"]:focus-visible { outline-color: var(--c-black); }
  .subnav__kids a {
    padding-left: calc(var(--space-5) + var(--space-4));
    border-top-width: 1px;
    font-size: var(--fs-sm);
  }

  .inner__body {
    --gut: clamp(1.5rem, 4vw, 4.5rem);
    padding-bottom: var(--space-9);
  }
  .section { scroll-margin-top: calc(var(--header-h) + var(--space-5)); }
  .section__bundle { height: 4.5rem; margin-top: 3.75rem; }
  .content td:first-child { white-space: nowrap; }
}

/* 화면 높이가 낮으면 왼쪽 칸 고정을 풀고 같이 스크롤 */
@media (min-width: 900px) and (max-height: 560px) {
  .inner__left { position: relative; height: auto; }
  .inner__zone { flex: none; height: 4rem; }
  .inner__zone--b { height: 6rem; }
}

/* 바닥글: Host·Organizer 줄의 왼쪽 끝을 본문 글 왼쪽 끝에 맞춘다 (PC, 안쪽 쪽만)
   본문 = 앞 두 칸(1fr + 4fr) 뒤 + 본문 안쪽 여백(--gut) */
@media (min-width: 900px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 0;
    padding-inline: 0;
  }
  .site-footer__col--contact,
  .site-footer__copy { padding-left: var(--gutter); }
  .site-footer__partners { padding-left: clamp(1.5rem, 4vw, 4.5rem); }
}

/* 11/29 작업 지시서 A-3 (휴대폰): 표 첫 칸이 좁아 낱말 중간에서 끊기지 않게 */
.content td:first-child, .content th:first-child { min-width: 6.5em; }
/* 경로 글자: 잘린 채로 두지 않고 줄을 바꾼다 (작업 지시서 A-3) */
@media (max-width: 899.98px) {
  .breadcrumb ol { flex-wrap: wrap; height: auto; min-height: var(--crumb-h); align-items: center; line-height: 1.4; white-space: normal; row-gap: var(--space-1); }
  .breadcrumb li:last-child { overflow: visible; text-overflow: clip; }
}

/* 하위 쪽 머리 띠 (휴대폰·태블릿): 쪽 제목과 본문 첫 줄이 한 화면에 들도록 줄무늬 띠를 낮춘다 (작업 지시서 A-3) */
@media (max-width: 899.98px) {
  .inner__left > .inner__zone:not(.inner__zone--b) { height: 1.75rem; }
  .inner__body > .l10n > .section:first-child > .section__bundle { height: 1.75rem; margin-top: var(--space-4); }
}

/* Organizer 그림(투명 바탕에 어두운 글자): 밝은 바탕을 깔아 읽히게 (작업 지시서 B-5) */
.content figure img[src*="organizer/"] { background: var(--c-white); padding: var(--space-4); }
/* 중·일 번역이 없는 쪽: 영문 위 안내 한 줄 (작업 지시서 B-3) */
.l10n-note { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); border: var(--border-thin) solid var(--gray-700); font-size: var(--t-note); color: var(--fg-muted); }
/* inner2.css — 2차 설정을 1안 안쪽 쪽에 맞추는 덧붙임 (1안 inner.css 는 그대로 둔다)
   (11/29) 색은 tokens.css 4색 한 벌, 마우스 반응(inner2.js)은 삭제
   1. 머리줄 로고 마크 (홈 인트로가 내려앉는 자리와 같은 모양) */
.site-logo { align-items: center; }
.site-logo__icon { display: block; width: auto; height: 1.75rem; margin-right: var(--space-1); }
.bars > i { translate: 0 var(--dy, 0px); }
@media (max-width: 899.98px) { .site-logo__icon { height: 1.5rem; } }

/* 휴대폰: 같은 대메뉴 안 쪽들을 가로로 미는 줄 (1차 수정 요청 — 모바일 하위 메뉴) */
@media (max-width: 899.98px) {
  .subnav {
    display: block;
    margin: 0 0 var(--space-4);
    border-top: 1px solid var(--line, rgba(255,255,255,.25));
    border-bottom: 1px solid var(--line, rgba(255,255,255,.25));
  }
  .subnav > ul {
    display: flex;
    gap: var(--space-2, .5rem);
    margin: 0;
    padding: .25rem var(--gutter, 1rem);
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .subnav > ul::-webkit-scrollbar { display: none; }
  .subnav li { flex: 0 0 auto; }
  .subnav > ul > li { display: contents; }
  .subnav > ul > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 2rem;                  /* 보이는 단추 32px (11/30 축소) */
    padding: 0 .75rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--fg);
    font-size: .8125rem;               /* 13px (11/30 축소, 전에는 14–16px) */
    font-weight: var(--fw-bold, 700);
    white-space: nowrap;
    text-decoration: none;
  }
  /* 누르는 영역은 40px 유지(1차 수정안 19번) — 보이는 단추 위아래로 4px씩 투명하게 넓힘 */
  .subnav > ul > li > a::after { content: ""; position: absolute; inset: -.25rem 0; }
  .subnav a[aria-current="page"] { background: var(--fg); color: var(--c-black, #000); border-color: var(--fg); }
  .subnav > ul > li > a[aria-current="page"] { font-size: .8125rem; }   /* 현재 쪽도 같은 크기 (type.css 의 큰 글자 덮음) */
  /* 3단계 쪽 목록은 휴대폰 줄에서는 빼고(경로·카드·Next 로 이동) 한 줄을 유지 */
  .subnav__kids { display: none; }
}

/* ── 격자 맞춤 (11/29 밤) — 하위 쪽도 첫 화면과 같은 12단(tokens.css --m · --g) 위에 ─────────────
   휴대폰·태블릿: 글은 바깥 여백(--m)선에서 시작
   PC(900~): 레일 = 1단 · 왼쪽(경로·제목·하위 메뉴) = 2–5단 · 본문 = 6–12단  (지시서 '하위 쪽 3단' 유지)
   칸 경계는 단 간격의 가운데 — 첫 화면처럼 줄무늬는 칸끼리 맞닿고, 글은 단 선에서 시작 */
.inner__head { padding-inline: var(--m); }
.inner__body { --gl: var(--m); --gr: var(--m); padding-left: var(--gl); padding-right: var(--gr); }
.section__bundle,
.section__band { margin-left: calc(-1 * var(--gl)); margin-right: calc(-1 * var(--gr)); }

@media (min-width: 900px) {
  .inner {
    --cw: calc((100% - 2 * var(--m) - 11 * var(--g)) / 12);   /* 한 단 폭 */
    grid-template-columns:
      calc(var(--m) + var(--cw) + var(--g) / 2)      /* 레일: 화면 끝 ~ 1·2단 사이 */
      calc(4 * var(--cw) + 4 * var(--g))             /* 왼쪽: 2–5단 */
      minmax(0, 1fr);                                /* 본문: 6–12단 ~ 화면 끝 */
  }
  .bars--rail { inset: 0; }                          /* 첫 화면 레일처럼 화면 끝부터 */
  .inner__head { padding: 0 calc(var(--g) / 2) var(--space-5); }
  .subnav a { padding-inline: calc(var(--g) / 2); }
  .subnav__kids a { padding-left: calc(var(--g) / 2 + var(--space-4)); }
  .inner__body { --gl: calc(var(--g) / 2); --gr: var(--m); }

  /* 바닥글도 같은 선: 첫째 줄 1단, 둘째 줄 6단(본문·사진과 같은 선) */
  .site-footer__inner { padding-inline: var(--m); column-gap: var(--g); grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .site-footer__col--contact, .site-footer__copy { padding-left: 0; }
  .site-footer__col--contact { grid-column: 1 / 6; }
  .site-footer__partners { grid-column: 6 / -1; padding-left: 0; }
  .site-footer__copy { grid-column: 1 / -1; }
}
/* 한·중·일: 본문 소제목 줄간격 1.15 → 1.3 (tokens.css 한·중·일 줄간격과 같은 이유) */
html[data-lang="kr"] .content h2, .content h2:lang(ko), .content h2:lang(zh), .content h2:lang(ja) { line-height: 1.3; }

/* 휴대폰·태블릿: 하위 메뉴 → 줄무늬 띠 → 본문 첫 줄무늬 사이의 검은 빈칸 없앰 (11/30) */
@media (max-width: 899.98px) {
  .subnav { margin-bottom: 0; }
  .inner__body { padding-top: 0; }
  .inner__body > .l10n > .section:first-child > .section__bundle { margin-top: 0; }
  .inner__body > .l10n-note { margin-top: var(--space-4); }
}
/* 휴대폰: 하위 메뉴 줄 밑(고정되는 머리 안)의 굵은 줄무늬 띠는 빼고, 메뉴 줄 아래 가는 선은 남긴다 (11/30)
   — 스크롤하면 머리 안의 굵은 줄과 본문 줄무늬가 겹쳐 굵은 줄이 둘로 보였음. 하위 메뉴가 없는 쪽은 띠를 그대로 둔다 */
@media (max-width: 899.98px) {
  .subnav + .inner__zone { display: none; }
  /* 스크롤을 시작하면 메뉴 줄 바로 밑에 지금 읽는 구역 색(--st)의 굵은 줄 하나 (11/30) */
  .inner.is-scrolled .subnav + .inner__zone {
    display: block; height: 6px; min-height: 0;
    background: var(--st); visibility: visible; animation: none;
  }
  .inner.is-scrolled .subnav + .inner__zone > i { display: none; }
}

/* PC: 하위 메뉴는 원래대로 줄무늬 아래(가운데 칸에서 스크롤에 따라 위 줄무늬가 자라며 메뉴를 밀어 내림).
   11/30 휴대폰용으로 HTML 순서를 제목 → 하위 메뉴 → 줄무늬로 바꿨기 때문에, PC는 보이는 순서만 되돌린다.
   (읽는 순서·키보드 순서는 제목 다음 하위 메뉴 그대로) */
@media (min-width: 900px) {
  .inner__left > .inner__head { order: 0; }
  .inner__left > .inner__zone:not(.inner__zone--b) { order: 1; }
  .inner__left > .subnav { order: 2; }
  .inner__left > .inner__zone--b { order: 3; }
}

/* 영문 긴 본문 줄 간격 150% 안팎 — 하위 쪽 본문·목록·FAQ 답변만. 첫 화면·표·제목은 그대로 (3차 지시서 2장 14번) */
.inner .content:lang(en) > :is(p, ul, ol),
.inner .faq__a:lang(en) > :is(p, ul, ol) { line-height: 1.5; }
