/* 고도화 5차 — 쪽별 대표 장면 2차 (2026-10-09). 마크업 = scripts/site-upgrade/apply-r5-scenes.py
   선생님 카드 자료 미리보기 · 점프 '앱 안 장면 세 장'(#scenes) · 소개 '레시피 미리 맛보기'.
   움직임 없음 — 정적 모습이 최종 모습이다(움직임 줄이기 · html.lite · JS 없음 모두 같다). */

/* ── 새 문구 구역의 언어 지킴(2026-10-09) ─────────────────────────
   점프 #scenes · 소개 레시피의 글은 아직 한국어 · 영어뿐이고 HTML 에 직접 있다(사전 열쇠 아님).
   화면 스크립트가 접두 없는 한국어 쪽을 방문자 언어로 다시 그리면 <html lang> 이 바뀐다 — 그때 글 언어와 다른 구역은 숨긴다.
   JS 없음 · 수집기는 <html lang> 이 원래 언어 그대로라 보인다. 51개 언어 사전으로 옮기면 이 규칙을 걷는다. */
html:not([lang="ko"]) [data-r5-lang="ko"],
html:not([lang="en"]) [data-r5-lang="en"],
/* 점프 쪽은 main#promo-content > section { display: block } (아이디 특이도)이 있어 #scenes 로 한 단계 더 높인다(!important 없이) */
html:not([lang="ko"]) #scenes[data-r5-lang="ko"],
html:not([lang="en"]) #scenes[data-r5-lang="en"] {
  display: none;
}

/* ── 선생님 — 카드 자료 미리보기 ─────────────────────────────── */
.tc-card__preview {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-top: var(--space-2, 8px);
  border-radius: var(--radius-lg, 16px);
  background: #fff;
}

.tc-card__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 칠한 마법 종이는 세로 그림이라 자르지 않고 흰 종이 위에 통째로 */
.tc-card__preview--run img {
  object-fit: contain;
  padding: 6px 0;
  box-sizing: border-box;
}

/* PC(카드 세 줄 나란히) — 카드 맨 위로 올려 카드 가장자리까지 채운다(카드 안쪽 여백 var(--space-6) 만큼 밖으로).
   카드가 한 줄로 쌓이는 860px 이하는 설명 아래 16:9 로 둔다(태블릿 폭에서 4:3 이면 그림이 너무 크다) */
@media (min-width: 861px) {
  .tc-card__preview {
    order: -1;
    aspect-ratio: 4 / 3;
    margin: calc(var(--space-6, 24px) * -1) calc(var(--space-6, 24px) * -1) var(--space-3, 12px);
    border-radius: calc(var(--radius-xl, 24px) - 2px) calc(var(--radius-xl, 24px) - 2px) 0 0;
  }
}

/* ── 점프 — 앱 안 장면 세 장 (#scenes, 밤하늘 바탕 위) ─────────── */
.r5-scenes {
  padding: 72px 0 56px;
  color: #fff;
}

.r5-scenes__wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.r5-scenes__title {
  margin: 0 0 12px;
  text-align: center;
  color: #fff;
  font-family: var(--font-display), sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.25;
  text-wrap: balance;
}

.r5-scenes__lead {
  max-width: 40em;
  margin: 0 auto 36px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.r5-scenes__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.r5-scene__fig {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.r5-scene__shot {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #1b1238;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.r5-scene__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.r5-scene__cap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
}

.r5-scene__num {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--wj-accent-mint, #00cd9c);
  color: #1a0f33;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}

.r5-scene__name {
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1.35;
}

.r5-scene__desc {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.95rem;
  line-height: 1.55;
  text-wrap: pretty;
}

@media (max-width: 860px) {
  .r5-scenes { padding: 56px 0 40px; }
  .r5-scenes__wrap { padding: 0 20px; }
  .r5-scenes__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    max-width: 560px;
    margin: 0 auto;
  }
}

/* ── 소개 — 레시피 미리 맛보기 ─────────────────────────────────── */
.r5-recipe {
  width: 100%;
  max-width: 880px;
  margin: 0 0 56px;
}

.r5-recipe__title {
  margin: 0 0 8px;
  font-family: var(--wz-font-display, 'Varela Round', 'Nunito', sans-serif);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary, #2d2a3e);
}

.r5-recipe__lead {
  margin: 0 0 28px;
  color: var(--text-secondary, #666);
  font-size: 15px;
  line-height: 1.6;
}

.r5-recipe__list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 세 재료를 잇는 레시피 선(그림 가운데 높이) */
.r5-recipe__list::before {
  content: "";
  position: absolute;
  top: 92px;
  left: 17%;
  right: 17%;
  border-top: 3px dashed rgba(158, 99, 207, 0.32);
}

.r5-recipe__step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.r5-recipe__img {
  width: 184px;
  height: 184px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 24px rgba(158, 99, 207, 0.16);
}

.r5-recipe__num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--wz-purple, #9e63cf);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}

.r5-recipe__name {
  font-family: var(--wz-font-display, 'Varela Round', 'Nunito', sans-serif);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary, #2d2a3e);
}

.r5-recipe__desc {
  max-width: 17em;
  color: var(--text-secondary, #666);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
}

.r5-recipe__svc {
  margin-top: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(158, 99, 207, 0.08);
  color: var(--wz-purple, #9e63cf);
  font-size: 12px;
  font-weight: 700;
}

/* 휴대폰 — 그림을 앞에, 글을 옆에. 레시피 선은 세로로 */
@media (max-width: 768px) {
  .r5-recipe__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .r5-recipe__list::before {
    top: 56px;
    bottom: 56px;
    left: auto;
    right: auto;
    inset-inline-start: 55px;
    border-top: 0;
    border-inline-start: 3px dashed rgba(158, 99, 207, 0.32);
  }
  .r5-recipe__step {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 2px;
    align-items: center;
    justify-items: start;
    text-align: start;
  }
  .r5-recipe__img {
    grid-row: 1 / span 4;
    width: 112px;
    height: 112px;
  }
  .r5-recipe__num { display: none; }
  .r5-recipe__desc { max-width: none; }
}
