/* Prompt Engineering page: certificate card + prompt portfolio cards.
   The left-hand nav is now the global sidebar (css/styles.css + js/nav.js);
   this file only styles the content pane. Accent comes from var(--accent). */

.docs-page {
  max-width: var(--content-max);
  padding: 2.5rem 2.5rem 4rem;
}

/* Sections are only hidden once JS takes over, so the page still shows
   everything (stacked) if the script fails to load. */
.js-docs .docs-section {
  display: none;
}

.js-docs .docs-section.is-active {
  display: block;
}

.docs-section + .docs-section {
  margin-top: 3rem;
}

.js-docs .docs-section + .docs-section {
  margin-top: 0;
}

.docs-section:focus {
  outline: none;
}

.docs-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.docs-section-intro {
  margin: 0 0 2rem;
  color: var(--text-dim);
  max-width: 62ch;
}

/* ---------- Certification ---------- */
/* The .cert* component lives in css/certificates.css, shared with
   certifications.html. prompting.html loads both stylesheets.
   Only the prompt-chevron half of the old shared chevron rule stays here. */

.prompt-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.prompt-details[open] .prompt-chevron {
  transform: rotate(180deg);
}

/* ---------- Portfolio ---------- */

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.prompt-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.prompt-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.75rem;
  cursor: pointer;
  list-style: none;
}

.prompt-summary::-webkit-details-marker {
  display: none;
}

.prompt-summary:hover,
.prompt-summary:focus-visible {
  background: var(--card-bg-hi);
}

.prompt-summary-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.prompt-title {
  font-size: 1.12rem;
  font-weight: 600;
}

.prompt-teaser {
  font-size: 0.89rem;
  color: var(--text-dim);
}

.prompt-chevron {
  color: var(--text-faint);
  flex-shrink: 0;
}

.prompt-body {
  padding: 0 1.75rem 1.75rem;
  border-top: 1px solid var(--border);
}

.prompt-context {
  margin: 1.25rem 0 1.75rem;
  color: var(--text-dim);
  font-size: 0.91rem;
}

.prompt-stage {
  margin-bottom: 1.75rem;
}

.prompt-stage-label,
.prompt-eval-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.7rem;
  font-size: 0.94rem;
  font-weight: 600;
}

.prompt-stage-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-dim);
}

.prompt-stage-badge--v1 {
  border: 1px solid var(--border-hi);
}

.prompt-stage-badge--final {
  background: var(--accent);
  color: var(--text-on-accent);
}

/* Code block with copy button */
.prompt-block {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.prompt-block pre {
  margin: 0;
  padding: 1.1rem 1.15rem;
  overflow-x: auto;
  /* leave room for the copy button on the first line */
  padding-right: 5.25rem;
}

.prompt-block code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.prompt-copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.28rem 0.6rem;
  font-size: 0.71rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.prompt-copy:hover,
.prompt-copy:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.prompt-copy.is-copied {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}

.prompt-problem {
  margin: 0.9rem 0 0;
  padding: 0.8rem 1rem;
  border-left: 2px solid var(--accent-acting);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.89rem;
  color: var(--text-dim);
}

.prompt-problem strong {
  color: var(--accent-acting);
}

.prompt-eval {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.prompt-eval p {
  margin: 0;
  font-size: 0.91rem;
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .docs-page {
    padding: 1.75rem 1.5rem 3rem;
  }

  /* .cert-* responsive rules live in css/certificates.css — don't add them
     back here, or the two files will fight over padding. */
  .prompt-summary {
    padding: 1.15rem 1.25rem;
  }

  .prompt-body {
    padding: 0 1.25rem 1.5rem;
  }

  .prompt-block pre {
    padding-right: 1.15rem;
    padding-top: 2.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-chevron,
  .prompt-copy {
    transition: none;
  }
}
