/* Shell for frosty.fab on top of swirl. Tokens only: every colour, space,
 * radius, font and shadow here is a --gp-* custom property (plus hp's
 * rich-magenta #C71585 and medium-blue #4145CB where the frosty theme
 * deliberately leaves room for them). Components themselves come from
 * assets/swirl/swirl.min.css; this file only lays out the page, adapts
 * swirl's primitives to the site's shapes, and paints hp's signature bits
 * (logo bar, nav chips, rail wrappers, background plate).
 *
 * Font swaps stay token-level too: change --gp-font-* in a :root rule below
 * (or in the frosty theme) and every heading, body face and code block
 * follows. The web-font files themselves load from swirl.min.css.
 */

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ shell */

body {
  padding: 0 var(--gp-space-md);
}

.wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "head"
    "nav"
    "main"
    "foot";
  gap: var(--gp-space-xl);
  max-inline-size: min(100%, 96rem);
  margin: 0 auto;
  padding-block-end: var(--gp-space-2xl);
}

.site-head { grid-area: head; }
.site-nav { grid-area: nav; }
.site-main { grid-area: main; min-inline-size: 0; }
.sidebar { grid-area: side; min-inline-size: 0; }
.site-footer { grid-area: foot; }

/* Below 60rem the sidebar stacks under main. Without a declared `side` area
 * here, grid-area: side on .sidebar names no line in the one-column template
 * and the browser invents implicit columns, collapsing main, head and nav to
 * the sidebar's min-content width. */
.wrapper--sidebar {
  grid-template-areas:
    "head"
    "nav"
    "main"
    "side"
    "foot";
}

@media (min-width: 60rem) {
  .wrapper--sidebar {
    grid-template-columns: 16rem minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "nav  nav"
      "side main"
      "foot foot";
    align-items: start;
  }

  .wrapper--sidebar .sidebar {
    position: sticky;
    top: var(--gp-space-md);
  }
}

.gp-page-head {
  margin-block-end: var(--gp-space-xl);
}

/* -------------------------------------------------------- hp's logo bar */

.site-head {
  background-color: rgb(248 241 240 / 0.35);
  box-shadow: var(--gp-shadow-1);
  border-radius: var(--gp-radius-md);
  padding: var(--gp-space-lg) var(--gp-space-lg);
  width: 100%;
  box-sizing: border-box;
  justify-self: stretch;
}

.site-logo {
  display: inline-block;
  font-family: var(--gp-font-display);
  font-weight: var(--gp-weight-display);
  font-size: clamp(1.5rem, 1rem + 3vw, 4rem);
  line-height: var(--gp-leading-tight);
  color: var(--gp-color-highlight);
  text-decoration: none;
}

a.site-logo:hover {
  color: var(--gp-color-highlight);
}

/* --------------------------------------------------------------- top nav */

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gp-space-xs) var(--gp-space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-family: var(--gp-font-mono);
  font-size: var(--gp-size-text-sm);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  padding: var(--gp-space-xs) var(--gp-space-sm);
  border-radius: var(--gp-radius-md);
  background-color: #c71585;
  color: var(--gp-color-surface-solid);
  text-decoration: none;
  --gp-color-focus: var(--gp-color-fill);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  padding: var(--gp-space-2xl) var(--gp-space-md);
  border-radius: var(--gp-radius-md);
  background-color: var(--gp-color-surface-solid);
  color: var(--gp-color-inverse-text);
  font-size: var(--gp-size-text-sm);
  text-align: center;
  --gp-color-focus: var(--gp-color-fill);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--gp-color-blue);
}

/* -------------------------------------------------- hp's background plate */

body::before {
  content: "";
  position: fixed;
  top: -7%;
  right: -7%;
  inline-size: 100%;
  block-size: 100%;
  background: var(--bg-image-url, none) top right / 30% no-repeat;
  opacity: 0;
  z-index: -1;
  animation: bg-fade-in 2s ease-in-out forwards;
}

@keyframes bg-fade-in {
  to { opacity: 0.35; }
}

/* -------------------------------------------------- scan-code rail hosts */

.rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--gp-scan-rail);
  gap: 0;
}

.rail > * {
  min-inline-size: 0;
}

.rail--float {
  float: inline-start;
  max-inline-size: 25%;
  margin-inline-end: var(--gp-space-md);
  margin-block-end: var(--gp-space-sm);
}

.with-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--gp-scan-rail);
  gap: 0;
  background-color: var(--gp-color-code-bg);
  overflow: hidden;
}

.with-rail > * {
  min-inline-size: 0;
}

/* -------------------------------------------------------------- home cards */

a.rail--card {
  color: inherit;
  text-decoration: none;
}

/* ------------------------------------------------------------ entry rows */

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
  --gp-stack-gap: var(--gp-space-lg);
}

.site-main > h2 {
  margin-block: var(--gp-space-2xl) var(--gp-space-lg);
}

.entry {
  display: flex;
  gap: var(--gp-space-sm);
  align-items: flex-start;
}

.entry__art {
  inline-size: 48px;
  block-size: 48px;
  flex: none;
  border-radius: var(--gp-radius-sm);
  object-fit: cover;
}

.entry__body {
  min-inline-size: 0;
}

.entry__title {
  font-family: var(--gp-font-display);
  font-size: var(--gp-size-text-lg);
  font-weight: var(--gp-weight-bold);
  line-height: var(--gp-leading-snug);
}

.entry__title a {
  color: var(--gp-color-inverse-text);
  text-decoration: none;
}

.entry__title a:hover {
  color: #c71585;
}

.entry__meta {
  font-size: var(--gp-size-text-sm);
}

.entry .gp-pill__segment {
  padding: var(--gp-space-3xs) var(--gp-space-xs);
  font-size: var(--gp-size-text-xs);
}

/* On solid ground the cyan link and focus ring lose their dark backdrop. */
.entry a {
  color: var(--gp-color-blue);
}

.entry .gp-pill a {
  color: inherit;
}

.entry,
.site-footer {
  --gp-color-focus: var(--gp-color-fill);
}

/* ---------------------------------------------------------------- sidebar */

.sidebar__title {
  font-family: var(--gp-font-mono);
  font-size: var(--gp-size-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gp-color-accent);
  margin: 0 0 var(--gp-space-xs);
}

.sidebar__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gp-space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar__list a {
   display: inline-block;
   padding: var(--gp-space-2xs) var(--gp-space-sm);
   border: 1px solid var(--gp-color-accent);
   border-radius: var(--gp-radius-pill);
   font-family: var(--gp-font-mono);
   font-size: var(--gp-size-text-sm);
   color: var(--gp-color-accent);
   text-decoration: none;
 }

 .sidebar__list a:hover {
   background-color: var(--gp-color-accent);
   color: var(--gp-color-on-accent);
 }




/* ------------------------------------------------------------ page extras */

.filter-status {
  font-family: var(--gp-font-mono);
  font-size: var(--gp-size-text-sm);
  color: var(--gp-color-accent);
}

.supply-group__links a::after {
  content: ",";
  color: var(--gp-color-accent);
}

.supply-group__links a:last-child::after {
  content: none;
}

.supply-group__links a {
  margin-inline-end: var(--gp-space-2xs);
}

.pop {
  display: block;
  max-inline-size: 100%;
}

/* Inline code in article prose (fences become .gp-code via build.rb). */
.gp-prose :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: var(--gp-radius-sm);
  background-color: var(--gp-color-surface-solid);
  color: var(--gp-color-inverse-text);
  font-size: 0.9em;
}

.gp-prose > img.pop,
.gp-prose > .with-rail,
.gp-prose > .rail--float {
  margin-block-start: var(--gp-space-lg);
}

.gp-prose :where(h2,h3,h4,h5,h6) {
  margin-block-start: var(--gp-space-2xl);
}

.gp-prose > :where(h2,h3,h4,h5,h6)+* {
  margin-block-start: var(--gp-space-lg);
}

.gp-prose :where(li)+:where(li) {
  margin-block-start: var(--gp-space-xs);
}

/* Recommendation: use Departure Mono for headings (logo/title retains Doto/Departure Mono) */
.gp-page-head__title,
.entry__title,
.gp-prose h2,
.gp-prose h3,
.gp-prose h4,
.gp-prose h5,
.gp-prose h6 {
  font-family: "Departure Mono", var(--gp-font-display);
}

