/* The HTTP status-code explorer. Each class of code has one color, used for its band, its tiles and the answer on the
   stage: 1xx slate, 2xx green, 3xx amber, 4xx orange, 5xx red. The class is always named beside the color. */
.pg-students-guide { --f1: #4b6b88; --f2: #1f7a4d; --f3: #8a6a12; --f4: #b4541a; --f5: #b3322f; --h-ink: #1c3145; --h-soft: #51677a; --h-line: #dbe3eb; }
.pg-http-explorer { position: relative; border: 1px solid #d7e2ec; background: #f7f9fc; border-radius: 14px; padding: 26px; }

/* The stage: a request goes out, an answer comes back. */
.pg-h-stage { --band: var(--f2); padding: 24px 26px 22px; border: 1px solid #d0dbe6; border-radius: 12px; background: #fff; }
.pg-h-stage[data-family="1"] { --band: var(--f1); } .pg-h-stage[data-family="3"] { --band: var(--f3); }
.pg-h-stage[data-family="4"] { --band: var(--f4); } .pg-h-stage[data-family="5"] { --band: var(--f5); }
.pg-h-stage h2 { margin: 0 0 14px; font-size: 1.25rem; letter-spacing: 0; color: var(--h-ink); }
.pg-h-situations { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.pg-h-situations button { min-height: 38px; padding: 6px 13px; border: 1px solid #b9c8d6; border-radius: 19px; background: #fff; color: var(--h-ink); font: inherit; font-size: .84rem; cursor: pointer; }
.pg-h-situations button:hover { background: #edf3f8; }
.pg-h-situations button[aria-pressed="true"] { background: var(--h-ink); border-color: var(--h-ink); color: #fff; }
.pg-h-wire { display: grid; grid-template-columns: 124px minmax(0, 1fr) 124px; align-items: center; gap: 16px; }
.pg-h-end { display: grid; justify-items: center; gap: 8px; font-size: .82rem; color: var(--h-ink); text-align: center; }
.pg-h-end svg { width: 76px; height: auto; fill: #f1f5f9; stroke: #6f879c; stroke-width: 1.6; stroke-linecap: round; }
.pg-h-end svg circle { fill: #6f879c; stroke: none; }
.pg-h-lines { display: grid; gap: 12px; min-width: 0; }
.pg-h-lines p { position: relative; display: flex; align-items: center; gap: 12px; margin: 0; padding: 9px 0; font-size: .78rem; color: var(--h-soft); }
/* The wire each message travels along, with an arrowhead at the end it travels to. */
.pg-h-lines p::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed #c3d0dc; }
.pg-h-lines p::after { content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -5px; border-top: 2px solid #8fa3b5; border-right: 2px solid #8fa3b5; }
.pg-h-request::after { right: 1px; transform: rotate(45deg); }
.pg-h-response::after { left: 1px; transform: rotate(-135deg); }
.pg-h-response { justify-content: flex-end; }
.pg-h-lines span, .pg-h-lines code { position: relative; z-index: 1; background: #fff; }
.pg-h-lines span { padding: 0 6px; }
.pg-h-lines code { padding: 7px 12px; border: 1px solid #c6d3df; border-radius: 6px; font-size: .92rem; color: var(--h-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-h-request { padding-right: 18px !important; }
.pg-h-response { padding-left: 18px !important; }
.pg-h-response code { border-color: var(--band); border-left-width: 5px; }
.pg-h-response code b { color: var(--band); font-size: 1.15rem; margin-right: 4px; }
.pg-h-plain { margin: 22px 0 14px; font-size: 1.35rem; line-height: 1.4; font-weight: 600; color: var(--h-ink); text-wrap: balance; }
.pg-h-facts { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 0; }
.pg-h-facts dt { font-size: .72rem; color: var(--h-soft); }
.pg-h-facts dd { margin: 2px 0 0; font-size: .92rem; color: var(--h-ink); }
/* A new answer travels in from the website's side. */
@media (prefers-reduced-motion: no-preference) {
    .pg-h-stage.pg-h-play .pg-h-request code { animation: pg-h-out .45s ease-out both; }
    .pg-h-stage.pg-h-play .pg-h-response code { animation: pg-h-back .5s .4s ease-out both; }
    .pg-h-stage.pg-h-play .pg-h-plain, .pg-h-stage.pg-h-play .pg-h-facts { animation: pg-h-show .35s .8s ease-out both; }
}
@keyframes pg-h-out { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes pg-h-back { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes pg-h-show { from { opacity: 0; } to { opacity: 1; } }

/* All the codes. */
.pg-http-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 14px 18px; padding: 30px 0 22px; }
.pg-http-toolbar h2 { flex-basis: 100%; margin: 0; font-size: 1.25rem; letter-spacing: 0; color: var(--h-ink); }
.pg-http-toolbar label { display: grid; gap: 8px; font-size: .8rem; flex: 1; min-width: 180px; max-width: 420px; }
.pg-http-toolbar input { width: 100%; height: 46px; padding: 0 12px; background: #fff; border: 1px solid #9db2c5; border-radius: var(--radius); font: inherit; font-size: 1rem; }
.pg-http-toolbar p { font-size: .8rem; margin: 0 0 12px; }
.pg-common-key { font-size: .74rem; padding-bottom: 13px; color: #486178; }
.pg-http-band { --band: var(--f1); padding: 18px 0; border-top: 1px solid var(--h-line); }
.pg-http-band-2 { --band: var(--f2); } .pg-http-band-3 { --band: var(--f3); } .pg-http-band-4 { --band: var(--f4); } .pg-http-band-5 { --band: var(--f5); }
.pg-http-band h3 { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 1rem; letter-spacing: 0; color: var(--band); margin: 0 0 14px; }
.pg-http-band h3 strong { font-size: 1.5rem; }
.pg-http-band h3 span { font-size: .84rem; font-weight: 400; color: var(--h-soft); }
.pg-http-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.pg-http-tile { min-width: 0; min-height: 91px; text-align: left; border: 1px solid #cbd6e0; border-top: 3px solid var(--band); border-radius: 5px; padding: 10px; background: #fff; color: #273f55; cursor: pointer; transition: opacity .15s; }
.pg-http-tile strong { display: flex; align-items: center; justify-content: space-between; font-size: 1.35rem; color: var(--band); }
.pg-http-tile i, .pg-common-key i { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; font-size: 0; vertical-align: middle; }
.pg-http-tile > span { display: block; font-size: .74rem; margin-top: 6px; overflow-wrap: anywhere; }
.pg-http-tile:hover, .pg-http-tile[aria-expanded="true"] { background: #eef3f8; border-color: var(--band); }
.pg-http-tile.pg-dimmed { opacity: .3; }
.pg-http-tile.pg-dimmed:focus-visible { opacity: 1; }

/* A code's card. */
.pg-h-card { --band: var(--f1); border-top: 4px solid var(--band); }
.pg-h-card[data-family="2"] { --band: var(--f2); } .pg-h-card[data-family="3"] { --band: var(--f3); }
.pg-h-card[data-family="4"] { --band: var(--f4); } .pg-h-card[data-family="5"] { --band: var(--f5); }
.pg-h-card .pg-h-lead { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.45; font-weight: 600; color: var(--h-ink); }
.pg-h-card .pg-h-example { margin: 0 0 16px; font-size: .92rem; line-height: 1.55; color: var(--h-soft); }
.pg-h-card dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 24px; margin: 0 0 14px; }
.pg-h-card dt { font-size: .72rem; color: var(--h-soft); }
.pg-h-card dd { margin: 2px 0 0; font-size: .9rem; color: var(--h-ink); }
.pg-h-card .pg-h-spec { margin: 0; font-size: .84rem; color: var(--h-soft); }

/* Below the explorer. */
.pg-students-guide .pg-h-actions { margin: 18px 0 14px; align-items: center; }
.pg-students-guide .pg-h-source { margin-bottom: 48px; }
.pg-students-guide .pg-h-source pre { max-height: 520px; overflow: auto; margin-top: 12px; font-size: .78rem; }
.pg-students-guide .pg-h-milestones { margin-bottom: 48px; }
.pg-students-guide .project-detail p { max-width: 860px; }

@media (max-width: 767px) {
    .pg-http-explorer { padding: 14px 12px; }
    .pg-h-stage { padding: 18px 14px; }
    .pg-h-stage h2 { font-size: 1.1rem; }
    .pg-h-situations button { min-height: 44px; }
    .pg-h-wire { grid-template-columns: 58px minmax(0, 1fr) 58px; gap: 8px; }
    .pg-h-end { font-size: .66rem; gap: 4px; }
    .pg-h-end svg { width: 44px; }
    .pg-h-lines span { display: none; }
    .pg-h-lines code { font-size: .76rem; padding: 6px 8px; }
    .pg-h-response code b { font-size: .95rem; }
    .pg-h-plain { font-size: 1.12rem; }
    .pg-http-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pg-http-toolbar label { flex-basis: 100%; max-width: none; }
    .pg-http-toolbar { gap: 6px 14px; padding-top: 24px; }
}
@media (min-width: 1024px) {
    /* The stage and its answer stay on the first screen. */
    .pg-students-guide .pg-header { grid-template-columns: minmax(0, 1fr) 190px; gap: 32px; padding: 14px 0 8px; }
    .pg-students-guide .pg-header-art { padding: 10px 6px; }
    .pg-students-guide .pg-header .eyebrow { margin-bottom: 7px; }
    .pg-students-guide .pg-header h1 { margin-bottom: 8px; }
    .pg-students-guide .site-breadcrumb { margin-bottom: 14px; }
    .pg-students-guide .pg-header .lead { font-size: .95rem; max-width: none; }
    .pg-students-guide .pg-header .project-actions { margin-top: 12px; }
    .pg-students-guide .pg-header .project-actions .btn { min-height: 40px; padding: 8px 16px; }
    .pg-students-guide .pg-guide-hint { margin: 6px 0 10px; }
    .pg-http-explorer { padding: 18px; }
    .pg-h-stage { padding: 18px 24px 20px; }
    .pg-h-situations { margin-bottom: 14px; }
    .pg-h-plain { margin: 14px 0 12px; }
}
@media (max-width: 767px) {
    /* One row of situations to swipe through, so the answer stays in view under them. */
    .pg-h-situations { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 16px; padding: 0 14px 6px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
    .pg-h-situations button { flex: none; scroll-snap-align: start; }
}
@media (max-width: 767px) {
    /* A long answer such as "500 Internal Server Error" wraps inside its box and never covers the website. */
    .pg-h-lines code { min-width: 0; white-space: normal; font-size: .72rem; line-height: 1.35; }
    .pg-h-request, .pg-h-response { padding-top: 6px; padding-bottom: 6px; }
}
/* The narrowest phones: a little less space between a code card's fields, so the whole card fits the screen. */
@media (max-width: 360px) {
    .pg-h-card .pg-h-lead { font-size: 1.05rem; }
    .pg-h-card dl { gap: 6px 24px; }
    .pg-h-card .pg-h-example { margin-bottom: 12px; }
}
