/* ==========================================================================
   roots-button — the only stylesheet of the package.

   Figma: light 20:609, dark 20:252 / 20:3446. 2px outline, padding
   20 / 32 / 20 / 34, gap 10, Inter 500 16/24 uppercase +0.32, 18px plus,
   20px folded corner on the outer bottom-left (−2 = over the border).
   Left / center / right is the row's justify-content.
   ========================================================================== */

@property --roots-fb { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --roots-btn-tt { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --roots-btn-tb { syntax: "<length>"; inherits: false; initial-value: 0px; }

.roots-btn-row,
#top #wrap_all .roots-btn-row {
  --roots-btn-mt-now: var(--roots-btn-mt, 0px);
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  margin-top: var(--roots-btn-mt-now);
  margin-right: 0;
  margin-bottom: var(--roots-btn-mb, 0px);
  margin-left: 0;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
}

.roots-btn-row--center,
#top #wrap_all .roots-btn-row--center {
  justify-content: center;
}

.roots-btn-row--right,
#top #wrap_all .roots-btn-row--right {
  justify-content: flex-end;
}

@media (max-width: 1199px) {
  .roots-btn-row.roots-btn-row--scale,
  #top #wrap_all .roots-btn-row.roots-btn-row--scale {
    --roots-btn-mt-now: calc(var(--roots-btn-mt, 0px) * 0.75);
  }
}

@media (max-width: 899px) {
  .roots-btn-row.roots-btn-row--scale,
  #top #wrap_all .roots-btn-row.roots-btn-row--scale {
    --roots-btn-mt-now: calc(var(--roots-btn-mt, 0px) * 0.6);
  }
}

@supports not ((text-box: trim-both cap alphabetic) or (text-box-trim: trim-both)) {
  .roots-btn, #top #wrap_all .roots-btn { --roots-fb: 1; }
}

/* ---- the button ------------------------------------------------------- */

.roots-btn,
#top #wrap_all .roots-btn {
  --roots-btn-bg: #ffffff;
  --roots-btn-fg: #3b2a20;
  --roots-btn-line: #b39b75;
  --roots-btn-bg-hover: #f3efe9;
  --roots-btn-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --cap-b: 0.7275;
  --desc: 0.1362;
  --cap-b-t: var(--cap-b);
  --desc-t: var(--desc);
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  column-gap: 10px;
  box-sizing: border-box;
  max-width: 100%;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  padding-top: 20px;
  padding-right: 32px;
  padding-bottom: 20px;
  padding-left: 34px;
  border-style: solid;
  border-width: 2px;
  border-color: var(--roots-btn-line);
  border-radius: 0;
  background-color: var(--roots-btn-bg);
  color: var(--roots-btn-fg);
  font-family: var(--roots-btn-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.roots-btn--dark,
#top #wrap_all .roots-btn--dark {
  --roots-btn-bg: #4a523e;
  --roots-btn-fg: #f1ede1;
  --roots-btn-line: #f1ede1;
  --roots-btn-bg-hover: #5e6551;
}

.roots-btn:hover,
.roots-btn:focus-visible,
#top #wrap_all .roots-btn:hover,
#top #wrap_all .roots-btn:focus-visible {
  background-color: var(--roots-btn-bg-hover);
  color: var(--roots-btn-fg);
  text-decoration: none;
}

.roots-btn:focus-visible,
#top #wrap_all .roots-btn:focus-visible {
  outline: 2px solid var(--roots-btn-line);
  outline-offset: 4px;
}

/* label: Inter 500 16/24 uppercase +0.32, cap-trimmed to its cap box */
.roots-btn .roots-btn__label,
#top #wrap_all .roots-btn .roots-btn__label {
  --fs: 16px;
  --lh: 24px;
  --roots-btn-tt: calc(var(--roots-fb) * (var(--lh) - var(--fs) * var(--cap-b-t)) / 2);
  --roots-btn-tb: calc(var(--roots-fb) * ((var(--lh) - var(--fs)) / 2 + var(--fs) * var(--desc-t)));
  display: block;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
  text-box: trim-both cap alphabetic;
  margin-top: calc(-1 * var(--roots-btn-tt));
  margin-right: 0;
  margin-bottom: calc(-1 * var(--roots-btn-tb));
  margin-left: 0;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
  border: 0;
  background: none;
  color: var(--roots-btn-fg);
  font-family: var(--roots-btn-sans);
  font-size: var(--fs);
  font-weight: 500;
  font-style: normal;
  line-height: var(--lh);
  letter-spacing: 0.32px;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 479px) {
  .roots-btn .roots-btn__label,
  #top #wrap_all .roots-btn .roots-btn__label {
    white-space: normal;
  }
}

/* the 18px plus — the export keeps its own width/height */
.roots-btn .roots-btn__icon,
#top #wrap_all .roots-btn .roots-btn__icon {
  display: block;
  flex-grow: 0;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  line-height: 0;
}

/* the 20px fold on the outer bottom-left corner */
.roots-btn .roots-btn__corner,
#top #wrap_all .roots-btn .roots-btn__corner {
  position: absolute;
  left: -2px;
  bottom: -2px;
  display: block;
  width: 20px;
  height: 20px;
  line-height: 0;
  pointer-events: none;
}

.roots-btn .roots-btn__icon img,
.roots-btn .roots-btn__corner img,
#top #wrap_all .roots-btn .roots-btn__icon img,
#top #wrap_all .roots-btn .roots-btn__corner img {
  display: block;
  max-width: none;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
  border: 0;
  background: none;
}
