/* 하위 페이지 공통 부품 */

/* 머리 영역 오른쪽 그림: 교재 지면 세 장 */
.subhead .art { width: 420px; height: 300px; }
.subhead .art img { position: absolute; width: 190px; border-radius: 6px; box-shadow: var(--sh-2); background: #fff; }
.subhead .art .a1 { left: 0; top: 60px; transform: rotate(-8deg); }
.subhead .art .a2 { left: 120px; top: 10px; z-index: 2; }
.subhead .art .a3 { left: 240px; top: 70px; transform: rotate(7deg); }
.subhead .art.one img { position: absolute; left: 90px; top: 0; width: 240px; transform: none; }
.subhead .art.emblem img { width: 260px; left: 120px; top: -10px; box-shadow: none; background: none; }

/* 교재 지면 한 장 */
.pg { position: relative; border-radius: 4px 8px 8px 4px; overflow: hidden; box-shadow: var(--sh-2); background: #fff; }
.pg::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: linear-gradient(90deg, rgba(0,0,0,.14), transparent); z-index: 1; }
.pg img { width: 100%; }
.shot { border-radius: var(--r-lg); box-shadow: var(--sh-3); }

/* 글과 그림 두 칸 */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.duo.wide-l { grid-template-columns: 1.2fr 1fr; }
.duo.wide-r { grid-template-columns: 1fr 1.2fr; }
.duo.flip > :first-child { order: 2; }
.duo .vis { position: relative; }

/* 점이 붙은 짧은 목록 */
.marks { list-style: none; margin-top: 28px; }
.marks li { padding: 16px 0 16px 34px; border-top: 1px solid var(--sage-d); position: relative; color: var(--sub); }
.marks li:last-child { border-bottom: 1px solid var(--sage-d); }
.marks li::before { content: ""; position: absolute; left: 4px; top: 24px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--gold); }
.marks b { color: var(--ink); }
.sage .marks li, .sec:not(.sage) .marks li { border-color: var(--line); }

/* 순서가 있는 단계 */
.flow { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: f; }
.flow li { background: #fff; border-radius: var(--r-md); padding: 26px 24px; box-shadow: var(--sh-1); position: relative; }
.sec:not(.sage) .flow li { background: var(--sage); box-shadow: none; }
.flow li::before { counter-increment: f; content: counter(f); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--forest); color: var(--gold-l); font-family: "Cormorant Garamond", serif; font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.flow li:not(:last-child)::after { content: ""; position: absolute; right: -12px; top: 46px; width: 8px; height: 8px; border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); transform: rotate(45deg); }
.flow b { display: block; font-size: 17px; margin-bottom: 6px; }
.flow span { font-size: 15px; color: var(--sub); }

/* 표 */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); box-shadow: var(--sh-1); background: #fff; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.tbl th, .tbl td { padding: 16px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl thead th { background: var(--forest); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-weight: 700; white-space: nowrap; }
.tbl tbody tr { transition: background-color .15s var(--ease); }
.tbl tbody tr:hover { background: var(--sage); }
.tbl .num { font-variant-numeric: tabular-nums; }
.note { font-size: 14px; color: var(--mute); margin-top: 14px; }

/* 제목과 글이 나란히 놓인 목록 */
.rowlist { list-style: none; }
.rowlist li { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 32px 0; border-top: 1px solid var(--line); }
.rowlist li:last-child { border-bottom: 1px solid var(--line); }
.rowlist h3 { font-size: 19px; }
.rowlist .k { display: block; font-size: 14px; font-weight: 700; color: var(--gold-t); margin-bottom: 4px; }
.rowlist p + p { margin-top: 8px; }

/* 상자 */
.panel { background: #fff; border-radius: var(--r-lg); padding: 40px; box-shadow: var(--sh-1); }
.sec:not(.sage) .panel { background: var(--sage); box-shadow: none; }

/* 알약 버튼 묶음 (필터, 탭) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seg button { height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; color: var(--sub); transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.seg button:hover { color: var(--forest); border-color: var(--forest); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }

/* 가맹 문의 띠 */
.mailband { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--forest); color: #fff; border-radius: var(--r-lg); padding: 36px 40px; }
.mailband h3 { font-size: 20px; margin-bottom: 4px; }
.mailband p { color: #c5d2c8; }

@media (max-width: 860px) {
  .duo, .duo.wide-l, .duo.wide-r { grid-template-columns: 1fr; gap: 36px; }
  .duo.flip > :first-child { order: 0; }
  .flow { grid-template-columns: 1fr; gap: 10px; }
  .flow li { display: grid; grid-template-columns: 40px 1fr; gap: 0 16px; padding: 20px; }
  .flow li::before { margin: 0; grid-row: span 2; }
  .flow li::after { display: none; }
  .rowlist li { grid-template-columns: 1fr; gap: 8px; padding: 26px 0; }
  .panel { padding: 24px 20px; }
  .mailband { padding: 28px 22px; }
}

/* ── 코드로 그린 도식 (아이콘: Lucide, ISC 라이선스) ── */
.li { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.dic { width: 52px; height: 52px; border-radius: 50%; background: var(--sage); color: var(--forest); display: grid; place-items: center; flex: none; }
.dic .li { width: 24px; height: 24px; }

/* 가로 단계 */
.dsteps { list-style: none; display: flex; align-items: stretch; gap: 0; counter-reset: ds; }
.dsteps > li { flex: 1 1 0; min-width: 0; position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 18px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.dsteps > li + li { margin-left: 36px; }
.dsteps > li + li::before { content: ""; position: absolute; left: -29px; top: 47px; width: 22px; height: 2px; background: var(--gold); }
.dsteps > li + li::after { content: ""; position: absolute; left: -13px; top: 44px; width: 7px; height: 7px; border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); transform: rotate(45deg); }
.dsteps .no { position: absolute; top: 18px; right: 18px; font-size: 13px; font-weight: 800; color: var(--gold-t); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.dsteps b { font-size: 17px; letter-spacing: -.02em; }
.dsteps p { font-size: 14px; color: var(--sub); margin-top: -8px; }
.dsteps > li.mark { flex: 0 0 104px; background: var(--forest); border-color: var(--forest); color: #fff; align-items: center; justify-content: center; text-align: center; padding: 18px 10px; }
.dsteps > li.mark .dic { background: rgba(255,255,255,.12); color: var(--gold-l); }
.dsteps > li.last .dic { background: var(--forest); color: #fff; }

/* 원형 순환 */
.dring { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; margin: 0 auto; }
.dring .track { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dring .track circle { fill: none; stroke: #c9d4cb; stroke-width: .45; stroke-dasharray: 1.4 1.2; }
.dring .track path { fill: var(--gold); }
.dring .hub { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; text-align: center; font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.35; padding: 10px; }
.dring .hub small { display: block; font-size: 12px; font-weight: 600; color: var(--gold-l); letter-spacing: .02em; margin-bottom: 4px; }
.dring ol { list-style: none; }
.dring li { position: absolute; transform: translate(-50%, -50%); width: 150px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1); padding: 14px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.dring li b { font-size: 15px; letter-spacing: -.02em; line-height: 1.3; }
.dring li .no { position: absolute; top: 10px; left: 12px; font-size: 12px; font-weight: 800; color: var(--gold-t); font-variant-numeric: tabular-nums; }
.dring li .dic { width: 44px; height: 44px; }

/* 시간 순서 */
.dtime { list-style: none; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 16px; position: relative; padding-bottom: 34px; }
.dtime::after { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 2px; background: var(--forest); }
.dtime li { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 22px 24px; }
.dtime li::after { content: ""; position: absolute; left: 50%; bottom: -33px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--gold); z-index: 1; }
.dtime small { display: block; font-size: 13px; font-weight: 700; color: var(--gold-t); margin: -10px 0 14px; }
.dtime b { display: block; font-size: 19px; letter-spacing: -.03em; margin: 0 0 14px; }
.dtime p { font-size: 14px; color: var(--sub); margin-top: 12px; }
.dtime li.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.dtime li.on small { color: var(--gold-l); }
.dtime li.on p { color: #c5d2c8; }
.dtime li.on .dic { background: rgba(255,255,255,.12); color: var(--gold-l); }

@media (max-width: 860px) {
  .dsteps { flex-direction: column; }
  .dsteps > li { flex-direction: row; align-items: center; padding: 16px; gap: 14px; flex-wrap: wrap; }
  .dsteps > li > div { flex: 1; min-width: 0; }
  .dsteps > li + li { margin-left: 0; margin-top: 22px; }
  .dsteps > li + li::before { left: 41px; top: -18px; width: 2px; height: 14px; }
  .dsteps > li + li::after { left: 38px; top: -10px; transform: rotate(135deg); }
  .dsteps p { margin-top: 2px; }
  .dsteps > li.mark { flex: none; flex-direction: row; justify-content: flex-start; text-align: left; padding: 12px 16px; }
  .dsteps .no { position: static; transform: none; order: 3; align-self: flex-start; margin-top: 4px; }
  .dring { aspect-ratio: auto; max-width: none; }
  .dring .track { display: none; }
  .dring .hub { position: static; transform: none; width: auto; aspect-ratio: auto; border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; font-size: 17px; }
  .dring ol { display: grid; gap: 10px; }
  .dring li { position: static; transform: none; width: auto; flex-direction: row; text-align: left; padding: 14px 16px; }
  .dring li .no { position: static; order: 3; margin-left: auto; }
  .dtime { grid-template-columns: 1fr; padding: 0 0 0 28px; }
  .dtime::after { left: 6px; top: 0; bottom: 0; right: auto; width: 2px; height: auto; }
  .dtime li::after { left: -22px; top: 26px; bottom: auto; margin: 0; }
}
