/* ================================================================
   blog.css — DSC Registration | Blog UI Enhancement System
   Primary: #f36c1e  |  Secondary: #2c3e50
   Scope: All blog/article pages — non-destructive overrides only
   ================================================================ */

/* ── 1. CSS Custom Properties ── */
:root {
  --c-primary:        #f36c1e;
  --c-primary-hover:  #d45a10;
  --c-primary-light:  #fff4ee;
  --c-primary-glow:   rgba(243, 108, 30, 0.18);
  --c-secondary:      #2c3e50;
  --c-secondary-light:#3d5467;
  --c-text:           #2d3748;
  --c-text-mid:       #4a5568;
  --c-text-soft:      #718096;
  --c-border:         #e2e8f0;
  --c-border-light:   #edf2f7;
  --c-bg-page:        #f0f4f8;
  --c-bg-card:        #ffffff;
  --c-bg-accent:      #f8fafc;
  --c-white:          #ffffff;

  --shadow-xs: 0 1px 3px rgba(44,62,80,.06), 0 1px 2px rgba(44,62,80,.04);
  --shadow-sm: 0 4px 12px rgba(44,62,80,.08), 0 1px 3px rgba(44,62,80,.05);
  --shadow-md: 0 8px 28px rgba(44,62,80,.11), 0 2px 6px rgba(44,62,80,.06);
  --shadow-lg: 0 20px 60px rgba(44,62,80,.14), 0 4px 12px rgba(44,62,80,.08);
  --shadow-primary: 0 4px 18px rgba(243,108,30,.28);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: 0.22s;
}

/* ── 2. Scroll Progress Bar ── */
#blog-progress {
  position: fixed;
  top: 0; left: 0; z-index: 9999;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--c-primary) 0%, #ff9a55 60%, var(--c-primary) 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 10px rgba(243,108,30,.5);
  transition: width .08s linear;
  animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 3. Page Background ── */
body {
  background: var(--c-bg-page) !important;
}

/* ── 4. Container Breathing Room ── */
.container.mt-4 {
  padding-top: 2rem !important;
  padding-bottom: 3rem !important;
}

/* ── 5. "Blog" Label / Page-Title ── */
.page-title {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem !important;
  font-weight: 700 !important;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-primary) !important;
  background: var(--c-primary-light);
  border: 1px solid rgba(243,108,30,.2);
  border-radius: 100px;
  padding: .3rem .9rem !important;
  margin-bottom: 1.4rem !important;
}
.page-title::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--c-primary);
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── 6. Content Cards (.box) ── */
.box {
  background: var(--c-bg-card) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--radius-md) !important;
  padding: 2.25rem 2.5rem !important;
  margin-bottom: 1.5rem !important;
  box-shadow: var(--shadow-sm) !important;
  color: var(--c-text) !important;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.box::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.box:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}
.box:hover::after { opacity: 1; }

/* ── 7. Banner Image ── */
.banner {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
  position: relative;
}
.banner img {
  width: 100%;
  display: block;
  transition: transform .55s var(--ease);
}
.banner:hover img { transform: scale(1.03); }

/* ── 8. Paragraph Text ── */
.box p {
  color: var(--c-text-mid) !important;
  line-height: 1.85;
  font-size: .975rem;
  margin-bottom: .95rem;
}
.box p:last-child { margin-bottom: 0; }

/* ── 9. Step Title Paragraphs / h4.step-title ── */
.box p.step-title,
.box h4.step-title {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  background: linear-gradient(135deg, var(--c-primary-light) 0%, #fff8f4 100%) !important;
  border-left: 4px solid var(--c-primary) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
  padding: .75rem 1.1rem !important;
  margin: 1.3rem 0 .6rem !important;
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-secondary) !important;
  line-height: 1.5;
}
.box p.step-title strong,
.box h4.step-title strong {
  color: var(--c-primary) !important;
  white-space: nowrap;
  font-weight: 800;
}

/* Step paragraphs (USB token page) */
.box p.step {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: .75rem 1rem !important;   /* ← remove the 3.2rem left padding */
  background: var(--c-bg-accent);
  border-radius: var(--radius-sm);
  margin-bottom: .65rem !important;
  border: 1px solid var(--c-border-light);
  font-size: .95rem;
  color: var(--c-text-mid) !important;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.box p.step:hover {
  background: var(--c-primary-light);
  border-color: rgba(243,108,30,.25);
}
.box p.step b:first-child {
  position: static !important;
  min-width: 60px;
  color: var(--c-primary) !important;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
}

.box p.step a {
  color: #0d6efd !important;          /* Bootstrap blue, or any blue you prefer */
  border-bottom-color: rgba(13,110,253,.3) !important;
}
.box p.step a:hover {
  color: #0a58ca !important;
  border-bottom-color: #0a58ca !important;
}
/* ── 10. Lists ── */
.box ul,
.box ol {
  padding-left: 1.4rem;
  margin: .6rem 0 1rem;
}
.box ul li,
.box ol li {
  color: var(--c-text-mid) !important;
  padding: .28rem 0;
  line-height: 1.7;
  font-size: .965rem;
  position: relative;
}
.box ul { list-style: none; padding-left: 1.6rem; }
.box ul li::before {
  content: '';
  position: absolute;
  left: -1.3rem;
  top: .65em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-primary);
  opacity: .75;
}
.box ul ul { margin-top: .2rem; }
.box ul ul li::before {
  background: transparent;
  border: 2px solid var(--c-primary);
  opacity: .55;
}

/* Bold labels (Class 1, 2, 3 / numbered sections) */
.box p > b:only-child,
.box p > b:first-child:last-child {
  display: inline-block;
  color: var(--c-secondary) !important;
  font-size: .93rem;
  font-weight: 700;
  padding: .3rem .8rem;
  background: var(--c-bg-accent);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xs);
  margin-bottom: .35rem;
}

/* ── 11. In-Content Links ── */
.box a {
  color: var(--c-primary) !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(243,108,30,.3);
  padding-bottom: 1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.box a:hover {
  color: var(--c-primary-hover) !important;
  border-bottom-color: var(--c-primary-hover);
}

/* ── 12. Inline Images (step screenshots) ── */
.box img.img:not(.img-fluid),
.box img.img.img-fluid:not([src*="banner"]):not([class*="banner"]) {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin: 1rem 0 1.2rem;
  max-width: 100%;
  display: block;
  border: 1px solid var(--c-border);
}

/* ── 13. H1 ── */
.box h1.text-dark,
.box h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem) !important;
  font-weight: 800 !important;
  color: var(--c-secondary) !important;
  line-height: 1.28;
  margin: 0 0 1.2rem !important;
  letter-spacing: -.02em;
}

/* ── 14. H2 in content (not page-title) ── */
.box h2:not(.page-title) {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--c-secondary) !important;
  margin: .2rem 0 .9rem !important;
  padding-bottom: .55rem;
  border-bottom: 2px solid var(--c-border-light);
  position: relative;
}
.box h2:not(.page-title)::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 36px; height: 2px;
  background: var(--c-primary);
  border-radius: 2px;
}

/* ── 15. H3 ── */
.box h3 {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: var(--c-secondary) !important;
  margin: .2rem 0 .9rem !important;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--c-border-light);
  position: relative;
}
.box h3::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 30px; height: 2px;
  background: var(--c-primary);
  border-radius: 2px;
}

/* ── 16. H4 (Conclusion headings) ── */
.box h4:not(.step-title) {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: var(--c-secondary) !important;
  margin: .2rem 0 .8rem !important;
}

/* ── 17. Right Sidebar ── */
.right-sticky {
  position: sticky !important;
  top: 88px;
  background: var(--c-bg-card) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--radius-md) !important;
  padding: 1.6rem !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
}
.right-sticky::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary) 0%, #ffb347 100%);
}

/* Sidebar H5 */
.right-sticky h5 {
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-secondary) !important;
  margin: 1.4rem 0 .65rem !important;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.right-sticky h5:first-child { margin-top: 0 !important; }
.right-sticky h5 i,
.right-sticky h5 .fa-solid {
  color: var(--c-primary);
  font-size: .82rem;
  background: var(--c-primary-light);
  padding: .28rem .32rem;
  border-radius: var(--radius-xs);
}

/* Sidebar links */
.right-sticky a {
  display: block;
  font-size: .845rem !important;
  color: var(--c-text-mid) !important;
  text-decoration: none !important;
  border-bottom: none !important;
  padding: .42rem .6rem .42rem .9rem;
  border-radius: var(--radius-xs);
  margin-bottom: .18rem;
  position: relative;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              padding-left var(--dur) var(--ease-spring);
  line-height: 1.45;
}
.right-sticky a::before {
  content: '›';
  position: absolute;
  left: .25rem;
  top: 50%; transform: translateY(-50%);
  color: var(--c-primary);
  font-size: 1.05rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), left var(--dur) var(--ease-spring);
}
.right-sticky a:hover {
  background: var(--c-primary-light) !important;
  color: var(--c-primary) !important;
  padding-left: 1.3rem;
}
.right-sticky a:hover::before { opacity: 1; left: .35rem; }

/* Sidebar list */
.right-sticky ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 .5rem !important;
  counter-reset: toc;
}
.right-sticky ul li { margin-bottom: 0; }
.right-sticky ul li a {
  counter-increment: toc;
  padding-left: 2rem;
  font-size: .82rem !important;
}
.right-sticky ul li a::after {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: .55rem;
  top: 50%; transform: translateY(-50%);
  font-size: .65rem;
  font-weight: 800;
  color: var(--c-primary);
  opacity: .7;
}
.right-sticky ul li a::before { display: none; }
.right-sticky ul li a:hover::after { opacity: 1; }

/* Divider after br tags in sidebar */
.right-sticky br { display: none; }

p.step {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  background-color: #f8f9fa !important;
  border-left: 4px solid #f36c1e !important;
  /* padding: 12px 16px !important; */
  border-radius: 6px !important;
  margin-bottom: 12px !important;
  color: #2c3e50 !important;
  overflow: visible !important;
  position: static !important;
}

p.step b {
  min-width: 70px !important;
  color: #f36c1e !important;
  flex-shrink: 0 !important;
  position: static !important;
}

/* ── 18. Fade-in Animation on Load ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.box {
  animation: fadeUp .45s var(--ease) both;
}
.col-md-8 .box:nth-child(1) { animation-delay: .05s; }
.col-md-8 .box:nth-child(2) { animation-delay: .12s; }
.col-md-8 .box:nth-child(3) { animation-delay: .19s; }
.col-md-8 .box:nth-child(4) { animation-delay: .26s; }
.col-md-8 .box:nth-child(5) { animation-delay: .33s; }
.col-md-4 { animation: fadeUp .45s var(--ease) .3s both; }

/* ── 19. Responsive — Tablet ── */
@media (max-width: 991.98px) {
  .right-sticky {
    position: static !important;
    margin-top: 1.5rem;
  }
  .box { padding: 1.75rem 1.5rem !important; }
}

/* ── 20. Responsive — Mobile ── */
@media (max-width: 767.98px) {
  .container.mt-4 { padding: .75rem !important; }
  .box { padding: 1.25rem 1rem !important; border-radius: var(--radius-sm) !important; }
  .box p.step-title,
  .box h4.step-title { padding: .6rem .85rem !important; font-size: .9rem; }
  .box h1.text-dark { font-size: 1.4rem !important; }
  .box h2:not(.page-title) { font-size: 1.15rem !important; }
  .box h3 { font-size: 1.05rem !important; }
  .banner { border-radius: var(--radius-sm); }
  .right-sticky { padding: 1.2rem !important; border-radius: var(--radius-sm) !important; }
  .box p.step { padding-left: 1rem !important; }
}

@media (max-width: 480px) {
  .box { margin-bottom: 1rem !important; }
  .page-title { font-size: .72rem !important; }
  .right-sticky h5 { font-size: .68rem !important; }
}

/* ── 21. Smooth Scroll & Focus ── */
html { scroll-behavior: smooth; }
a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── 22. Selection Color ── */
::selection {
  background: rgba(243,108,30,.18);
  color: var(--c-secondary);
}

/* ── 23. Print: strip decoratives ── */
@media print {
  .right-sticky { display: none; }
  .box { box-shadow: none !important; border: 1px solid #ddd !important; }
  #blog-progress { display: none; }
}

/* ── Mobile Step Fix ── */
@media (max-width: 767.98px) {
  .box p.step {
    flex-wrap: wrap !important;
  }

  .box p.step b:first-child {
    min-width: auto !important;
    width: 100%;
  }

  .box p.step a {
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    display: inline-block;
    max-width: 100%;
  }
}