/* ============================================
   Blog Article — Magazine Layout
   Unified class system: mag__*
   ============================================ */

/* Reading progress bar */
.mag__progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-main);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* Container */
.mag {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  position: relative;
  z-index: 1;
}

/* Breadcrumb */
.mag__breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 7rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.mag__breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}
.mag__breadcrumb a:hover {
  color: var(--accent-purple);
}

/* Header */
.mag__header {
  margin-bottom: 3rem;
}
.mag__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.mag__meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mag__tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.mag__title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}
.mag__title .gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero image */
.mag__hero {
  margin: 0 -2rem 3rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  position: relative;
}
.mag__hero img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 420px;
}

/* Body */
.mag__body {
  position: relative;
}

/* Typography */
.mag__body p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.mag__body a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}
.mag__body a:hover {
  color: var(--accent-blue);
}
.mag__body .btn--primary {
  color: white;
}
.mag__body .btn--secondary {
  color: var(--text-primary);
}
.mag__body strong {
  color: var(--text-primary);
  font-weight: 600;
}
.mag__body ul,
.mag__body ol {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.mag__body li {
  margin-bottom: 0.5rem;
}

/* Drop cap */
.mag__dropcap::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.8;
  padding-right: 0.12em;
  margin-top: 0.05em;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section headings with decorative number */
.mag__section {
  position: relative;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-top: 1.5rem;
  border-top: 3px solid transparent;
  border-image: var(--gradient-main) 1;
}
.mag__section-num {
  position: absolute;
  top: -0.3rem;
  right: 0;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(59, 130, 246, 0.04));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  pointer-events: none;
  user-select: none;
  font-family: var(--font-mono);
}
.mag__section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
  position: relative;
  z-index: 1;
}
.mag__body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

/* Code blocks */
.mag__body pre {
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    border-radius: 0.75rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.mag__body pre code {
    color: #e2e8f0;
    background: none;
    padding: 0;
    border: none;
    font-size: inherit;
}

.mag__body code {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
}

/* Pull quote */
.mag__pullquote {
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  border-left: 4px solid transparent;
  border-image: var(--gradient-main) 1;
  position: relative;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.mag__pullquote::before {
  content: "\201C";
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.3;
  pointer-events: none;
}
.mag__pullquote p {
  text-align: left !important;
  margin-bottom: 0;
  color: var(--text-primary);
}

/* Callout boxes */
.mag__callout {
  padding: 1.5rem 1.75rem;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  margin: 1.75rem 0;
  border-left: 4px solid var(--accent-emerald);
  position: relative;
}
.mag__callout--result {
  border-left-color: var(--accent-emerald);
}
.mag__callout--tip {
  border-left-color: var(--accent-blue);
}
.mag__callout--warning {
  border-left-color: var(--accent-orange);
}
.mag__callout p {
  margin-bottom: 0;
  text-align: left !important;
}
.mag__callout .mag__callout-icon {
  margin-right: 0.5rem;
}
.mag__callout--result .mag__callout-icon {
  color: var(--accent-emerald);
}
.mag__callout--tip .mag__callout-icon {
  color: var(--accent-blue);
}
.mag__callout--warning .mag__callout-icon {
  color: var(--accent-orange);
}

/* Figure / in-body images */
.mag__figure {
  margin: 2.5rem -1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}
.mag__figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.mag__figure figcaption {
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

/* Checklist */
.mag__checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mag__checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.mag__checklist .fa-check {
  color: var(--accent-emerald);
  margin-top: 0.25rem;
  flex-shrink: 0;
}

/* Tables */
.mag__table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0 2rem;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}
.mag__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.mag__table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
.mag__table td {
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  line-height: 1.6;
}
.mag__table tr:last-child td {
  border-bottom: none;
}
.mag__table tr:hover td {
  background: rgba(168, 85, 247, 0.05);
}
.mag__table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Divider */
.mag__divider {
  border: none;
  height: 3px;
  background: var(--gradient-main);
  margin: 3rem auto;
  max-width: 200px;
  border-radius: 2px;
  opacity: 0.4;
}

/* CTA block */
.mag__cta {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid var(--glass-border);
  margin: 3rem 0 1rem;
}
.mag__cta h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}
.mag__cta p {
  text-align: center !important;
  max-width: 500px;
  margin: 0 auto 1.5rem;
  color: var(--text-secondary);
}
.mag__cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Inline SVG illustrations */
.mag__illustration {
  display: block;
  margin: 2.5rem auto;
  max-width: 320px;
  width: 100%;
  height: auto;
  opacity: 0.85;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablet */
@media (max-width: 960px) {
  .mag {
    padding: 0 1.5rem 3rem;
  }
  .mag__hero {
    margin: 0 -1.5rem 2.5rem;
  }
  .mag__figure {
    margin: 2rem 0;
  }
  .mag__section-num {
    font-size: 4rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .mag {
    padding: 0 1rem 2rem;
  }
  .mag__breadcrumb {
    padding-top: 6rem;
    margin-bottom: 1.5rem;
  }
  .mag__title {
    font-size: 1.6rem;
  }
  .mag__hero {
    margin: 0 -1rem 2rem;
    border-radius: 12px;
  }
  .mag__hero img {
    max-height: 260px;
  }
  .mag__body p {
    font-size: 0.95rem;
    text-align: left;
    hyphens: none;
    -webkit-hyphens: none;
  }
  .mag__section-num {
    font-size: 3rem;
  }
  .mag__pullquote {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    margin: 2rem 0;
  }
  .mag__pullquote::before {
    font-size: 3rem;
  }
  .mag__figure {
    margin: 1.5rem -0.5rem;
  }
  .mag__dropcap::first-letter {
    font-size: 2.8em;
  }
  .mag__callout {
    padding: 1.25rem 1rem;
  }
  .mag__cta {
    padding: 2rem 1.25rem;
  }
  .mag__table th,
  .mag__table td {
    padding: 0.75rem 0.8rem;
    font-size: 0.8rem;
  }
  .mag__divider {
    margin: 2rem auto;
  }
}
