/* ============================================================
   blog-detail.css — article reading page only (blog-detail.html)
   Depends on assets/css/base.css.
   ============================================================ */

:root{ --reading: 720px; }

/* ───── Reading progress bar ───── */
.progress{
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--pink);
  z-index: 100;
  transition: width .1s linear;
}

/* ───── Article header ───── */
.art-head{
  max-width: var(--reading);
  margin: 64px auto 48px;
  padding: 0 24px;
}
.crumb{
  display: inline-flex; gap: 6px; align-items: center;
  color: var(--ink-3); font-size: 13px; font-weight: 600;
  margin-bottom: 28px;
}
.crumb a:hover{ color: var(--ink);}
.cat-pill{
  display: inline-block;
  color: var(--navy);
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.art-head h1{
  margin: 0 0 24px;
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 900; letter-spacing: -0.04em;
  line-height: 1.12;
  text-wrap: balance;
}
.art-head .deck{
  margin: 0 0 36px;
  font-size: 19px; color: var(--ink-2); line-height: 1.6;
  font-weight: 500;
  text-wrap: pretty;
}
.art-meta{
  display: flex; align-items: center; gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.art-meta .ava{
  width: 44px; height: 44px; border-radius: 999px;
  background: linear-gradient(135deg, #ffd1e3, #fc7cb4);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}
.art-meta .who b{ display: block; font-size: 14.5px; font-weight: 800; letter-spacing: -0.02em;}
.art-meta .who span{ display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px;}
.art-meta .dot{ width: 3px; height: 3px; border-radius: 999px; background: var(--ink-3);}
.art-meta .info{ font-size: 13px; color: var(--ink-3); font-weight: 600;}
.art-meta .share-mini{ margin-left: auto; display: flex; gap: 6px; }
.art-meta .share-mini button{
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--bg-soft); border: 0;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
}
.art-meta .share-mini button:hover{ background: var(--ink); color: #fff;}

/* ───── Cover image ───── */
.cover{ max-width: 1080px; margin: 0 auto 64px; padding: 0 24px; }
.cover .frame{
  aspect-ratio: 16/9;
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg-soft);
}
.cover img{ width: 100%; height: 100%; object-fit: cover;}
.cover figcaption{
  margin: 14px 4px 0;
  font-size: 13px; color: var(--ink-3); font-weight: 500;
  text-align: center;
}

/* ───── Article layout (with sidebar share) ───── */
.art-wrap{
  position: relative;
  max-width: var(--reading);
  margin: 0 auto;
  padding: 0 24px 80px;
}
.art-share{
  position: absolute;
  left: -88px; top: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}
.art-share button{
  width: 44px; height: 44px; border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.art-share button:hover{
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.art-share .saved{ color: var(--pink); }
/* Brand colours on hover for the share buttons */
.art-share .sh-kakao:hover{ background: #FEE500; border-color: #FEE500; color: #191919; }
.art-share .sh-x:hover{ background: #000; border-color: #000; color: #fff; }
.art-share .sh-fb:hover{ background: #1877F2; border-color: #1877F2; color: #fff; }
.art-share .sh-naver:hover{ background: #03C75A; border-color: #03C75A; color: #fff; }

/* Copy-link toast */
.share-toast{
  position: fixed; left: 50%; bottom: 96px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 18px 40px -18px rgba(15,16,32,0.5);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.share-toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* ───── Article body typography ───── */
.article{
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.article > * + *{ margin-top: 28px;}
.article p{ margin: 0; text-wrap: pretty; }
.article h2{
  margin: 64px 0 4px;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 900; letter-spacing: -0.035em;
  line-height: 1.25;
  text-wrap: balance;
}
.article h2 + p{ margin-top: 18px;}
.article h3{
  margin: 48px 0 4px;
  font-size: 22px;
  font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.3;
}
.article h3 + p{ margin-top: 14px;}
.article strong{ font-weight: 800;}
.article a{
  color: var(--navy); font-weight: 700;
  border-bottom: 2px solid rgba(35,34,100,0.2);
  transition: border-color .15s ease;
}
.article a:hover{ border-color: var(--navy);}
.article ul, .article ol{ margin: 0; padding-left: 24px; }
.article ul li, .article ol li{ margin-bottom: 10px; line-height: 1.7; }
.article ul li::marker{ color: var(--pink); font-weight: 900;}

.article blockquote{
  margin: 56px 0;
  padding: 8px 0 8px 28px;
  border-left: 4px solid var(--pink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.45;
  color: var(--ink);
}
.article blockquote cite{
  display: block;
  margin-top: 14px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-3);
  font-style: normal;
  letter-spacing: 0;
}

.article .info-box{
  margin: 48px 0;
  background: var(--bg-soft);
  border-radius: 20px;
  padding: 28px 32px;
}
.article .info-box .lbl{
  display: inline-block;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--pink); text-transform: uppercase;
  margin-bottom: 10px;
}
.article .info-box h4{
  margin: 0 0 8px;
  font-size: 19px; font-weight: 800; letter-spacing: -0.025em;
}
.article .info-box p{
  margin: 0;
  font-size: 15.5px; line-height: 1.6;
  color: var(--ink-2);
}

.article figure{ margin: 56px -40px; }
.article figure img{ border-radius: 20px; width: 100%; height: auto; }
.article figure figcaption{
  margin: 14px 12px 0;
  font-size: 13px; color: var(--ink-3); font-weight: 500;
  text-align: center;
}
/* Image block modifiers (EditorJS: withBorder / stretched / withBackground) */
.article figure.is-bordered img{ border: 1px solid var(--line); }
.article figure.is-stretched{ margin-left: -40px; margin-right: -40px; }
.article figure.has-background{
  background: var(--bg-soft); padding: 24px; border-radius: 24px;
}
.article figure.has-background img{ max-width: 80%; margin: 0 auto; }

/* ============================================================
   EditorJS content blocks — styles for everything the admin
   editor can output (table, checklist, warning, code, embed,
   link-card, marker, delimiter, h4–h6…). Applies to blog posts
   AND static pages (both render into .article).
   ============================================================ */

/* ── Headings h4–h6 ── */
.article h4{ margin: 40px 0 4px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; }
.article h5{ margin: 32px 0 4px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.article h6{ margin: 28px 0 4px; font-size: 15px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3); }
.article h4 + p, .article h5 + p, .article h6 + p{ margin-top: 12px; }

/* ── Ordered list numbers in brand colour ── */
.article ol{ list-style: none; counter-reset: ol; padding-left: 0; }
.article ol > li{ counter-increment: ol; position: relative; padding-left: 40px; }
.article ol > li::before{
  content: counter(ol); position: absolute; left: 0; top: 0;
  min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 999px; background: var(--bg-soft); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}

/* ── Tables ── */
.article .tbl-wrap{
  margin: 40px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.article table{
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
  min-width: 460px;          /* forces horizontal scroll instead of squishing */
}
.article table th,
.article table td{
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.article table th:last-child,
.article table td:last-child{ border-right: 0; }
.article table tr:last-child td{ border-bottom: 0; }
.article table thead th{
  background: var(--navy); color: #fff;
  font-weight: 800; letter-spacing: -0.01em;
  border-right-color: rgba(255,255,255,0.15);
  white-space: nowrap;
}
.article table tbody tr:nth-child(even){ background: var(--bg-softer); }
.article table tbody tr:hover{ background: #fff5fa; }

/* ── Checklist (EditorJS checklist) ── */
.article ul.checklist{
  list-style: none; padding-left: 0; margin: 32px 0;
  display: grid; gap: 12px;
}
.article ul.checklist li{
  display: flex; align-items: flex-start; gap: 12px;
  margin: 0; padding: 14px 18px;
  background: var(--bg-soft); border-radius: 14px;
  line-height: 1.6;
}
.article ul.checklist li::marker{ content: none; }
.article ul.checklist input[type="checkbox"]{
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; margin: 2px 0 0; flex-shrink: 0;
  border: 2px solid var(--ink-3); border-radius: 7px;
  background: #fff; position: relative; cursor: default;
}
.article ul.checklist input[type="checkbox"]:checked{
  background: var(--pink); border-color: var(--pink);
}
.article ul.checklist input[type="checkbox"]:checked::after{
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* ── Warning callout ── */
.article aside.warning{
  margin: 40px 0; padding: 22px 24px 22px 56px;
  position: relative;
  background: #fff8ed; border: 1px solid #fde6c0;
  border-radius: 16px;
}
.article aside.warning::before{
  content: "!"; position: absolute; left: 20px; top: 22px;
  width: 24px; height: 24px; border-radius: 999px;
  background: #f5a73a; color: #fff;
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px;
}
.article aside.warning strong{ display: block; font-weight: 800; margin-bottom: 4px; color: #92400e; }
.article aside.warning p{ margin: 0; font-size: 15.5px; color: var(--ink-2); }

/* ── Code (block + inline) ── */
.article pre{
  margin: 32px 0; padding: 20px 22px;
  background: #0f1020; color: #e7e7ef;
  border-radius: 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  font-size: 14px; line-height: 1.65;
}
.article pre code{
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  background: none; padding: 0; color: inherit; white-space: pre;
}
.article code{
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-soft); color: var(--navy);
  padding: 2px 7px; border-radius: 6px;
}
.article mark{
  background: #fff0a6; color: inherit;
  padding: 1px 3px; border-radius: 4px;
}

/* ── Delimiter ── */
.article hr{
  border: 0; margin: 56px auto;
  width: 60px; height: 0;
  border-top: 3px dotted var(--ink-3);
  opacity: 0.6;
}

/* ── Embed (YouTube, etc.) — responsive 16:9 ── */
.article figure.embed{
  margin: 48px 0; position: relative;
}
.article figure.embed iframe{
  width: 100%; aspect-ratio: 16 / 9; height: auto;
  border: 0; border-radius: 18px; display: block; background: #000;
}

/* ── Link card (linkTool) ── */
.article a.link-card{
  display: flex; align-items: stretch; gap: 0;
  margin: 32px 0; border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; background: #fff;
  border-bottom: 1px solid var(--line);     /* cancel the underline links get */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.article a.link-card:hover{
  border-color: var(--navy);
  box-shadow: 0 18px 40px -28px rgba(15,16,32,0.3);
}
.article a.link-card img{
  width: 140px; object-fit: cover; flex-shrink: 0; border-radius: 0;
}
.article a.link-card .link-card__body{
  display: flex; flex-direction: column; justify-content: center;
  gap: 6px; padding: 18px 20px; min-width: 0;
}
.article a.link-card .link-card__title{
  font-weight: 800; font-size: 16px; color: var(--ink); letter-spacing: -0.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article a.link-card .link-card__desc{
  font-size: 13.5px; color: var(--ink-3); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ───── Numbered checklist ───── */
.check-list{
  margin: 40px 0;
  counter-reset: ck;
  padding: 0; list-style: none;
}
.check-list li{
  counter-increment: ck;
  padding: 24px 28px 24px 80px;
  border: 1px solid var(--line);
  border-radius: 20px;
  margin-bottom: 14px;
  position: relative;
}
.check-list li::before{
  content: counter(ck);
  position: absolute;
  left: 24px; top: 24px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px;
}
.check-list li b{
  display: block;
  font-size: 17px; font-weight: 800; letter-spacing: -0.025em;
  margin-bottom: 6px;
  color: var(--ink);
}
.check-list li span{
  display: block;
  font-size: 15px; line-height: 1.6;
  color: var(--ink-2);
}

/* ───── Author card ───── */
.author-card{
  margin: 72px auto 0;
  max-width: var(--reading);
  padding: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex; gap: 20px; align-items: center;
}
.author-card .ava{
  width: 64px; height: 64px; border-radius: 999px;
  background: linear-gradient(135deg, #ffd1e3, #fc7cb4);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 22px;
  flex-shrink: 0;
}
.author-card .desc{ flex: 1; min-width: 0; }
.author-card .desc .lbl{
  display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em;
  color: var(--ink-3); text-transform: uppercase; margin-bottom: 6px;
}
.author-card .desc b{ display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.025em;}
.author-card .desc p{ margin: 6px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.55;}
.author-card .follow{
  height: 44px; padding: 0 22px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  font-weight: 700; font-size: 14px;
  border: 0;
  flex-shrink: 0;
  font-family: inherit;
}

/* ───── App CTA strip ───── */
.app-cta{
  margin: 80px auto 0;
  max-width: 1080px; padding: 0 24px;
}
.app-cta-card{
  background: var(--navy); color: #fff;
  border-radius: 28px;
  padding: 48px 56px;
  display: flex; gap: 40px; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
}
.app-cta-card::after{
  content: ""; position: absolute;
  width: 280px; height: 280px; border-radius: 999px;
  background: var(--pink); opacity: 0.18;
  right: -80px; top: -80px; pointer-events: none;
}
.app-cta-card h3{
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 900; letter-spacing: -0.035em;
  line-height: 1.2;
  position: relative; z-index: 2;
  text-wrap: balance;
}
.app-cta-card h3 .pink{ color: var(--pink); }
.app-cta-card .btn-pink{
  height: 56px; padding: 0 28px;
  font-size: 15px; font-weight: 800;
  position: relative; z-index: 2;
  flex-shrink: 0;
}

/* ───── Related ───── */
.related{
  padding: 100px 0 80px;
  background: var(--bg-soft);
  margin-top: 100px;
}
.related h3{
  margin: 0 0 36px;
  font-size: 28px; font-weight: 900; letter-spacing: -0.03em;
}
.rel-grid{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.rel-card{ display: flex; flex-direction: column; cursor: pointer;}
.rel-card .thumb{
  aspect-ratio: 4/3;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 18px;
}
.rel-card .thumb img{ width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease;}
.rel-card:hover .thumb img{ transform: scale(1.04);}
.rel-card .cat-pill{
  color: var(--navy); font-weight: 800; font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 8px;
}
.rel-card h4{
  margin: 0 0 10px;
  font-size: 17px; font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rel-card .foot{
  margin-top: auto;
  font-size: 12.5px; color: var(--ink-3); font-weight: 600;
}

/* ───── Mobile bottom share bar ───── */
.mob-share{
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 60;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  gap: 8px;
}
.mob-share button{
  flex: 1;
  height: 48px;
  border-radius: 999px;
  background: var(--bg-soft); color: var(--ink);
  border: 0; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit;
}
.mob-share button.cta{
  background: var(--navy); color: #fff;
  flex: 1.5;
}

/* ───── Responsive ───── */
@media (max-width: 1200px){
  .art-share{ left: -72px; }
}
@media (max-width: 1024px){
  .art-share{ display: none; }
  .article figure{ margin: 48px 0; }
  .rel-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px){
  .art-head{ margin: 32px auto 28px;}
  .art-head h1{ font-size: 28px;}
  .art-head .deck{ font-size: 16px;}
  .art-meta{ flex-wrap: wrap; gap: 12px;}
  .art-meta .share-mini{ display: none;}
  .cover{ margin-bottom: 40px;}
  .cover .frame{ border-radius: 18px;}
  .article{ font-size: 16.5px;}
  .article h2{ font-size: 22px; margin-top: 44px;}
  .article h3{ font-size: 18px; margin-top: 32px;}
  .article blockquote{ font-size: 18px; padding-left: 20px; margin: 40px 0;}
  .article .info-box{ padding: 22px 24px;}
  /* EditorJS blocks on mobile */
  .article figure.is-stretched{ margin-left: 0; margin-right: 0; }
  .article figure.has-background img{ max-width: 100%; }
  .article .tbl-wrap{ margin: 28px 0; }
  .article table{ font-size: 14px; }
  .article table th, .article table td{ padding: 11px 14px; }
  .article pre{ padding: 16px; border-radius: 12px; }
  .article a.link-card{ flex-direction: column; }
  .article a.link-card img{ width: 100%; height: 160px; }
  .article ol > li{ padding-left: 34px; }
  .check-list li{ padding: 20px 22px 20px 68px;}
  .check-list li::before{ left: 18px; top: 20px; width: 32px; height: 32px; font-size: 13px;}
  .check-list li b{ font-size: 16px;}
  .author-card{ padding: 24px 0; flex-wrap: wrap; gap: 16px; margin-top: 56px;}
  .author-card .desc{ flex-basis: calc(100% - 80px);}
  .author-card .follow{ width: 100%; order: 3;}
  .app-cta{ margin-top: 56px;}
  .app-cta-card{ flex-direction: column; gap: 28px; padding: 36px 28px; align-items: stretch; text-align: center;}
  .app-cta-card .btn-pink{ width: 100%;}
  .related{ margin-top: 64px; padding: 64px 0;}
  .rel-grid{ grid-template-columns: 1fr; gap: 24px;}
  /* Article action bar sits ABOVE the global app tab bar. */
  .mob-share{ display: flex; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: 12px; }
  body{ padding-bottom: calc(var(--tabbar-h) + 80px + env(safe-area-inset-bottom)); }
}
