:root {
  --bg: #fafaf7;
  --bg-soft: #f4f1e9;
  --bg-card: #ffffff;
  --fg: #1a1717;
  --fg-soft: #4a4540;
  --fg-mute: #8a8278;
  --accent: #e63946;
  --accent-hot: #ff3838;
  --accent-soft: #fde2e4;
  --accent-deep: #c1121f;
  --gold: #ffb703;
  --border: #ece6dc;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.14);
  --max: 1280px;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/woff2/Pretendard-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/woff2/Pretendard-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/woff2/Pretendard-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ============ Header ============ */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(180%) blur(12px);
}
.site-header .container {
  display: flex; align-items: center; gap: 28px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-weight: 900; font-size: 26px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.brand-mark {
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.brand-mark::after {
  content: '🔥';
  position: absolute;
  top: -6px; right: -16px;
  font-size: 14px;
}
.brand-name { color: var(--fg); margin-left: 10px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-link {
  font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-link .emoji { font-size: 16px; }
.hamburger {
  display: none;
  background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px 8px;
  margin-left: auto;
}

/* ============ Main ============ */
.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 30%, #c1121f 100%);
  color: #fff;
  padding: 48px 32px;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 120%; height: 200%;
  background: radial-gradient(ellipse at top, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: '🔥 HOT';
  position: absolute;
  top: 16px; right: 20px;
  background: var(--gold);
  color: #1a1717;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
  position: relative;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.hero p {
  margin: 0;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

/* ============ Section title ============ */
.section-title {
  font-size: 22px; font-weight: 900;
  margin: 0 0 18px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.03em;
}
.section-title span:first-child {
  font-size: 22px;
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--accent-soft);
  border-radius: 10px;
}
.section-title .more {
  margin-left: auto;
  font-size: 13px; font-weight: 600;
  color: var(--fg-soft);
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-soft);
}
.section-title .more:hover { background: var(--accent-soft); color: var(--accent); }

/* ============ Post Grid + Cards ============ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-soft);
}
.post-card-thumb {
  height: 130px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.post-card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.25) 100%);
}
/* Cards without hero image have a thin colored top accent bar instead of large thumb */
.post-card:not(:has(.post-card-thumb)) {
  border-top: 3px solid var(--accent);
}
.post-card[data-cat="ssul"]:not(:has(.post-card-thumb))   { border-top-color: #c1121f; }
.post-card[data-cat="love"]:not(:has(.post-card-thumb))   { border-top-color: #d9376e; }
.post-card[data-cat="family"]:not(:has(.post-card-thumb)) { border-top-color: #b85c00; }
.post-card[data-cat="work"]:not(:has(.post-card-thumb))   { border-top-color: #1d7a3b; }
.post-card[data-cat="in-laws"]:not(:has(.post-card-thumb)){ border-top-color: #6e3acc; }
.post-card[data-cat="horror"]:not(:has(.post-card-thumb)) { border-top-color: #2a2521; }
/* Per-category thumb gradients */
.post-card[href*="/c/ssul/"] .post-card-thumb-placeholder,
.post-card-thumb-placeholder[data-cat="ssul"] {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.post-card-cat[data-cat="ssul"]   { background: #ffe1ea; color: #c1121f; }
.post-card-cat[data-cat="love"]   { background: #fde2e4; color: #d9376e; }
.post-card-cat[data-cat="family"] { background: #fff3d9; color: #b85c00; }
.post-card-cat[data-cat="work"]   { background: #d9f0e3; color: #1d7a3b; }
.post-card-cat[data-cat="in-laws"]{ background: #f0e4ff; color: #6e3acc; }
.post-card-cat[data-cat="horror"] { background: #2a2521; color: #ffe066; }

/* Default thumb gradients by nth-child */
.post-grid .post-card:nth-child(6n+1) .post-card-thumb-placeholder { background: linear-gradient(135deg, #ff6b6b, #ee5a52); }
.post-grid .post-card:nth-child(6n+2) .post-card-thumb-placeholder { background: linear-gradient(135deg, #fa709a, #fee140); }
.post-grid .post-card:nth-child(6n+3) .post-card-thumb-placeholder { background: linear-gradient(135deg, #f093fb, #f5576c); }
.post-grid .post-card:nth-child(6n+4) .post-card-thumb-placeholder { background: linear-gradient(135deg, #ffa17f, #00223e); }
.post-grid .post-card:nth-child(6n+5) .post-card-thumb-placeholder { background: linear-gradient(135deg, #667eea, #764ba2); }
.post-grid .post-card:nth-child(6n+6) .post-card-thumb-placeholder { background: linear-gradient(135deg, #43e97b, #38f9d7); }

.post-card-body { padding: 10px 12px 12px; }
.post-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px 2px 6px;
  border-radius: 3px;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.02em;
}
.post-card-cat .cat-emoji { font-size: 11px; }
.post-card-title {
  margin: 6px 0 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.02em;
}
.post-card-desc {
  margin: 0 0 7px;
  font-size: 12px;
  color: var(--fg-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.post-card-date {
  font-size: 10.5px;
  color: var(--fg-mute);
  font-weight: 600;
}

/* Category page header */
.cat-header {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: #fff;
  padding: 36px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cat-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.cat-header p {
  margin: 6px 0 0;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
}

.cat-section { padding-top: 8px; }

/* ============ Post article + sidebar ============ */
.site-main:has(.post-article) {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  .site-main:has(.post-article) {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}
.post-article {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
}
.post-header { margin-bottom: 20px; }
.post-cat-link {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.02em;
}
.post-cat-link:hover { background: var(--accent); color: #fff; }
.post-title {
  margin: 12px 0 8px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.post-meta {
  color: var(--fg-mute);
  font-size: 13px;
  font-weight: 600;
}
.post-hero {
  width: 100%;
  border-radius: 10px;
  margin-top: 18px;
}
.post-content {
  font-size: 17.5px;
  line-height: 1.88;
  margin: 24px 0;
  color: #2a2521;
}
.post-content p { margin: 0 0 1.2em; }
.post-content h2, .post-content h3 {
  margin-top: 1.8em;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 18px;
  margin: 1.2em 0;
  border-radius: 6px;
  color: #2a2521;
}
.post-content strong { color: var(--accent-deep); font-weight: 800; }

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.post-tags .tag {
  background: var(--bg-soft);
  color: var(--fg-soft);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.post-source {
  font-size: 12px;
  color: var(--fg-mute);
  margin: 12px 0;
}

.post-share {
  display: flex;
  gap: 10px;
  margin: 28px 0;
  flex-wrap: wrap;
}
.post-share button {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.post-share button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.post-sidebar { display: flex; flex-direction: column; gap: 18px; }

/* ============ Static pages ============ */
.static-page {
  background: var(--bg-card);
  padding: 36px 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.78;
}
.static-page h1 {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}
.static-page h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 28px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.static-page h2:first-of-type { border-top: 0; padding-top: 0; }
.static-page ul { padding-left: 22px; margin: 8px 0; }
.static-page li { margin: 4px 0; }
.static-page code {
  background: var(--bg-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, monospace;
}
.static-page a { color: var(--accent); text-decoration: underline; }
.static-page p { margin: 8px 0; }
.static-page em {
  color: var(--fg-mute);
  font-style: normal;
  font-size: 13px;
}

/* ============ Ad slots ============ */
.adslot-wrap { display: block; }
.adslot {
  display: block;
  background: var(--bg-soft);
  border: 1px dashed #d9d2c2;
  border-radius: 8px;
  margin: 18px 0;
  padding: 10px;
  text-align: center;
  min-height: 100px;
  position: relative;
}
.adslot::before {
  display: none;
  content: none;
  position: absolute;
  top: 6px; left: 8px;
  font-size: 9px;
  color: #b8ad97;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.adslot:has(ins) { background: transparent; border: 0; padding: 0; }
.adslot:has(ins)::before { display: none; }

.coupang-banner, .ali-banner {
  display: block;
  width: 100%;
  margin: 12px auto;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.coupang-banner:hover, .ali-banner:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.ali-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ali-leaderboard { max-width: 725px; }

/* AliExpress product grid */
.ali-grid-section { margin: 32px 0 8px; }
.ali-grid-title {
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 8px;
}
.ali-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.ali-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--shadow-sm);
}
.ali-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #ff4e00;
}
.ali-card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}
.ali-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ali-card-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  z-index: 2;
}
.ali-card-source {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(255,78,0,0.92);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.ali-card-body { padding: 8px 10px 10px; }
.ali-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px;
  color: var(--fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.ali-card-price {
  display: flex; align-items: baseline; gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 4px;
}
.ali-card-orig {
  font-size: 11px;
  color: var(--fg-mute);
  text-decoration: line-through;
}
.ali-card-discount {
  font-size: 15px;
  font-weight: 900;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
}
.ali-card-sales {
  font-size: 10.5px;
  color: var(--fg-mute);
  font-weight: 600;
}

/* AliExpress promo card (텍스트 링크 + 시각 강조) */
.ali-promo {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #ff4e00 0%, #ec9f05 100%);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  margin: 20px auto;
  max-width: 720px;
  box-shadow: var(--shadow);
  text-decoration: none;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}
.ali-promo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at right, rgba(255,255,255,0.2) 0%, transparent 60%);
  pointer-events: none;
}
.ali-promo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: #fff;
}
.ali-promo-badge {
  background: rgba(0,0,0,0.25);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  white-space: nowrap;
}
.ali-promo-title {
  flex: 1;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.ali-promo-cta {
  background: rgba(255,255,255,0.9);
  color: #c1121f;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 540px) {
  .ali-promo { flex-direction: column; align-items: stretch; text-align: center; }
  .ali-promo-cta { align-self: center; }
}
.coupang-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.coupang-leaderboard { margin: 20px auto; }

.coupang-slot {
  display: block;
  width: 100%;
  margin: 12px auto;
  overflow: hidden;
  line-height: 0;
  text-align: center;
}
.coupang-slot:empty { display: none; margin: 0; }
.coupang-slot[data-align="left"] { margin-left: 0; margin-right: auto; }
.coupang-slot > iframe,
.coupang-slot > div,
.coupang-slot > a {
  max-width: 100% !important;
  display: inline-block !important;
}
.coupang-slot:empty, .coupang-slot:not(:has(iframe)):not(:has(a)):not(:has(div > *)) {
  display: none;
}

/* ============ Footer ============ */
.site-footer {
  background: #1a1717;
  color: #c8c1b7;
  padding: 48px 0 28px;
  margin-top: 72px;
  border-top: 4px solid var(--accent);
}
.site-footer h4 {
  color: #fff;
  font-size: 14px;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.site-footer a { color: #c8c1b7; font-size: 13px; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 7px; }
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid #2d2a26;
}
.footer-bottom {
  padding-top: 20px;
  font-size: 11px;
  color: #6a6358;
  line-height: 1.6;
}
.footer-bottom p { margin: 4px 0; }

/* ============ Side rails (좌/우 sticky AdSense) ============ */
/* AdSense unfilled (광고 인벤토리 없음) 자동 숨김 */
.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.adslot:has(.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }
.site-rail:has(.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }

.site-rail {
  position: fixed;
  top: 100px;
  width: 160px;
  height: 600px;
  z-index: 5;
}
.site-rail--left  { left: 16px; }
.site-rail--right { right: 16px; }
@media (max-width: 1620px) {
  .site-rail { display: none; }
}

/* ============ Mobile ============ */
@media (max-width: 720px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex; flex-direction: column;
    gap: 4px; width: 100%; padding: 14px 0 6px;
  }
  .site-nav.open .nav-link {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .hamburger { display: inline-block; }
  .site-header .container { gap: 12px; }
  .brand { font-size: 22px; }
  .post-article { padding: 22px 18px; }
  .post-title { font-size: 23px; }
  .post-content { font-size: 16px; }
  .static-page { padding: 22px 18px; }
  .footer-cols { grid-template-columns: 1fr; gap: 22px; }
  .hero { padding: 32px 22px; }
  .hero h1 { font-size: 24px; }
  .cat-header { padding: 26px 22px; }
  .cat-header h1 { font-size: 24px; }
  .section-title { font-size: 19px; }
  .post-card-thumb { height: 130px; }
}

/* ── Anti-adblock blur ─────────────────────────────────── */
body.adblock-detected .post-content,
body.adblock-detected .post-grid,
body.adblock-detected .latest,
body.adblock-detected .cat-section {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}
