/**
 * ┌─────────────────────────────────────────────────────────────────────┐
 * │  FILE INDEX — 여수뉴스포털                                          │
 * ├──────────────┬──────────────────────────────────────────────────────┤
 * │  파일명      │  deal-main.css                                           │
 * │  위치        │  /deal/assets/css/deal-main.css                                        │
 * │  생성일      │  2026-05-16                                           │
 * │  수정일      │  2026-05-16                                           │
 * │  버전        │  v1.0                                                 │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  기능/역할   │  스타일시트 — 포털·컴포넌트별 규칙 적용               │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  레이아웃    │  기준 너비: 1200px (전역·포털 변수와 연동)            │
 * │  섹터 구조   │  .sector-wrap width:100% — 다열은 .sector-inner (원칙2) │
 * │  폰트 기준   │  최소 14px (--fs-base 등 변수 연동)                 │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  연관 파일   │  load-by  : header.php·포털 레이아웃 (상이)            │
 * │              │  변수 주입: echoLayoutVars()·포털 CSS (해당 시)       │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  참조 사항   │  /docs/PROJECT_RULES.md 원칙8·포털 CSS 접두 규칙       │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  변경 이력   │  2026-05-16 v1.0 - FILE INDEX 일괄 부여                     │
 * └──────────────┴──────────────────────────────────────────────────────┘
 */

:root {
  --dm-orange: #d35400;
  --dm-re:  #2563eb;
  --dm-car: #d97706;
  --dm-mkt: #059669;
  --dm-onl: #7c3aed;

  /* ── 타이포그래피 스케일 (PROJECT_RULES.md 원칙3 / layout.css --fs-* 공통 참조) ── */
  --dm-fs-xs: var(--fs-sm, 14px);   /* 12px — 배지 전용 */
  --dm-fs-sm: var(--fs-sm, 14px);   /* 14px — 메타·날짜·보조텍스트 최솟값 */
  --dm-fs-base: var(--fs-base, 16px);   /* 16px — 본문 기본 */
  --dm-fs-md: var(--fs-md, 17px);   /* 17px — 강조 본문·버튼·폼 */
  --dm-fs-lg: var(--fs-lg, 18px);   /* 18px — 카드 제목·섹션명 */
  --dm-fs-xl: var(--fs-xl, 20px);   /* 20px — 서브 헤더 */
  --dm-fs-2xl: var(--fs-2xl, 24px);   /* 24px — 페이지 제목 */
  --dm-fs-3xl: var(--fs-3xl, 28px);   /* 28px — 섹션 대제목 */
  --dm-fs-hero: var(--fs-hero, 32px);   /* 32px — 히어로 제목 */
}

/* ── 서브네비 ── */
.dm-subnav {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.dm-subnav-inner {
  width:100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 16px;
}
.dm-snav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  font-size: var(--dm-fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}
.dm-snav-item:hover,
.dm-snav-item.active {
  background: var(--dm-orange);
  color: #fff;
}

/* ── 히어로 ── */
.dm-hero {
  background: linear-gradient(135deg, #d35400 0%, #e67e22 100%);
  color: #fff;
  padding: 36px 24px;
}
.dm-hero-inner {
  width:100%;
  margin: 0 auto;
}
.dm-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
}
.dm-hero p {
  margin: 0;
  opacity: .88;
  font-size: var(--dm-fs-sm);
}

/* ── 래퍼 ── */
.dm-wrap {
  width:100%;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

/* ── 카테고리 카드 그리드 ── */
.dm-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}
.dm-cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  text-decoration: none;
  color: #1e293b;
  border: 1.5px solid #f1f5f9;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.dm-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.dm-cat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--dm-fs-xl);
  flex-shrink: 0;
  color: #fff;
}
.dm-cat-re  .dm-cat-icon { background: var(--dm-re); }
.dm-cat-car .dm-cat-icon { background: var(--dm-car); }
.dm-cat-mkt .dm-cat-icon { background: var(--dm-mkt); }
.dm-cat-onl .dm-cat-icon { background: var(--dm-onl); }

.dm-cat-re:hover  { border-color: var(--dm-re); }
.dm-cat-car:hover { border-color: var(--dm-car); }
.dm-cat-mkt:hover { border-color: var(--dm-mkt); }
.dm-cat-onl:hover { border-color: var(--dm-onl); }

.dm-cat-body { flex: 1; min-width: 0; }
.dm-cat-name { font-size: var(--dm-fs-base); font-weight: 700; margin-bottom: 3px; }
.dm-cat-desc { font-size: 14px; color: #64748b; margin-bottom: 6px; line-height: 1.4; }
.dm-cat-cnt  { font-size: var(--dm-fs-xs); font-weight: 600; color: #94a3b8; }
.dm-cat-arr  { color: #cbd5e1; font-size: var(--dm-fs-sm); flex-shrink: 0; }

/* ── 섹션 ── */
.dm-section {
  margin-bottom: 40px;
}
.dm-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f5f9;
}
.dm-sec-head h2 {
  margin: 0;
  font-size: var(--dm-fs-base);
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dm-sec-more {
  font-size: var(--dm-fs-sm);
  color: #64748b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}
.dm-sec-more:hover { color: var(--dm-orange); }

/* ── 카드 행 (3열) ── */
.dm-card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.dm-item-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #f1f5f9;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  text-decoration: none;
  color: #1e293b;
  transition: all .18s;
}
.dm-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.dm-item-thumb {
  position: relative;
  width: 100%;
  padding-top: 62%;
  background: #f1f5f9;
  overflow: hidden;
}
.dm-item-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.dm-item-card:hover .dm-item-thumb img { transform: scale(1.04); }
.dm-thumb-blank {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--dm-fs-hero);
  color: #cbd5e1;
}
.dm-sold-badge {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--dm-fs-sm);
  font-weight: 700;
  z-index: 2;
}
.dm-deal-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  z-index: 3;
}
.dm-badge-re  { background: var(--dm-re); }
.dm-badge-car { background: var(--dm-car); }
.dm-badge-mkt { background: var(--dm-mkt); }
.dm-badge-onl { background: var(--dm-onl); }

.dm-item-body {
  padding: 12px 13px 14px;
}
.dm-item-price {
  font-size: var(--dm-fs-base);
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}
.dm-item-title {
  font-size: var(--dm-fs-sm);
  color: #334155;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-item-meta {
  font-size: 14px;
  color: #94a3b8;
}

/* ── 빈 상태 ── */
.dm-empty {
  text-align: center;
  padding: 36px 24px;
  background: #f8fafc;
  border-radius: 12px;
  color: #94a3b8;
  font-size: var(--dm-fs-sm);
}
.dm-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

/* ── 반응형 ── */
@media (max-width: 860px) {
  .dm-cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dm-card-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .dm-cat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .dm-cat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px;
  }
  .dm-cat-arr { display: none; }
  .dm-card-row {
    grid-template-columns: 1fr;
  }
  .dm-hero h1 { font-size: var(--dm-fs-xl); }
}

/* ── Mobile-First 보정 (원칙: 최소 14px · 모바일 우선 · 터치 44px) ── */
@media (max-width: 768px) {
  /* 2열 그리드 → 1열 */
  [class*="-grid"]:not([class*="-grid-1"]),
  [class*="-layout"],
  [class*="-content-wrap"]:not(.pub-content-wrap),
  [class*="-list-wrap"] {
    grid-template-columns: 1fr !important;
  }
  /* flex 가로 배치 → 줄바꿈 */
  [class*="-header"],
  [class*="-page-hd"],
  [class*="-filter-row"],
  [class*="-search"] {
    flex-wrap: wrap !important;
  }
  /* 입력 폼: iOS zoom 방지 */
  input[type="text"], input[type="search"], input[type="email"],
  input[type="number"], input[type="tel"], select, textarea {
    font-size: 16px !important;
  }
  /* 고정폭 사이드바 숨김 */
  [class*="-sidebar"]:not(.pub-sidebar),
  [class*="-side-col"],
  [class*="-aside"] {
    display: none !important;
  }
  /* 버튼 터치 타깃 */
  [class*="-btn"]:not([class*="-icon"]):not([class*="-badge"]) {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  /* 카드 그리드 1열 강제 */
  [class*="-card-grid"],
  [class*="-view-card"],
  [class*="-items"] {
    grid-template-columns: 1fr !important;
  }
}
