/* Components: the atoms and molecules of the site, each defined exactly once. Overview: docs/DESIGN-SYSTEM.md,
   live on /styleguide. Layer "components": a page may adjust typography, size and spacing of a component in its
   own stylesheet and always wins, but it never redraws a component's icon, shape or states. */
@layer components{
  /* Icon: SVG symbols from partials/symbols.html, <svg class="icon"><use href="#arrow-up"></use></svg>.
     Interface icons are always these symbols, never font glyphs. Size comes from the component around it. */
  .icon{display:inline-block;flex-shrink:0;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}

  /* Label (eyebrow) and notes */
  .eyebrow{font-family:var(--font-mono);font-size:var(--text-label);font-weight:400;letter-spacing:.085em;line-height:1.65}
  .small-note{font-size:var(--text-label);color:var(--muted);line-height:1.65}
  .accent,.danger{color:var(--orange)}

  /* Button: filled by default, .button-outline and .button-light as variants, .button-small for tight rows */
  .button{display:inline-flex;justify-content:center;align-items:center;gap:25px;min-height:54px;padding:14px 24px;border:1px solid var(--ink);border-radius:var(--radius-xs);background:var(--ink);color:var(--paper-light);font-size:var(--text-control);font-weight:500;line-height:1.3;transition:background .25s,transform .25s}
  .button>.icon{width:17px;height:17px}
  .button:hover{transform:translateY(-2px);background:var(--button-hover)}
  .button:disabled:hover{transform:none}
  .button-small{min-height:var(--tap);padding:11px 18px;gap:21px;font-size:var(--text-label)}
  .button-outline{background:transparent;color:var(--ink)}
  .button-light{background:var(--paper);border-color:var(--paper);color:var(--ink)}
  .button-outline:hover,.button-light:hover{background:var(--wash);color:var(--ink)}

  /* Text link (underline on hover) and text button (always underlined) */
  .text-link{display:inline-flex;gap:14px;align-items:center;min-height:var(--tap);border-bottom:1px solid transparent;background:transparent;font-size:var(--text-control);line-height:1.5}
  .text-link>.icon{width:15px;height:15px}
  .text-link:hover{border-color:currentColor}
  .text-button{min-height:var(--tap);padding:10px 0;background:none;font-size:var(--text-label);text-decoration:underline;text-underline-offset:4px}

  /* Chip: one choice in a group (filters, intents, places, scenes, modes, ratings).
     A button with aria-pressed, or a span right after a visually hidden radio input (.chip-input). */
  .chip{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--tap);padding:9px 11px;border:1px solid var(--chip-line,var(--line));border-radius:var(--radius-pill);background:transparent;color:inherit;font-size:var(--text-control);line-height:1.3;white-space:nowrap;cursor:pointer;transition:border-color .2s,background-color .2s,color .2s}
  .chip:hover{border-color:var(--ink)}
  .chip[aria-pressed=true],:checked+.chip{border-color:var(--ink);background:var(--ink);color:var(--paper-light)}
  .chip-input{position:absolute;opacity:0;pointer-events:none}
  .chip-input:focus-visible+.chip{outline:var(--focus-width) solid var(--focus-colour);outline-offset:3px}

  /* Field: underlined text input or textarea; .field-box is the framed variant for dialogs and the workspace */
  .field{display:block;width:100%;min-height:46px;padding:10px 0;border:0;border-bottom:1px solid var(--field-line,var(--muted));border-radius:0;background:transparent;color:var(--ink);font-size:16px;line-height:1.55}
  .field-box{display:block;width:100%;min-height:46px;padding:11px 13px;border:1px solid var(--muted);border-radius:var(--radius-xs);background:var(--paper-light);color:var(--ink);font-size:15px;line-height:1.55}
  .field::placeholder,.field-box::placeholder{color:var(--field-placeholder,var(--muted));opacity:1}
  textarea.field,textarea.field-box{resize:vertical;line-height:1.7}
  .field:focus-visible,.field-box:focus-visible{outline-offset:2px}
  .field[aria-invalid=true]{border-bottom:2px solid var(--orange)}
  .field-box[aria-invalid=true]{border-color:var(--orange)}

  /* Checkbox line */
  .check-line{display:flex!important;align-items:flex-start;gap:10px;font-size:var(--text-control);line-height:1.5;cursor:pointer}
  .check-line input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;margin:1px 0 0;accent-color:var(--ink)}

  /* Round icon button, used to close dialogs */
  .close-round{position:absolute;right:14px;top:12px;display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:50%;background:var(--paper)}
  .close-round>.icon{width:18px;height:18px}

  /* Notice and status chip */
  .notice-box{padding:22px;background:var(--yellow);margin-bottom:30px}
  .status-chip{display:inline-block;padding:5px 12px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--wash);font:10px var(--font-mono);white-space:nowrap}
  .status-chip.muted{background:transparent;color:var(--muted)}

  /* Disclosure (accordion): <details class="disclosure"><summary><span>Title</span>
     <span class="disclosure-icon" aria-hidden="true"></span></summary>…</details>
     The icon is drawn: a ring with a plus that turns into a minus and fills when open. It follows the text colour;
     on dark sections the section sets --disclosure-on (colour of the minus on the filled ring). */
  .disclosure>summary{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:48px;list-style:none;cursor:pointer}
  .disclosure>summary::-webkit-details-marker{display:none}
  .disclosure>summary::marker{content:""}
  .disclosure-icon{--disclosure-size:36px;position:relative;flex:0 0 var(--disclosure-size);width:var(--disclosure-size);height:var(--disclosure-size);box-sizing:border-box;border:1px solid currentColor;border-radius:50%;color:inherit;transition:background-color .2s}
  .disclosure-icon::before,.disclosure-icon::after{content:"";position:absolute;left:50%;top:50%;width:12px;height:1.5px;margin:-.75px 0 0 -6px;border-radius:1px;background:currentColor;transition:transform .25s var(--ease),background-color .2s}
  .disclosure-icon::after{transform:rotate(90deg)}
  .disclosure>summary:hover .disclosure-icon{background:color-mix(in srgb,currentColor 12%,transparent)}
  .disclosure[open]>summary .disclosure-icon{background:currentColor}
  .disclosure[open]>summary .disclosure-icon::before,.disclosure[open]>summary .disclosure-icon::after{background:var(--disclosure-on,var(--paper))}
  .disclosure[open]>summary .disclosure-icon::after{transform:rotate(0deg)}

  /* Colour dot: the colour the visitor picked (--seed), never the darkened accent --orange derived from it */
  .theme-dot{display:block;width:16px;height:16px;border-radius:50%;outline:1px solid var(--ink);outline-offset:3px;background:var(--seed,var(--orange))}
}
