/* =========================================================================
   Proper Sky — Brand Guide shell
   Reusable chrome for every brand-guide page: sidebar nav, top bar, page
   hero, section scaffolding, swatch primitives, copy-to-clipboard toast.
   Pairs with colors_and_type.css (load that FIRST).
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ps-paper);
  color: var(--fg-1);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- App frame ---------- */
.guide {
  --sidebar-w: 272px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--ps-paper);
  border-right: 1px solid var(--ps-line);
  padding: 28px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.side__brand { display: block; padding: 0 2px; }
.side__brand .brand-lockup { width: 100%; height: auto; display: block; }
.side__brandtag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: var(--w-medium);
  padding-left: 2px;
}

.nav { display: flex; flex-direction: column; gap: 22px; }
.nav__group { display: flex; flex-direction: column; gap: 4px; }
.nav__label {
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ps-dark-blue-300);
  font-weight: var(--w-bold);
  margin: 0 0 6px 2px;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -10px;
  padding: 9px 12px;
  border-radius: var(--r-1);
  font-size: 14.5px;
  font-weight: var(--w-medium);
  color: var(--fg-2);
  text-decoration: none;
  border: none;
  transition: background var(--d-fast) var(--ease-standard), color var(--d-fast) var(--ease-standard);
}
.nav__item:hover { background: var(--ps-cloud-gray); color: var(--fg-1); }
.nav__item.is-active {
  background: var(--ps-primary-blue);
  color: #fff;
}
.nav__item.is-active:hover { background: var(--ps-primary-blue); color: #fff; }
.nav__item.is-soon {
  color: var(--ps-ink-300);
  cursor: not-allowed;
  pointer-events: none;
}
.nav__item .soon {
  margin-left: auto;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ps-ink-300);
  border: 1px solid var(--ps-line);
  border-radius: 60px;
  padding: 2px 7px;
  font-weight: var(--w-medium);
}
.nav__dot { display: none; }

.side__foot {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.6;
  color: var(--fg-3);
}
.side__foot b { color: var(--fg-2); font-weight: var(--w-medium); }

/* ---------- Main column ---------- */
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--ps-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(28px, 4vw, 64px);
  height: 64px;
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--fg-3); }
.crumb b { color: var(--fg-1); font-weight: var(--w-medium); }
.crumb .sep { color: var(--ps-line-strong); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.btn-ghost {
  font-size: 13px; font-weight: var(--w-medium);
  color: var(--ps-primary-blue);
  background: var(--ps-cloud-gray);
  border: 1px solid var(--ps-line);
  border-radius: var(--r-1);
  padding: 7px 14px; cursor: pointer;
  transition: background var(--d-fast) var(--ease-standard);
}
.btn-ghost:hover { background: var(--ps-dark-blue-100); }
.btn-primary{display:inline-flex;align-items:center;gap:9px;text-decoration:none;background:var(--ps-primary-blue);color:#fff;font-size:14.5px;font-weight:var(--w-medium);padding:11px 22px;border-radius:var(--r-1);box-shadow:var(--sh-1);transition:background var(--d-fast) var(--ease-standard),transform var(--d-fast) var(--ease-standard),box-shadow var(--d-fast) var(--ease-standard)}
.btn-primary:hover{background:var(--ps-dark-blue-700);transform:translateY(-1px);box-shadow:var(--sh-2);color:#fff}

/* ---------- Content container ---------- */
.wrap { padding: 0 clamp(28px, 4vw, 64px) 120px; }
.wrap--narrow { max-width: 1180px; margin: 0 auto; }

/* page hero */
.phero { padding: 56px 0 16px; max-width: 920px; }
.phero .eyebrow {
  font-size: 13px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ps-primary-blue); font-weight: var(--w-bold); margin: 0 0 16px;
}
.phero h1 { font-size: clamp(40px, 5vw, 62px); line-height: 1.02; letter-spacing: -0.025em; margin: 0; font-weight: var(--w-medium); }
.phero .lede { font-size: 19px; line-height: 1.65; color: var(--fg-2); margin: 22px 0 0; max-width: 64ch; }
.phero .lede strong { color: var(--fg-1); font-weight: var(--w-medium); }

/* section scaffolding */
.section { padding-top: 64px; scroll-margin-top: 80px; }
.section__head { border-bottom: 1px solid var(--ps-line); padding-bottom: 16px; margin-bottom: 34px; display: flex; align-items: baseline; gap: 14px; }
.section__n { font-family: var(--font-mono); font-size: 13px; color: var(--ps-dark-blue-300); font-weight: 600; }
.section__head h2 { font-size: clamp(26px, 2.8vw, 34px); margin: 0; font-weight: var(--w-medium); letter-spacing: -0.015em; }
.section__intro { font-size: 16.5px; line-height: 1.7; color: var(--fg-2); max-width: 70ch; margin: -16px 0 34px; }
.section__intro strong { color: var(--fg-1); font-weight: var(--w-medium); }

/* ---------- Copy toast (shared) ---------- */
[data-copy] { cursor: copy; }
.copy-toast {
  position: fixed;
  z-index: 9999;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ps-navy);
  color: #fff;
  font-size: 13.5px; font-weight: var(--w-medium);
  font-family: var(--font-sans);
  padding: 11px 18px;
  border-radius: var(--r-1);
  box-shadow: var(--sh-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
  display: flex; align-items: center; gap: 9px;
}
.copy-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.copy-toast .tk { font-family: var(--font-mono); color: var(--ps-secondary-teal); }

/* shared do/don't */
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dd { border-radius: var(--r-3); padding: 24px 26px; }
.dd--do { background: #EAF6F0; }
.dd--dont { background: #FBEDEB; }
.dd__h { font-weight: var(--w-bold); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.dd--do .dd__h { color: #1F7A52; }
.dd--dont .dd__h { color: var(--ps-flag-ink); }
.dd ul { margin: 0; padding-left: 18px; }
.dd li { font-size: 14.5px; line-height: 1.6; margin-bottom: 11px; color: var(--fg-1); }
.dd li:last-child { margin-bottom: 0; }
.dd li strong { font-weight: var(--w-medium); }

/* ---------- Mobile navigation — Option A: app bar + slide-in drawer ----------
   Chrome injected by mobile-nav.js on every guide page; hidden on desktop. */
.mnav { display: none; }
.mnav-scrim { display: none; }
.side__close { display: none; }

@media (max-width: 920px) {
  /* sticky app bar */
  .mnav {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 80;
    padding: 0 12px 0 14px;
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--ps-line);
  }
  .mnav__logo { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer; }
  .mnav__logo img { height: 21px; width: auto; display: block; }
  .mnav__logo .pg { font-size: 13px; font-weight: var(--w-medium); color: var(--fg-3); border-left: 1px solid var(--ps-line); padding-left: 9px; }
  .mnav__menu {
    display: inline-flex; align-items: center; gap: 9px;
    min-height: 44px; padding: 0 15px; cursor: pointer;
    background: var(--ps-cloud-gray); border: 1px solid var(--ps-line);
    border-radius: var(--r-1); color: var(--ps-primary-blue);
    font-family: var(--font-sans); font-size: 14px; font-weight: var(--w-medium);
    transition: background var(--d-fast) var(--ease-standard);
  }
  .mnav__menu:hover { background: var(--ps-dark-blue-100); }
  .mnav__menu .bars { display: flex; flex-direction: column; gap: 3.5px; }
  .mnav__menu .bars i { width: 17px; height: 2px; border-radius: 2px; background: currentColor; display: block; }

  /* single column; make room for the fixed bar; hide the desktop top bar */
  .guide { grid-template-columns: 1fr; }
  .main { padding-top: 56px; }
  .topbar { display: none; }

  /* turn the sidebar into an off-canvas right drawer */
  .side {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: min(84vw, 320px); height: 100vh; z-index: 90;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 26px;
    padding: 60px 20px 28px; overflow-y: auto;
    border-right: 0; border-left: 1px solid var(--ps-line);
    box-shadow: -14px 0 34px -10px rgba(37,124,168,0.35);
    transform: translateX(102%);
    transition: transform 240ms var(--ease-out);
  }
  body.mnav-open .side { transform: translateX(0); }
  .side .nav { flex-direction: column; flex-wrap: nowrap; }
  .side__foot { display: block; }

  /* close (✕) button, top-right of the drawer */
  .side__close {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 14px;
    width: 44px; height: 44px; cursor: pointer;
    background: none; border: 0; color: var(--fg-2); font-size: 22px; line-height: 1;
    border-radius: var(--r-1);
  }
  .side__close:hover { background: var(--ps-cloud-gray); color: var(--fg-1); }

  /* scrim */
  .mnav-scrim {
    display: block; position: fixed; inset: 0; z-index: 85;
    background: rgba(12,14,22,0.42);
    opacity: 0; pointer-events: none;
    transition: opacity 240ms var(--ease-out);
  }
  body.mnav-open .mnav-scrim { opacity: 1; pointer-events: auto; }
  body.mnav-open { overflow: hidden; }

  .dd-grid { grid-template-columns: 1fr; }
}

