/* Pool planner: the section drawing beside the controls, then the parts, ring sizes and drawings.
   Built on site.css: only what this page needs. The drawing is line art in the site's own terms:
   white above grade, stone below, a thin ink grade line, white faces with ink outlines, grey
   dimensions, and red only for the callout dots and the ring that was just added. */

/* ---------- planner layout ---------- */
.section.pp { padding-top: 0; }
.pp-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 32px clamp(32px, 4vw, 64px);
  align-items: start;
}
.pp-fig { position: sticky; top: calc(var(--head-h) + 20px); min-width: 0; margin: 0; }
.pp-draw { position: relative; }

/* ---------- the section drawing ---------- */
.pp-svg { display: block; width: 100%; height: auto; max-height: calc(100vh - var(--head-h) - 40px); }
.pp-svg line, .pp-svg rect, .pp-svg path, .pp-svg circle,
.pp-part-art line, .pp-part-art rect, .pp-part-art path, .pp-part-art circle { vector-effect: non-scaling-stroke; }
.pp-svg .ground, .pp-part-art .ground { fill: var(--stone); }
.pp-svg .grade, .pp-part-art .grade { stroke: var(--ink); stroke-width: 1.25; }
.pp-svg .face, .pp-part-art .face { fill: var(--white); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.pp-svg .slot, .pp-part-art .slot { fill: var(--ink); }
.pp-svg .is-new .face { stroke: var(--red); stroke-width: 2; }
.pp-svg .is-new .slot { fill: var(--red); }
.pp-svg .dim, .pp-svg .tick, .pp-svg .xl { fill: none; stroke: var(--grey); stroke-width: 1; }
.pp-svg .xl { stroke-opacity: 0.45; }
.pp-svg .leader, .pp-part-art .leader { stroke: var(--ink); stroke-width: 1; }
.pp-svg .dot, .pp-part-art .dot { fill: var(--red); }
.pp-svg .bub, .pp-part-art .bub { fill: var(--white); stroke: var(--ink); stroke-width: 1.25; }
.pp-svg text, .pp-part-art text { font-family: var(--sans); font-variant-numeric: tabular-nums; fill: var(--ink); }
.pp-svg .t-dim { font-weight: 500; }
.pp-svg .t-total { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; }
.pp-svg .t-sub, .pp-svg .t-grade { fill: var(--grey); }
.pp-svg .t-bub, .pp-part-art .t-bub { font-weight: 600; }

/* Motion only answers a click: a ring that was just added drops onto the stack.
   (site.css switches it off for reduced motion, and the script doesn't ask for it then.) */
.pp-svg .drop { animation: pp-drop 0.32s cubic-bezier(0.3, 0.75, 0.25, 1); }
@keyframes pp-drop { from { transform: translateY(-22px); opacity: 0.25; } }

/* ---------- controls: one row per choice, label on the left ---------- */
.pp-form { --lab: 104px; min-width: 0; }
.pp-row { display: flow-root; min-width: 0; margin: 0; padding: 14px 0; border: 0; border-top: 1px solid var(--rule); }
.pp-form > .pp-row:first-child { padding-top: 0; border-top: 0; }
.pp-row > legend { float: left; width: var(--lab); padding: 10px 12px 0 0; font-weight: 600; font-size: var(--fs-small); }
.pp-row > .pick-list, .pp-row > .pp-cell { margin-left: var(--lab); }

.ring-list { list-style: none; }
.ring-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 42px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums;
}
.ring-list li.is-new { padding-left: 12px; box-shadow: inset 3px 0 0 var(--red); font-weight: 600; }
.ring-rm { position: relative; flex: none; width: 38px; height: 38px; margin-right: -6px; border: 0; background: none; cursor: pointer; }
.ring-rm::before, .ring-rm::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.6px; background: var(--ink);
  transform: translate(-50%, -50%) rotate(45deg);
}
.ring-rm::after { transform: translate(-50%, -50%) rotate(-45deg); }
.ring-rm:hover { background: var(--stone); }
.ring-rm:disabled { visibility: hidden; }

.add-ring { display: grid; gap: 10px; margin-top: 16px; }
.add-title { font-size: var(--fs-small); color: var(--grey); }
.pick-list-sm .pick span { min-height: 38px; padding: 6px 12px; }
.add-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.add-btns .btn { min-width: 64px; font-variant-numeric: tabular-nums; }
.ring-max { max-width: 30em; font-size: var(--fs-fine); color: var(--grey); }
.ring-max a { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* ---------- what the pool is and costs ---------- */
.pp-sum { margin-top: 6px; padding-top: 18px; border-top: 1.5px solid var(--ink); }
.pp-sum-title { font-size: var(--fs-small); }
.pp-key { list-style: none; margin-top: 6px; }
.pp-key li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-small); line-height: 1.35;
}
.pp-num {
  display: inline-grid; place-items: center; align-self: center; width: 22px; height: 22px;
  border: 1.25px solid var(--ink); border-radius: 50%; font-size: 12px; font-weight: 600; line-height: 1;
}
.pp-what small { display: block; color: var(--grey); font-size: var(--fs-fine); }
.pp-key .price { text-align: right; }

.pp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; margin: 20px 0; }
.pp-fact { min-width: 0; }
.pp-fact dt { font-size: var(--fs-fine); color: var(--grey); }
.pp-fact dd { margin: 0; }
.pp-fact dd span { display: block; font-size: var(--fs-fine); color: var(--grey); line-height: 1.35; }
.pp-big {
  display: block; margin: 2px 0 2px; font-family: var(--display); font-weight: 500;
  font-size: clamp(27px, 2.3vw, 32px); line-height: 1.1; letter-spacing: -0.012em; font-variant-numeric: tabular-nums;
}
.pp-fact-price { text-align: right; }
.pp-add { width: 100%; }
.pp-fine { margin-top: 10px; }
.pp-fine a { color: var(--ink); }

/* ---------- the parts, numbered as in the drawing ---------- */
.pp-parts { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 24px; }
.pp-part { min-width: 0; }
.pp-part-art { aspect-ratio: 3 / 2; }
.pp-part-art svg { width: 100%; height: 100%; }
.pp-part-art .off .face { stroke: rgba(25, 27, 29, 0.24); stroke-width: 1; }
.pp-part h3 { margin-top: 16px; font-size: var(--h3); line-height: 1.25; }
.pp-part p { margin-top: 6px; }
.pp-part-sizes { font-size: var(--fs-small); font-weight: 600; }
.pp-part-from { font-size: var(--fs-small); color: var(--grey); }
.pp-part-from .price { color: var(--ink); }
.pp-part-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fs-small); }

/* ---------- ring sizes ---------- */
.pp-matrix-cap { padding-bottom: 10px; font-size: var(--fs-small); color: var(--grey); }
.pp-matrix { min-width: 760px; table-layout: fixed; }
.pp-matrix thead th:first-child { width: 16%; }
.pp-matrix th[scope="col"] { white-space: nowrap; }
.pp-matrix tbody th, .pp-matrix thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--stone); }
.pp-dia { display: block; font-family: var(--display); font-size: 26px; font-weight: 500; line-height: 1.1; }
.pp-matrix .price { display: block; font-size: 17px; }
.pp-per { font-weight: 400; color: var(--grey); font-size: var(--fs-fine); }
.pp-cell-note { display: block; margin-top: 2px; font-size: var(--fs-fine); font-weight: 400; color: var(--grey); line-height: 1.35; }
.pp-none { color: var(--grey); }
.pp-matrix-wrap:focus-visible { outline-offset: 6px; }

.pp-drawings {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--gap) var(--gap-wide);
  margin-top: clamp(48px, 6vw, 72px); padding-top: 28px; border-top: 1px solid var(--rule);
}
.pp-drawings h3 { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.15; }
.pp-drawings-text p { margin-top: 10px; max-width: 30em; color: var(--grey); }
.pp-drawings-text p:last-child { margin-top: 20px; }
.pp-sheets { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 14px; }
.pp-sheets a { display: block; text-decoration: none; }
.pp-thumb { display: block; padding: 6px; background: var(--white); }
.pp-thumb img { width: 100%; }
.pp-sheet-name { display: block; margin-top: 8px; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.pp-sheets a:hover .pp-sheet-name { text-decoration: underline; text-underline-offset: 3px; }
.pp-sheets a:focus-visible { outline-offset: 4px; }

/* ---------- the fine print ---------- */
.pp-close-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 20px var(--gap-wide); align-items: start; }
.pp-close h2 { font-size: var(--h2); line-height: 1.06; letter-spacing: -0.02em; }
.pp-close-text p { max-width: 38em; }
.pp-close-text p + p { margin-top: 12px; }
.pp-close-text a[data-phone] { white-space: nowrap; }
.pp-close-text .actions { margin-top: 26px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
  .pp-grid { grid-template-columns: minmax(0, 1fr); }
  .pp-fig { position: static; max-width: 760px; }
  .pp-svg { max-height: none; }
  .pp-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-drawings, .pp-close-grid { grid-template-columns: minmax(0, 1fr); }
  .pp-sheets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .pp-form { --lab: 0px; }
  /* still floated, so the legend never sits in the fieldset's border line */
  .pp-row > legend { width: 100%; padding: 0; margin-bottom: 10px; }
  .pp-row > .pick-list, .pp-row > .pp-cell { clear: left; }
  .pp-rings > legend { margin-bottom: 2px; }
  .pp-parts { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  /* drawing beside the words, so four parts don't run four screens long */
  .pp-part { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 16px; align-items: start; }
  .pp-part-art { grid-row: 1 / span 5; aspect-ratio: 1; }
  .pp-part h3 { margin-top: 0; }
  .pp-sheets { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .pp-sheet-name { font-size: 13.5px; }
  .pp-thumb { padding: 4px; }
  .pp-facts { gap: 0 10px; }
  .pp-big { font-size: 25px; }
  .pp-close-text .actions .btn { flex: 1 1 100%; }
}
