/* ============================================================
   이벤트·캠페인 페이지 전용 스타일 (sub-event.css)
   ============================================================ */

/* ── 에러 / 빈 상태 ── */
.ev-empty {
  text-align: center;
  padding: 80px 24px;
}
.ev-empty-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 16px;
  color: #cbd5e1;
}
.ev-empty-text {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}
.ev-empty-sub {
  font-size: 14px;
  color: #6b7280;
}
.ev-empty-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 11px 24px;
  background: var(--color-primary, #3a7bd5);
  color: #fff !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  letter-spacing: -.2px;
  transition: background .18s, transform .18s;
}
.ev-empty-link:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════
   검색 툴바
   ══════════════════════════════════════════ */
.ev-toolbar {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── 툴바 바로가기 버튼 ── */
.ev-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 22px;
  height: 38px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
  letter-spacing: -.2px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.40);
  transition: transform .2s cubic-bezier(.22, .68, 0, 1.2), box-shadow .2s ease, opacity .2s;
  position: relative;
  overflow: hidden;
  border-radius: 50px;
}
.ev-shortcut-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
  pointer-events: none;
}
.ev-shortcut-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.50);
  opacity: .93;
}
.ev-shortcut-btn:active {
  transform: translateY(-1px);
}
.ev-shortcut-btn i {
  font-size: 15px;
  opacity: .9;
}

.ev-search {
  display: flex;
  align-items: center;
  position: relative;
  max-width: 480px;
  width: 100%;
  background: #fff;
  border-radius: 50px;
  border: 1.5px solid #dde3ef;
  box-shadow:
    0 2px 8px rgba(58, 123, 213, 0.07),
    0 1px 2px rgba(15, 30, 60, 0.05);
  transition: border-color .18s, box-shadow .18s;
}
.ev-search:focus-within {
  border-color: var(--color-primary, #3a7bd5);
  box-shadow:
    0 0 0 3px rgba(58, 123, 213, 0.12),
    0 4px 16px rgba(58, 123, 213, 0.10);
}
.ev-search-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  color: #6b7280;
  pointer-events: none;
  z-index: 1;
  transition: color .18s;
}
.ev-search:focus-within .ev-search-icon {
  color: var(--color-primary, #3a7bd5);
}
.ev-search-input {
  flex: 1;
  height: 48px;
  padding: 0 18px 0 46px;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  color: #1e293b;
  background: transparent;
  outline: none;
  width: 100%;
}
.ev-search-input::placeholder { color: #6b7280; }
/* 브라우저 기본 clear 버튼 제거 */
.ev-search-input::-webkit-search-cancel-button { display: none; }

.ev-search-btn { display: none; }

/* ══════════════════════════════════════════
   페이지네이션
   ══════════════════════════════════════════ */
.ev-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #f1f5f9;
}
.ev-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 4px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
  letter-spacing: -.2px;
}
.ev-page-btn:hover:not(:disabled):not(.is-active) {
  border-color: var(--color-primary, #3a7bd5);
  color: var(--color-primary, #3a7bd5);
  background: rgba(58, 123, 213, 0.06);
  transform: translateY(-2px);
}
.ev-page-btn.is-active {
  background: var(--color-primary, #3a7bd5);
  border-color: var(--color-primary, #3a7bd5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(58, 123, 213, 0.35);
  cursor: default;
}
.ev-page-btn--ctrl { font-size: 13px; }
.ev-page-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════
   이벤트 카드 그리드
   ══════════════════════════════════════════ */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

/* ── 카드 래퍼 ── */
.ev-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  padding: 0 16px 20px;   /* 좌우 인셋 — thumb은 이 안에서 width:100% */
  box-shadow:
    0 1px 3px rgba(15, 30, 60, 0.06),
    0 6px 20px rgba(15, 30, 60, 0.07);
  transition:
    transform .28s cubic-bezier(.22, .68, 0, 1.2),
    box-shadow .28s ease;
  text-decoration: none !important;
  color: inherit;
  position: relative;
}
.ev-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1.5px solid transparent;
  transition: border-color .22s ease;
  pointer-events: none;
}
.ev-card:hover,
.ev-card:focus-visible {
  transform: translateY(-8px);
  box-shadow:
    0 4px 12px rgba(58, 123, 213, 0.12),
    0 20px 48px rgba(15, 30, 60, 0.14);
  outline: none;
}
.ev-card:hover::after,
.ev-card:focus-visible::after {
  border-color: var(--color-primary, #3a7bd5);
}

/* ── 접수중 카드 배경 ── */
.ev-card--open {
  background: linear-gradient(160deg, #f0fdf6 0%, #e8f5ff 100%);
  box-shadow:
    0 1px 3px rgba(16, 185, 129, 0.08),
    0 6px 20px rgba(16, 185, 129, 0.10);
}
.ev-card--open:hover,
.ev-card--open:focus-visible {
  box-shadow:
    0 4px 12px rgba(16, 185, 129, 0.18),
    0 20px 48px rgba(16, 185, 129, 0.14);
}
.ev-card--open::after {
  border-color: rgba(16, 185, 129, 0.35);
}
.ev-card--open:hover::after,
.ev-card--open:focus-visible::after {
  border-color: #10b981;
}
.ev-card--open .ev-card-footer {
  border-top-color: rgba(16, 185, 129, 0.25);
}

/* ── 상태 배지 (이미지 위) ── */
.ev-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: center;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 15px;
  border-radius: 100px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin: 16px 0 8px;
  position: relative;
  z-index: 1;
}
.ev-card-badge--open {
  background: #E91E63;
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.20);
}
.ev-card-badge--upcoming {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.20);
}
.ev-card-badge--wait {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.20);
}
.ev-card-badge--closed {
  background: #f1f5f9;
  color: #64748b;
}

/* ── 썸네일 ── */
.ev-card-thumb-wrap {
  width: 100%;
  aspect-ratio: 3 / 3.5;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;   /* flex가 높이를 강제 확장하지 못하도록 고정 */
  align-self: stretch;
  border:1px solid #ccc;
  border-radius: 16px;
}

.ev-winner.ev-card-thumb-wrap {
  margin-top:15px;
}

.ev-card-thumb {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform .4s cubic-bezier(.22, .68, 0, 1.1);
  border-radius: 16px;
}
.ev-card:hover .ev-card-thumb,
.ev-card:focus-visible .ev-card-thumb {
  transform: scale(1.07);
}


/* 썸네일 없을 때 플레이스홀더 */
.ev-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(140deg, #eef2ff 0%, #e0e7ff 100%);
  font-size: 40px;
  color: #818cf8;
}

/* ── 카드 본문 ── */
.ev-card-body {
  flex: 1;
  padding: 14px 4px 0;   /* 카드 패딩(16px) 활용 — 좌우 추가 여백 최소화 */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ev-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  letter-spacing: -.3px;
}

.ev-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ev-card-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary, #3a7bd5);
  letter-spacing: -.1px;
  padding: 5px 12px;
  background: rgba(58, 123, 213, 0.07);
  border-radius: 100px;
  transition: background .18s, color .18s;
}
.ev-card:hover .ev-card-more {
  background: var(--color-primary, #3a7bd5);
  color: #fff;
}

.ev-card-date {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   상세 페이지
   ══════════════════════════════════════════ */
.ev-detail-header {
  padding: 28px 32px;
  background: linear-gradient(135deg, #f8faff 0%, #f0f5ff 100%);
  border-radius: 16px;
  border: 1px solid rgba(58, 123, 213, 0.12);
  margin-bottom: 32px;
}
.ev-detail-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
  margin: 0 0 16px;
  word-break: keep-all;
  letter-spacing: -.4px;
}
.ev-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin: 0;
}
.ev-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
}
.ev-detail-meta-item dt {
  font-weight: 700;
  color: #6b7280;
}
.ev-detail-meta-item dd { margin: 0; }

.ev-detail-content {
  font-size: 15px;
  line-height: 1.8;
  color: #334155;
  word-break: keep-all;
  overflow-x: auto;
}
.ev-detail-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
  border-radius: 8px;
}
.ev-detail-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ev-detail-content td,
.ev-detail-content th {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  vertical-align: top;
  line-height: 1.65;
}
.ev-detail-content tr:first-child td { background: #f8fafc; }
.ev-detail-content p { margin: 8px 0; }

.ev-detail-actions {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
}
.ev-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #f1f5f9;
  color: #334155;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  letter-spacing: -.2px;
  transition: background .2s, color .2s, transform .2s;
}
.ev-back-btn:hover {
  background: var(--color-primary, #3a7bd5);
  color: #fff;
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════
   반응형
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .ev-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .ev-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
  }
  .ev-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ev-search  { max-width: 100%; }
  .ev-shortcut-btn { width: 100%; justify-content: center; height: 44px; font-size: 13px; }
  .ev-card       { padding: 0 10px 16px; }
  .ev-card-body  { padding: 10px 2px 0; }
  .ev-card-title { font-size: 13px; }
  .ev-card-badge { margin: 12px 0 6px; font-size: 10px; padding: 4px 9px; }
  .ev-detail-header { padding: 20px; }
  .ev-detail-title  { font-size: 18px; }
}
@media (max-width: 479px) {
  .ev-grid { grid-template-columns: 1fr; }
}
