/* DFLUX Tour & Festival LED Widget — 통일 토큰 (2026-09 톤앤매너 기준) */
:root,
html[data-theme="dark"] {
  --bg: #05080d;
  --card: #0b1018;
  --text: #f7f9fc;
  --muted: #8d98a8;
  --accent: #69e3ff;
  --good: #77f2bf;
  --line: rgba(255, 255, 255, .08);
  --scrim: #0b1018;
}
html[data-theme="light"] {
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #13233d;
  --muted: #5b6b80;
  --accent: #0a7fa8;
  --good: #14895f;
  --line: rgba(19, 35, 61, .10);
  --scrim: #ffffff;
}
html[data-theme="transparent"] {
  --bg: transparent;
  --card: rgba(5, 8, 13, .55);
  --text: #f7f9fc;
  --muted: #b4bdca;
  --accent: #69e3ff;
  --good: #77f2bf;
  --line: rgba(255, 255, 255, .12);
  --scrim: rgba(5, 8, 13, .55);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h2, p { margin: 0; }

/* ---------- 가로형 (기본) : vh 기준 ---------- */
.wg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
  padding: 3.2vh 3vw 2.4vh;
  box-sizing: border-box;
}
.hd {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  height: 9vh;
  font-size: 4.6vh;
  font-weight: 700;
  white-space: nowrap;
}
.hd-t { overflow: hidden; text-overflow: ellipsis; }
.hd-t:before {
  content: "";
  display: inline-block;
  width: 1.6vh; height: 1.6vh;
  margin: 0 1.6vh .5vh 0;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.hd-n { color: var(--muted); font-weight: 400; font-size: 3.6vh; padding-left: 2vw; }

.stage {
  position: relative;
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  margin: 1.6vh 0;
}
.card {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: -webkit-box; display: -webkit-flex; display: flex;
  opacity: 0;
  -webkit-transition: opacity .7s ease; transition: opacity .7s ease;
}
.card.on { opacity: 1; }

.media {
  position: relative;
  width: 56%;
  height: 100%;
  border-radius: 1.6vh;
  overflow: hidden;
  background: var(--card);
}
.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lic3 .media img { object-fit: contain; }   /* 공공누리 3유형(변경금지): 자르지 않음 */
.noimg .media { display: none; }

.body {
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  min-width: 0;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  padding-left: 3.6vw;
}
.noimg .body { padding-left: 0; }

.badge {
  -webkit-align-self: flex-start; align-self: flex-start;
  font-size: 3.4vh;
  font-weight: 700;
  line-height: 1;
  padding: 1vh 1.6vh;
  border-radius: 1vh;
  border: .3vh solid var(--accent);
  color: var(--accent);
  margin-bottom: 2.6vh;
  white-space: nowrap;
}
.badge.now { background: var(--good); border-color: var(--good); color: #05080d; }
.badge:empty { display: none; }
html[data-theme="light"] .badge.now { color: #ffffff; }

.ttl {
  font-size: 7.2vh;
  line-height: 1.22;
  font-weight: 700;
  max-height: 2.44em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.date {
  margin-top: 2.6vh;
  font-size: 4.6vh;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.place, .extra {
  margin-top: 1.4vh;
  font-size: 3.6vh;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.extra { font-size: 3.2vh; }
.date:empty, .place:empty, .extra:empty { display: none; }

.empty {
  position: absolute;
  top: 50%; left: 0; right: 0;
  -webkit-transform: translateY(-50%); transform: translateY(-50%);
  text-align: center;
  font-size: 5vh;
  color: var(--muted);
  display: none;
}
.is-empty .empty { display: block; }
.is-empty .card { display: none; }

.ft {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 1.4vh;
  font-size: 2.6vh;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 세로형 : 가로/세로 비율 1.2 미만, vw 기준 ---------- */
@media (max-aspect-ratio: 6/5) {
  .wg { padding: 4vw 4vw 3vw; }
  .hd { height: auto; padding: 1vw 0 2vw; font-size: 5.6vw; }
  .hd-t:before { width: 2vw; height: 2vw; margin: 0 2vw .6vw 0; }
  .hd-n { font-size: 4.4vw; }
  .stage { margin: 2vw 0 3vw; }
  .card {
    -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
  }
  .media { width: 100%; height: 52%; border-radius: 2vw; }
  .body {
    -webkit-box-pack: start; -webkit-justify-content: flex-start; justify-content: flex-start;
    padding: 5vw 0 0;
  }
  .noimg .body { -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; padding: 0; }
  .badge { font-size: 4.2vw; padding: 1.3vw 2vw; border-radius: 1.2vw; border-width: .4vw; margin-bottom: 3.4vw; }
  .ttl { font-size: 7.6vw; }
  .date { margin-top: 3.4vw; font-size: 5.4vw; }
  .place, .extra { margin-top: 2vw; font-size: 4.4vw; }
  .extra { font-size: 4vw; }
  .empty { font-size: 5.4vw; }
  .ft { padding-top: 2vw; font-size: 3.2vw; }
}

/* 아주 납작한 세로형(정사각에 가까움)에서는 이미지 비중 축소 */
@media (max-aspect-ratio: 6/5) and (min-aspect-ratio: 4/5) {
  .media { height: 46%; }
  .ttl { font-size: 6.4vw; }
  .body { padding-top: 3.6vw; }
}
