/* Guides pages — hub + individual how-to guides */

/* ── Buttons (shared with homepage patterns) ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.6875rem var(--sp-6);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--clr-brand);
  color: var(--clr-text-inv);
  border-color: var(--clr-brand);
}

.btn-primary:hover {
  background: var(--clr-brand-dark);
  border-color: var(--clr-brand-dark);
}

.btn-outline {
  background: transparent;
  color: var(--clr-text-2);
  border-color: var(--clr-border-strong);
}

.btn-outline:hover {
  color: var(--clr-text);
  background: var(--clr-raised);
}

/* ── Phone frame ── */

.device-phone {
  position: relative;
  z-index: 1;
  flex-shrink: 1;
  width: min(100%, 300px);
  max-width: 100%;
  border: 5px solid #1a1a1a;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #1a1a1a;
}

.device-phone::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 14px;
  background: #1a1a1a;
  border-radius: var(--r-full);
  z-index: 1;
  pointer-events: none;
}

.device-phone img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Breadcrumbs ── */

.guide-breadcrumbs {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6) 0;
}

.guide-breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--clr-text-3);
}

.guide-breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.guide-breadcrumbs li:not(:last-child)::after {
  content: '/';
  color: var(--clr-text-3);
}

.guide-breadcrumbs a {
  color: var(--clr-text-2);
  text-decoration: none;
  transition: color var(--t-fast);
}

.guide-breadcrumbs a:hover {
  color: var(--clr-text);
}

.guide-breadcrumbs [aria-current='page'] {
  color: var(--clr-text-3);
}

/* ── Guide hero ── */

.guide-hero {
  padding: var(--sp-10) 0 var(--sp-12);
  border-bottom: 1px solid var(--clr-border);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(5, 150, 105, 0.10) 0%, transparent 55%),
    var(--clr-bg);
}

.guide-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: grid;
  gap: var(--sp-10);
  align-items: center;
}

.guide-hero--with-visual .guide-hero-inner {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.guide-eyebrow {
  font-family: var(--font-head);
  font-size: var(--text-sm);
  font-weight: var(--w-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-brand-muted);
  margin-bottom: var(--sp-3);
}

.guide-title {
  font-family: var(--font-head);
  font-weight: var(--w-extrabold);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: var(--leading-tight);
  color: var(--clr-text);
  margin-bottom: var(--sp-4);
  max-width: 18ch;
}

.guide-sub {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--clr-text-2);
  margin-bottom: var(--sp-6);
  max-width: 42ch;
}

.guide-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
}

.guide-trust {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--clr-text-3);
}

.guide-hero-visual {
  display: flex;
  justify-content: center;
  min-width: 0;
}

/* ── Hub page ── */

.guides-hub-intro {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-6) var(--sp-8);
}

.guides-hub-intro .guide-title {
  max-width: 22ch;
}

.guides-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6) var(--sp-16);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-6);
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-base);
  min-width: 0;
}

.guide-card:hover {
  border-color: var(--clr-border-strong);
  background: var(--clr-raised);
}

.guide-card-label {
  font-family: var(--font-head);
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-brand-muted);
}

.guide-card-title {
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: var(--w-bold);
  line-height: var(--leading-snug);
  color: var(--clr-text);
}

.guide-card-body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--clr-text-2);
  flex: 1;
}

.guide-card-cta {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--w-semibold);
  color: var(--clr-brand-muted);
}

.guide-card:hover .guide-card-cta {
  color: var(--clr-brand);
}

/* ── Content sections ── */

.guide-section {
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--clr-border);
}

.guide-section--alt {
  background: var(--clr-bg-alt);
}

.guide-section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.guide-section-inner--narrow {
  max-width: var(--max-w-text);
}

.guide-section-label {
  font-family: var(--font-head);
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-brand-muted);
  margin-bottom: var(--sp-3);
}

.guide-section-title {
  font-family: var(--font-head);
  font-weight: var(--w-bold);
  font-size: clamp(1.35rem, 3vw, 1.875rem);
  line-height: var(--leading-snug);
  color: var(--clr-text);
  margin-bottom: var(--sp-4);
}

.guide-prose {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--clr-text-2);
}

.guide-prose p + p {
  margin-top: var(--sp-4);
}

.guide-prose--lead {
  max-width: var(--max-w-text);
  margin-bottom: var(--sp-2);
}

.guide-prose strong {
  color: var(--clr-text);
  font-weight: var(--w-semibold);
}

/* Split: copy + visual */

.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-10);
  align-items: center;
}

.guide-split--flip {
  direction: rtl;
}

.guide-split--flip > * {
  direction: ltr;
}

.guide-split-visual {
  display: flex;
  justify-content: center;
  min-width: 0;
}

/* Capability list */

.guide-caps {
  list-style: none;
  display: grid;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.guide-cap {
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--clr-border);
}

.guide-cap:last-child {
  border-bottom: 1px solid var(--clr-border);
}

.guide-cap-title {
  font-family: var(--font-head);
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  color: var(--clr-text);
  margin-bottom: var(--sp-1);
}

.guide-cap-body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--clr-text-2);
}

/* Steps */

.guide-steps {
  list-style: none;
  counter-reset: guide-step;
  display: grid;
  gap: var(--sp-6);
  margin-top: var(--sp-8);
}

.guide-step {
  counter-increment: guide-step;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.guide-step::before {
  content: counter(guide-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-full);
  background: var(--clr-brand-dim);
  color: var(--clr-brand-muted);
  font-family: var(--font-head);
  font-size: var(--text-sm);
  font-weight: var(--w-bold);
  flex-shrink: 0;
}

.guide-step-title {
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: var(--w-semibold);
  color: var(--clr-text);
  margin-bottom: var(--sp-1);
}

.guide-step-body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--clr-text-2);
}

/* Tab explainer (debt Overview vs History) */

.guide-tabs {
  display: grid;
  gap: var(--sp-8);
  margin-top: var(--sp-8);
}

.guide-tab-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: center;
}

.guide-tab-block--flip {
  direction: rtl;
}

.guide-tab-block--flip > * {
  direction: ltr;
}

.guide-tab-pill {
  display: inline-block;
  font-family: var(--font-head);
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-brand-muted);
  background: var(--clr-brand-dim);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-3);
}

/* Related guides */

.guide-related {
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--clr-border);
}

.guide-related-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.guide-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

/* Final CTA */

.guide-cta {
  padding: var(--sp-20) 0;
  background: var(--clr-surface);
  text-align: center;
}

.guide-cta-inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.guide-cta-headline {
  font-family: var(--font-head);
  font-weight: var(--w-extrabold);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: var(--leading-tight);
  color: var(--clr-text);
}

.guide-cta-sub {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--clr-text-2);
  max-width: 36ch;
}

.guide-cta .btn {
  padding: var(--sp-4) var(--sp-10);
  font-family: var(--font-head);
  font-size: var(--text-lg);
}

/* Nav current page */

.nav-links a[aria-current='page'] {
  color: var(--clr-text);
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .guide-hero-copy,
  .guide-hero-visual {
    opacity: 0;
    transform: translateY(12px);
    animation: guide-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .guide-hero-visual {
    animation-delay: 80ms;
  }

  .guide-card {
    transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-base);
  }

  .guide-card:hover {
    transform: translateY(-2px);
  }
}

@keyframes guide-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .guide-hero--with-visual .guide-hero-inner,
  .guide-split,
  .guide-split--flip,
  .guide-tab-block,
  .guide-tab-block--flip {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .guide-split--flip > *,
  .guide-tab-block--flip > * {
    direction: ltr;
  }

  .guides-grid,
  .guide-related-grid {
    grid-template-columns: 1fr;
  }

  .guide-hero-visual,
  .guide-split-visual {
    order: -1;
  }
}

@media (max-width: 767px) {
  .guide-hero {
    padding: var(--sp-8) 0 var(--sp-10);
  }

  .guide-breadcrumbs,
  .guide-hero-inner,
  .guides-hub-intro,
  .guides-grid,
  .guide-section-inner,
  .guide-related-inner,
  .guide-cta-inner {
    padding-left: var(--sp-5);
    padding-right: var(--sp-5);
  }

  .guide-section {
    padding: var(--sp-12) 0;
  }

  .guide-title {
    max-width: none;
  }

  .device-phone {
    width: min(100%, 280px);
  }
}

@media (max-width: 375px) {
  .guide-breadcrumbs,
  .guide-hero-inner,
  .guides-hub-intro,
  .guides-grid,
  .guide-section-inner,
  .guide-related-inner,
  .guide-cta-inner {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
}
