/* ==========================================================
   멍냥백과 — 공통 스타일
   ========================================================== */
:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --bg: #fffdf9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e8e2d9;
  --accent-bg: #fff7ed;
  --max-w: 1080px;
  --article-w: 760px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  word-break: keep-all;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.site-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem 0;
}
.site-nav a:hover { color: var(--primary-dark); text-decoration: none; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ---------- 레이아웃 ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.2rem; }

.page-hero {
  text-align: center;
  padding: 3rem 1rem 2.2rem;
  background: linear-gradient(180deg, #fff3e4 0%, var(--bg) 100%);
}
.page-hero h1 { font-size: 2rem; margin-bottom: 0.6rem; }
.page-hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }

/* 홈 전용 포털형 히어로 */
.home-hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 1.2rem 3.2rem;
  background: linear-gradient(180deg, #ffedd5 0%, #fff3e4 55%, var(--bg) 100%);
}
.home-hero h1 { font-size: 2.15rem; line-height: 1.35; }
.home-hero::before,
.home-hero::after {
  content: "🐾";
  position: absolute;
  font-size: 7rem;
  opacity: 0.08;
  pointer-events: none;
}
.home-hero::before { left: 4%; top: 10%; transform: rotate(-18deg); }
.home-hero::after { right: 4%; bottom: 6%; transform: rotate(15deg); }
.hero-search {
  margin: 2rem auto 0;
  max-width: 640px;
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: 1.4rem;
  margin: 2.5rem 0 1.2rem;
  padding-left: 0.75rem;
  border-left: 5px solid var(--primary);
}

/* ---------- 카드 그리드 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
  color: var(--text);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
  border-color: #fdba74;
  text-decoration: none;
}
.card .emoji {
  font-size: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--chip, var(--accent-bg));
  margin-bottom: 0.8rem;
}
.card h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.card p { font-size: 0.9rem; color: var(--muted); }
.card .card-meta {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--primary-dark);
  font-weight: 600;
}

/* ---------- 위젯 (계산기) ---------- */
.widget {
  background: var(--accent-bg);
  border: 1px solid #fed7aa;
  border-radius: 16px;
  padding: 1.8rem;
  max-width: 560px;
  margin: 0 auto;
}
.widget h2, .widget h3 { margin-bottom: 1rem; }
.widget label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0.9rem 0 0.3rem;
}
.widget input, .widget select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  font-family: inherit;
}
.widget button {
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.8rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.widget button:hover { background: var(--primary-dark); }
.widget .result {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  background: #fff;
  border-radius: 10px;
  border: 1px dashed var(--primary);
  font-size: 1rem;
  display: none;
}
.widget .result.show { display: block; }
.widget .result strong { color: var(--primary-dark); font-size: 1.25rem; }
.widget .note { font-size: 0.8rem; color: var(--muted); margin-top: 0.8rem; }

/* ---------- 본문 (글) ---------- */
.article {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 2.2rem 1.2rem 3rem;
}
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.article h1 { font-size: 1.85rem; line-height: 1.4; margin-bottom: 0.8rem; }
.post-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.8rem; }
.article .lead {
  background: var(--accent-bg);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.8rem;
  font-size: 1.02rem;
}
.article h2 {
  font-size: 1.35rem;
  margin: 2.4rem 0 1rem;
  padding-left: 0.7rem;
  border-left: 5px solid var(--primary);
}
.article h3 { font-size: 1.1rem; margin: 1.6rem 0 0.7rem; }
.article p { margin-bottom: 1rem; }
.article ul, .article ol { margin: 0 0 1.2rem 1.4rem; }
.article li { margin-bottom: 0.45rem; }

/* 목차 */
.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
}
.toc strong { display: block; margin-bottom: 0.6rem; }
.toc ol { margin: 0 0 0 1.2rem; }
.toc li { margin-bottom: 0.3rem; font-size: 0.95rem; }

/* 표 */
.table-wrap { overflow-x: auto; margin: 1.2rem 0 1.6rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--card);
}
th, td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}
th { background: var(--accent-bg); font-weight: 700; white-space: nowrap; }

/* 강조 박스 */
.box-tip, .box-warn {
  border-radius: 12px;
  padding: 1rem 1.3rem;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}
.box-tip { background: #f0fdf4; border: 1px solid #bbf7d0; }
.box-warn { background: #fef2f2; border: 1px solid #fecaca; }

/* FAQ */
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.7rem;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 0.7rem 0 0; font-size: 0.95rem; }

/* 관련 글 */
.related {
  background: var(--accent-bg);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-top: 2.5rem;
}
.related strong { display: block; margin-bottom: 0.6rem; }
.related ul { margin: 0 0 0 1.2rem; }

/* 면책 문구 */
.disclaimer-box {
  margin-top: 2rem;
  padding: 0.9rem 1.2rem;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* 광고 자리 (애드센스 승인 후 교체) */
.ad-slot {
  margin: 2rem auto;
  padding: 1.6rem;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 12px;
  color: #b9b2a7;
  font-size: 0.85rem;
  max-width: var(--article-w);
}

/* ---------- 검색 ---------- */
.search-box {
  margin: 2rem auto 0.8rem;
  max-width: 680px;
}
.search-box input {
  width: 100%;
  padding: 1.1rem 1.6rem;
  border: 2px solid #fdba74;
  border-radius: 999px;
  font-size: 1.08rem;
  background: #fff;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.1);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.search-box input::placeholder { color: #bfae9e; }
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}
@media (max-width: 768px) {
  .search-box input { padding: 0.95rem 1.3rem; font-size: 1rem; }
}
#search-results { margin-top: 1.2rem; }
.search-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

/* ---------- 추천 아이템 (쿠팡 파트너스) ---------- */
.affiliate-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin: 1.5rem 0 0.5rem;
  font-size: 0.88rem;
  color: #92600a;
  line-height: 1.6;
}
.product-card {
  display: flex;
  flex-direction: column;
}
.product-card p { flex: 1; }
.buy-btn {
  display: block;
  margin-top: 1rem;
  padding: 0.7rem;
  text-align: center;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}
.buy-btn:hover { background: var(--primary-dark); text-decoration: none; }
.product-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--accent-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}
.product-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  line-height: 1.8;
}
.product-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 1.4rem;
}
.filter-btn {
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--text); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.product-pager {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2.2rem 0 0.5rem;
}
.page-btn {
  min-width: 42px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.product-thumb {
  display: block;
  margin: -1.4rem -1.4rem 1rem;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #f5f1ea;
}
.product-thumb img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  display: block;
}
.product-price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.4rem 0 0.2rem;
}
.price-off { color: #e11d48; font-weight: 800; font-size: 1.05rem; }
.price-list { color: var(--muted); text-decoration: line-through; font-size: 0.9rem; }
.price-sale { font-size: 1.35rem; font-weight: 800; color: var(--text); }

/* ---------- 품종 탭 ---------- */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0 1.6rem;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.7rem 1.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.guide-card { margin-bottom: 1.8rem; }

/* 품종 카드 그리드 */
.breed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
}
.breed-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.breed-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #fdba74;
  text-decoration: none;
}
.breed-card strong { font-size: 1.02rem; }
.breed-card span { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.breed-card em {
  align-self: flex-start;
  margin-top: 0.3rem;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--accent-bg);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.breed-note {
  margin: -0.4rem 0 1.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.back-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.3rem 0;
  margin-bottom: 0.4rem;
  font-family: inherit;
}
.back-btn:hover { text-decoration: underline; }
.breed-card {
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}

/* ---------- 발행 예정 ---------- */
.upcoming-list {
  list-style: none;
  margin: 0;
}
.upcoming-list li {
  padding: 0.7rem 1rem;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}
.upcoming-list li::before { content: "📝 "; }

/* ---------- 정적 페이지 ---------- */
.static-page {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 2.5rem 1.2rem 3rem;
}
.static-page h1 { font-size: 1.7rem; margin-bottom: 1.4rem; }
.static-page h2 { font-size: 1.25rem; margin: 2rem 0 0.8rem; }
.static-page p, .static-page li { margin-bottom: 0.8rem; }
.static-page ul, .static-page ol { margin-left: 1.4rem; }

/* ---------- 푸터 ---------- */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: #fdf9f3;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.8rem 1.2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-links { margin-bottom: 0.5rem; }
.footer-links a { color: var(--muted); margin: 0 0.4rem; }

/* ---------- 반응형 ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.2rem 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
  .page-hero h1 { font-size: 1.55rem; }
  .home-hero h1 { font-size: 1.65rem; }
  .home-hero { padding: 2.8rem 1.2rem 2.4rem; }
  .home-hero::before, .home-hero::after { font-size: 4.5rem; }
  .article h1 { font-size: 1.5rem; }
}
