/*
 * 29MU inherited editions
 * Baseline stays in media.css. This file only adds the shared theme control and
 * the approved 20% A/B variation: section rhythm, hero ratio and open-check emphasis.
 */

/* 2026-09-05 (재검수 0335 H2): 링 색의 진짜 주인이 여기였다. 이 시트를 싣는 화면은
   index.html 과 hub/today.html 둘뿐이고, 그 둘이 바로 토글 모양이 갈린 화면이다 —
   `border:1px solid var(--ink)!important` 가 정본(29mu-theme-toggle.css 의
   `border:1px solid var(--line-strong)`)을 이겼다. 콘솔 면에서만 뺀다:
   허브의 운영자 사본은 정본 토글을 쓰고, 손님 정본 index 는 이 편집판을 그대로 쓴다.
   같은 요소를 두 시트가 그리면 화면마다 모양이 갈린다(D-26). */
:where(body:not(.mu-console)) .theme-toggle {
  display: inline-flex;
  min-width: 52px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px !important;
  border: 1px solid var(--ink) !important;
  font: 700 8px/1 var(--font-mono) !important;
  letter-spacing: .08em;
}

.edition-mark {
  margin-left: 2px;
  color: var(--grey);
  font: 700 8px/1.2 var(--font-mono);
  letter-spacing: .12em;
  white-space: nowrap;
}

html[data-edition] main {
  display: flex;
  flex-direction: column;
}

/* A — original 67/33 cover, then official moving-image programming. */
html[data-edition="premiere"] .channel-section { border-top: 8px solid var(--lime); }

/* B — same components, 60/40 cover and open-check programming first. */
html[data-edition="open"] .opening-story {
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr);
}
html[data-edition="open"] .opening-story__media {
  display: grid;
  align-items: center;
  background: var(--slab-well);
}
html[data-edition="open"] .opening-story__media img { object-fit: contain; }
html[data-edition="open"] .community-prompt { border-top: 8px solid var(--lime); }

html[data-edition="open"] .community-prompt__head {
  background: var(--ink);
  color: var(--paper);
}
html[data-edition="open"] .community-prompt__head > p:not(.label) { color: var(--paper); opacity: .72; }
html[data-edition="open"] .community-prompt__head .outline-button { border-color: var(--paper); color: var(--paper); }
html[data-edition="open"] .community-ops article { border-bottom-width: 2px; }
html[data-edition="open"] .community-ops .avatar { border-radius: 0; }

.community-ops footer a {
  border-bottom: 1px solid currentColor;
  color: var(--grey);
  font-weight: 750;
}
.community-ops footer a:hover { color: var(--ink); }

/* The user can switch either edition; theme never determines the edition. */
/* 2026-09-01 · 여기 있던 다크 팔레트 재선언(--paper/--ink/--grey/--hairline)을
   걷어냈다. tokens.css 다크와 값이 같았고 --hairline 만 #41454e 로 갈려 있어서,
   index 만 다른 선 색을 쓰는 화면이 됐다(실측: index #41454e vs 나머지 다섯
   rgba(255,255,255,.16)). 색은 tokens.css 한 곳에서 온다.
   어두운 판은 --slab-* 를 쓴다 — 라이트에서도 어두워야 하는 판이다. */
html[data-theme="dark"] .editorial-shop {
  background: var(--slab-well);
  color: var(--slab-ink);
}
html[data-theme="dark"] .commerce-card { border-color: var(--slab-line); }
html[data-theme="dark"] .commerce-card__media { background: var(--slab-raised); }
html[data-theme="dark"] .editor-note { background: var(--slab-well); }
html[data-theme="dark"] .overlay-dialog { background: var(--paper); }
html[data-theme="dark"] .opening-story__media figcaption { background: var(--ink); color: var(--bg); }
html[data-theme="dark"] .buying-guide { background: var(--paper); }
html[data-theme="dark"] .media-footer { background: var(--paper); }

/* Korean type safety: preserve editorial scale without glyph collisions. */
#opening-title,
#main h2,
#main h3 {
  word-break: keep-all;
  overflow-wrap: break-word;
  /* balance 는 한글 강제 br 제목에서 들쭉날쭉 정렬을 만듦 */
  text-wrap: pretty;
}

#opening-title,
#main h2 {
  line-height: 1.16;
  letter-spacing: -.02em;
}

#main h3 { line-height: 1.2; letter-spacing: -.015em; }

@media (max-width: 1120px) {
  html[data-edition="open"] .opening-story { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .theme-toggle { min-width: 45px; }
  .edition-mark { display: none; }
  #opening-title {
    font-size: clamp(40px, 11.5vw, 52px);
    line-height: 1.18;
    letter-spacing: -.015em;
  }
  #main h2 { line-height: 1.18; letter-spacing: -.015em; }
  .opening-story__media img {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    object-position: center;
  }
  html[data-edition="open"] .opening-story__media img { aspect-ratio: 16 / 9; object-fit: contain; }
}

@media (forced-colors: active) {
  .theme-toggle,
  .community-ops article { border: 1px solid CanvasText !important; }
}
