/* ==========================================================================
   Brandage — handover documents (store playbook + brand book)
   Loaded by the two document sections only (sections/brandage-playbook,
   sections/brandage-brandbook), never by layout/theme.html: these pages are
   not part of the storefront and must cost it nothing.
   Every colour and font comes from the brand tokens in base/brandage.css.
   Chapter, contents and step numbers are CSS counters, so hiding or
   reordering a chapter in the editor renumbers everything on its own.
   ========================================================================== */

.bdd {
  --bdd-rail-top: calc(var(--bd-header-h, 80px) + 24px);
  background: var(--bd-cream);
  color: var(--bd-ink);
  font-family: var(--bd-font-body);
  counter-reset: bdd-chapter bdd-toc;
}

.bdd *,
.bdd *::before,
.bdd *::after { box-sizing: border-box; }

/* ----------------------------------------------------------------- Cover -- */

.bdd .bdd-cover {
  position: relative;
  overflow: hidden;
  background-color: var(--bd-navy);
  background-image: radial-gradient(var(--bd-navy-dot) 2.2px, transparent 2.3px);
  background-size: 26px 26px;
  border-bottom: var(--bd-border) solid var(--bd-ink);
  color: var(--bd-cream);
}
.bdd .bdd-cover__inner {
  position: relative;
  z-index: 1;
  max-width: var(--bd-page);
  margin: 0 auto;
  padding: 72px var(--bd-gutter) 64px;
}
.bdd .bdd-cover__copy { max-width: 760px; }

.bdd .bdd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 7px 16px;
  border: 2px solid var(--bd-ink);
  border-radius: 999px;
  background: var(--bd-yellow);
  color: var(--bd-ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bdd .bdd-cover__title {
  margin: 0;
  font-family: var(--bd-font-display);
  font-weight: 400;
  font-size: clamp(44px, 6.2vw, 92px);
  line-height: 0.98;
  color: var(--bd-cream);
  text-wrap: balance;
}
.bdd .bdd-cover__title span {
  display: block;
  color: var(--bd-yellow);
}
.bdd .bdd-cover__lede {
  margin: 24px 0 0;
  max-width: 58ch;
  font-size: 19px;
  line-height: 1.6;
  color: var(--bd-cream);
}
.bdd .bdd-cover__lede p { margin: 0; }
.bdd .bdd-cover__lede p + p { margin-top: 0.8em; }

.bdd .bdd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 32px 0 0;
  padding: 0;
}
.bdd .bdd-meta > div {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 16px;
  border: 2px solid var(--bd-pink-soft);
  border-radius: 999px;
  font-size: 14.5px;
  line-height: 1.3;
}
.bdd .bdd-meta dt { color: var(--bd-sky); font-weight: 600; }
.bdd .bdd-meta dd { margin: 0; font-weight: 800; color: var(--bd-cream); }
.bdd .bdd-meta a { color: var(--bd-yellow); text-underline-offset: 3px; }
.bdd .bdd-meta a:hover { color: var(--bd-pink-soft); }

/* Tattoo characters scattered over the cover and the help band */
/* Pinned to the same 1440px frame as the content, so on a wide screen the characters stay
   next to the words instead of drifting to the far edges. */
.bdd .bdd-stickers {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: var(--bd-page);
  z-index: 0;
  pointer-events: none;
}
.bdd .bdd-sticker {
  position: absolute;
  width: var(--s, 120px);
  height: auto;
  transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 6px 0 rgba(11, 11, 13, 0.18));
}
.bdd .bdd-cover .bdd-sticker:nth-child(1) { --s: 168px; --r: -8deg; right: 6%; top: 14%; }
.bdd .bdd-cover .bdd-sticker:nth-child(2) { --s: 128px; --r: 10deg; right: 22%; top: 52%; }
.bdd .bdd-cover .bdd-sticker:nth-child(3) { --s: 112px; --r: -4deg; right: 3%; bottom: 8%; }
.bdd .bdd-cover .bdd-sticker:nth-child(4) { --s: 92px; --r: 14deg; right: 30%; top: 8%; }

@media (prefers-reduced-motion: no-preference) {
  .bdd .bdd-sticker { animation: bdd-bob 5s ease-in-out infinite; }
  .bdd .bdd-sticker:nth-child(2n) { animation-delay: -2.5s; }
}
@keyframes bdd-bob {
  0%, 100% { transform: rotate(var(--r, 0deg)) translateY(0); }
  50% { transform: rotate(calc(var(--r, 0deg) * -1)) translateY(-8px); }
}

@media (max-width: 1180px) {
  .bdd .bdd-cover .bdd-sticker:nth-child(2),
  .bdd .bdd-cover .bdd-sticker:nth-child(4) { display: none; }
}
@media (max-width: 900px) {
  .bdd .bdd-cover__inner { padding: 52px var(--bd-gutter) 48px; }
  .bdd .bdd-cover .bdd-sticker:nth-child(1) { --s: 96px; top: 18px; right: 14px; }
  .bdd .bdd-cover .bdd-sticker:nth-child(3) { display: none; }
  .bdd .bdd-cover__copy { padding-right: 0; }
  .bdd .bdd-eyebrow { margin-right: 96px; }
}
@media (max-width: 480px) {
  .bdd .bdd-cover .bdd-sticker:nth-child(1) { --s: 72px; }
  .bdd .bdd-eyebrow { margin-right: 72px; font-size: 13px; }
  .bdd .bdd-cover__lede { font-size: 17.5px; }
  .bdd .bdd-meta > div { font-size: 13.5px; padding: 7px 13px; }
}

/* ------------------------------------------------------------------ Body -- */

.bdd .bdd-body {
  max-width: var(--bd-page);
  margin: 0 auto;
  padding: 56px var(--bd-gutter) 24px;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* Contents rail --------------------------------------------------------- */

.bdd .bdd-rail {
  position: sticky;
  top: var(--bdd-rail-top);
  max-height: calc(100vh - var(--bdd-rail-top) - 24px);
  overflow-y: auto;
  padding: 22px 20px;
  border: var(--bd-border) solid var(--bd-navy);
  border-radius: var(--bd-radius-md);
  background: var(--bd-cream);
}
.bdd .bdd-rail__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bd-muted);
}
.bdd .bdd-rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bdd .bdd-rail__list li { counter-increment: bdd-toc; }
.bdd .bdd-rail__list a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--bd-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.bdd .bdd-rail__list a::before {
  content: counter(bdd-toc);
  flex: 0 0 auto;
  min-width: 18px;
  font-family: var(--bd-font-display);
  font-size: 17px;
  color: var(--bd-pink);
}
.bdd .bdd-rail__list a:hover { background: var(--bd-pale); color: var(--bd-navy); }
.bdd .bdd-rail__list a[aria-current="true"] {
  background: var(--bd-pink-tint);
  color: var(--bd-navy);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--bd-pink);
}
.bdd .bdd-rail__help {
  display: block;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--bd-pale);
  font-size: 14px;
  line-height: 1.5;
  color: var(--bd-muted);
}
.bdd .bdd-rail__help a { color: var(--bd-navy); font-weight: 800; text-underline-offset: 3px; }
.bdd .bdd-rail__help a:hover { color: var(--bd-pink); }

@media (max-width: 900px) {
  .bdd .bdd-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-top: 36px;
  }
  .bdd .bdd-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .bdd .bdd-rail__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
  }
}
@media (max-width: 560px) {
  .bdd .bdd-rail__list { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------------- Chapters -- */

.bdd .bdd-chapters { min-width: 0; }

.bdd .bdd-chapter {
  counter-increment: bdd-chapter;
  counter-reset: bdd-step;
  scroll-margin-top: var(--bdd-rail-top);
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: var(--bd-border) dashed var(--bd-pale-dot);
}
.bdd .bdd-chapter:last-of-type { border-bottom: 0; margin-bottom: 24px; }

.bdd .bdd-chapter__head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 14px;
}
.bdd .bdd-chapter__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: var(--bd-border) solid var(--bd-ink);
  border-radius: 50%;
  background: var(--bd-pink);
  color: var(--bd-ink);
  font-family: var(--bd-font-display);
  font-size: 26px;
  line-height: 1;
}
.bdd .bdd-chapter__num::before { content: counter(bdd-chapter); }
.bdd .bdd-chapter:nth-of-type(3n + 2) .bdd-chapter__num { background: var(--bd-yellow); }
.bdd .bdd-chapter:nth-of-type(3n + 3) .bdd-chapter__num { background: var(--bd-sky); }

.bdd .bdd-chapter__title {
  margin: 0;
  font-family: var(--bd-font-display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.04;
  color: var(--bd-navy);
  text-wrap: balance;
}
.bdd .bdd-chapter__intro {
  margin: 0 0 26px;
  max-width: 62ch;
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--bd-muted);
}

/* :where() keeps these defaults at the weight of a single class, so every component below
   (call-out labels, specimens, swatches) can set its own size without a fight. */
.bdd .bdd-chapter :where(p, li) {
  font-size: 16.5px;
  line-height: 1.65;
}
.bdd .bdd-chapter :where(p) { margin: 0 0 16px; max-width: 70ch; }
.bdd .bdd-chapter b,
.bdd .bdd-chapter strong { font-weight: 800; }
.bdd .bdd-chapter a:not(.bd-btn) { color: var(--bd-navy); font-weight: 700; text-underline-offset: 3px; }
.bdd .bdd-chapter a:not(.bd-btn):hover { color: var(--bd-pink); }

.bdd .bdd-h3 {
  margin: 36px 0 12px;
  font-family: var(--bd-font-display);
  font-weight: 400;
  font-size: clamp(23px, 2.2vw, 28px);
  line-height: 1.1;
  color: var(--bd-navy);
}
.bdd .bdd-h4 {
  margin: 24px 0 8px;
  font-family: var(--bd-font-body);
  font-size: 18px;
  font-weight: 800;
  color: var(--bd-ink);
}

/* Numbered steps. The number sits in a padding well, not a grid column, so a
   step that opens with bold text stays one item (playbook §14.3 trap). */
.bdd .bdd-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: bdd-step;
}
.bdd .bdd-steps > li {
  position: relative;
  min-height: 38px;
  padding: 6px 0 0 56px;
  counter-increment: bdd-step;
  max-width: 72ch;
}
.bdd .bdd-steps > li::before {
  content: counter(bdd-step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: var(--bd-border) solid var(--bd-ink);
  border-radius: 50%;
  background: var(--bd-yellow);
  color: var(--bd-ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.bdd .bdd-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bdd .bdd-list > li {
  position: relative;
  padding-left: 26px;
  max-width: 72ch;
}
.bdd .bdd-list > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bd-pink);
}

/* An admin click-path, written as one pill: Online Store › Pages › Add page */
.bdd .bdd-path {
  display: inline;
  padding: 1px 10px;
  border: 2px solid var(--bd-navy);
  border-radius: 999px;
  background: var(--bd-pale);
  color: var(--bd-navy);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.9;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* A long path may wrap on a phone; box-decoration-break gives each line its own pill end. */
.bdd .bdd-path > span { white-space: normal; }
.bdd .bdd-path > span + span::before {
  content: "›";
  margin: 0 6px;
  color: var(--bd-pink);
}

.bdd .bdd-ui {
  display: inline-block;
  padding: 0 8px;
  border: 2px solid var(--bd-ink);
  border-radius: 8px;
  background: var(--bd-cream);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.6;
  white-space: nowrap;
}

/* Call-outs ------------------------------------------------------------- */

.bdd .bdd-callout {
  margin: 22px 0;
  padding: 18px 22px 18px 22px;
  border: var(--bd-border) solid var(--bd-navy);
  border-radius: var(--bd-radius-md);
  background: var(--bd-pale);
  max-width: 76ch;
}
.bdd .bdd-callout > :last-child { margin-bottom: 0; }
.bdd .bdd-callout__label {
  display: inline-block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bd-navy);
}
.bdd .bdd-callout--warn { background: var(--bd-pink-tint); border-color: var(--bd-pink); }
.bdd .bdd-callout--warn .bdd-callout__label { color: var(--bd-error); }

/* A small "we can do this for you" nudge inside a chapter */
.bdd .bdd-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin: 26px 0 8px;
  padding: 18px 22px;
  border: var(--bd-border) solid var(--bd-ink);
  border-radius: var(--bd-radius-md);
  background: var(--bd-yellow);
  max-width: 76ch;
}
.bdd .bdd-nudge p { margin: 0; flex: 1 1 280px; font-weight: 600; }
.bdd .bdd-nudge .bd-btn { flex: 0 0 auto; }

/* Code — kept short and inside its own scroller so the page never scrolls sideways */
.bdd .bdd-code {
  margin: 10px 0 18px;
  padding: 14px 18px;
  border-radius: var(--bd-radius-sm);
  background: var(--bd-ink);
  color: var(--bd-cream);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}
.bdd .bdd-code mark {
  background: var(--bd-yellow);
  color: var(--bd-ink);
  border-radius: 4px;
  padding: 0 3px;
}
.bdd code.bdd-inline {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bd-pale);
  color: var(--bd-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

/* Cards and grids ------------------------------------------------------- */

.bdd .bdd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 8px 0 24px;
}
.bdd .bdd-card {
  min-width: 0;
  padding: 20px;
  border: var(--bd-border) solid var(--bd-navy);
  border-radius: var(--bd-radius-md);
  background: var(--bd-cream);
}
.bdd .bdd-card--pale { background: var(--bd-pale); }
.bdd .bdd-card h3,
.bdd .bdd-card h4 {
  margin: 0 0 6px;
  font-family: var(--bd-font-body);
  font-size: 17.5px;
  font-weight: 800;
  color: var(--bd-ink);
}
.bdd .bdd-card p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; color: var(--bd-muted); }
.bdd .bdd-card p:last-child { margin-bottom: 0; }
.bdd .bdd-card__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border: var(--bd-border) solid var(--bd-navy);
  border-radius: 14px;
  background: var(--bd-pale);
}
.bdd .bdd-card__icon img { width: 44px; height: 44px; object-fit: contain; }

/* A simple two-column "what / where" list that stacks on phones */
.bdd .bdd-map {
  margin: 8px 0 24px;
  border-top: 2px solid var(--bd-pale-dot);
}
.bdd .bdd-map > div {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 6px 24px;
  padding: 14px 0;
  border-bottom: 2px solid var(--bd-pale-dot);
}
.bdd .bdd-map dt { font-weight: 800; color: var(--bd-ink); font-size: 16px; }
.bdd .bdd-map dd { margin: 0; color: var(--bd-muted); font-size: 15.5px; line-height: 1.6; }
@media (max-width: 640px) {
  .bdd .bdd-map > div { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------- Power Commerce band -- */

.bdd .bdd-help {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  padding: 80px var(--bd-gutter);
  background-color: var(--bd-pale);
  background-image: radial-gradient(var(--bd-pale-dot) 3px, transparent 3.2px);
  background-size: 28px 28px;
  border-top: var(--bd-border) solid var(--bd-navy);
  border-bottom: var(--bd-border) solid var(--bd-navy);
}
.bdd .bdd-help__card {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 52px;
  border: var(--bd-border) solid var(--bd-ink);
  border-radius: 28px;
  background: var(--bd-cream);
  text-align: center;
}
.bdd .bdd-help__eyebrow { margin-bottom: 18px; background: var(--bd-pink); }
.bdd .bdd-help__title {
  margin: 0;
  font-family: var(--bd-font-display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.02;
  color: var(--bd-navy);
  text-wrap: balance;
}
.bdd .bdd-help__text {
  margin: 18px auto 0;
  max-width: 54ch;
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--bd-muted);
}
.bdd .bdd-help__text p { margin: 0; }
.bdd .bdd-help__text p + p { margin-top: 0.8em; }
.bdd .bdd-help__list {
  list-style: none;
  margin: 26px auto 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.bdd .bdd-help__list li {
  padding: 6px 14px;
  border: 2px solid var(--bd-navy);
  border-radius: 999px;
  background: var(--bd-pale);
  color: var(--bd-navy);
  font-size: 14.5px;
  font-weight: 800;
}
.bdd .bdd-help__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 22px;
  margin-top: 32px;
}
.bdd .bdd-help__small {
  margin: 18px 0 0;
  font-size: 14.5px;
  color: var(--bd-muted);
}
.bdd .bdd-help .bdd-sticker:nth-child(1) { --s: 150px; --r: -10deg; left: 4%; top: 12%; }
.bdd .bdd-help .bdd-sticker:nth-child(2) { --s: 132px; --r: 9deg; right: 4%; bottom: 10%; }
.bdd .bdd-help .bdd-sticker:nth-child(3) { --s: 104px; --r: 12deg; right: 7%; top: 8%; }
@media (max-width: 1180px) {
  .bdd .bdd-help .bdd-sticker { display: none; }
}
@media (max-width: 640px) {
  .bdd .bdd-help { padding: 52px var(--bd-gutter); }
  .bdd .bdd-help__card { padding: 34px 22px; border-radius: 22px; }
  .bdd .bdd-help__text { font-size: 17px; }
  .bdd .bdd-help .bd-btn { width: 100%; }
}

/* -------------------------------------------------------------- Colophon -- */

.bdd .bdd-colophon {
  max-width: var(--bd-page);
  margin: 0 auto;
  padding: 28px var(--bd-gutter) 48px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--bd-muted);
}
.bdd .bdd-colophon p { margin: 0; max-width: 90ch; }
.bdd .bdd-colophon a { color: var(--bd-navy); font-weight: 700; text-underline-offset: 3px; }

/* ----------------------------------------------------------------- Print -- */

@media print {
  .bdd .bdd-rail,
  .bdd .bdd-stickers,
  .bdd .bdd-help { display: none; }
  .bdd .bdd-body { display: block; padding-top: 24px; }
  .bdd .bdd-chapter { break-inside: auto; page-break-inside: auto; }
  .bdd .bdd-chapter__head { break-after: avoid; }
}
