/* ==========================================================================
   Prompt library
   --------------------------------------------------------------------------
   Loaded only on /prompts, because none of this layout is needed anywhere
   else and there is no reason to carry it on every page.

   Colours come from the site tokens in assets/css/styles.css rather than the
   palette in prompts.json. The two corals differ by a few points (#EC623A
   against #e8643c) and a page carrying both would read as a near-miss rather
   than a brand. The site's --orange-ink is also the one that clears AA on a
   light background, which the lighter coral does not.
   ========================================================================== */

.pl__intro { max-width: 60ch; }

/* --- Search and filters --------------------------------------------------- */

.pl__search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 1.25rem;
}

.pl__search input[type="search"] {
  flex: 1 1 16rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-pill);
  -webkit-appearance: none;
          appearance: none;
}

.pl__search input::placeholder { color: var(--grey-dark); }

.pl__surprise { flex: 0 0 auto; min-height: 48px; }

.pl__filters {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.pl__group { margin: 0; padding: 0; border: 0; }

.chips--filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* A filter chip is a button, so it carries real state rather than a colour
   change alone — aria-pressed is what a screen reader reads. */
.chips--filter button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chips--filter button:hover { border-color: var(--orange-ink); }

.chips--filter button[aria-pressed="true"] {
  color: var(--white);
  background: var(--orange-ink);   /* 5.54:1 with white */
  border-color: var(--orange-ink);
}

.chip__n {
  color: var(--grey-dark);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.chips--filter button[aria-pressed="true"] .chip__n { color: #ffe3d9; }

.pl__count {
  margin: 0 0 1.25rem;
  color: var(--grey-dark);
  font-size: 0.9rem;
}

/* --- The grid ------------------------------------------------------------- */

.pl__grid {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 30em) { .pl__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 48em) { .pl__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 70em) { .pl__grid { grid-template-columns: repeat(4, 1fr); } }

.pl__card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pl__card:hover {
  transform: translateY(-3px);
  border-color: rgba(181, 67, 31, 0.35);
  box-shadow: 0 10px 24px rgba(28, 28, 28, 0.07);
}

/* The whole card is the link. One tap target, not three. */
.pl__card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.pl__card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--cream);
}

.pl__body { padding: 0.9rem 1rem 1.1rem; }

.pl__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--grey-dark);
}

.pl__no {
  font-weight: 600;
  color: var(--orange-ink);
  font-variant-numeric: tabular-nums;
}

.pl__level {
  padding: 0.1rem 0.5rem;
  background: rgba(28, 28, 28, 0.06);
  border-radius: var(--radius-pill);
}

.pl__hook {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.pl__more { margin: 2rem 0 0; text-align: center; }

/* --- Skeletons ------------------------------------------------------------ */

.pl__card--skeleton { padding: 0 0 1.1rem; pointer-events: none; }

.pl__card--skeleton .pl__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(28, 28, 28, 0.07);
}

.pl__card--skeleton .pl__line {
  display: block;
  height: 0.85rem;
  margin: 0.9rem 1rem 0;
  border-radius: 4px;
  background: rgba(28, 28, 28, 0.07);
}

.pl__card--skeleton .pl__line--short { width: 55%; }

/* --- The prompt view ------------------------------------------------------ */

.pl__detail { max-width: 46rem; }
.pl__detail:focus { outline: none; }

.pl__detail .pl__meta { font-size: 0.8rem; margin-bottom: 0.75rem; }

.pl__title {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  margin-bottom: 0.75rem;
}

.pl__sub {
  margin-bottom: 1.5rem;
  color: var(--grey-dark);
  font-size: 1.05rem;
}

/* The prompt itself. Monospace because it is text to be copied verbatim,
   and whitespace is preserved for the same reason. */
.pl__box {
  position: relative;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--charcoal);
  border-radius: var(--radius-card);
}

.pl__text {
  margin: 0;
  color: #f2eee8;              /* 14.6:1 on the charcoal box */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.925rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* [PLACEHOLDERS] the reader has to fill in. Not decoration — if these are
   missed the prompt does not work, so they get the accent and a border. */
.pl__ph {
  padding: 0.05em 0.3em;
  color: #ffd9cc;
  background: rgba(232, 100, 60, 0.22);
  border: 1px solid rgba(232, 100, 60, 0.5);
  border-radius: 4px;
  font-weight: 600;
}

.pl__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.pl__copied {
  display: inline-flex;
  align-items: center;
  color: #2f7d4f;
  font-size: 0.9rem;
  font-weight: 600;
}

.pl__detail h2 {
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: 1.2rem;
  border-top: 1px solid var(--rule-light);
}

.pl__why { margin-bottom: 0; }

/* --- Do it in Claude ------------------------------------------------------ */

.pl__steps { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }

.pl__step {
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-card);
}

.pl__step h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.pl__badge {
  padding: 0.12rem 0.55rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--charcoal);
  border-radius: var(--radius-pill);
}

.pl__plan {
  padding: 0.12rem 0.55rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--orange-ink);
  background: rgba(181, 67, 31, 0.1);
  border-radius: var(--radius-pill);
}

.pl__step p { margin: 0; font-size: 0.95rem; }

/* --- Previous / next ------------------------------------------------------ */

.pl__nav {
  display: grid;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-light);
}

@media (min-width: 40em) { .pl__nav { grid-template-columns: 1fr 1fr; } }

.pl__nav a {
  display: block;
  padding: 0.9rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
}

.pl__nav a:hover { border-color: rgba(181, 67, 31, 0.35); }
.pl__nav a:last-child:nth-child(2) { text-align: right; }

.pl__nav .pl__dir {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--grey-dark);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pl__nav .pl__to { font-weight: 600; font-size: 0.95rem; }

.pl__back { margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .pl__card:hover { transform: none; box-shadow: none; }
}
