/* Style Canon — shared design system
   Tokens + base type + shared header/nav. The single source of truth for the
   visual system: tweak a token here and all linked pages update.
   Linked today by: index.html, wardrobe.html, via.html. */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --cream:    #FFFDFA;   /* Coconut Cream — ground */
  --ink:      #1F1C16;   /* Black */
  --charcoal: #514E47;   /* Charcoal — secondary ink, resting nav */
  --dove:     #C9C8C5;   /* Dove Grey — hairline rules */
  --pothos:   #C4C89A;   /* Pothos Green — soft accent (kept in palette) */
  --fill:     #ECE9E1;   /* warm neutral for empty tiles / controls */

  /* Selection / active accent — the vivid bar shown on a selected item.
     Default cobalt. Swap to one of the alts to change it everywhere. */
  --accent:   #2E5BFF;   /* cobalt  | alts: orange #FF5A1F · red #E5392E */

  /* Universal page side gutter. Wardrobe, Inspiration and Mirror all pull their
     horizontal body padding from this one token, so the tabs share a content
     width by construction instead of each page hand-setting its own padding.
     Tune this single value to move every tab's side buffers together. */
  --page-pad-x: clamp(28px, 4vw, 72px);

  /* Capped content measure — a max-width ceiling so long text (e.g. the Mirror
     headline) breathes wide but never runs edge-to-edge on a large monitor. */
  --content-max: 1080px;

  --font-display: 'Outfit', 'Avenir Next', Avenir, 'Century Gothic', 'Helvetica Neue', Arial, sans-serif;

  /* Detail-page field-width standard. Every editable control on a detail page —
     select, text/number input, color swatch, brand input, dashed "+ add" — is
     capped to this one width so the value column shares a single right edge.
     Standing UI rule (ui_notes.md). Tune here to move every control together. */
  --field-w: 200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-display);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- shared top header ---- */
.sc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--dove);
  padding-bottom: 16px;
  margin-bottom: 32px;
}
.sc-header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.sc-nav { display: flex; gap: 26px; align-items: center; }
.sc-nav a {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--charcoal);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.sc-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.sc-nav a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* circular profile avatar, far-right of the header, slightly separated. Higher
   specificity than `.sc-nav a` so it keeps its full ring (not the text underline). */
.sc-nav .sc-avatar, .sc-subnav .sc-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; margin-left: 8px; flex: none;
  border: 1px solid var(--dove); border-radius: 50%; overflow: hidden;
}
.sc-nav .sc-avatar:hover, .sc-subnav .sc-avatar:hover { border-color: var(--accent); }
.sc-nav .sc-avatar img, .sc-subnav .sc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-nav .sc-avatar .ph, .sc-subnav .sc-avatar .ph { width: 100%; height: 100%; background: var(--fill); }

/* ---- shared detail-page sub-nav (back link + right-hand links) ----
   Promoted from the duplicated per-page .top-nav on garment / inspiration detail. */
.sc-subnav {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 28px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
}
.sc-subnav a {
  color: var(--charcoal); text-decoration: none;
  border-bottom: 2px solid transparent; padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.sc-subnav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.sc-subnav .links { display: flex; gap: 22px; align-items: center; }

/* ---- shared inspiration image-op controls + crop modal ----
   Used by the gallery cards (via.html) and the detail page (via_detail.html).
   Only .card-tools POSITIONING is page-local (gallery vs detail); the pill look,
   icon buttons, and the crop modal are shared here. */
.tool {
  font-family: var(--font-display); font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--charcoal);
  background: rgba(255, 253, 250, 0.92); border: 1px solid var(--dove);
  border-radius: 4px; padding: 3px 7px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.tool:hover { color: var(--ink); border-color: var(--accent); }
.tool:disabled { opacity: 0.5; cursor: default; }
.tool.icon { padding: 4px 6px; }                 /* square-ish for the SVG-only pills */
.tool .ic { width: 12px; height: 12px; display: block; }

.crop-modal {
  position: fixed; inset: 0; display: none; z-index: 60;
  background: rgba(31, 28, 22, 0.7); align-items: center; justify-content: center;
}
.crop-modal.show { display: flex; }
.crop-stage {
  background: var(--cream); padding: 16px; max-width: 92vw; max-height: 92vh;
  display: flex; flex-direction: column; gap: 12px;
}
.crop-imgwrap { position: relative; display: inline-block; touch-action: none; user-select: none; }
.crop-imgwrap img { display: block; max-width: 86vw; max-height: 78vh; }
.crop-box { position: absolute; border: 2px solid var(--accent); background: rgba(46, 91, 255, 0.12); display: none; }
.crop-actions { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.crop-hint { margin-right: auto; font-size: 11px; color: var(--charcoal); letter-spacing: 0.06em; }
.crop-btn {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; padding: 7px 14px;
  border: 1px solid var(--dove); background: var(--fill); color: var(--ink); cursor: pointer;
}
.crop-btn.primary { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.crop-btn:disabled { opacity: 0.5; cursor: default; }
