/* ============================================================================
   Remediate — organic-search guide pages and resource hub.
   Loaded after app.css; uses the same tokens so guides match the product.
   ========================================================================== */

.guide-hero {
  background:
    radial-gradient(1200px 420px at 12% -10%, rgba(47, 95, 219, 0.10), transparent 60%),
    linear-gradient(180deg, var(--paper, #f7f9fc), #fff 70%);
  border-bottom: 1px solid var(--line);
}

.guide-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) clamp(2rem, 4vw, 3.2rem);
}

.guide-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--muted);
}

.guide-crumbs li + li::before {
  content: '/';
  margin-right: 0.45rem;
  color: var(--line-strong);
}

.guide-hero h1 {
  max-width: 22ch;
  margin: 0.35rem 0 0.7rem;
  font-size: clamp(2rem, 4.6vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.guide-hero .marketing-lead {
  max-width: 68ch;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 1.2rem 0 1.4rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.guide-meta span + span::before {
  content: '·';
  margin-right: 1.1rem;
  color: var(--line-strong);
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: clamp(1.4rem, 4vw, 3.2rem);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.2rem) clamp(1rem, 4vw, 2.5rem) clamp(2.4rem, 5vw, 4rem);
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: 1.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 0.8rem;
}

.guide-toc h2 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.guide-toc ol {
  margin: 0;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.guide-toc a {
  color: var(--ink-2);
  text-decoration: none;
}

.guide-toc a:hover,
.guide-toc a:focus-visible {
  color: var(--brand-600);
  text-decoration: underline;
}

.guide-toc-cta {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.guide-toc-cta strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
}

.guide-toc-cta p {
  margin: 0.25rem 0 0.45rem;
  color: var(--muted);
  line-height: 1.45;
}

.guide-body {
  min-width: 0;
  max-width: min(74ch, 100%);
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
}

/* Grid children default to min-width:auto; long tables would otherwise widen
   the mobile layout viewport and make the page zoom out. */
.guide-layout > * {
  min-width: 0;
}

.guide-body h2 {
  margin: 2.3rem 0 0.7rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  letter-spacing: -0.02em;
  scroll-margin-top: 1.2rem;
}

.guide-body h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.guide-body h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.05rem;
}

.guide-body p,
.guide-body li {
  color: var(--ink-2);
}

.guide-body a {
  color: var(--brand-600);
  text-underline-offset: 2px;
}

.guide-body ul,
.guide-body ol {
  margin: 0.7rem 0 1rem;
  padding-left: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.guide-body .check-list {
  font-size: 0.94rem;
  gap: 0.45rem;
}

.guide-body .check-list li::before {
  content: '☐';
  color: var(--brand-600);
  font-weight: 400;
}

.guide-body .steps-list {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.guide-body .steps-list > li {
  position: relative;
  padding-left: 2.2rem;
}

.guide-body .steps-list > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.guide-body .table-wrap {
  max-width: 100%;
  margin: 1rem 0 1.3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.guide-body table {
  min-width: 520px;
}

.guide-body th,
.guide-body td {
  overflow-wrap: anywhere;
}

.guide-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.5;
  background: #fff;
}

.guide-body caption {
  caption-side: top;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-size: 0.76rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.guide-body th,
.guide-body td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.guide-body thead th {
  background: #f7f9fc;
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-body tbody th {
  color: var(--ink);
  font-weight: 600;
  white-space: normal;
}

.guide-body .faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.guide-body .faq {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.2rem 0.85rem;
}

.guide-body .faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
}

.guide-body .faq summary::-webkit-details-marker {
  display: none;
}

.guide-body .faq-icon {
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.guide-body .faq-icon::before,
.guide-body .faq-icon::after {
  content: '';
  position: absolute;
  inset: 6px 0 auto;
  height: 2px;
  background: var(--ink-2);
  border-radius: 2px;
}

.guide-body .faq-icon::after {
  transform: rotate(90deg);
  transition: transform 150ms ease;
}

.guide-body .faq[open] .faq-icon::after {
  transform: rotate(0deg);
}

.guide-body .faq-body {
  padding: 0 0 0.85rem;
}

.guide-body .faq-body p {
  margin: 0;
  font-size: 0.92rem;
}

.guide-disclaimer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

/* ------------------------------------------------------------- resource hub -- */

.guide-index .marketing-lead {
  max-width: 70ch;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0 2rem;
}

.resource-grid--wide {
  margin-top: 1.8rem;
}

.resource-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  border-color: var(--brand-300);
  box-shadow: 0 10px 30px -22px rgba(16, 24, 40, 0.5);
  transform: translateY(-1px);
}

.resource-card strong {
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.resource-card > span:not(.resource-kicker):not(.resource-more) {
  font-size: 0.86rem;
  line-height: 1.5;
}

.resource-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brand-600);
  font-weight: 600;
}

.resource-more {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-600);
}

/* ------------------------------------------------------------------- cta -- */

.guide-cta {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #f7f9fc, #fff);
}

.guide-cta .shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem);
}

.guide-cta h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
}

.guide-cta p {
  max-width: 60ch;
  margin: 0 0 1rem;
  color: var(--ink-2);
}

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-toc {
    position: static;
    order: -1;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .guide-meta span + span::before {
    display: none;
  }

  .guide-body {
    font-size: 0.96rem;
  }

  .guide-hero .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Public header buttons must stay on one line on narrow phones. */
@media (max-width: 420px) {
  .public-nav {
    gap: 0.4rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .public-nav-actions {
    gap: 0.35rem;
  }

  .public-nav-actions .btn {
    white-space: nowrap;
    padding: 0.45rem 0.6rem;
    font-size: 0.74rem;
  }
}
