/* ==========================================================================
   Northwatch website: product page only (product.html)
   Loaded after css/site.css. Uses the shared tokens and nothing else:
   no new colors, hairlines only, 4px radius at most, no shadows.
   ========================================================================== */

/* ---------- Layers diagram ----------------------------------------------
   Shows how Northwatch sits beside what the site already owns.
   Three nodes joined by labeled lines, plus a return line under them.
   Stacked top to bottom on small screens, left to right from 900px.

   <figure class="layers">
     <div class="layers__flow">
       <div class="layers__node"> ... </div>
       <p class="layers__link"><span>Label</span></p>
       <div class="layers__node layers__node--nw"> ... </div>   (the new layer)
       <p class="layers__link"><span>Label</span></p>
       <div class="layers__node"> ... </div>
     </div>
     <div class="layers__return"><span></span><p>Label</p><span></span></div>
     <figcaption class="figure-caption"> ... </figcaption>
   </figure>
   ------------------------------------------------------------------------ */

.layers { --layers-link: 9rem; }

.layers__flow { display: grid; grid-template-columns: 1fr; }

.layers__node {
  padding: var(--sp-5);
  border: var(--nw-hairline);
  border-radius: var(--nw-radius);
}
.layers__node--nw { border-color: var(--nw-white); }

.layers__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  color: var(--nw-quiet);
  font-family: var(--nw-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}
.layers__title {
  margin-top: var(--sp-4);
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.25;
}
.layers__list { margin-top: var(--sp-5); border-top: var(--nw-hairline); }
.layers__list li {
  padding: var(--sp-3) 0;
  border-bottom: var(--nw-hairline);
  color: var(--nw-white);
  font-size: var(--fs-small);
  line-height: 1.5;
}
.layers__list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* Connector between two nodes. Small screens: a vertical line with the
   label beside it and an arrow head at the bottom. */
.layers__link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  padding-left: 3.25rem;
  color: var(--nw-white);
  font-family: var(--nw-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}
.layers__link::before {            /* the line */
  content: "";
  position: absolute;
  left: 1.5rem; top: 0; bottom: 0;
  width: 1px;
  background: var(--nw-quiet);
}
.layers__link::after {             /* the arrow head */
  content: "";
  position: absolute;
  left: calc(1.5rem - 0.25rem); bottom: 1px;
  width: 0.5625rem; height: 0.5625rem;
  border-right: 1px solid var(--nw-quiet);
  border-bottom: 1px solid var(--nw-quiet);
  transform: rotate(45deg);
}

/* Return line. Small screens: a plain note under the last node. */
.layers__return { margin-top: var(--sp-5); padding-left: var(--sp-5); border-left: 1px solid var(--nw-white); }
.layers__return span { display: none; }
.layers__return p {
  color: var(--nw-white);
  font-family: var(--nw-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

.layers .figure-caption { margin-top: var(--sp-6); max-width: 42rem; }

@media (min-width: 900px) {
  .layers__flow,
  .layers__return {
    grid-template-columns: minmax(0, 1fr) var(--layers-link) minmax(0, 1fr) var(--layers-link) minmax(0, 1fr);
  }
  .layers__flow { align-items: stretch; }

  /* The line sits at the middle of the nodes; the label sits just above it. */
  .layers__link { display: block; min-height: 0; padding: 0; }
  .layers__link span {
    position: absolute;
    left: 0; right: 0; bottom: 50%;
    padding: 0 var(--sp-3) var(--sp-4);
    text-align: center;
  }
  .layers__link::before { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 1px; }
  .layers__link::after {
    left: auto; right: 1px; bottom: auto; top: calc(50% - 0.25rem);
    border-bottom: 0;
    border-top: 1px solid var(--nw-quiet);
    transform: rotate(45deg);
  }

  /* A three sided line from the middle of the last node back to the
     middle of the first, with the arrow head pointing up at the first. */
  .layers__return {
    display: grid;
    margin-top: 0;
    padding-left: 0;
    border-left: 0;
  }
  .layers__return span { display: block; position: relative; height: 4.5rem; border-bottom: 1px solid var(--nw-quiet); }
  .layers__return span:first-child { grid-column: 1; margin-left: 50%; border-left: 1px solid var(--nw-quiet); }
  .layers__return span:last-child { grid-column: 5; margin-right: 50%; border-right: 1px solid var(--nw-quiet); }
  .layers__return span:first-child::before {
    content: "";
    position: absolute;
    left: calc(-0.28125rem - 0.5px); top: 1px;
    width: 0.5625rem; height: 0.5625rem;
    border-left: 1px solid var(--nw-quiet);
    border-top: 1px solid var(--nw-quiet);
    transform: rotate(45deg);
  }
  .layers__return p {
    grid-column: 2 / 5;
    grid-row: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 var(--sp-4) var(--sp-4);
    border-bottom: 1px solid var(--nw-quiet);
    text-align: center;
  }
  .layers__return span:first-child { grid-row: 1; }
  .layers__return span:last-child { grid-row: 1; }
}

/* ---------- Alert section ------------------------------------------------
   The list of the four parts sits beside the alert card. On wide screens
   the card stays in view while the list is read. */
@media (min-width: 900px) {
  .product-alert { align-items: start; }
}
