/* ============================================================
   PREMIUM DARK EDITORIAL — design SSOT
   Ref: /tmp/lifecycle_ref/LifeCycle/styles.css
   Scope: single article pages only (body.premium-single)
   ============================================================ */

/* ── Design tokens ── */
:root {
  --pm-bg:           #0b1020;
  --pm-bg-soft:      #111830;
  --pm-panel:        rgba(10, 18, 40, 0.78);
  --pm-line:         rgba(179, 201, 255, 0.16);
  --pm-text:         #eff3ff;
  --pm-muted:        #b7c0db;
  --pm-accent:       #84a8ff;
  --pm-accent-strong:#d9e5ff;
  --pm-rose:         #f0accb;
  --pm-shadow:       0 36px 90px rgba(5, 10, 24, 0.42);
  --pm-max:          1160px;
}

/* ── Body override (single pages only) ── */
body.premium-single {
  margin: 0;
  color: var(--pm-text);
  background:
    radial-gradient(circle at top left, rgba(96, 124, 255, 0.34), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(244, 144, 184, 0.26), transparent 24%),
    linear-gradient(180deg, #0a0f1d 0%, #090d18 100%);
  font-family: "Noto Serif KR", serif;
}

/* 42px grid texture */
body.premium-single::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 90%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 90%);
}

/* PaperMod chrome: hide nav / footer on premium single so the dark shell is clean */
body.premium-single #header,
body.premium-single .header,
body.premium-single header.header,
body.premium-single footer.footer,
body.premium-single #footer {
  display: none;
}

/* PaperMod wraps everything in <main class="main"> */
body.premium-single main.main {
  padding: 0;
  max-width: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Page shell ── */
.pm-shell {
  width: min(calc(100% - 32px), var(--pm-max));
  margin: 0 auto;
  padding: 28px 0 80px;
}

/* ── Glass panel base ── */
.pm-hero,
.pm-article {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--pm-line);
  border-radius: 32px;
  background: var(--pm-panel);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--pm-shadow);
}

/* glass shimmer overlay */
.pm-hero::after,
.pm-article::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.07),
    transparent 30%,
    transparent 70%,
    rgba(132, 168, 255, 0.08)
  );
}

/* ── Hero: 2-column grid ── */
.pm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: stretch;
  padding: 34px;
  margin-bottom: 28px;
}

.pm-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-height: 420px;
}

.pm-hero-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--pm-text);
}

.pm-hero-copy .pm-description {
  margin: 0;
  max-width: 36rem;
  color: var(--pm-muted);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  line-height: 1.9;
}

.pm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-family: "Outfit", sans-serif;
  font-size: 0.82rem;
  color: var(--pm-muted);
  margin-top: 4px;
}

/* ── Hero visual panel ── */
.pm-hero-visual {
  position: relative;
  z-index: 1;
  margin: 0;
  min-height: 420px;
  border-radius: 28px;
  overflow: hidden;
  /* match the generated card's navy so object-fit:contain letterboxing is seamless */
  background: #0b1020;
}

.pm-hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 22, 0.04), rgba(8, 12, 22, 0.44)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 28%);
  pointer-events: none;
  z-index: 1;
}

.pm-hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;        /* show the whole generated card — never crop it */
  object-position: center;
  display: block;
  position: relative;
  z-index: 0;
}

/* gradient placeholder when no cover image */
.pm-hero-visual-placeholder {
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: linear-gradient(
    135deg,
    rgba(132, 168, 255, 0.18) 0%,
    rgba(240, 172, 203, 0.12) 50%,
    rgba(10, 18, 40, 0.6) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Article body ── */
.pm-article {
  padding: clamp(28px, 4vw, 56px);
}

.pm-article > * {
  position: relative;
  z-index: 1;
}

/* Map Hugo .Content output (bare semantic tags) */
.pm-article p,
.pm-article li {
  margin: 0;
  color: rgba(239, 243, 255, 0.92);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  line-height: 2;
}

.pm-article p + p,
.pm-article p + h2,
.pm-article h2 + p,
.pm-article hr {
  margin-top: 22px;
}

.pm-article h2 {
  margin: 28px 0 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--pm-accent-strong);
}

.pm-article h3 {
  margin: 22px 0 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  font-weight: 600;
  color: var(--pm-accent);
}

.pm-article a {
  color: #c7d7ff;
  text-decoration-color: rgba(199, 215, 255, 0.46);
  text-underline-offset: 0.18em;
  transition: color 0.15s;
}

.pm-article a:hover {
  color: var(--pm-accent-strong);
}

.pm-article strong {
  color: #ffffff;
}

.pm-article em {
  color: var(--pm-muted);
}

.pm-article ul,
.pm-article ol {
  padding-left: 1.5rem;
  margin: 12px 0 0;
}

.pm-article ul li + li,
.pm-article ol li + li {
  margin-top: 8px;
}

.pm-article hr {
  border: 0;
  border-top: 1px solid rgba(190, 205, 255, 0.16);
  margin-bottom: 22px;
}

/* Blockquote */
.pm-article blockquote {
  margin: 22px 0;
  padding: 14px 22px;
  border-left: 3px solid var(--pm-accent);
  background: rgba(132, 168, 255, 0.06);
  border-radius: 0 12px 12px 0;
  color: var(--pm-muted);
  font-style: italic;
}

/* Code */
.pm-article code {
  font-size: 0.88em;
  background: rgba(132, 168, 255, 0.12);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--pm-accent-strong);
}

.pm-article pre {
  margin: 18px 0;
  padding: 18px 22px;
  background: rgba(5, 10, 24, 0.7);
  border: 1px solid var(--pm-line);
  border-radius: 14px;
  overflow-x: auto;
}

.pm-article pre code {
  background: none;
  padding: 0;
}

/* ── Diagram card (figures in markdown) ── */
.pm-article figure.diagram-card,
figure.diagram-card {
  margin: 34px 0;
  padding: 20px;
  border: 1px solid rgba(203, 214, 246, 0.2);
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(245, 248, 255, 0.98),
    rgba(238, 243, 252, 0.94)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 40px rgba(6, 12, 30, 0.18);
}

.pm-article figure.diagram-card img,
figure.diagram-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #ffffff;
}

.pm-article figure.diagram-card figcaption,
figure.diagram-card figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: #4a5068;
  font-family: "Outfit", sans-serif;
}

/* ── Sources section ── */
.pm-article .sources,
.pm-article section.sources {
  margin-top: 22px;
}

.pm-article .sources ul,
.pm-article section.sources ul {
  margin: 12px 0 0;
  padding-left: 1.2rem;
}

.pm-article .sources li + li,
.pm-article section.sources li + li {
  margin-top: 10px;
}

/* ── AdSense safety ── */
/* Ensure ad containers aren't clipped by dark glass panels */
.adsbygoogle {
  background: transparent !important;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .pm-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .pm-hero-copy,
  .pm-hero-visual {
    min-height: auto;
  }

  .pm-hero-visual {
    aspect-ratio: 5 / 4;
  }

  .pm-hero-visual-placeholder {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .pm-shell {
    width: min(calc(100% - 20px), var(--pm-max));
    padding-top: 14px;
    padding-bottom: 40px;
  }

  .pm-hero,
  .pm-article {
    border-radius: 24px;
  }

  .pm-article {
    padding: 22px 18px 28px;
  }

  .pm-article p,
  .pm-article li {
    line-height: 1.88;
  }
}
