/*
  역할: Blazor catalog 앱의 전역 레이아웃, intro overlay, 카드 목록, 상세 화면 반응형 스타일을 정의한다.
  Microsoft Learn 참고:
  - Blazor components: https://learn.microsoft.com/aspnet/core/blazor/?view=aspnetcore-10.0#components
*/

:root {
  color: #1c2430;
  background: #f3f5f8;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, #f8f9fb 0%, #eef2f5 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

img,
video {
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
  padding: 40px 24px 56px;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 32px 20px;
  border: 0;
  background: rgba(8, 11, 17, 0.78);
  cursor: pointer;
}

/* 소개 이미지는 팝업임을 알 수 있도록 화면을 꽉 채우지 않고, 나머지 영역은 어둡게 남긴다. */
.intro-image {
  width: min(92vw, 980px);
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.intro-video {
  width: min(92vw, 980px);
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #05070b;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  cursor: default;
}

.app-header,
.catalog-container,
.catalog-surface {
  width: min(1120px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.app-header {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #5f6f82;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header h1 {
  margin: 0;
  color: #151b24;
  font-size: clamp(2rem, 5vw, 3.3rem);
  font-weight: 750;
  line-height: 1.05;
}

.catalog-summary {
  max-width: 56rem;
  margin: 14px 0 0;
  color: #526173;
  font-size: 0.98rem;
}

.catalog-container,
.catalog-surface {
  padding: 24px;
  border: 1px solid #dbe1e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(34, 44, 58, 0.08);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e6ebf0;
}

.breadcrumb-button {
  min-height: 34px;
  max-width: 100%;
  padding: 7px 13px;
  overflow-wrap: anywhere;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #f7f9fb;
  color: #263445;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.breadcrumb-button:hover:not(:disabled),
.breadcrumb-button:focus-visible:not(:disabled) {
  border-color: #6688ad;
  background: #eef4fb;
  color: #17395d;
}

.breadcrumb-button:focus-visible,
.catalog-card:focus-visible {
  outline: 3px solid rgba(48, 111, 178, 0.28);
  outline-offset: 2px;
}

.breadcrumb-button:disabled {
  border-color: #dfe5eb;
  background: #eceff3;
  color: #667486;
  cursor: default;
}

.catalog-section {
  display: grid;
  gap: 18px;
}

.catalog-section h2,
.candidate-video-section h3 {
  margin: 0;
  color: #171f2a;
  font-weight: 720;
  line-height: 1.2;
}

.catalog-section h2 {
  font-size: 1.35rem;
}

.candidate-video-section h3 {
  font-size: 1.08rem;
}

.card-grid,
.catalog-grid,
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.style-list,
.style-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.character-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-card,
.style-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 132px;
  padding: 16px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #fbfcfd;
  color: #1d2734;
  cursor: pointer;
  text-align: left;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.catalog-card:hover,
.catalog-card:focus-visible {
  border-color: #7994b2;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(30, 48, 70, 0.1);
  transform: translateY(-1px);
}

.unit-card,
.character-card {
  grid-template-rows: 1fr auto auto;
}

.unit-card {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: center;
}

.unit-card-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.unit-emblem {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  background: #eef2f6;
}

.character-card {
  grid-template-rows: auto auto auto;
}

.character-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  overflow: hidden;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  background: #eef2f6;
}

.style-card {
  grid-template-rows: auto auto 1fr;
  min-height: 285px;
}

.thumb-frame,
.style-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  background: #eef2f6;
}

.style-thumbnail {
  display: block;
  object-fit: cover;
}

.card-title {
  color: #17202b;
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-meta {
  color: #5a6878;
  font-size: 0.92rem;
}

.badge-list,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid #d6dde5;
  border-radius: 999px;
  background: #f4f7fa;
  color: #465569;
  font-size: 0.78rem;
  font-weight: 680;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.style-detail {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  align-items: start;
  column-gap: 24px;
}

.style-detail h2 {
  grid-column: 1 / -1;
}

.detail-media,
.cg-panel,
.style-hero-cg {
  min-width: 0;
}

.style-hero-cg {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  background: #eef2f6;
}

.main-video-panel,
.video-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dde4eb;
  border-radius: 8px;
  background: #f8fafc;
}

.main-video,
.video-empty,
.main-video-panel > .empty-state-message {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #111820;
}

.main-video {
  display: block;
  object-fit: contain;
}

.main-video-panel > .empty-state-message {
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px dashed #aeb9c6;
  color: #d5dde7;
  text-align: center;
}

.candidate-video-section,
.candidate-section {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dde5ec;
  border-radius: 8px;
  background: #fbfcfd;
}

.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.video-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #ffffff;
}

.video-card p {
  margin: 0;
}

.video-source {
  color: #182230;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.video-note {
  color: #536274;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.video-type,
.video-recommendations,
.video-meta {
  color: #6b5a2d;
  font-size: 0.84rem;
  font-weight: 680;
}

.empty-state,
.empty-state-message,
.error-text {
  max-width: 100%;
  margin: 0;
  padding: 18px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #f8fafc;
  color: #526173;
  overflow-wrap: anywhere;
}

.error-text {
  border-color: #edc7c0;
  background: #fff7f5;
  color: #9b3e32;
}

@media (max-width: 760px) {
  /* 모바일에서는 카드와 상세 화면을 단일 열로 접어 긴 이름과 배지가 겹치지 않게 한다. */
  .app-shell {
    padding: 22px 12px 32px;
  }

  .app-header {
    margin-bottom: 16px;
  }

  .app-header h1 {
    font-size: 2rem;
  }

  .catalog-container,
  .catalog-surface {
    padding: 16px;
  }

  .breadcrumbs {
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }

  .breadcrumb-button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.84rem;
  }

  .card-grid,
  .catalog-grid,
  .style-list,
  .style-grid,
  .video-list {
    grid-template-columns: 1fr;
  }

  .catalog-card,
  .style-card {
    min-height: 0;
    padding: 14px;
  }

  .style-detail {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .style-hero-cg {
    aspect-ratio: 16 / 10;
  }

  .main-video-panel,
  .candidate-video-section,
  .candidate-section {
    padding: 12px;
  }
}
