/* ─── Docs Styles ─── */
/* Inherits design tokens from /styles.css */

/* ─── Breadcrumb ─── */
.docs-breadcrumb {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.docs-breadcrumb a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.docs-breadcrumb a:hover {
  color: var(--coral);
}

.docs-breadcrumb .sep {
  margin: 0 6px;
  opacity: 0.5;
}

/* ─── Page Wrapper ─── */
.docs-listing {
  max-width: var(--container);
  margin: 0 auto;
  padding: 120px 24px 80px;
}

/* ─── Hero ─── */
.docs-hero {
  text-align: center;
  margin-bottom: 40px;
}

.docs-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 12px;
}

.docs-hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ─── Search ─── */
.docs-search-wrap {
  max-width: 480px;
  margin: 0 auto 48px;
  position: relative;
}

.docs-search-wrap::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236f6a60' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat center;
  pointer-events: none;
}

.docs-search-input {
  width: 100%;
  padding: 14px 48px 14px 48px;
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--charcoal);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-search-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.docs-search-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(235, 119, 108, 0.15);
}

.docs-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.docs-search-clear:hover {
  color: var(--charcoal);
  background: var(--cream-dark);
}

.docs-search-clear.visible {
  display: flex;
}

/* ─── No Results ─── */
.docs-no-results {
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  padding: 40px 0;
}

/* ─── Grid ─── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

/* ─── Card ─── */
.docs-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
  border: 2px solid transparent;
  overflow: hidden;
}

.docs-card:not(.is-open):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.docs-card.is-open {
  border-color: var(--coral);
  grid-column: 1 / -1;
}

/* ─── Card Trigger ─── */
.docs-card-trigger {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.docs-card-trigger:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: -2px;
  border-radius: var(--radius);
}

.docs-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
}

.docs-card-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
  line-height: 1.3;
}

.docs-card-text p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.docs-card-chevron {
  flex-shrink: 0;
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  transition: transform 0.3s var(--ease);
}

.docs-card.is-open .docs-card-chevron {
  transform: rotate(180deg);
}

/* ─── Card Panel ─── */
.docs-card-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease), opacity 0.3s;
}

.docs-card.is-open .docs-card-panel {
  opacity: 1;
}

/* ─── Card Body Typography ─── */
.docs-card-body {
  padding: 0 24px 32px;
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding-top: 24px;
  max-width: 760px;
}

.docs-card-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.docs-card-body h3:first-child {
  margin-top: 0;
}

.docs-card-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--charcoal);
  margin-bottom: 16px;
}

.docs-card-body ul,
.docs-card-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
  list-style: disc;
}

.docs-card-body ol {
  list-style: decimal;
}

.docs-card-body li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--charcoal);
  margin-bottom: 6px;
}

.docs-card-body a {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.docs-card-body a:hover {
  color: var(--coral-dark);
}

.docs-card-body strong {
  font-weight: 600;
}

/* ─── Steps ─── */
.docs-steps {
  counter-reset: step;
  list-style: none !important;
  padding-left: 0 !important;
}

.docs-steps li {
  position: relative;
  padding-left: 40px;
  counter-increment: step;
  margin-bottom: 16px;
}

.docs-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 3px;
  width: 28px;
  height: 28px;
  background: var(--coral);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Tip Callout ─── */
.docs-tip {
  background: var(--cream-dark);
  border-left: 4px solid var(--coral);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.95rem;
  line-height: 1.7;
}

.docs-tip strong {
  color: var(--coral-dark);
}

/* ─── Screenshots ─── */
.docs-screenshot {
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--line);
  margin: 16px 0;
}

/* ─── SR Only ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .docs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .docs-card.is-open {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .docs-listing {
    padding-top: 100px;
  }

  .docs-hero h1 {
    font-size: 1.8rem;
  }

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

  .docs-card.is-open {
    grid-column: 1;
  }

  .docs-card-trigger {
    padding: 20px;
  }

  .docs-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .docs-card-text h2 {
    font-size: 0.95rem;
  }

  .docs-card-body {
    padding: 0 20px 24px;
    padding-top: 20px;
  }
}
