/* ====================================================================
   수업용 프리젠터 스타일시트 - 특수 기능
   - 블록 확대(Focus), 게이트 화면, QR 패널, 댓글 시스템, 라이트박스
   ==================================================================== */

/* ---------- 블록 전체화면 기능 ---------- */

.block-fullscreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1100;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

/* Guide gallery */
.guide-gallery {
  min-height: 100vh;
  background: linear-gradient(180deg, #f7f9fc 0, #ffffff 260px);
  color: var(--text);
  font-family: var(--font-sans);
}

.guide-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 420px);
  gap: 1.25rem;
  align-items: start;
}

.guide-hero__back {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  background: #fff;
  text-decoration: none;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.guide-hero__eyebrow {
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 0.4rem;
}

.guide-hero h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.08;
  letter-spacing: 0;
  font-family: var(--font-sans);
}

.guide-hero p {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.65;
}

.guide-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.guide-hero__stat {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.guide-hero__stat strong,
.guide-hero__stat span {
  display: block;
}

.guide-hero__stat strong {
  font-size: 1.45rem;
  color: var(--brand);
  line-height: 1;
}

.guide-hero__stat span {
  margin-top: 0.45rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 800;
}

.guide-level-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  background: rgba(247, 249, 252, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.guide-level-tabs a {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--brand-ink);
  background: #fff;
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 900;
}

.guide-gallery__main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.guide-section {
  scroll-margin-top: 84px;
  margin-top: 2rem;
}

.guide-section__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.guide-section__index {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 900;
}

.guide-section h2 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: 0;
  font-family: var(--font-sans);
}

.guide-section p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.guide-card-list {
  display: grid;
  gap: 1rem;
}

.guide-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.guide-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 1rem;
}

.guide-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 0.32rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.guide-card--object .guide-card__badge {
  background: #eaf5ee;
  color: #16402a;
}

.guide-card--text .guide-card__badge {
  background: #fff1d6;
  color: #6c4600;
}

.guide-card h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.guide-card__head p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: var(--text-sm);
}

.guide-card__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 1rem;
  align-items: stretch;
}

.guide-preview,
.guide-code {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}

.guide-panel-title {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0;
}

.guide-preview > .guide-panel-title {
  padding: 0.75rem 0.85rem 0;
}

.guide-preview__stage {
  padding: 0.25rem 0.85rem 0.85rem;
  font-family: var(--font-serif);
}

.guide-preview__stage .block {
  margin: 0.75rem 0;
}

.guide-preview__stage .section-sub-heading {
  margin-top: 0.75rem;
}

.section-sub-heading {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-sub-heading::before {
  bottom: 0.15rem;
}

.guide-preview__stage .focus-btn {
  display: none;
}

.guide-preview__error {
  color: #a32020;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.guide-code {
  background: #111418;
  color: #f7f9fc;
}

.guide-code__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.guide-code .guide-panel-title {
  color: #cfd6e2;
}

.guide-copy {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0.42rem 0.6rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.guide-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.guide-code pre {
  margin: 0;
  padding: 0.9rem;
  overflow: auto;
  max-height: 340px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.guide-code code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.guide-card__notes {
  margin: 0.9rem 0 0;
  padding: 0.85rem 1rem 0.85rem 2rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.guide-card__notes li + li {
  margin-top: 0.25rem;
}

@media (max-width: 960px) {
  .guide-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .guide-hero__stats {
    grid-column: 1 / -1;
  }

  .guide-card__body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .guide-hero {
    padding: 1rem 1rem 0.75rem;
    gap: 0.75rem;
  }

  .guide-hero h1 {
    font-size: 2rem;
  }

  .guide-hero__stats {
    grid-template-columns: 1fr;
  }

  .guide-level-tabs {
    padding: 0.55rem 1rem;
    overflow-x: auto;
  }

  .guide-level-tabs a {
    flex: 0 0 auto;
  }

  .guide-gallery__main {
    padding: 1rem 1rem 3rem;
  }

  .guide-section__head,
  .guide-card__head {
    grid-template-columns: 1fr;
  }
}

.block-fullscreen.is-open {
  opacity: 1;
}

/* 블록 전체화면 무대 영역 */
.block-fullscreen__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: hidden;
  overflow-x: hidden;
  padding: 4rem 4.5rem;
  scrollbar-gutter: stable;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.16s ease-out, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.block-fullscreen__stage.is-scrollable {
  align-items: flex-start;
  overflow-y: auto;
}

.block-fullscreen__stage.is-section-leaving-next {
  opacity: 0;
  transform: translateX(-2.4rem);
}

.block-fullscreen__stage.is-section-leaving-prev {
  opacity: 0;
  transform: translateX(2.4rem);
}

.block-fullscreen__stage.is-section-entering-next {
  opacity: 0;
  transform: translateX(2.4rem);
}

.block-fullscreen__stage.is-section-entering-prev {
  opacity: 0;
  transform: translateX(-2.4rem);
}

.block-fullscreen__close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 1101;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-md);
}

.block-fullscreen__close:hover {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* 이전/다음 블록 화살표 버튼 */
.block-fullscreen__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 7rem;
  padding: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 1101;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.block-fullscreen__nav--prev {
  left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: none;
}

.block-fullscreen__nav--next {
  right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
}

.block-fullscreen__nav:not(:disabled):hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.block-fullscreen__nav:disabled {
  opacity: 0.18;
  cursor: not-allowed;
}

/* 원본 가로폭은 유지하고, 너무 넓을 때만 JS에서 축소 */
.block--fullscreen {
  flex-shrink: 0;
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .block-fullscreen__stage {
    transition: none;
  }
}

/* ---------- 전체화면 버튼 (⛶) ---------- */

/* 전체화면 버튼의 absolute 기준점 */
.block--focusable {
  position: relative;
}

/* ⛶ 버튼 — 평소엔 투명, 블록 hover 시 페이드인 */
.focus-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, transform 0.05s;
  z-index: 2;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.block--focusable:hover>.focus-btn,
.focus-btn:focus-visible {
  opacity: 1;
}

.focus-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.focus-btn:active {
  transform: translateY(1px);
}

/* heading/divider/paragraph 같은 얕은 블록에서도 버튼이 잘 보이도록 */
.block.paragraph>.focus-btn,
.block.section-sub-heading>.focus-btn {
  top: -0.5rem;
  right: -0.5rem;
}

/* ---------- 오버레이 ---------- */
.focus-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 32, 0.78);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 4vw;
  opacity: 0;
  transition: opacity 0.18s ease-out;
  overflow-y: auto;
}

.focus-overlay.is-open {
  opacity: 1;
}

/* 스테이지: 복제된 블록이 들어가는 중앙 영역 */
.focus-overlay__stage {
  position: relative;
  max-width: 1400px;
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.focus-overlay.is-open .focus-overlay__stage {
  transform: scale(1);
}

/* 우상단 닫기 버튼 */
.focus-overlay__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.focus-overlay__close:hover {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* 포커스된 블록: 원본보다 키움 */
.block--focused {
  margin: 0 !important;
  /* 블록 간격은 스테이지가 담당 */
  font-size: 1.15em;
  /* 본문 키움 */
}

.block--focused.section-sub-heading {
  font-size: 1.9rem;
}

.block--focused.paragraph {
  font-size: 1.4rem;
  line-height: 1.85;
}

.block--focused.callout {
  padding: 2rem 2.5rem;
  font-size: 1.15rem;
}

.block--focused .callout__label {
  font-size: 1.3rem;
}

.block--focused .question {
  font-size: 1.5rem;
}

.block--focused .question__prompt {
  font-size: 1.5rem;
}

.block--focused .concept__title {
  font-size: 1.5rem;
}

.block--focused .concept__body,
.block--focused .concept__bullets {
  font-size: 1.15rem;
}

.block--focused .case__text {
  font-size: 1.3rem;
}

.inline-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45em;
  margin: 0 0.08em;
  padding: 0;
  border: 0;
  border-bottom: 2px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  vertical-align: -0.08em;
  cursor: pointer;
}

.inline-blank span {
  color: transparent;
}

.inline-blank:hover,
.inline-blank:focus-visible {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  outline: none;
}

.inline-blank.is-revealed {
  border-bottom-color: color-mix(in srgb, currentColor 35%, transparent);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  font-weight: 800;
}

.inline-blank.is-revealed span {
  color: inherit;
}

.case > .answer,
.concept > .answer {
  font-size: var(--text-xl);
}

.material--link-embed {
  display: grid;
  gap: var(--space-3);
}

.material--link-embed .material-link-card__embed {
  position: relative;
  min-height: 280px;
  height: clamp(280px, 52vw, 560px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.material--link-embed .material-link-card__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.material--link-embed .material-link-card__fallback {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  display: none;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.material--link-embed.is-embed-fallback .material-link-card__fallback {
  display: block;
}

.material--link-embed .material-link-card__anchor {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.material--link-embed .material-link-card__footer {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.material--link-embed .material-link-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 var(--space-3);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 900;
  white-space: nowrap;
}

.material--link-embed .material-link-card__caption {
  display: block;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: var(--leading-snug);
}

.material--link-embed .material-link-card__anchor:hover .material-link-card__action,
.material--link-embed .material-link-card__anchor:focus-visible .material-link-card__action {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

@media (max-width: 700px) {
  .material--link-embed {
    gap: 0;
  }

  .material--link-embed .material-link-card__embed {
    display: none;
  }

  .material--link-embed .material-link-card__anchor {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .material--link-embed .material-link-card__footer {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .material--link-embed .material-link-card__thumb {
    display: none;
  }

  .material--link-embed .material-link-card__action {
    width: 100%;
  }
}

.block--focused .summary ol {
  font-size: 1.4rem;
}

.block--focused .figure-row__quote {
  font-size: 1.4rem;
}

/* 포커스된 text-cutout도 확대 */
.block--focused .text-cutout__headline {
  font-size: 1.5rem;
}

.block--focused .text-cutout__body {
  font-size: 1.1rem;
  line-height: 1.85;
}

/* body에 is-focus-locked: 배경 스크롤 잠금 */
body.is-focus-locked {
  overflow: hidden;
}

/* 모바일/좁은 화면 대응 */
@media (max-width: 900px) {
  .block-fullscreen__stage,
  .focus-overlay__stage {
    padding: 2rem 1.5rem;
  }

  .block--focused.paragraph {
    font-size: 1.15rem;
  }

  .block--focused .question {
    font-size: 1.2rem;
  }
}

/* ====================================================================
   수업 코드 게이트 화면
   ==================================================================== */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  padding: 2rem;
}

.gate__box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.gate__logo {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.gate__title {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.gate__subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.gate__form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

.gate__section-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-top: 0.25rem;
}

.gate__section-label--secondary {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.gate__input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gate__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27, 107, 255, 0.12);
}

.gate__input--secondary {
  border-color: var(--border);
}

.gate__btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  margin-top: 0.25rem;
}

.gate__btn:hover:not(:disabled) {
  background: var(--brand-deep);
}

.gate__btn:active:not(:disabled) {
  transform: translateY(1px);
}

.gate__btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.gate__btn--secondary {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}

.gate__btn--secondary:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.gate__error {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--accent);
  min-height: 1.2em;
}

.gate__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 0.25rem;
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

.gate__divider::before,
.gate__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ====================================================================
   세션 배지 (수업 진입 후)
   ==================================================================== */
.teacher-badge,
.student-badge {
  position: fixed;
  top: 0.75rem;
  right: 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  z-index: 500;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.teacher-badge {
  background: var(--accent);
  color: #fff;
}

.student-badge {
  background: var(--brand);
  color: #fff;
}

/* ====================================================================
   사이드바 QR 버튼
   ==================================================================== */
.sidebar__qr-btn {
  display: block;
  width: 100%;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar__qr-btn:hover {
  background: var(--brand);
  color: #fff;
}

/* ====================================================================
   QR 패널 (교사용 — 우측 슬라이드인)
   ==================================================================== */
.qr-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 320px;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(17, 20, 24, 0.1);
  z-index: 400;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.qr-panel.is-open {
  transform: translateX(0);
}

.qr-panel__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.qr-panel__header {
  text-align: center;
}

.qr-panel__code-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.qr-panel__code {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.01em;
}

.qr-panel__qr {
  background: #fff;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.qr-panel__qr-img {
  width: 200px;
  height: 200px;
  display: block;
}

.qr-panel__url {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--text-faint);
  word-break: break-all;
  text-align: center;
  line-height: 1.5;
  padding: 0 0.5rem;
}

.qr-panel__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.qr-panel__btn {
  width: 100%;
  padding: 0.7rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s;
  background: var(--brand);
  color: #fff;
  border: none;
}

.qr-panel__btn:hover {
  background: var(--brand-deep);
}

.qr-panel__btn:active {
  transform: translateY(1px);
}

.qr-panel__btn--close {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.qr-panel__btn--close:hover {
  background: var(--bg-soft);
}

/* ====================================================================
   댓글 시스템
   ==================================================================== */
.comment-section {
  margin-top: 1.5rem;
}

.comment-section__toggle {
  width: 100%;
  padding: 0.8rem 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  outline: none !important;
}

.comment-section__toggle:focus {
  box-shadow: 0 0 0 3px rgba(27, 107, 255, 0.15);
}

.comment-section__toggle:hover {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand);
}

.comment-section__body {
  display: none;
  padding: 1rem 0;
}

.comment-section.is-open .comment-section__body {
  display: block;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.comment-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  border-left: 4px solid var(--brand);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-item__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.comment-item__name {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
}

.comment-item__time {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.comment-item__text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

.comment-form {
  background: var(--bg-soft);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.comment-form__name,
.comment-form__text {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
  outline: none !important;
}

.comment-form__name:focus,
.comment-form__text:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27, 107, 255, 0.15);
}

.comment-form__text {
  min-height: 80px;
  resize: vertical;
}

.comment-form__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-form__submit {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.comment-form__submit:hover {
  background: var(--brand-deep);
  transform: translateY(-1px);
}

.comment-form__submit:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.comment-item__delete {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0.2rem;
  margin-left: 0.5rem;
  font-size: 0.75rem;
}

.comment-item__delete:hover {
  color: var(--accent);
}

/* ====================================================================
   이미지 라이트박스 (전체화면 보기)
   ==================================================================== */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 32, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 4vw;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.image-lightbox.is-open {
  opacity: 1;
}

.image-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.image-lightbox.is-open .image-lightbox__img {
  transform: scale(1);
}

.image-lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  padding: 0;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.image-lightbox__close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

/* ====================================================================
   BOOONG design-system alignment layer
   ==================================================================== */

.block-fullscreen {
  background: var(--bg);
  transition: opacity var(--duration-fast) ease-out;
}

.block-fullscreen__close,
.focus-overlay__close,
.image-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-sans);
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), transform 0.1s;
}

.block-fullscreen__close,
.focus-overlay__close {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  box-shadow: var(--shadow-md);
}

.block-fullscreen__close:hover,
.focus-overlay__close:hover {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.block-fullscreen__nav {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-muted);
  font-family: var(--font-sans);
  box-shadow: var(--shadow-sm);
}

.block-fullscreen__nav:not(:disabled):hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.focus-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.focus-btn:hover,
.focus-btn:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  outline: none;
}

.focus-overlay {
  background: rgba(12, 18, 32, 0.82);
  transition: opacity var(--duration-fast) ease-out;
}

.focus-overlay__stage {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.22s var(--ease-out-smooth);
}

.gate {
  background: var(--bg-soft);
  font-family: var(--font-sans);
}

.gate__box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.gate__logo {
  color: var(--brand);
  font-family: var(--font-display);
}

.gate__title {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gate__subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.gate__section-label {
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.gate__input,
.comment-form__name,
.comment-form__text {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-family: var(--font-sans);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.gate__input:focus,
.comment-form__name:focus,
.comment-form__text:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-focus-ring);
  outline: none;
}

.gate__btn,
.comment-form__submit,
.qr-panel__btn {
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 800;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), transform 0.05s;
}

.gate__btn:hover:not(:disabled),
.comment-form__submit:hover:not(:disabled),
.qr-panel__btn:hover {
  background: var(--brand-deep);
}

.gate__btn:active:not(:disabled),
.comment-form__submit:active:not(:disabled),
.qr-panel__btn:active {
  transform: translateY(1px);
}

.gate__btn--secondary,
.qr-panel__btn--close {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
}

.gate__btn--secondary:hover:not(:disabled),
.qr-panel__btn--close:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.teacher-badge,
.student-badge {
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-md);
}

.teacher-badge {
  background: var(--accent);
  color: #fff;
}

.student-badge {
  background: var(--brand);
  color: #fff;
}

.sidebar__qr-btn {
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 800;
}

.sidebar__qr-btn:hover {
  background: var(--brand);
  color: #fff;
}

.qr-panel {
  border-left: 1px solid var(--border);
  background: #fff;
  box-shadow: -4px 0 24px rgba(17, 20, 24, 0.1);
  font-family: var(--font-sans);
  transition: transform var(--duration-base) var(--ease-out-smooth);
}

.qr-panel__code-label,
.comment-section__toggle {
  font-family: var(--font-sans);
}

.qr-panel__code {
  color: var(--brand);
  font-weight: 800;
}

.qr-panel__qr {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.comment-section__toggle {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-weight: 800;
}

.comment-section__toggle:hover,
.comment-section__toggle:focus {
  border-color: var(--brand);
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-focus-ring);
}

.comment-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.comment-item__name {
  color: var(--text);
  font-weight: 800;
}

.comment-item__time,
.comment-item__delete {
  color: var(--text-faint);
}

.comment-item__text {
  color: var(--text);
  font-family: var(--font-serif);
  line-height: var(--leading-normal);
}

.comment-form {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

.comment-form__counter,
.comment-empty,
.comment-loading {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.image-lightbox {
  background: rgba(12, 18, 32, 0.85);
}

.image-lightbox__img {
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: transform var(--duration-base) var(--ease-out-smooth);
}

.image-lightbox__close {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}
