@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

/* =========================================================
   GlobalHot – home.css
   라이트 레지스트리 스킨. 홈 + 상세 + 정보 페이지에 함께 씀.
   avdbs식 밀도 있는 목록 — 작은 썸네일, 등록번호 스탬프, 조밀한 행.
   ========================================================= */

body {
  --page: #f6f4ef;
  --h-card: #ffffff;
  --h-card-hover: #fbfaf7;
  --h-line: #e1ddd4;
  --h-line-soft: #eae7df;
  --h-ink: #232a33;
  --h-muted: #5b6472;
  --h-faint: #69707b;
  --h-stamp: #c9422c;
  --h-stamp-deep: #8a2d1d;
  --h-verm: #c9422c;
  --h-verm-soft: #8a2d1d;
  --h-rule: #d8d2c6;
  --font-sans: 'Noto Sans KR', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Bebas Neue', var(--font-sans);
  background: var(--page);
  color: var(--h-ink);
  font-family: var(--font-sans);
}

/* ── 01 토큰 매핑 (portal.css 키 재정의) ── */
body {
  --base: var(--page);
  --panel: var(--h-card);
  --surface: var(--h-card);
  --ink: var(--h-ink);
  --muted: var(--h-muted);
  --quiet: var(--h-faint);
  --line: var(--h-line-soft);
  --coral: var(--h-verm);
  --coral-soft: var(--h-verm-soft);
  --focus: var(--h-verm);
  --shadow: 0 18px 40px rgba(35, 42, 51, .12);
}

a { text-decoration-thickness: .08em; text-underline-offset: .18em; }
::selection { background: rgba(201, 66, 44, .18); color: var(--h-ink); }
:focus-visible { outline: 2px solid var(--h-verm); outline-offset: 2px; }

/* ── 02 헤더 ── */
.site-header {
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--h-rule);
  backdrop-filter: blur(10px);
}
.header-inner { min-height: 62px; gap: 18px; }
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: .12em;
  color: var(--h-ink);
}
.brand span { color: var(--h-verm); }
.brand + .brand-sub {
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .34em;
  color: var(--h-faint);
  border-left: 1px solid var(--h-rule);
  padding-left: 10px;
}
.primary-nav { gap: 18px; font-size: .78rem; }
.primary-nav a { color: var(--h-muted); font-weight: 700; }
.primary-nav a:hover { color: var(--h-ink); }

/* ── 03 레지스트리 마스트헤드 ── */
.registry-mast {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--h-rule);
  background: #14171d;
  min-height: clamp(400px, 62vh, 560px);
  display: flex;
  align-items: stretch;
}
.registry-media { position: absolute; inset: 0; z-index: 0; }
.registry-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.registry-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13, 15, 19, .38), rgba(13, 15, 19, .78));
}
.registry-mast-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 18px;
  padding: 40px 24px 34px;
}
.registry-badge {
  position: absolute;
  top: 22px; left: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  height: 88px;
  padding: 0 16px;
  border: 1px solid rgba(255, 165, 140, .55);
  color: #ffc4b3;
  background: rgba(13, 15, 19, .28);
}
.registry-mast .registry-badge-no { border-top-color: rgba(255, 165, 140, .45); }
.registry-copy { max-width: 640px; }
.registry-mast .registry-kicker { color: #ffb7a8; margin-bottom: 12px; }
.registry-mast .registry-title { color: #fff; }
.registry-mast .registry-title em { color: #ff8a73; }
.registry-title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  line-height: 1.22;
  letter-spacing: -.02em;
}
.registry-title em { color: var(--h-verm); }
.registry-rule { width: 72px; height: 3px; background: #ff8a73; }
.registry-mast .registry-rule { margin: 20px 0 16px; }
.registry-mast .registry-lead { color: #d8d2ca; max-width: 60ch; margin: 0; font-size: .9rem; line-height: 1.8; }
.registry-meta {
  display: flex; flex-wrap: wrap; gap: 26px;
  margin: 8px 0 0;
}
.registry-meta > div { display: flex; flex-direction: column; gap: 3px; }
.registry-meta dt {
  font-family: var(--font-display);
  font-size: .64rem; letter-spacing: .24em;
  color: rgba(255, 255, 255, .55);
}
.registry-meta dd { margin: 0; font-size: .9rem; font-weight: 900; letter-spacing: .04em; color: #fff; }
.registry-badge-top {
  font-family: var(--font-display);
  font-size: .82rem; letter-spacing: .22em;
}
.registry-badge-no {
  font-family: var(--font-display);
  font-size: .86rem; letter-spacing: .06em;
  border-top: 1px solid rgba(201, 66, 44, .5);
  padding-top: 4px;
}
.registry-copy { min-width: 0; }
.registry-kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: .7rem; letter-spacing: .3em;
}
.registry-lead { margin: 0; max-width: 56ch; color: var(--h-muted); font-size: .9rem; line-height: 1.8; }

/* ── 04 섹션 / 발견 바 ── */
.registry-main .feed-section { padding: 34px 0 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-weight: 900; font-size: 1.5rem; color: var(--h-ink); }
.eyebrow { margin: 0 0 6px; font-family: var(--font-display); font-size: .68rem; letter-spacing: .3em; color: var(--h-verm); }
.section-heading > p { margin: 0 0 2px; color: var(--h-faint); font-size: .8rem; }

.discovery-bar {
  background: var(--h-card);
  border: 1px solid var(--h-rule);
  border-left: 3px solid var(--h-verm);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(35, 42, 51, .04);
  color: var(--h-ink);
}
.controls-wrap {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  gap: 14px 18px;
  align-items: end;
  padding: 16px 18px 14px;
}
.controls-wrap > .search-form { grid-column: 1; grid-row: 1; }
.controls-wrap > .sort-control { grid-column: 2; grid-row: 1; }
.controls-wrap > .filter-group { grid-row: 2; }
.controls-wrap > .filter-category { grid-column: 1; }
.controls-wrap > .filter-country { grid-column: 2; justify-self: start; }
.search-form label, .sort-control label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-display); font-size: .64rem;
  letter-spacing: .22em; color: var(--h-faint);
}
.search-form input, .sort-control select {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--page); border: 1px solid var(--h-rule);
  color: var(--h-ink); font-size: .84rem; font-weight: 500;
  border-radius: 4px;
}
.search-form input::placeholder { color: var(--h-faint); }
.search-form input:focus, .sort-control select:focus {
  border-color: var(--h-verm);
  box-shadow: 0 0 0 3px rgba(201, 66, 44, .12);
  outline: none;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-button {
  min-height: 40px; padding: 0 13px;
  background: transparent; border: 1px solid var(--h-rule);
  color: var(--h-muted); font-size: .76rem; font-weight: 700;
  border-radius: 4px; cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.filter-button:hover { color: var(--h-ink); border-color: var(--h-faint); }
.filter-button.is-active {
  background: var(--h-verm); border-color: var(--h-verm); color: #fff;
}
.sort-control select {
  min-width: 130px; width: auto; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a92a0'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; cursor: pointer;
}
.results-count { grid-column: 1 / -1; margin: 2px 0 0; color: var(--h-faint); font-size: .76rem; font-weight: 700; letter-spacing: .04em; }

/* ── 05 레지스트리 행 그리드 : 폴더 카드 한 장씩 ── */
.model-grid.board-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  counter-reset: reg;
}
.model-card {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 0 18px;
  min-width: 0;
  padding: 14px 18px 10px;
  background: var(--h-card);
  border: 1px solid var(--h-rule);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(35, 42, 51, .04);
  counter-increment: reg;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.model-card:hover {
  border-color: #c8c1b2;
  box-shadow: 0 8px 22px rgba(35, 42, 51, .08);
  transform: translateY(-1px);
}
.model-card::before {
  content: "№" counter(reg, decimal-leading-zero);
  position: absolute; top: 10px; right: 13px;
  color: var(--h-verm);
  font-family: var(--font-display);
  font-size: .76rem;
  letter-spacing: .1em;
  line-height: 1;
}
.portrait {
  grid-column: 1;
  grid-row: 1;
  width: 160px;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  isolation: isolate;
  background: #eae6dc;
  display: block;
  align-self: center;
}
.portrait::after { display: none; }
.portrait img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 20%;
  display: block;
}
.portrait[data-monogram] {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem; letter-spacing: .08em;
  color: rgba(35, 42, 51, .55);
}
.card-body {
  display: flex; flex-direction: column; gap: 4px;
  grid-column: 2; grid-row: 1;
  padding: 0; min-width: 0;
}
.category-label {
  margin: 0;
  font-family: var(--font-display); font-size: .6rem;
  letter-spacing: .24em; color: var(--h-verm);
  padding-right: 46px;
}
.model-card h3 {
  margin: 0;
  font-weight: 900;
  font-size: 1.06rem; line-height: 1.3;
  color: var(--h-ink);
  overflow-wrap: anywhere;
  padding-right: 46px;
}
.model-card h3 small { display: block; margin-top: 2px; font-size: .7rem; font-weight: 500; color: var(--h-faint); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 2px; }
.tag-list span {
  padding: 2px 8px; border: 1px solid var(--h-rule); border-radius: 999px;
  background: var(--page); color: var(--h-muted); font-size: .66rem; font-weight: 500;
}
.source-links {
  display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0;
}
/* 채널 링크는 밑줄 텍스트 나열 대신 태그와 같은 알약 칩으로 — 카드가 한결 정돈된다. */
.source-links a {
  padding: 2px 8px; border: 1px solid var(--h-rule); border-radius: 999px;
  background: var(--page); color: var(--h-faint);
  font-size: .62rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  text-decoration: none;
}
.source-links a:hover { color: var(--h-verm); border-color: var(--h-verm); }
.card-detail-link {
  display: inline-block; margin: 3px 0 0;
  color: var(--h-verm); font-size: .76rem; font-weight: 800;
}
.card-detail-link:hover { color: var(--h-stamp-deep); }
.card-footer {
  margin-top: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0 0;
  border-top: 1px solid var(--h-line-soft);
}
.recommend-wrap { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.recommend-count { font-family: var(--font-display); font-size: .78rem; letter-spacing: .08em; color: var(--h-verm); }
.recommend-button {
  min-height: 28px; padding: 0 12px;
  border: 1px solid var(--h-verm); border-radius: 4px;
  background: transparent; color: var(--h-verm);
  font-size: .7rem; font-weight: 800; cursor: pointer;
  transition: background .16s, color .16s;
}
.recommend-button:hover { background: var(--h-verm); color: #fff; }
.recommend-button:disabled { opacity: .5; cursor: default; }

/* ── 06 빈 상태 / 로딩 / 페이지네이션 ── */
.board-loading { grid-column: 1 / -1; text-align: center; color: var(--h-faint); padding: 40px 0; font-size: .82rem; }
.pagination { margin-top: 26px; display: flex; justify-content: center; }
.pagination-control { display: inline-flex; align-items: center; gap: 4px; }
.pagination-button, .pagination-page, .pagination-arrow {
  min-width: 38px; height: 38px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--h-rule); border-radius: 4px;
  background: var(--h-card); color: var(--h-muted);
  font-size: .8rem; font-weight: 800; font-family: var(--font-sans);
  cursor: pointer; user-select: none;
  transition: border-color .16s, color .16s, background .16s;
}
.pagination-arrow { font-size: 1rem; }
.pagination-button:hover:not(:disabled),
.pagination-page:hover:not(:disabled),
.pagination-arrow:hover:not(:disabled) {
  border-color: var(--h-verm); color: var(--h-verm);
}
.pagination-page.is-active {
  background: var(--h-verm); border-color: var(--h-verm); color: #fff;
}
.pagination-page.is-active:hover { color: #fff; }
.pagination-button:disabled, .pagination-arrow:disabled {
  opacity: .35; cursor: default; pointer-events: none;
}
.empty-state { grid-column: 1 / -1; text-align: center; padding: 42px 20px; color: var(--h-muted); border: 1px solid var(--h-rule); border-radius: 6px; background: var(--h-card); }
.empty-state strong { color: var(--h-ink); font-weight: 900; }
.empty-state p { margin: 8px 0 14px; }
.text-button { background: none; border: none; color: var(--h-verm); font-weight: 800; cursor: pointer; text-decoration: underline; }

/* ── 07 모달 ── */
.modal-card {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  background: var(--h-card);
  border: 1px solid var(--h-rule);
  border-top: 3px solid var(--h-verm);
  border-radius: 8px;
}
.modal-image {
  border-radius: 8px 0 0 8px;
  background: #eae6dc;
}
.modal-image:before {
  color: rgba(35, 42, 51, .18);
  font-family: var(--font-display);
  letter-spacing: -.06em;
}
.modal-title { color: var(--h-ink); font-weight: 900; font-family: var(--font-sans); }
.modal-category { color: var(--h-verm); }
.modal-summary { color: var(--h-muted); line-height: 1.7; }
.modal-stats dt { color: var(--h-faint); }
.modal-stats dd { color: var(--h-ink); }
.modal-close { color: var(--h-ink); border-color: var(--h-rule); background: var(--h-card); }
.modal-close:hover { background: var(--h-verm); color: #fff; border-color: var(--h-verm); }
.profile-actions a { color: var(--h-muted); border-color: var(--h-rule); }
.profile-actions a:hover { color: var(--h-verm); border-color: var(--h-verm); }
.profile-actions a:after { color: var(--h-verm); }

/* ── 08 푸터 ── */
.site-footer { background: #efede7; border-top: 1px solid var(--h-rule); color: var(--h-muted); }
.footer-grid nav a { color: var(--h-muted); }
.footer-grid nav a:hover { color: var(--h-ink); }
.rights-note { margin: 10px 0 0; color: var(--h-faint); }
.footer-copy, .copyright { color: var(--h-faint); }
.support-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 9px 16px;
  border: 1px solid rgba(201, 66, 44, .55); border-radius: 4px;
  background: rgba(201, 66, 44, .06); color: var(--h-verm);
  font-size: .76rem; font-weight: 800; letter-spacing: .04em;
  text-decoration: none; transition: background .16s, color .16s;
}
.support-cta:hover { background: var(--h-verm); color: #fff; }
.support-cta .support-icon { font-size: .9rem; line-height: 1; }

/* ── 09 모바일 하단 바 ── */
.mobile-nav { background: rgba(255, 255, 255, .97); border-top: 1px solid var(--h-rule); }
.mobile-nav-item { color: var(--h-faint); border-top-color: transparent; }
.mobile-nav-item svg { display: block; }
.mobile-nav-item.is-active { color: var(--h-verm); border-top-color: var(--h-verm); }

/* ── 10 광고 영역 ── */
.home-ad-band {
  padding: 28px 0 24px;
  background: transparent;
  border: 0;
  display: flex;
  justify-content: center;
}
/* 광고가 끝내 들어오지 않은 밴드는 하얀 공백으로 남기지 않고 접는다 (ads.js). */
.ad-zone-band[data-ad-collapsed="1"] { display: none; }
.ad-zone-band .shell { display: flex; justify-content: center; }
.ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 300px;
  max-width: 100%;
  min-height: 250px;
  color: var(--h-faint);
}
/* JuicyAds 로더(jads2.js)가 ins를 0x0 인라인 스타일로 축소하므로,
   !important로 300x250 자리를 확보해 광고가 렌더링되기 전후 레이아웃
   시프트와 인접 섹션과의 겹침을 막는다. */
.ad-slot .adsbyjuicy {
  display: block;
  width: 300px !important;
  height: 250px !important;
  max-width: 100%;
  line-height: 0;
}
.ad-slot .adsbyjuicy iframe { display: block; max-width: 100%; border: 0; }
.ad-spot-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .3em;
  color: var(--h-faint);
  text-transform: uppercase;
}
/* 점선 프레임은 광고가 비었을(폴백) 때만 보이도록 폴백 박스로 옮긴다. */
.ad-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 300px;
  height: 250px;
  padding: 20px 16px;
  border: 1px dashed var(--h-rule);
  border-radius: 6px;
  background: var(--h-card);
  text-align: center;
  box-sizing: border-box;
}
.ad-fallback-label {
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .24em;
  color: var(--h-verm);
  text-transform: uppercase;
}
.ad-fallback p { margin: 0; font-size: .78rem; line-height: 1.6; color: var(--h-faint); }

/* 홈 광고: 데스크톱 리더보드(728x90) + 모바일 배너(300x50) 한 쌍.
   display:none 슬롯은 IntersectionObserver에 교차하지 않아 로드되지 않는다(불필요한
   광고 요청 없음). 모델/갤러리 슬롯은 단일 data-width="300"이라 아래 규칙과 무관. */
.home-ad-band .ad-slot--mobile { display: none; }
.home-ad-band .ad-slot--desktop[data-width="728"] {
  width: 728px;
  max-width: 100%;
  min-height: 90px;
}
.home-ad-band .ad-slot--desktop[data-width="728"] .adsbyjuicy {
  width: 728px !important;
  height: 90px !important;
  max-width: 100%;
}
.home-ad-band .ad-slot--desktop[data-width="728"] .ad-fallback {
  width: 728px;
  height: 90px;
  max-width: 100%;
}
.home-ad-band .ad-slot--mobile[data-width="300"] {
  width: 300px;
  max-width: 100%;
  min-height: 50px;
}
.home-ad-band .ad-slot--mobile[data-width="300"] .adsbyjuicy {
  width: 300px !important;
  height: 50px !important;
  max-width: 100%;
}
.home-ad-band .ad-slot--mobile[data-width="300"] .ad-fallback {
  width: 300px;
  height: 50px;
  max-width: 100%;
}
/* 768px 미만에서 데스크톱 슬롯 숨기고 모바일 슬롯 노출. */
@media (max-width: 767px) {
  .home-ad-band .ad-slot--desktop { display: none; }
  .home-ad-band .ad-slot--mobile { display: flex; }
}

/* ── 11 반응형 ── */
@media (max-width: 820px) {
  .registry-badge { top: 16px; height: 72px; padding: 0 12px; }
  .registry-badge-top { font-size: .7rem; }
  .registry-badge-no { font-size: .74rem; }
  .registry-mast { min-height: clamp(300px, 52vh, 420px); }
}
@media (max-width: 980px) {
  .model-grid.board-list { gap: 14px; }
}
@media (max-width: 700px) {
  .model-grid.board-list { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 640px) {
  .pagination-control { gap: 3px; }
  .pagination-button, .pagination-page, .pagination-arrow { min-width: 34px; height: 34px; font-size: .78rem; }
  .shell { width: min(100% - 28px, 1180px); }
  .header-inner { min-height: 56px; gap: 12px; }
  .brand { font-size: 1.34rem; }
  .brand + .brand-sub { display: none; }
  .primary-nav { display: none; }
  .controls-wrap { display: flex; flex-wrap: wrap; gap: 11px; padding: 14px 0; }
  .search-form { flex: 1 1 100%; }
  .filter-group { flex: 1 1 100%; }
  .filter-button { flex: 1; min-width: 68px; min-height: 44px; padding: 0 8px; }
  .sort-control { margin-left: auto; }
  .results-count { width: 100%; }
  .registry-mast-inner { padding: 30px 24px 26px; gap: 14px; }
  .registry-title { font-size: 1.8rem; }
  .registry-meta { gap: 18px; }
  .registry-badge { top: 12px; height: 62px; }
  .model-card { grid-template-columns: 108px minmax(0, 1fr); gap: 0 13px; padding: 12px 14px 9px; }
  .portrait { width: 108px; min-height: 0; aspect-ratio: 3 / 4; }
  .model-card::before { top: 8px; right: 10px; font-size: .7rem; }
}
@media (max-width: 640px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    width: 100%;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
  }
  .modal-image {
    min-height: 0;
    max-height: 44vh;
    aspect-ratio: 1 / 1;
    border-radius: 12px 12px 0 0;
  }
  .modal-copy { padding: 20px 20px calc(22px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .registry-video { display: none; }
  .registry-mast { background: linear-gradient(180deg, #1c1f26, #14171d); }
  .registry-overlay { background: linear-gradient(180deg, rgba(13, 15, 19, .35), rgba(13, 15, 19, .7)); }
}