/* COPIED from ~/Desktop/Design System/components/button.css on 2026-10-20 by selfprint/tools/build_zds.py.
   Do not edit here — change the Design System, then re-run the script. */
/* =============================================================================
   Zigu — Button  (components/button.css)
   Requires tokens.css (+ components/icon.css/icon-glyphs.css for glyphs).
   Spec: components/button.md · Figma: page "Button / Button group" (5:1627), set 🧬 Button (48:3953).

   <button type="button" class="zg-button">
     <i class="zg-icon zg-icon--check" aria-hidden="true"></i>
     <span class="zg-button__label">저장</span>
   </button>

   color  (primary) · --secondary · --negative      style  (fill) · --line · --ghost
   size   --sm · (md) · --lg                         shape  --icon-only · --block · --bar
   state  :disabled / aria-disabled · aria-busy (loading: + .zg-button__spinner)
   ========================================================================== */
.zg-button {
  /* size (md) */
  --_h: var(--button-height-md);
  --_px: var(--button-padding-x);
  --_px-icon: var(--button-padding-icon);
  --_icon: var(--icon-md);
  --_font: var(--body-sm-size) / var(--body-sm-lh);
  --_weight: var(--font-regular);
  /* color set (primary) — the style rules below pick from it */
  --_c-bg: var(--button-primary-bg);
  --_c-bg-hover: var(--button-primary-bg-hover);
  --_c-bg-press: var(--button-primary-bg-press);
  --_c-fg: var(--button-primary-fg);
  --_c-line: var(--button-primary-line-border);
  --_c-line-hover: var(--button-primary-line-border-hover);
  --_c-line-press: var(--button-primary-line-border-press);
  --_c-line-bg-hover: var(--button-primary-line-bg-hover);
  --_c-line-fg: var(--button-primary-line-fg);
  --_c-line-w: 2px;
  --_c-ghost-fg: var(--button-primary-ghost-fg);
  /* style (fill) */
  --_bg: var(--_c-bg);
  --_bg-hover: var(--_c-bg-hover);
  --_bg-press: var(--_c-bg-press);
  --_fg: var(--_c-fg);
  --_bw: 0px;
  --_bd: transparent;
  --_bd-hover: transparent;
  --_bd-press: transparent;
  /* written by the state rules */
  --_bd-now: var(--_bd);
  --_pl: var(--_px);
  --_pr: var(--_px);
  --_bump: calc(var(--_icon) * var(--button-text-bumper));

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  box-sizing: border-box;
  height: var(--_h);
  min-width: calc(var(--button-min-content) + var(--_pl) + var(--_pr));
  margin: 0;
  padding-block: 0;
  padding-inline: var(--_pl) var(--_pr);   /* logical: the leading side is the icon's side in right-to-left too */
  border: 0;
  border-radius: var(--button-radius);
  background: var(--_bg);
  /* the line is drawn inside, so fill and line buttons have the same size (Figma: stroke inside) */
  box-shadow: inset 0 0 0 var(--_bw) var(--_bd-now);
  color: var(--_fg);
  font: var(--_weight) var(--_font) var(--font-sans);
  letter-spacing: var(--tracking);
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.zg-button__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* the glyph follows the label color; the button decides the artboard size */
.zg-button > .zg-icon { --zg-icon-size: var(--_icon); color: inherit; }
/* optical edges: the icon artboard carries its own air (≈ 1/6 of it), so the icon edge sits closer
   (Figma 8) and the text edge across from it gets that air back as a bumper (user-picked: 1/6).
   md: icon 8 | text 12 + 3.3 · sm: 4 | 4 + 2.7 · lg: 8 | 12 + 4. Icons on both ends: both are icon edges. */
.zg-button:has(> .zg-icon:first-child) { --_pl: var(--_px-icon); --_pr: calc(var(--_px) + var(--_bump)); }
.zg-button:has(> .zg-icon:nth-last-child(1 of :not(.zg-button__spinner)):not(:first-child)) { --_pr: var(--_px-icon); --_pl: calc(var(--_px) + var(--_bump)); }
.zg-button:has(> .zg-icon:first-child ~ .zg-icon:nth-last-child(1 of :not(.zg-button__spinner))) { --_pl: var(--_px-icon); --_pr: var(--_px-icon); }
/* CSS can't see a bare text node, so a lone glyph counts as leading. Always wrap the words in .zg-button__label —
   then a trailing glyph (words first) is read right too. (A bare label once made "✓ 생성" lose its bumper, v0.5.68.) */
/* loading (Storybook "loading"; user v0.5.37): the words and glyphs give way to a turning spinner in the
   middle — the button keeps its width. Add aria-busy="true" and a spinner as the LAST child:
   <i class="zg-icon zg-icon--spinner zg-spinner zg-button__spinner" aria-hidden="true"></i> (needs spinner.css) */
.zg-button[aria-busy="true"] { cursor: progress; }
.zg-button[aria-busy="true"] > :not(.zg-button__spinner) { visibility: hidden; }
.zg-button__spinner { position: absolute; inset: 0; margin: auto; }
.zg-button:not([aria-busy="true"]) > .zg-button__spinner { display: none; }

/* ---- size ---- */
.zg-button--sm {
  --_h: var(--button-height-sm);
  --_px: var(--button-padding-sm);
  --_px-icon: var(--button-padding-sm);
  --_icon: var(--icon-sm);
  --_font: var(--body-xs-size) / var(--body-xs-lh);
}
.zg-button--lg {
  --_h: var(--button-height-lg);
  --_icon: var(--icon-lg);
  --_font: var(--body-md-size) / var(--body-md-lh);
}

/* ---- color ---- (pressed = hover where Figma draws no pressed color) */
.zg-button--secondary {
  --_c-bg: var(--button-secondary-bg);
  --_c-bg-hover: var(--button-secondary-bg-hover);
  --_c-bg-press: var(--button-secondary-bg-press);
  --_c-fg: var(--button-secondary-fg);
  --_c-line: var(--button-secondary-line-border);
  --_c-line-hover: var(--button-secondary-line-border-hover);
  --_c-line-press: var(--button-secondary-line-border-hover);
  --_c-line-bg-hover: var(--button-secondary-line-bg-hover);
  --_c-line-fg: var(--button-secondary-line-fg);
  --_c-line-w: 1px;
  --_c-ghost-fg: var(--button-secondary-ghost-fg);
}
.zg-button--negative {
  --_c-bg: var(--button-negative-bg);
  --_c-bg-hover: var(--button-negative-bg-hover);
  --_c-bg-press: var(--button-negative-bg-press);
  --_c-fg: var(--button-negative-fg);
  --_c-line: var(--button-negative-line-border);
  --_c-line-hover: var(--button-negative-line-border-hover);
  --_c-line-press: var(--button-negative-line-border-hover);
  --_c-line-bg-hover: var(--button-negative-line-bg-hover);
  --_c-line-fg: var(--button-negative-line-fg);
  --_c-ghost-fg: var(--button-negative-ghost-fg);
}

/* ---- style ---- */
.zg-button--line {
  --_bg: var(--button-line-bg);
  --_bg-hover: var(--_c-line-bg-hover);
  --_bg-press: var(--_c-line-bg-hover);
  --_fg: var(--_c-line-fg);
  --_bw: var(--_c-line-w);
  --_bd: var(--_c-line);
  --_bd-hover: var(--_c-line-hover);
  --_bd-press: var(--_c-line-press);
}
.zg-button--ghost {
  --_bg: transparent;
  --_bg-hover: var(--button-ghost-bg-hover);
  --_bg-press: var(--button-ghost-bg-press);
  --_fg: var(--_c-ghost-fg);
}

/* ---- state ---- */
/* hover (product rule, user v0.5.60): it must show. fill → one step darker · line → a light tint of its colour
   inside + a darker line · ghost → a quiet overlay. pressed goes one more step. */
.zg-button:hover { background: var(--_bg-hover); --_bd-now: var(--_bd-hover); }
.zg-button:active { background: var(--_bg-press); --_bd-now: var(--_bd-press); }
/* focus (product rule, user v0.5.60 · on click too v0.5.61; Figma <FocusRing> 39:233): a 2px primary-500 line
   around the button with a 2px gap — on mouse click and keyboard alike (:focus, not :focus-visible). An outline,
   so the gap is see-through on any surface; z-index lifts it over a group neighbour.
   (Safari on macOS doesn't focus a button on click — the app calls button.focus() there if the line must show.) */
.zg-button:focus { outline: var(--button-focus-width) solid var(--button-focus); outline-offset: var(--button-focus-gap); z-index: 1; }
/* disabled: every style becomes the same quiet box (Figma: black 5% + gray-400, line keeps its width) */
.zg-button:disabled,
.zg-button[aria-disabled="true"] {
  --_bg: var(--button-disabled-bg);
  --_bg-hover: var(--_bg);
  --_bg-press: var(--_bg);
  --_fg: var(--button-disabled-fg);
  --_bd: var(--button-disabled-bg);
  --_bd-hover: var(--_bd);
  --_bd-press: var(--_bd);
  cursor: not-allowed;
}

/* option button (Figma ButtonIconOption, merged here): a line icon button that opens options.
   open (aria-expanded) → blue line + glyph; an option is in force (.is-valued) → blue glyph.
   (A split button's arrow keeps the Button group rule.) */
.zg-button--line[aria-expanded="true"]:not(.zg-button-group--split > .zg-button) { --_bd: var(--primary); --_bd-hover: var(--primary); --_bd-press: var(--primary); --_fg: var(--primary); }
.zg-button--line.is-valued { --_fg: var(--primary); }

/* ---- shape ---- */
/* square, glyph only — always give the button an aria-label */
.zg-button--icon-only { width: var(--_h); min-width: 0; padding: 0; }
.zg-button--block { display: flex; width: 100%; }
/* bottom CTA bar (Figma bottomBar): full width, 52 high, square corners, 18 Medium label */
.zg-button--bar {
  --_h: var(--button-height-xl);
  --_font: var(--h7-size) / var(--h7-lh);
  --_weight: var(--font-medium);
  display: flex;
  width: 100%;
  border-radius: 0;
}
