/* ═══════════════════════════════════════════════════
   css/public.css — 공고모아 공통 스타일시트
═══════════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8fafc;
  color: #111827;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ═════════════════════════════
   HEADER
═════════════════════════════ */
.pub-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.pub-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.pub-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.15rem; font-weight: 800; color: #fff;
}
.pub-logo i { font-size: 1.3rem; }

.pub-nav { display: flex; gap: 4px; }
.pub-nav-link {
  padding: 6px 14px; border-radius: 8px;
  font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.75);
  display: flex; align-items: center; gap: 5px;
  transition: background .15s, color .15s;
}
.pub-nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }

.pub-header-right { display: flex; align-items: center; gap: 8px; }

.pub-btn-login,
.pub-btn-register {
  padding: 6px 14px; border-radius: 8px;
  font-size: .82rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .15s;
}
.pub-btn-login {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.pub-btn-login:hover { background: rgba(255,255,255,.28); }
.pub-btn-register {
  background: #fbbf24; color: #92400e;
  border: none;
}
.pub-btn-register:hover { background: #f59e0b; }

.header-user-group {
  display: flex; align-items: center; gap: 10px;
}
.header-user-name {
  color: #fff; font-size: .85rem; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.pub-btn-mypage {
  padding: 5px 12px; border-radius: 7px;
  font-size: .78rem; font-weight: 600;
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  display: inline-flex; align-items: center; gap: 4px;
}
.pub-btn-mypage:hover { background: rgba(255,255,255,.28); }
.pub-btn-logout {
  padding: 5px 12px; border-radius: 7px;
  font-size: .78rem; font-weight: 600;
  background: rgba(239,68,68,.2); color: #fca5a5;
  border: 1px solid rgba(239,68,68,.3);
  display: inline-flex; align-items: center; gap: 4px;
}
.pub-btn-logout:hover { background: rgba(239,68,68,.35); }

/* ═════════════════════════════
   HERO
═════════════════════════════ */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  padding: 50px 20px 44px;
  text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,.08), transparent 50%);
}
.hero-inner { position: relative; max-width: 700px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); padding: 5px 14px;
  border-radius: 20px; font-size: .78rem; font-weight: 600;
  margin-bottom: 16px; backdrop-filter: blur(4px);
}
.hero-title { font-size: 2rem; font-weight: 800; line-height: 1.3; margin-bottom: 10px; }
.hero-highlight {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-desc { font-size: .95rem; color: rgba(255,255,255,.8); margin-bottom: 24px; }
.hero-search-wrap { max-width: 560px; margin: 0 auto; }
.hero-search {
  display: flex; align-items: center;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 4px; position: relative;
}
.hero-search-icon {
  position: absolute; left: 16px; color: #9ca3af; font-size: 1rem;
}
.hero-search input {
  flex: 1; border: none; outline: none;
  padding: 14px 16px 14px 42px; font-size: .95rem;
  font-family: inherit; background: transparent;
}
.hero-search button {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff; border: none; padding: 12px 28px;
  border-radius: 11px; font-size: .9rem; font-weight: 700;
  transition: background .15s;
}
.hero-search button:hover { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.hero-search-tags {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px;
}
.hero-search-tags span {
  background: rgba(255,255,255,.18); padding: 4px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.hero-search-tags span:hover { background: rgba(255,255,255,.32); }

/* ═════════════════════════════
   SOURCE BAR
═════════════════════════════ */
.source-bar {
  background: #fff; border-bottom: 1px solid #e5e7eb;
  padding: 12px 0;
}
.source-bar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.src-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .15s;
}
.src-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.src-chip-count { font-weight: 800; }
.src-g2b      { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.src-seoul    { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.src-contract { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.src-total    { background: #f3f4f6; color: #374151; border-color: #d1d5db; }

/* ═════════════════════════════
   MAIN & SECTIONS
═════════════════════════════ */
.pub-main { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }
.section-block { margin-bottom: 40px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.section-title {
  font-size: 1.1rem; font-weight: 800; color: #111827;
  display: flex; align-items: center; gap: 8px;
}
.section-badge {
  background: #fef2f2; color: #dc2626;
  font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.section-more {
  font-size: .82rem; font-weight: 600; color: #3b82f6;
  display: flex; align-items: center; gap: 4px;
}
.section-more:hover { color: #1d4ed8; }

/* ── 탭 바 ── */
.src-tab-bar {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.src-tab {
  padding: 6px 16px; border-radius: 20px;
  font-size: .82rem; font-weight: 600; border: 1px solid #e5e7eb;
  background: #fff; color: #6b7280;
  transition: all .15s;
}
.src-tab.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.src-tab:hover:not(.active) { border-color: #93c5fd; color: #1d4ed8; }

/* ═════════════════════════════
   CARD GRID
═════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.notice-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 20px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.notice-card:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08);
  border-color: #93c5fd;
}
.notice-card.card-urgent { border-left: 4px solid #ef4444; }

.card-top {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.card-src {
  font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.card-src.src-g2b_api        { background: #dbeafe; color: #1d4ed8; }
.card-src.src-seoul_board    { background: #d1fae5; color: #065f46; }
.card-src.src-seoul_contract { background: #ffedd5; color: #9a3412; }
.card-type {
  font-size: .72rem; color: #6b7280; background: #f3f4f6;
  padding: 2px 8px; border-radius: 20px;
}
.days-badge {
  font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: #dbeafe; color: #1d4ed8;
}
.days-badge.days-urgent { background: #fef2f2; color: #dc2626; }

.card-title {
  font-size: .92rem; font-weight: 700; color: #111827;
  line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-org {
  font-size: .8rem; color: #6b7280;
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 10px;
}
.card-bottom {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid #f3f4f6; padding-top: 10px;
}
.card-budget {
  font-size: .8rem; font-weight: 700; color: #1d4ed8;
  background: #eff6ff; padding: 2px 10px; border-radius: 8px;
}
.card-date {
  font-size: .78rem; color: #9ca3af;
  display: flex; align-items: center; gap: 4px;
}

/* ── 스켈레톤 ── */
.card-skeleton {
  background: #f3f4f6; border-radius: 14px;
  height: 160px; animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* ═════════════════════════════
   FOOTER
═════════════════════════════ */
.pub-footer {
  background: #111827; color: #9ca3af;
  text-align: center; padding: 32px 20px;
}
.pub-footer-inner { max-width: 600px; margin: 0 auto; }
.footer-logo {
  font-size: 1.1rem; font-weight: 800; color: #fff;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.footer-desc { font-size: .82rem; margin-bottom: 4px; }
.footer-copy { font-size: .72rem; color: #6b7280; }

/* ═════════════════════════════
   RESPONSIVE
═════════════════════════════ */
@media (max-width: 768px) {
  .pub-header-inner { padding: 0 12px; }
  .pub-nav { display: none; }
  .hero-title { font-size: 1.5rem; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .pub-header-inner { height: 50px; }
  .pub-logo span { display: none; }
  .hero { padding: 36px 16px 32px; }
  .hero-title { font-size: 1.3rem; }
  .source-bar-inner { gap: 8px; }
  .src-chip { font-size: .75rem; padding: 5px 10px; }
}
