/* blog.css — 미니멀 카드 레이아웃 + 글래스 헤더 (라이트 전용) */

:root {
  --bg: #faf9f7;
  --bg-elev: #ffffff;
  --text: #1c1b19;
  --text-sub: #6f6b64;
  --line: #e8e5df;
  --accent: #ff6b57;
  --accent-2: #f14f6f;
  --grad: linear-gradient(135deg, #ff9a5c 0%, #ff6b57 55%, #f14f6f 100%);
  --shadow: 0 2px 10px rgba(28, 27, 25, .06);
  --shadow-hover: 0 10px 30px rgba(28, 27, 25, .12);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* 화면에서만 감춘다 — display:none 과 달리 크롤러·스크린리더에는 그대로 읽힌다 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
a.btn-more { display: inline-block; text-decoration: none; }

/* ---- 데스크톱 상단 카테고리 ----
   드로어에만 두면 카테고리 링크가 기본 상태에서 감춰진 콘텐츠가 된다. 구글은
   그런 내비게이션을 낮게 보고 사이트링크 후보를 거기서 잘 뽑지 않는다.
   좁은 화면에서는 자리가 없으니 기존대로 햄버거가 맡는다. */
.topnav { display: none; }
@media (min-width: 900px) {
  .menu-btn { display: none; }
  .topnav {
    display: flex; align-items: center; gap: 4px;
    flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a {
    padding: 7px 11px; border-radius: 8px; white-space: nowrap;
    font-size: .93rem; font-weight: 700; color: var(--text-sub);
  }
  .topnav a:hover, .topnav a:focus-visible { background: var(--line); color: var(--text); }
  .brand { flex: 0 0 auto; }
}

/* ---- header (sticky + blur) ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand {
  flex: 1; font-size: 1.25rem; font-weight: 900; letter-spacing: -.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 1rem;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--accent); }

/* 햄버거 */
.menu-btn {
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-elev);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  flex-shrink: 0;
}
.menu-btn span {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform .22s, opacity .22s;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 검색 바 (토글) */
.search-bar { max-height: 0; overflow: hidden; transition: max-height .25s; border-top: 0 solid var(--line); }
.search-bar.open { max-height: 90px; border-top-width: 1px; }
.search-bar form { display: flex; gap: 8px; padding: 12px 20px; }
.search-bar input {
  flex: 1; padding: 11px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-elev); color: var(--text); font-size: .95rem; outline: none;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar button {
  padding: 0 20px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--grad); color: #fff; font-weight: 700; font-size: .92rem;
}

/* ---- drawer ---- */
.drawer-dim {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px); animation: fade .2s;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 61;
  width: min(310px, 84vw); background: var(--bg-elev);
  border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(0, 0, 0, .18);
  transform: translateX(-102%); transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
}
.drawer-title { font-weight: 800; font-size: 1.02rem; }
.drawer-list { list-style: none; margin: 0; padding: 10px 10px 18px; flex: 1; }
.drawer-top {
  display: block; padding: 12px 14px; border-radius: 10px;
  font-weight: 700; font-size: 1rem;
}
.drawer-top:hover, .drawer-top:focus-visible { background: var(--line); }
.drawer-sub { list-style: none; margin: 2px 0 8px; padding-left: 14px; }
.drawer-sub a {
  display: block; padding: 9px 14px; border-radius: 9px;
  font-size: .93rem; color: var(--text-sub);
  border-left: 2px solid var(--line);
}
.drawer-sub a:hover { color: var(--accent); border-left-color: var(--accent); }
.drawer-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  font-size: .88rem; color: var(--text-sub);
}
.drawer-foot a:hover { color: var(--accent); }

/* ---- sections ---- */
main.wrap { padding-top: 36px; padding-bottom: 60px; }
.section-title {
  font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: var(--grad); }
.featured { margin-bottom: 44px; }
.page-title { font-size: 1.6rem; font-weight: 900; letter-spacing: -.02em; margin: 4px 0 14px; }

/* ---- card grid ---- */
.card-grid, .featured-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-link { display: block; height: 100%; }
.card-thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--line); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 2.2rem; font-weight: 900;
}
.card-body { padding: 14px 16px 16px; }
.card-title {
  margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc {
  margin: 0 0 10px; font-size: .87rem; color: var(--text-sub); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; gap: 10px; font-size: .8rem; color: var(--text-sub); }

/* ---- 목록 광고 ----
   그리드 칸에 넣으면 모바일에서 폭이 150px 까지 좁아져(디스플레이 광고 최소 250px)
   빈 흰 칸만 남는다. 항상 한 줄 전체를 쓰고, 채워지지 않으면 자리 자체를 없앤다. */
.ad-card {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  min-width: 250px; background: none; border: 0; box-shadow: none;
}
.ad-card:hover { transform: none; box-shadow: none; }
.ad-card .ad-box { margin: 0; width: 100%; min-height: 0; }
.ad-card ins.adsbygoogle { width: 100%; }

/* 인피드 광고는 카드 한 칸에 들어가 목록에 섞인다(전체 폭을 쓰지 않는다) */
.ad-card.infeed {
  grid-column: auto; min-width: 0; display: block;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}

/* 구글은 미노출을 unfilled / unfill-optimized 두 가지로 표시한다 */
ins.adsbygoogle[data-ad-status="unfilled"],
ins.adsbygoogle[data-ad-status="unfill-optimized"] { display: none !important; }
.ad-card:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-card:has(ins.adsbygoogle[data-ad-status="unfill-optimized"]) { display: none; }

/* ---- 무한 스크롤 ---- */
.feed-status {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; min-height: 60px; margin-top: 28px;
}
.feed-spinner { display: none; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: feed-spin .7s linear infinite;
}
.feed-status.loading .feed-spinner { display: block; }
@keyframes feed-spin { to { transform: rotate(360deg); } }
.btn-more {
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--text-sub); font: inherit;
  font-size: .9rem; font-weight: 700; cursor: pointer;
}
.btn-more:hover { border-color: var(--accent); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .feed-spinner { animation: none; } }

/* ---- 추천 이벤트 스트립 ---- */
.cp-events { margin: 40px 0 8px; padding-top: 26px; border-top: 1px solid var(--line); }
.cp-events-title { font-size: 1.02rem; font-weight: 800; margin: 0 0 14px; }
.cp-viewport {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.cp-viewport::-webkit-scrollbar { display: none; }
.cp-track { display: flex; gap: 12px; width: max-content; }
.cp-event {
  flex: 0 0 176px; width: 176px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-elev); overflow: hidden; transition: transform .18s, box-shadow .18s;
}
.cp-event:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.cp-event-thumb { display: block; aspect-ratio: 4/3; background: var(--line); }
.cp-event-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cp-event-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: 9px 11px 11px; font-size: .86rem; font-weight: 600; line-height: 1.45;
}

/* 목록 그리드 안에 끼는 스트립은 한 줄을 통째로 쓴다 */
/* 아직 안 채워진 쿠팡 자리. 그리드 안에서 빈 칸을 만들지 않게 레이아웃에서 뺀다.
   coupang.js 가 내용을 꽂으면서 이 속성을 지우면 제자리로 돌아온다. */
[data-cp-slot] { display: none; }
.feed-events { grid-column: 1 / -1; }
.feed-events .cp-events { margin: 6px 0; }

/* ---- 하단 고정 이벤트 바 ---- */
.cp-anchor {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(28, 27, 25, .1);
  transform: translateY(105%); transition: transform .25s ease;
}
.cp-anchor.on { transform: none; }
.cp-anchor-slides { position: relative; flex: 1; height: 52px; overflow: hidden; }
.cp-anchor-item {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 10px;
  opacity: 0; visibility: hidden; transition: opacity .35s;
}
.cp-anchor-item.on { opacity: 1; visibility: visible; }
.cp-anchor-item img {
  width: 68px; height: 46px; object-fit: cover; border-radius: 8px; flex-shrink: 0;
  background: var(--line);
}
.cp-anchor-name {
  flex: 1; font-size: .88rem; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cp-anchor-go {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px;
  background: var(--grad); color: #fff; font-size: .82rem; font-weight: 800;
}
.cp-anchor-close {
  flex-shrink: 0; width: 30px; height: 30px; align-self: flex-start;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg-elev);
  color: var(--text-sub); font-size: .8rem; line-height: 1; cursor: pointer;
}
.cp-anchor-close:hover { color: var(--accent); border-color: var(--accent); }
body.has-cp-anchor { padding-bottom: 84px; }
@media (prefers-reduced-motion: reduce) {
  .cp-anchor, .cp-anchor-item { transition: none; }
}
.cp-events-note { margin: 16px 0 0; text-align: center; }
.cp-events-note img { max-width: 100%; height: auto; border-radius: 8px; }

/* ---- post ---- */
.post { max-width: 760px; margin: 0 auto; }
.crumbs { font-size: .85rem; color: var(--text-sub); margin-bottom: 18px; }
.crumbs .sep { margin: 0 6px; opacity: .5; }
.cat-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .8rem;
  font-weight: 700; color: #fff; background: var(--grad); margin-bottom: 12px;
}
.post-title { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.35; margin: 0 0 10px; }
.post-meta { color: var(--text-sub); font-size: .88rem; display: flex; gap: 8px; margin-bottom: 28px; }
.post-content { font-size: 1.02rem; }
.post-content h2 {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em;
  margin: 40px 0 14px; padding-top: 10px;
}
.post-content h3 { font-size: 1.12rem; font-weight: 700; margin: 28px 0 10px; }
.post-content p { margin: 0 0 16px; }
.post-content img { border-radius: 12px; }
.post-content figure { margin: 20px auto; }
.post-content hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }
.post-content table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 9px 11px; }
.post-content thead th { background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev)); }
.post-content blockquote {
  margin: 20px 0; padding: 14px 18px; border-left: 4px solid var(--accent);
  background: var(--bg-elev); border-radius: 0 10px 10px 0; color: var(--text-sub);
}
.post-content pre {
  background: #1d1f24; color: #e8e8e8; padding: 16px; border-radius: 12px;
  overflow-x: auto; font-size: .88rem; line-height: 1.6;
}
.post-tags { margin-top: 26px; }

/* ---- chips / misc ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 20px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-elev); font-size: .85rem; font-weight: 600; color: var(--text-sub);
  transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.related { max-width: 1080px; margin: 56px auto 0; }
.empty { color: var(--text-sub); padding: 30px 0; }
.ad-box { margin: 26px 0; text-align: center; min-height: 90px; }
.ad-box:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-box:has(ins.adsbygoogle[data-ad-status="unfill-optimized"]) { min-height: 0; margin: 0; }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--line); padding: 26px 0; margin-top: 40px;
  color: var(--text-sub); font-size: .87rem;
}
.site-footer a:hover { color: var(--accent); }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .header-inner { height: 54px; }
  .brand { font-size: 1.12rem; }
  .post-title { font-size: 1.5rem; }
  .card-grid, .featured-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .post-content { font-size: .98rem; }
  .post-content div[style*="overflow-x"] { margin: 0 -16px; padding: 0 16px; }
  .post-content table { font-size: .88rem; }
}
