/* 새 셸 화면별 완성도 층 — ads(DA 배너 구좌 3규격). DESIGN.md(Framer 다크) 준수 · body.shell-v2 스코프.
 *   ⚠️ 광고는 본문보다 조용해야 한다 — 파랑·글로우·강한 모션을 쓰지 않는다. 테두리 한 단 + '광고' 뱃지가 전부다.
 *   규격: billboard(와이드 상단 · 40:9) · leaderboard(얇은 띠 · 가로 카피) · mpu(정사각 인라인 카드).
 *   원본 이미지는 전부 16:9 라 규격별로 object-fit: cover 가 자른다(규격마다 다시 생성하지 않는다). */

/* 자리표 — 동적 import 로 구좌를 받아오는 화면이 쓴다. 빈 동안 부모의 gap 을 벌리지 않게 레이아웃에서 사라진다. */
body.shell-v2 .ad-host { display: contents; }

body.shell-v2 .ad-slot {
  position: relative; display: block; width: 100%;
  border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-1);
}
/* '광고' 표시 — 규격 불문 항상 보인다(adSlot.js 의 결정). 브랜드 바로 앞 · 흐름 안이다.
   ⚠️ 구석에 absolute 로 띄우지 않는다 — CTA 도 오른쪽에 있어 세로로 어긋난 두 덩어리가 된다(오너 지적 2026-09-16). */
body.shell-v2 .ad-brandrow { display: flex; align-items: center; gap: 7px; min-width: 0; }
body.shell-v2 .ad-tag {
  flex: none; padding: 0 7px; line-height: 17px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ink-80); font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
}
body.shell-v2 .ad-card {
  display: block; width: 100%; padding: 0; border: 0; background: transparent;
  text-align: left; cursor: pointer; color: inherit;
}
body.shell-v2 .ad-card:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
body.shell-v2 .ad-body { position: relative; display: block; width: 100%; }
body.shell-v2 .ad-body--noimg { background: linear-gradient(120deg, #141414 0%, #1c1c1c 60%, #242424 100%); }
body.shell-v2 .ad-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body.shell-v2 .ad-scrim { position: absolute; inset: 0; }

/* 세로 리듬(4/8 스케일) — 글 묶음 안은 한 덩어리로 좁게, 글 묶음과 CTA 사이는 한 단 넓게.
   🔴 `.ad-text` 에 gap 을 반드시 준다 — 래퍼가 생긴 뒤로 `.ad-copy` 의 gap 은 [글 묶음]↔[CTA] 사이에만 걸리므로,
      여기를 비우면 브랜드·헤드라인·서브가 gap 0 으로 붙는다(2026-09-16 오너 지적 "행간이 너무 좁음" 의 원인). */
body.shell-v2 .ad-copy { position: relative; display: flex; flex-direction: column; min-width: 0; gap: 12px; }
body.shell-v2 .ad-text { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
body.shell-v2 .ad-brand { color: var(--ink-48); font-size: 12px; font-weight: 600; letter-spacing: var(--ls-footnote); }
body.shell-v2 .ad-headline { color: var(--ink); letter-spacing: -0.3px; text-wrap: balance; word-break: keep-all; }
body.shell-v2 .ad-sub { color: var(--ink-80); font-size: var(--fs-fine); line-height: 1.5; word-break: keep-all; }
body.shell-v2 .ad-cta {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink); font-size: var(--fs-fine); font-weight: 600;
}
body.shell-v2 .ad-card:hover .ad-cta { gap: 7px; }
body.shell-v2 .ad-cta svg { transition: transform 0.18s ease; }
body.shell-v2 .ad-card:hover .ad-cta svg { transform: translateX(2px); }

/* ── billboard — 넓은 상단 띠. 문구는 좌측, 이미지가 우측으로 흐른다. ── */
body.shell-v2 .ad-slot--billboard .ad-body { aspect-ratio: 40 / 9; min-height: 168px; }
body.shell-v2 .ad-slot--billboard .ad-scrim {
  background: linear-gradient(90deg, rgba(9, 9, 9, 0.94) 0%, rgba(9, 9, 9, 0.8) 40%, rgba(9, 9, 9, 0.1) 78%, rgba(9, 9, 9, 0.3) 100%);
}
body.shell-v2 .ad-slot--billboard .ad-copy {
  position: absolute; left: 28px; top: 0; bottom: 0; right: 40%; justify-content: center; gap: 16px;
}
body.shell-v2 .ad-slot--billboard .ad-text { gap: 8px; }
body.shell-v2 .ad-slot--billboard .ad-headline { font-size: var(--fs-title-2); line-height: var(--lh-title-2); }

/* ── leaderboard — 얇은 띠. 이미지는 왼쪽 썸네일, 문구는 한 줄로 이어진다. ── */
body.shell-v2 .ad-slot--leaderboard .ad-body {
  display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 10px 16px 10px 10px;
}
body.shell-v2 .ad-slot--leaderboard .ad-img {
  position: relative; inset: auto; flex: none; width: 128px; height: 72px; border-radius: var(--r-md);
}
body.shell-v2 .ad-slot--leaderboard .ad-scrim { display: none; }
/* 리더보드만 카피가 가로다 — 글 묶음은 왼쪽에서 늘어나고 CTA 는 오른쪽 끝에서 세로 중앙에 선다. */
body.shell-v2 .ad-slot--leaderboard .ad-copy { flex: 1 1 auto; flex-direction: row; align-items: center; gap: 16px; }
body.shell-v2 .ad-slot--leaderboard .ad-text { flex: 1 1 auto; }
body.shell-v2 .ad-slot--leaderboard .ad-headline { font-size: var(--fs-title-3); line-height: 1.3; }
body.shell-v2 .ad-slot--leaderboard .ad-cta { flex: none; }

/* ── mpu — 피드 타임라인에 섞이는 인라인 네이티브 유닛. 문구는 이미지 아래 본문 단.
      ⚠️ 300×250 짜리 고전 MPU 로 만들지 않는다 — 열 너비가 880px 인 피드에서 360px 카드는 깨진 것처럼 보인다.
      열 너비를 채우되 이미지는 16:9 로 눕혀 카드 하나가 화면을 통째로 먹지 않게 한다(정사각이면 880px 높이가 된다). ── */
body.shell-v2 .ad-slot--mpu .ad-body { padding-bottom: 0; }
body.shell-v2 .ad-slot--mpu .ad-img { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; }
body.shell-v2 .ad-slot--mpu .ad-scrim { display: none; }
body.shell-v2 .ad-slot--mpu .ad-copy { padding: 16px; }
body.shell-v2 .ad-slot--mpu .ad-headline { font-size: var(--fs-body); line-height: 1.35; }

/* 좁은 화면 — 빌보드도 리더보드처럼 세로로 눕는다(문구가 이미지를 가리지 않게). */
@media (max-width: 720px) {
  body.shell-v2 .ad-slot--billboard .ad-body { aspect-ratio: 16 / 10; min-height: 0; }
  body.shell-v2 .ad-slot--billboard .ad-scrim {
    background: linear-gradient(0deg, rgba(9, 9, 9, 0.95) 0%, rgba(9, 9, 9, 0.6) 50%, rgba(9, 9, 9, 0.15) 100%);
  }
  body.shell-v2 .ad-slot--billboard .ad-copy { left: 16px; right: 16px; top: auto; bottom: 14px; justify-content: flex-end; }
  body.shell-v2 .ad-slot--billboard .ad-headline { font-size: var(--fs-title-3); }
  body.shell-v2 .ad-slot--leaderboard .ad-body { align-items: flex-start; padding: 10px; }
  body.shell-v2 .ad-slot--leaderboard .ad-copy { flex-direction: column; align-items: flex-start; gap: 8px; }
  body.shell-v2 .ad-slot--leaderboard .ad-img { width: 92px; height: 60px; }
  body.shell-v2 .ad-slot--leaderboard .ad-headline { font-size: var(--fs-body); }
}
