/* ==== 기능 자세히 보기 — /announcementsystem (views/include/announce_features.ejs · announce-features.js) ====
   머리(제목 왼쪽 · 묶음 탭 오른쪽) → 무대(왼쪽, 영상 한 편) + 기능 목록(오른쪽, 고른 기능만 펼침).
   무대는 3:2 고정 틀 — 영상은 비율(--r = 가로/세로) 그대로 틀 안에 '떠 있는 화면'으로 들어가 잘리지 않는다.
   이 파일을 고치면 preview_broadcast.ejs 의 ?v= 를 올린다(정적 파일 1년 캐시). */

/* ---------- 머리 ---------- */
.bfx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  margin-bottom: 40px;
}
.bfx-head .section-head {
  flex: 1 1 420px;
  min-width: 0;
  max-width: 660px;
  margin-bottom: 0;
}

/* 묶음 탭 — 한 줄 세그먼트(고른 것만 흰 바탕) */
.bfx-tabs {
  flex: none;
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--w-cool-96);
}
.bfx-tab {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  color: var(--fg-neutral-muted);
  font: 700 15px/1.2 var(--font-sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.bfx-tab:hover { color: var(--fg-primary); }
.bfx-tab[aria-selected="true"] {
  background: #fff;
  color: var(--fg-primary);
  box-shadow: 0 1px 2px rgba(24, 20, 54, .06), 0 4px 12px rgba(24, 20, 54, .08);
}
.bfx-tab:focus-visible { outline: 3px solid rgba(79, 55, 255, .24); outline-offset: 2px; }

/* ---------- 몸통: 무대 + 목록 ---------- */
.bfx-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.bfx-stage {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 24px;
  background: var(--w-cool-96);
}
.bfx-stage-fit {
  position: absolute;
  inset: 28px;
  display: grid;
  place-items: center;
  container-type: size;
}
/* 영상 한 편 = 틀 안에서 비율대로 가장 크게(가로가 꽉 차거나 세로가 꽉 차거나) */
.bfx-shot {
  grid-area: 1 / 1;
  width: min(100cqw, 100cqh * var(--r));
  aspect-ratio: var(--r);
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 18, 40, .06), 0 18px 40px -18px rgba(24, 20, 54, .32);
  opacity: 0;
  visibility: hidden;
  transform: scale(.98);
  transition: opacity .4s ease, transform .5s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .4s;
}
.bfx-shot.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .4s ease, transform .5s cubic-bezier(.2, .7, .2, 1), visibility 0s;
}
.bfx-shot video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}
/* 컨테이너 단위를 모르는 옛 브라우저 — 가로를 채우고 넘치는 부분만 잘린다 */
@supports not (width: 1cqw) {
  .bfx-shot { width: 100%; max-height: 100%; }
}

.bfx-toggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--fg-primary);
  box-shadow: 0 0 0 1px rgba(15, 18, 40, .06), 0 4px 14px rgba(24, 20, 54, .14);
  transition: transform .15s ease, background .2s ease;
}
.bfx-toggle:hover { background: #fff; transform: scale(1.06); }
.bfx-toggle:focus-visible { outline: 3px solid rgba(79, 55, 255, .3); outline-offset: 2px; }
.bfx-toggle svg { width: 16px; height: 16px; }
.bfx-toggle .is-play,
.bfx-toggle.is-paused .is-pause { display: none; }
.bfx-toggle.is-paused .is-play { display: block; }

/* ---------- 기능 목록 ---------- */
.bfx-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bfx-item {
  position: relative;
  border-radius: 16px;
  transition: background .25s ease;
}
.bfx-item:hover { background: var(--w-cool-98); }
.bfx-item.is-on { background: var(--w-cool-97); }
.bfx-item-btn {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: baseline;
  column-gap: 4px;
  width: 100%;
  padding: 17px 20px;
  border-radius: 16px;
  color: inherit;
  text-align: left;
  transition: padding .4s cubic-bezier(.2, .7, .2, 1);
}
.bfx-item.is-on .bfx-item-btn { padding-bottom: 8px; }
.bfx-item-btn:focus-visible { outline: 3px solid rgba(79, 55, 255, .24); outline-offset: -3px; }
.bfx-item-num {
  color: var(--fg-neutral-disable);
  font: 700 12px/1 var(--font-mono);
  letter-spacing: .06em;
  transition: color .25s ease;
}
.bfx-item.is-on .bfx-item-num { color: var(--w-blue-50); }
.bfx-item-title {
  color: var(--fg-neutral-muted);
  font: 700 17px/1.4 var(--font-sans);
  letter-spacing: -0.02em;
  text-wrap: pretty;
  transition: color .25s ease;
}
.bfx-item:hover .bfx-item-title,
.bfx-item.is-on .bfx-item-title { color: var(--fg-primary); }

/* 고른 기능만 펼친다 — 0fr→1fr 로 높이를 부드럽게 */
.bfx-item-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s cubic-bezier(.2, .7, .2, 1);
}
.bfx-item.is-on .bfx-item-more { grid-template-rows: 1fr; }
.bfx-item-more-in {
  min-height: 0;
  overflow: hidden;
  padding: 0 20px 0 54px; /* 54 = 단추 안쪽 20 + 번호 칸 30 + 사이 4 → 제목과 첫 글자 줄을 맞춘다 */
}
.bfx-item-desc {
  margin: 0;
  color: var(--fg-neutral-subtle);
  font: 500 15px/1.65 var(--font-sans);
  overflow-wrap: break-word;
}
/* 한국어만 단어 단위 줄바꿈 — 중국어·일본어에 keep-all 을 걸면 줄이 안 나뉘어 넘친다 */
.bfx-item-title:lang(ko),
.bfx-item-desc:lang(ko) { word-break: keep-all; }

.bfx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 26px;
  padding: 0;
  list-style: none;
}
.bfx-chips li {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid var(--line-neutral);
  border-radius: 999px;
  background: #fff;
  color: var(--fg-neutral-subtle);
  font: 600 12.5px/1.25 var(--font-sans);
}
/* 조건 표시(예: 윈도우 프로그램 전용) — 기능 칩과 구분되게 점선·투명 */
.bfx-chips li.is-note {
  border-style: dashed;
  background: transparent;
  color: var(--fg-neutral-muted);
}

/* 지금 영상이 얼마나 지났는지 — 다 차면 다음 기능으로 넘어간다 */
.bfx-item-bar {
  position: absolute;
  left: 54px;
  right: 20px;
  bottom: 12px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-neutral);
  opacity: 0;
  transition: opacity .25s ease;
}
.bfx-item.is-on .bfx-item-bar { opacity: 1; }
.bfx-item-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--w-blue-50);
  transform: scaleX(0);
  transform-origin: left center;
}

/* 목록 높이 재기(announce-features.js measure) 동안은 움직임을 끈다 */
.bfx.is-measuring .bfx-item,
.bfx.is-measuring .bfx-item * { transition: none !important; }

/* ---------- 좁은 화면: 탭 → 무대 → 목록 한 줄로 ---------- */
@media (max-width: 959px) {
  .bfx-head {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 24px;
  }
  .bfx-head .section-head { flex: none; }
  .bfx-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 16px;
  }
  .bfx-tab {
    min-width: 0;
    padding: 8px 6px;
    border-radius: 12px;
    font-size: 14.5px;
    white-space: normal;
    text-wrap: balance;
  }
  .bfx-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 600px) {
  .bfx-stage {
    aspect-ratio: 4 / 3;
    border-radius: 18px;
  }
  .bfx-stage-fit { inset: 14px; }
  .bfx-shot { border-radius: 10px; }
  .bfx-toggle {
    right: 10px;
    bottom: 10px;
    width: 34px;
    height: 34px;
  }
  .bfx-tab { font-size: 13.5px; }
  .bfx-item-btn {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 15px 14px;
  }
  .bfx-item-more-in { padding: 0 14px 0 44px; }
  .bfx-item-title { font-size: 16px; }
  .bfx-item-desc { font-size: 14.5px; }
  .bfx-chips { margin-bottom: 24px; }
  .bfx-item-bar {
    left: 44px;
    right: 14px;
    bottom: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfx-tab,
  .bfx-shot,
  .bfx-shot.is-on,
  .bfx-toggle,
  .bfx-item,
  .bfx-item-btn,
  .bfx-item-num,
  .bfx-item-title,
  .bfx-item-more,
  .bfx-item-bar { transition: none; }
  .bfx-shot { transform: none; }
}
