/* ===========================================================================
   GTM Prompts library — page-specific styles
   Used by: /resources/prompts
   Depends on: colorography.css (tokens), global.css (layout/nav/footer/sections)
   =========================================================================== */

body { background: #fff; }
html { scroll-behavior: smooth; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* -------- Hero ----------------------------------------------------------- */
.pr-hero {
  position: relative;
  overflow: hidden;
  padding-top: 80px;
  padding-bottom: 0;          /* SVG cards bleed into the next section */
  background: linear-gradient(180deg, #F8F9FC 0%, #F5F8FF 100%);
}

.pr-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.pr-hero-title {
  font-family: 'Instrument Sans', 'Inter', sans-serif;
  font-weight: 500;
  font-size: 48px;
  line-height: 60px;
  letter-spacing: -0.96px;
  color: #232532;
  margin: 0;
}
.pr-hero-title .accent { color: var(--color-primary-500); }

.pr-hero-sub {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 28px;
  color: var(--color-neutral-600);
  margin: 0;
}

/* Decorative cards graphic — sits centered below copy, partially overlapping
   the white list section to create the "rising up" effect from Figma. */
.pr-hero-graphic {
  display: block;
  width: 100%;
  max-width: 1280px;
  height: auto;
  margin: 48px auto 0;
  pointer-events: none;
  position: relative;
  z-index: 0;
}

/* -------- Filter row (Category + Department + Search) -------------------- */
.pr-filter-section {
  background: #fff;
  padding-top: 80px;
  padding-bottom: 24px;
  position: relative;
  z-index: 2;                   /* sits above the hero graphic overlap */
}

/* Filter row: dropdowns group + search are each one half of the row, so the
   search bar lines up with two card widths (which is half the 4-col card grid
   below, including the 24px column gap). */
.pr-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

/* Role + Department sit flush against each other (no gap). */
.pr-filter-dropdowns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}

/* Dropdown (Role + Department) — Figma nodes 1664:850 + 1664:854.
   Both filters use the same spec; only the option list differs. */
.pr-dropdown {
  position: relative;
  font-family: 'Inter', sans-serif;
}
.pr-dropdown-toggle {
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: #F5F8FF;
  border: 1px solid #D4D9EA;
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  color: #424766;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.pr-dropdown-toggle:hover { border-color: var(--color-neutral-300); }
.pr-dropdown-toggle[aria-expanded="true"] { border-color: var(--color-neutral-300); }
/* Department sits flush against Role — share the right border of Role. */
.pr-dropdown-toggle[data-default-label="Department"] { border-left: 0; }
.pr-dropdown-toggle .pr-caret {
  width: 16px;
  height: 16px;
  color: #1F212E;
  transition: transform 0.15s ease;
}
.pr-dropdown-toggle[aria-expanded="true"] .pr-caret { transform: rotate(180deg); }

.pr-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 236px;
  max-height: 360px;
  overflow-y: auto;
  background: #F5F8FF;
  border: 1px solid #D4D9EA;
  box-shadow: 0 12px 12px 0 rgba(122, 122, 122, 0.12);
  padding: 0;
  z-index: 30;
  display: none;
}
.pr-dropdown.is-open .pr-dropdown-menu { display: block; }

.pr-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 12px 16px;
  background: #F5F8FF;
  border-bottom: 1px solid #D4D9EA;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  color: #424766;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}
.pr-dropdown-option:last-child { border-bottom: 0; }
.pr-dropdown-option:hover { background: #ECF1FE; }

.pr-dropdown-option .pr-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #1F212E;
  flex-shrink: 0;
  position: relative;
}
.pr-dropdown-option.is-selected .pr-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: #1F212E;
  border-radius: 50%;
}

/* Search ------------------------------------------------------------------ */
.pr-search {
  position: relative;
  width: 100%;
  height: 46px;
}
.pr-search input {
  width: 100%;
  height: 100%;
  padding: 0 16px 0 40px;
  background: #F5F8FF;
  border: 1px solid #D4D9EA;
  border-radius: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--color-neutral-800);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pr-search input::placeholder { color: var(--color-neutral-400); }
.pr-search input:focus {
  border-color: var(--color-primary-300);
  box-shadow: 0 0 0 3px rgba(54, 97, 237, 0.08);
}
.pr-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-neutral-500);
  pointer-events: none;
}

/* -------- List section (cards grid) ------------------------------------- */
.pr-list-section {
  background: #fff;
  padding-top: 24px;
  padding-bottom: 80px;
}

.pr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* Card spec per Figma node 1609:5154. */
.pr-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--color-neutral-200);
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pr-card:hover {
  border-color: var(--color-primary-300);
  box-shadow: 0 4px 16px rgba(54, 97, 237, 0.08);
}
.pr-card[hidden] { display: none; }

.pr-card-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.pr-card-title {
  font-family: 'Instrument Sans', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
  color: #1F212E;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-card-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  color: var(--color-neutral-700);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.pr-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 20px;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-100);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 10px;
  line-height: 22px;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}

.pr-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--color-neutral-500);
}
.pr-empty[hidden] { display: none; }

/* -------- Pagination ----------------------------------------------------- */
.pr-pagination {
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.pr-pagination-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--color-neutral-600);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.pr-pagination-link:hover { color: var(--color-primary-500); }
.pr-pagination-link[aria-current="page"] {
  background: var(--color-neutral-100);
  color: var(--color-neutral-800);
  font-weight: 600;
}
.pr-pagination-link[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.pr-pagination-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pr-pagination-ellipsis {
  color: var(--color-neutral-500);
  padding: 0 4px;
}

/* ===========================================================================
   Detail page (/resources/prompts/<slug>)
   =========================================================================== */

/* -------- Detail hero --------------------------------------------------- */
.pd-hero {
  position: relative;
  background-color: #F5F8FF;
  background-image: url('/assets/marketing/prompt-detail-hero.svg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  padding-top: 64px;
  padding-bottom: 64px;
}
.pd-hero .padding-global { position: relative; z-index: 1; }
.pd-hero-inner {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.pd-hero-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.pd-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pd-hero-title {
  font-family: 'Instrument Sans', 'Inter', sans-serif;
  font-weight: 500;
  font-size: 40px;
  line-height: 52px;
  letter-spacing: -0.8px;
  color: var(--color-neutral-900);
  margin: 0;
}
.pd-hero-sub {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 26px;
  color: var(--color-neutral-600);
  margin: 0;
  max-width: 760px;
}

/* Back link — sd-back pattern (ported, same as glossary detail). */
.pd-back.sd-back.blog-post-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #52577A;
  text-decoration: none;
  transition: color 0.18s ease;
}
.pd-back.sd-back.blog-post-back:hover { color: var(--color-primary-500); }
.pd-back .sd-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #D4D9EA;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.pd-back.sd-back.blog-post-back:hover .sd-back-icon {
  background: rgba(54, 97, 237, 0.10);
  border-color: rgba(54, 97, 237, 0.35);
}
.pd-back .sd-back-icon svg {
  width: 16px;
  height: 16px;
  color: currentColor;
}

/* -------- Detail body layout (sidebar + content) ------------------------ */
.pd-layout {
  background: #fff;
  padding-top: 48px;
  padding-bottom: 80px;
}
.pd-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* Sticky sidebar — same pattern as glossary .gl-detail-aside */
.pd-aside {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-self: start;
}

/* Sidebar blocks (TOC + Applicable Roles) — ported from glossary so prompts
   pages don't need to load glossary.css. */
.pd-aside .gl-toc-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-aside .gl-toc-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
}

/* TOC links — mirrors the ss-toc pattern from glossary detail */
.pd-aside .ss-toc-links {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e1e4ee;
}
.pd-aside .ss-toc-link {
  position: relative;
  display: block;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #757a97;
  text-decoration: none;
  transition: color 0.15s ease;
}
.pd-aside .ss-toc-link::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.15s ease;
}
.pd-aside .ss-toc-link:hover { color: #2D3044; }
.pd-aside .ss-toc-link.is-active { color: var(--color-primary-500); }
.pd-aside .ss-toc-link.is-active::before { background: var(--color-primary-500); }

/* Applicable roles list — plain links, no left rule. */
.pd-aside .gl-related {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pd-aside .gl-related-link.pd-role {
  display: block;
  padding: 8px 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 22px;
  color: var(--color-text-primary);
  text-decoration: none;
}

/* -------- Right column: prompt cards + body sections ------------------- */
.pd-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}

.pd-prompt-card {
  padding-top: 0;
  padding-bottom: 0;
  background: #F5F8FF;
  border: 1px solid var(--color-neutral-100);
  border-radius: 12px;
  overflow: hidden;
  scroll-margin-top: 100px;
}
#follow-up-prompts.pd-prompt-card { background: #ffffff; }
.pd-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(0, 0, 0, 0.02);
}
.pd-prompt-head-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-neutral-800);
}
.pd-prompt-head-icon {
  width: 20px;
  height: 20px;
  color: var(--color-neutral-500);
  flex-shrink: 0;
}
.pd-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-neutral-600);
  cursor: pointer;
  transition: background 0.15s ease;
}
.pd-copy-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.pd-copy-btn:hover {
  color: var(--color-neutral-600);
  background: var(--color-neutral-100);
}
.pd-copy-btn.is-copied {
  color: var(--color-neutral-600);
  background: var(--color-neutral-100);
}
.pd-copy-btn .pd-copy-icon-check { display: none; }
.pd-copy-btn.is-copied .pd-copy-icon-copy { display: none; }
.pd-copy-btn.is-copied .pd-copy-icon-check { display: inline-block; }
.pd-prompt-body {
  padding: 20px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 24px;
  color: var(--color-neutral-700);
}
.pd-prompt-body p { margin: 0 0 12px; }
.pd-prompt-body p:last-child { margin-bottom: 0; }
.pd-prompt-body ul,
.pd-prompt-body ol {
  margin: 0 0 12px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pd-prompt-body li::marker { color: inherit; }
.pd-prompt-body strong { color: var(--color-neutral-800); font-weight: 600; }

/* -------- Body sections (markdown) ------------------------------------- */
.pd-body-section {
  padding-top: 0;
  padding-bottom: 0;
  scroll-margin-top: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-body-h2 {
  font-family: 'Instrument Sans', 'Inter', sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.3px;
  color: var(--color-neutral-900);
  margin: 0;
}
.pd-body-section p,
.pd-body-section li {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 24px;
  color: var(--color-neutral-700);
}
.pd-body-section p { margin: 0 0 12px; }
.pd-body-section p:last-child { margin-bottom: 0; }
.pd-body-section ul,
.pd-body-section ol {
  margin: 0 0 12px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pd-body-section li::marker { color: inherit; }
.pd-body-section strong { color: var(--color-neutral-800); font-weight: 600; }

/* Sidebar on tablet/mobile collapses below the content. */
@media (max-width: 991px) {
  .pd-hero-inner,
  .pd-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .pd-aside { position: static; flex-direction: row; flex-wrap: wrap; gap: 20px; }
  .pd-aside .gl-toc-block { flex: 1 1 200px; }
  .pd-hero-title { font-size: 32px; line-height: 42px; letter-spacing: -0.6px; }
  /* TOC links become horizontal pills/chips. */
  .pd-aside .ss-toc-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    border-left: 0;
  }
  .pd-aside .ss-toc-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--color-primary-50);
    border: 1px solid var(--color-primary-100);
    font-size: 13px;
    color: var(--color-neutral-700);
  }
  .pd-aside .ss-toc-link::before { display: none; }
  .pd-aside .ss-toc-link.is-active {
    background: var(--color-primary-100);
    color: var(--color-primary-500);
  }
}
@media (max-width: 768px) {
  .pd-hero { padding-top: 40px; padding-bottom: 40px; }
  .pd-hero .padding-global,
  .pd-layout .padding-global { padding-left: 20px; padding-right: 20px; }
  .pd-hero-title { font-size: 28px; line-height: 36px; }
  .pd-hero-sub { font-size: 15px; line-height: 24px; }
  .pd-body-h2 { font-size: 22px; line-height: 30px; }
}

/* -------- Responsive ---------------------------------------------------- */
@media (max-width: 1199px) {
  .pr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-hero-title { font-size: 40px; line-height: 50px; letter-spacing: -0.8px; }
}
@media (max-width: 768px) {
  .pr-hero { padding-top: 48px; padding-bottom: 48px; }
  .pr-hero-title { font-size: 32px; line-height: 40px; letter-spacing: -0.6px; }
  .pr-hero-sub { font-size: 15px; line-height: 24px; }
  .pr-hero-graphic { display: none; }
  .pr-card { padding: 20px; }
  .pr-filter-section { padding-top: 56px; }
  .pr-filter-section .padding-global { padding-left: 20px; padding-right: 20px; }
  .pr-list-section .padding-global { padding-left: 20px; padding-right: 20px; }
  .pr-filter-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .pr-filter-dropdowns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pr-dropdown-label { flex: 1; text-align: left; }
  .pr-grid { grid-template-columns: minmax(0, 1fr); }
  .pr-card { min-height: 0; }
}
@media (max-width: 480px) {
  .pr-hero { padding-top: 40px; }
  .pr-hero-title { font-size: 28px; line-height: 36px; }
  .pr-pagination { flex-wrap: wrap; justify-content: center; }
}
