/*
 * Editorial layout for the guides under public/guides (limitations guides, the
 * long-form articles converted by scripts/redesign-article-guides.mjs, and the index).
 *
 * The pages still load Tailwind from the CDN for utilities; this file carries
 * the handful of components that Tailwind classes cannot express cleanly
 * (numbered list counters, the hero overlay, the sticky CTA bar) so that the
 * template can be tuned in one place instead of 80-odd files.
 *
 * Type comes from /js/shared.js (Playfair Display for headings, Inter for body).
 */

/* ── Hero ─────────────────────────────────────────────────────────────── */
.guide-hero img.guide-hero-img {
  object-position: center 55%;
}
.guide-hero .hero-overlay {
  background:
    linear-gradient(90deg, rgba(3, 7, 18, 0.6) 0%, rgba(3, 7, 18, 0.35) 45%, rgba(3, 7, 18, 0.05) 100%),
    linear-gradient(180deg, rgba(3, 7, 18, 0.35) 0%, rgba(3, 7, 18, 0.45) 40%, rgba(3, 7, 18, 0.96) 100%);
}
.guide-hero h1 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.guide-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1.75rem;
}
.guide-eyebrow a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.guide-eyebrow a:hover { color: #fff; }
.guide-eyebrow .sep { color: rgba(255, 255, 255, 0.3); }

/* ── Labels, pull quote, in-page nav ─────────────────────────────────── */
.guide-label {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}
.guide-pullquote {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #111827;
  border-left: 2px solid #111827;
  padding-left: 1.25rem;
  text-wrap: balance;
}
@media (min-width: 768px) {
  .guide-pullquote { font-size: 1.75rem; }
}
.guide-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 1.125rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}
.guide-toc .guide-label { margin: 0; width: 100%; }
@media (min-width: 768px) {
  .guide-toc .guide-label { width: auto; margin-right: 0.5rem; }
}
.guide-toc a {
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.guide-toc a:hover { color: #111827; border-color: #111827; }

/* ── Numbered limitations list ───────────────────────────────────────── */
.guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: guide;
  border-bottom: 1px solid #e5e7eb;
}
.guide-list > li {
  counter-increment: guide;
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.75rem 1rem;
  padding: 1.75rem 0;
  border-top: 1px solid #e5e7eb;
}
.guide-list > li::before {
  content: counter(guide, decimal-leading-zero);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.375rem;
  line-height: 1.2;
  color: #9ca3af;
  padding-top: 0.2rem;
}
.guide-list > li > h3 { grid-column: 2; margin: 0 0 0.5rem; }
.guide-list > li > p { grid-column: 2; margin: 0; }
.guide-list > li > * + * { grid-column: 2; }

/* ── Buttons and links ───────────────────────────────────────────────── */
.guide-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: #111827;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.8125rem 1.5rem;
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s;
}
.guide-btn-primary:hover {
  background: #f3f4f6;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}
.guide-btn-primary svg { width: 1rem; height: 1rem; }
.guide-link-quiet {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s;
}
.guide-link-quiet:hover { color: #fff; }
.guide-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #111827;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid #111827;
  padding-bottom: 2px;
  transition: opacity 0.15s;
}
.guide-link-arrow:hover { opacity: 0.7; }
.guide-link-arrow svg { width: 1rem; height: 1rem; flex-shrink: 0; }

/* ── Related guides ──────────────────────────────────────────────────── */
.guide-related { border-bottom: 1px solid #e5e7eb; }
.guide-related-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
  text-decoration: none;
}
.guide-related-item:hover .guide-related-title { text-decoration: underline; text-underline-offset: 3px; }
.guide-related-item::after {
  content: "\2192";
  color: #9ca3af;
  flex-shrink: 0;
}

/* ── Article bodies (long-form guides rendered through the same shell) ── */
.guide-prose { color: #4b5563; }
.guide-prose h2 { margin-top: 3rem; margin-bottom: 1rem; font-size: 1.875rem; line-height: 1.15; color: #111827; }
.guide-prose h3 { margin-top: 2.25rem; margin-bottom: 0.75rem; font-size: 1.375rem; line-height: 1.25; color: #111827; }
.guide-prose h4 { margin-top: 1.75rem; margin-bottom: 0.5rem; font-size: 1.0625rem; font-weight: 500; color: #111827; }
.guide-prose h2 + h3 { margin-top: 1.25rem; }
.guide-prose p, .guide-prose li { color: #4b5563; font-weight: 300; }
.guide-prose strong { color: #111827; font-weight: 500; }
.guide-prose a { color: #111827; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #d1d5db; font-weight: 400; }
.guide-prose a:hover { text-decoration-color: #111827; }
.guide-prose ul > li::marker { color: #9ca3af; }
.guide-prose blockquote { border-left: 2px solid #111827; font-style: normal; color: #111827; font-family: "Playfair Display", Georgia, serif; font-size: 1.25rem; font-weight: 400; quotes: none; }
.guide-prose table { display: block; overflow-x: auto; font-size: 0.9375rem; line-height: 1.5; }
.guide-prose thead { border-bottom: 1px solid #111827; }
.guide-prose th, .guide-prose td { border: 0 !important; border-bottom: 1px solid #e5e7eb !important; padding: 0.75rem 1rem !important; text-align: left; vertical-align: top; }
.guide-prose th { background: transparent !important; font-weight: 500; color: #111827; font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; }
.guide-prose tr:last-child td { border-bottom: 0 !important; }
.guide-prose tr.bg-gray-50, .guide-prose tr.bg-gray-100 { background: transparent !important; }
.guide-prose pre { background: #111827; color: #e5e7eb; border-radius: 0.75rem; font-size: 0.875rem; }
.guide-prose :not(pre) > code { background: #f3f4f6; color: #111827; padding: 0.1em 0.4em; border-radius: 0.3em; font-size: 0.875em; font-weight: 400; }
.guide-prose :not(pre) > code::before, .guide-prose :not(pre) > code::after { content: none; }
.guide-prose hr { border-color: #e5e7eb; margin: 3rem 0; }
.guide-prose img { border-radius: 0.75rem; }
/* Tinted callout boxes from the older templates read as one neutral note. */
.guide-prose .guide-note,
.guide-prose [class*="bg-blue-50"], .guide-prose [class*="bg-green-50"], .guide-prose [class*="bg-yellow-50"],
.guide-prose [class*="bg-red-50"], .guide-prose [class*="bg-purple-50"], .guide-prose [class*="bg-indigo-50"],
.guide-prose [class*="bg-amber-50"], .guide-prose [class*="bg-orange-50"], .guide-prose [class*="bg-emerald-50"],
.guide-prose [class*="bg-gray-50"], .guide-prose [class*="bg-gray-100"] {
  background: #f9fafb !important;
  border-color: #e5e7eb !important;
  border-radius: 0.75rem;
  box-shadow: none !important;
}
.guide-prose [class*="border-l-4"] { border-left: 2px solid #111827 !important; border-radius: 0 0.75rem 0.75rem 0; }
.guide-prose .guide-note > :first-child, .guide-prose [class*="bg-"] > :first-child { margin-top: 0; }
.guide-prose .guide-note > :last-child, .guide-prose [class*="bg-"] > :last-child { margin-bottom: 0; }
.guide-prose [class*="bg-gray-900"], .guide-prose [class*="bg-gray-800"], .guide-prose [class*="bg-blue-600"], .guide-prose [class*="bg-indigo-600"] {
  background: #111827 !important;
  color: #e5e7eb;
  border-radius: 0.75rem;
}
.guide-prose [class*="bg-gray-900"] :is(h2, h3, h4, strong), .guide-prose [class*="bg-gray-800"] :is(h2, h3, h4, strong),
.guide-prose [class*="bg-blue-600"] :is(h2, h3, h4, strong), .guide-prose [class*="bg-indigo-600"] :is(h2, h3, h4, strong) { color: #fff; }
.guide-prose [class*="bg-gray-900"] :is(p, li), .guide-prose [class*="bg-gray-800"] :is(p, li),
.guide-prose [class*="bg-blue-600"] :is(p, li), .guide-prose [class*="bg-indigo-600"] :is(p, li) { color: rgba(255, 255, 255, 0.75); }
.guide-prose [class*="text-indigo"], .guide-prose [class*="text-blue-6"], .guide-prose [class*="text-purple"] { color: #111827 !important; }
.guide-prose [class*="shadow"] { box-shadow: none !important; }
.guide-prose [class*="font-bold"] { font-weight: 500 !important; }

/* ── Sticky CTA bar (built by /js/guide-sticky-cta.js) ───────────────── */
.guide-sticky {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 60;
  width: calc(100% - 2rem);
  max-width: 46rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.5rem 0.5rem 0.5rem 0.625rem;
  background: rgba(3, 7, 18, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 140%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}
.guide-sticky.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.guide-sticky img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.guide-sticky-text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.3;
}
.guide-sticky-text strong { display: block; font-weight: 500; color: #fff; }
.guide-sticky-text span {
  display: block;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-sticky .guide-btn-primary {
  padding: 0.625rem 1.125rem;
  font-size: 0.875rem;
}
.guide-sticky-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 0.25rem;
  line-height: 0;
  border-radius: 9999px;
  transition: color 0.15s;
}
.guide-sticky-close:hover { color: #fff; }
.guide-sticky-close svg { width: 0.875rem; height: 0.875rem; }
@media (max-width: 640px) {
  .guide-sticky { bottom: 0.75rem; gap: 0.625rem; }
  .guide-sticky img { display: none; }
  .guide-sticky-text { padding-left: 0.5rem; }
  .guide-sticky-text span { display: none; }
  .guide-sticky .guide-btn-primary { padding: 0.625rem 0.875rem; font-size: 0.8125rem; }
}
/* Keep the Zee chat button clear of the bar until the viewport is wide
   enough for both to sit side by side. */
@media (max-width: 1180px) {
  body.guide-sticky-on #zcw-fab { bottom: 5.75rem; }
}
