/* Web hosting guide page. Shared tokens and components live in landing.css. */

.lp section[id] { scroll-margin-top: 80px; }

/* The guide's contents, printed */

.lp .w-toc-wrap {
  justify-self: end;
  width: min(100%, 360px);
  margin-top: 12px;
}

.lp .w-toc { padding: 26px 26px calc(20px + var(--zz)); }

.lp .w-toc-title {
  display: block;
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
}

.lp .w-toc li a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.lp .w-toc li:last-child a { border-bottom: 0; }
.lp .w-toc li a:hover { color: var(--magenta); }

.lp .w-toc li a span {
  min-width: 0.8em;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 0.8;
  color: var(--magenta);
}

/* How it works: a request goes to the server and the page comes back */

.lp .w-flow {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  align-items: center;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.lp .w-flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.lp .w-flow-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
}

.lp .w-flow-url {
  padding: 6px 10px;
  border-bottom: 2px solid var(--ink);
  background: var(--blush);
  font-size: 0.78rem;
  color: var(--mute);
}

.lp .w-flow-page {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 8px;
  padding: 12px;
}

.lp .w-flow-page i {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--rose);
}

.lp .w-flow-page i:nth-child(1) { height: 40px; background: var(--magenta); }
.lp .w-flow-page i:nth-child(2) { width: 80%; }
.lp .w-flow-page i:nth-child(3) { width: 60%; }

.lp .w-flow-rack {
  display: grid;
  gap: 8px;
  width: 150px;
  padding: 14px;
  border-radius: 14px;
  background: var(--plum);
}

.lp .w-flow-rack i {
  position: relative;
  display: block;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.lp .w-flow-rack i::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--good);
}

.lp .w-flow-path { position: relative; height: 60px; }

.lp .w-flow-line {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 2px dashed var(--rule);
}

.lp .w-flow-packet {
  position: absolute;
  top: 50%;
  display: grid;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.9rem;
  color: #fff;
  opacity: 0;
}

/* The browser is on the right and the server on the left */
.lp .w-flow-request { right: 0; background: var(--magenta); }
.lp .w-flow-response { left: 0; background: var(--plum); }

.lp .w-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  max-width: 1040px;
  margin: 56px auto 0;
}

.lp .w-flow-steps li {
  padding-top: 16px;
  border-top: 3px solid var(--magenta);
  transition: border-color 0.3s;
}

.lp .w-flow-steps.is-animated li { border-top-color: var(--rule); }
.lp .w-flow-steps.is-animated li.is-on { border-top-color: var(--magenta); }

.lp .w-flow-n {
  display: block;
  margin-bottom: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 0.8;
  color: var(--magenta);
}

.lp .w-flow-steps strong { display: block; font-size: 1.1rem; }
.lp .w-flow-steps p { margin-top: 4px; font-size: 0.95rem; color: var(--mute); }

/* What to check */

.lp .w-callouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.lp .w-callout {
  padding: 20px 22px;
  border-inline-start: 3px solid var(--magenta);
  border-start-end-radius: 12px;
  border-end-end-radius: 12px;
  background: var(--blush);
}

.lp .w-callout cite {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  font-style: normal;
  color: var(--mute);
}

/* Which hosting fits: your situation, joined by a leader to what fits it */

.lp .w-fit { max-width: 980px; margin: 0 auto; }

.lp .w-fit-head,
.lp .w-fit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 12px;
}

.lp .w-fit-head {
  padding: 0 22px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mute);
}

.lp .w-fit ul {
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
  overflow: hidden;
}

.lp .w-fit li + li { border-top: 1px solid var(--line); }

.lp .w-fit-row {
  align-items: center;
  padding: 20px 22px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s;
}

.lp .w-fit-row:hover,
.lp .w-fit-row:focus-visible { background: var(--blush); color: var(--ink); }

.lp .w-fit-if {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.05rem;
}

.lp .w-fit-if::after {
  content: '';
  flex: 1;
  min-width: 24px;
  border-bottom: 2px dotted var(--rule);
}

.lp .w-fit-then {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.lp .w-fit-then strong { font-size: 1.1rem; }
.lp .w-fit-row:hover strong { color: var(--magenta); }
.lp .w-fit-then small { font-size: 0.9rem; color: var(--mute); white-space: nowrap; }

/* Responsive: the diagram runs top to bottom */

@media (max-width: 900px) {
  .lp .w-toc-wrap { justify-self: center; }

  .lp .w-flow {
    grid-template-columns: minmax(0, 1fr);
    max-width: 280px;
    gap: 12px;
  }

  .lp .w-flow-path { height: 110px; }

  .lp .w-flow-line {
    top: 0;
    bottom: 0;
    right: 50%;
    left: auto;
    border-top: 0;
    border-right: 2px dashed var(--rule);
  }

  .lp .w-flow-packet {
    right: auto;
    left: 50%;
    margin: 0 0 0 -20px;
  }

  .lp .w-flow-request { top: 0; }
  .lp .w-flow-response { top: auto; bottom: 0; }

  .lp .w-flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp .w-callouts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .lp .w-flow-steps { grid-template-columns: minmax(0, 1fr); }
  .lp .w-fit-head { display: none; }
  .lp .w-fit-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lp .w-fit-if { color: var(--mute); font-size: 0.95rem; }
  .lp .w-fit-if::after { display: none; }
}
