/* ====================================================================
   PROJECT DETAIL PAGE — individual project write-ups.
   Used by _template-project.html and every page copied from it.

   Layout: a two-column grid — a scrolling main column (write-up, blog,
   patch notes, screenshots) and a STICKY sidebar of key specs that
   stays in view as you scroll.

   Shares CSS variables from style.css and the .res-badge base from
   resources.css (both are linked on the project pages).
   ==================================================================== */

/* ---- back link ---------------------------------------------------- */
.pp-back {
  max-width: 1040px;
  margin: 20px auto 0;
  padding: 0 24px;
  font-size: 11.5px;
}
.pp-back a { color: var(--text-dim); }
.pp-back a:hover { color: var(--blue); text-decoration: none; }

/* ---- page header -------------------------------------------------- */
.pp-header {
  max-width: 1040px;
  margin: 16px auto 0;
  padding: 0 24px 22px;
  border-bottom: 0.5px solid var(--border);
}

.pp-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pp-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 10px;
}

.pp-tagline {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 680px;
}

/* ---- two-column stage --------------------------------------------- */
.pp-stage { margin: 26px 0 56px; }

.pp-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* main column is placed left, sidebar right — regardless of source
   order (the sidebar comes first in the HTML so that on mobile the key
   details show above the write-up). */
.pp-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;               /* let wide code/pre shrink, not overflow */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pp-aside {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 58px;                  /* clears the sticky top bar             */
  align-self: start;
}

/* ---- panels (windows) in the main column -------------------------- */
.pp-panel {
  position: static;           /* cancel the absolute default of .window */
  width: 100%;
}
.pp-panel .window-body { padding: 18px 18px; }

/* ---- prose -------------------------------------------------------- */
.pp-prose p {
  font-size: 13px;
  line-height: 1.85;
  color: var(--text);
}
.pp-prose p + p { margin-top: 10px; }
.pp-prose ul {
  margin: 10px 0 0 0;
  padding-left: 18px;
}
.pp-prose li {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}

/* ---- inline code block -------------------------------------------- */
.pp-code {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  background: var(--bar);
  border: 0.5px solid var(--border);
  border-radius: 5px;
  padding: 14px 16px;
  margin-top: 14px;
  overflow-x: auto;
  color: var(--text);
  white-space: pre;
}

/* ---- sticky sidebar: spec list ------------------------------------ */
.pp-detail-window {
  position: static;
  width: 100%;
}

.pp-specs { display: block; }

.pp-spec {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border-dim);
  font-size: 11.5px;
}
.pp-spec:first-child { padding-top: 0; }
.pp-spec:last-child { border-bottom: none; padding-bottom: 0; }

.pp-spec dt {
  color: var(--text-dim);
  white-space: nowrap;
}
.pp-spec dd {
  color: var(--text);
  text-align: right;
}
.pp-spec dd a { color: var(--blue); }

/* small yes / no pill for the "AI assisted" row */
.pp-flag {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 3px;
  border: 0.5px solid;
}
.pp-flag--yes {
  color: var(--green);
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
}
.pp-flag--no {
  color: var(--text-dim);
  border-color: var(--border);
}

/* ---- blog / devlog ------------------------------------------------ */
.pp-blog-post {
  border-left: 2px solid var(--blue);
  padding: 2px 0 2px 14px;
}
.pp-blog-post + .pp-blog-post { margin-top: 20px; }
.pp-blog-date { font-size: 10.5px; color: var(--text-dim); }
.pp-blog-title { font-size: 15px; font-weight: 600; margin: 4px 0 8px; }
.pp-blog-body { font-size: 12.5px; line-height: 1.8; color: var(--text); }

/* ---- changelog / patch notes -------------------------------------- */
.pp-change {
  padding: 13px 0;
  border-bottom: 0.5px solid var(--border-dim);
}
.pp-change:first-child { padding-top: 0; }
.pp-change:last-child { border-bottom: none; padding-bottom: 0; }

.pp-change-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
}
.pp-ver {
  font-size: 10.5px;
  color: var(--blue);
  border: 0.5px solid var(--blue);
  border-radius: 3px;
  padding: 1px 7px;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}
.pp-change-date { font-size: 10.5px; color: var(--text-dim); }

.pp-change ul { list-style: none; }
.pp-change li {
  font-size: 12px;
  line-height: 1.7;
  padding-left: 15px;
  position: relative;
  color: var(--text);
}
.pp-change li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: var(--green);
}

/* ---- screenshots gallery ------------------------------------------ */
.pp-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.pp-figure { margin: 0; }

.pp-shot {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bar);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
  overflow: hidden;
}
.pp-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pp-caption {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-top: 7px;
}

/* ====================================================================
   MOBILE — collapse to a single column; the sidebar (first in source)
   shows above the write-up.
   ==================================================================== */
@media (max-width: 900px) {
  .pp-back,
  .pp-header { padding-left: 14px; padding-right: 14px; }

  .pp-grid {
    grid-template-columns: 1fr;
    padding: 0 14px;
    gap: 20px;
  }
  .pp-aside,
  .pp-main {
    grid-column: auto;
    grid-row: auto;
  }
  .pp-aside { position: static; top: auto; }

  .pp-title { font-size: 20px; }
  .pp-gallery { grid-template-columns: 1fr; }
}
