:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #9ca3af;
  --border: #e5e7eb;
  --brand: #e11d48;
  --brand-2: #f97316;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 4px 16px rgba(17, 24, 39, .06);
  --shadow-lg: 0 10px 40px rgba(17, 24, 39, .14);
  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Lora", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.ad-lock, html.ad-lock body { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 40px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px rgba(225, 29, 72, .35);
}
.header-nav { display: flex; gap: 6px; }
.header-nav a { padding: 6px 12px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--text-2); }
.header-nav a:hover, .header-nav a.active { background: #f1f2f4; color: var(--text); }
.header-date { margin-left: auto; color: var(--muted); font-size: 13px; text-transform: capitalize; }

/* ---------- Footer ---------- */
.site-footer { background: #0b1220; color: #cbd5e1; margin-top: 40px; }
.footer-inner { padding: 40px 16px; }
.footer-inner .logo { color: #fff; }
.footer-inner p { margin: 12px 0; color: #94a3b8; }
.footer-inner small { color: #64748b; }

/* ---------- Common ---------- */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 16px;
}
.section-title::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(var(--brand), var(--brand-2)); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.sidebar { position: sticky; top: 88px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; overflow: hidden;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 32px;
}
.hero-media { aspect-ratio: 16/10; background: linear-gradient(135deg, #fde2e4, #fed7aa); overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.hero:hover .hero-media img { transform: scale(1.04); }
.hero-body { padding: 32px; display: flex; flex-direction: column; justify-content: center; }
.hero-body h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.02em; margin: 10px 0 12px; }
.hero-body p { color: var(--text-2); margin: 0 0 14px; font-size: 16px; }
.hero-body time { color: var(--muted); font-size: 13px; }
.kicker {
  align-self: flex-start; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand); background: #ffe4e6; padding: 4px 10px; border-radius: 999px;
}

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, #fde2e4, #fed7aa); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h2 {
  font-size: 16px; font-weight: 700; line-height: 1.4; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-body p {
  font-size: 14px; color: var(--text-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-body time { margin-top: auto; font-size: 12px; color: var(--muted); }

/* ---------- Popular widget ---------- */
.widget { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.popular-list { list-style: none; margin: 0; padding: 0; }
.popular-list li + li { border-top: 1px solid var(--border); }
.popular-list a { display: flex; gap: 14px; padding: 12px 0; align-items: flex-start; }
.popular-list a:hover .popular-title { color: var(--brand); }
.rank {
  flex: none; font-size: 26px; font-weight: 800; line-height: 1; width: 26px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.popular-title { font-weight: 600; font-size: 15px; line-height: 1.45; transition: color .15s; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pagination a {
  min-width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--surface); border-radius: 12px; font-weight: 600; box-shadow: var(--shadow);
}
.pagination a.active { background: var(--text); color: #fff; }

/* ---------- Article ---------- */
.article { background: var(--surface); padding: 36px 44px; border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.breadcrumb { font-size: 13px; color: var(--muted); display: flex; gap: 8px; margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--brand); }
.article h1 { font-size: 34px; line-height: 1.25; letter-spacing: -.025em; margin: 0 0 16px; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.meta strong { color: var(--text); }
.author-dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 13px;
}
.article .lead { font-weight: 600; font-size: 19px; line-height: 1.6; color: #1f2937; margin: 0 0 20px; }
.article .cover { width: 100%; border-radius: 12px; margin-bottom: 24px; }
.article .content { font-family: var(--serif); font-size: 19px; line-height: 1.8; color: #1f2937; }
.article .content h2, .article .content h3 { font-family: var(--font); letter-spacing: -.01em; line-height: 1.35; margin-top: 1.6em; }
.article .content img { border-radius: 12px; margin: 1em auto; }
.article .content blockquote { margin: 1.4em 0; padding: 4px 20px; border-left: 4px solid var(--brand); color: var(--text-2); font-style: italic; }
.article .content a { color: var(--brand); text-decoration: underline; }
.article .content iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 12px; }
.related { margin-top: 40px; }

.empty { text-align: center; padding: 80px 0; }
.empty h1 { font-size: 64px; margin: 0; }
.btn { display: inline-block; padding: 10px 22px; background: var(--text); color: #fff; border-radius: 999px; font-weight: 600; }

/* =================================================================
   Ad popup
   ================================================================= */
.ad { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; cursor: pointer; }
.ad[hidden] { display: none; }
.ad__backdrop {
  position: absolute; inset: 0; background: rgba(9, 12, 20, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .3s ease;
}
.ad__dialog {
  position: relative; width: 100%; max-width: 400px;
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(20px) scale(.96);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2, .9, .3, 1.2);
}
.ad.is-open .ad__backdrop { opacity: 1; }
.ad.is-open .ad__dialog { opacity: 1; transform: none; }

.ad__top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; padding: 12px;
}
.ad__label {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: rgba(0, 0, 0, .55); color: #fff; padding: 3px 8px; border-radius: 6px;
}
.ad__close {
  width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff;
}

.ad__media { position: relative; background: linear-gradient(135deg, #ffe4e6, #fed7aa); }
.ad__media img { width: 100%; max-height: 52vh; object-fit: cover; }
.ad__placeholder { aspect-ratio: 4/3; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.ad__placeholder span { font-size: 96px; font-weight: 800; color: rgba(255, 255, 255, .9); }
.ad__badge {
  position: absolute; left: 12px; bottom: 44px;
  background: linear-gradient(135deg, #facc15, #f97316); color: #fff;
  font-weight: 800; font-size: 18px; padding: 6px 14px; border-radius: 12px;
  box-shadow: 0 6px 16px rgba(249, 115, 22, .45); transform: rotate(-4deg);
}

.ad__body { padding: 16px 20px 20px; }
.ad__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ad__brand strong { display: block; font-size: 14px; line-height: 1.2; }
.ad__brand small { color: var(--muted); font-size: 12px; }
.ad__avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800;
}
.ad__title { font-size: 17px; line-height: 1.35; font-weight: 700; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad__text { font-size: 13.5px; color: var(--text-2); margin: 0 0 14px; }
.ad__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; border-radius: 14px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff;
  font-weight: 700; font-size: 16px;
  box-shadow: 0 8px 20px rgba(225, 29, 72, .35);
  position: relative; overflow: hidden;
  animation: ad-pulse 1.8s ease-in-out infinite;
}
.ad__cta::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); animation: ad-shine 2.6s ease-in-out infinite;
}
.ad__timer {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 12px;
  background: linear-gradient(90deg, #e11d48, #f97316); color: #fff;
  font-size: 12px; font-weight: 600; text-align: center;
}
.ad__clock { font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .25); padding: 1px 6px; border-radius: 4px; margin-left: 2px; }
.ad__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ad__rating b { color: #f59e0b; }
.ad__rating { color: #f59e0b; font-weight: 600; }
.ad__pricebox { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ad__price { font-size: 28px; font-weight: 800; color: #e11d48; letter-spacing: -.02em; line-height: 1.1; }
.ad__old { font-size: 15px; color: var(--muted); text-decoration: line-through; }
.ad--fullscreen .ad__old, .ad--fullscreen .ad__meta { color: #94a3b8; }
.ad--fullscreen .ad__price { color: #fb7185; }
@keyframes ad-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes ad-shine { 0% { left: -60%; } 60%, 100% { left: 130%; } }

/* Layout: fullscreen interstitial */
.ad--fullscreen { padding: 0; }
.ad--fullscreen .ad__backdrop { background: #000; }
.ad--fullscreen .ad__dialog {
  max-width: 480px; height: 100%; border-radius: 0;
  display: flex; flex-direction: column; background: #0b0b0f; color: #fff;
}
.ad--fullscreen .ad__media { flex: 1; min-height: 0; }
.ad--fullscreen .ad__media img, .ad--fullscreen .ad__placeholder { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: cover; }
.ad--fullscreen .ad__body { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.ad--fullscreen .ad__text { color: #cbd5e1; }
.ad--fullscreen .ad__brand small { color: #94a3b8; }

/* Layout: bottom sheet */
.ad--bottom { align-items: flex-end; padding: 0; }
.ad--bottom .ad__dialog { max-width: 520px; border-radius: 24px 24px 0 0; transform: translateY(100%); }
.ad--bottom.is-open .ad__dialog { transform: none; }
.ad--bottom .ad__dialog::before {
  content: ""; position: absolute; top: 8px; left: 50%; z-index: 3; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .8);
}
.ad--bottom .ad__media img { max-height: 36vh; }
.ad--bottom .ad__placeholder { aspect-ratio: 16/9; }
.ad--bottom .ad__body { padding-bottom: max(20px, env(safe-area-inset-bottom)); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero { grid-template-columns: 1fr; }
  .hero-body { padding: 20px; }
  .hero-body h1 { font-size: 24px; }
}
@media (max-width: 600px) {
  .header-inner { height: 56px; gap: 12px; }
  .header-nav, .header-date { display: none; }
  .main { padding-top: 16px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { flex-direction: row; }
  .card-thumb { width: 120px; flex: none; aspect-ratio: auto; min-height: 96px; }
  .card-body { padding: 10px 12px; }
  .card-body h2 { font-size: 15px; }
  .card-body p { display: none; }
  .article { padding: 20px 16px; border-radius: 12px; }
  .article h1 { font-size: 25px; }
  .article .lead { font-size: 17px; }
  .article .content { font-size: 18px; }
  .ad__title { font-size: 16px; }
  .ad__price { font-size: 24px; }
}
