/* ============================================================
   CHARACTER PROFILE SKIN (VisualOverehaul branch, 2026-08-11)

   The tabbed profile look for EVERYONE since 2026-08-11 (players
   joined at the owner's word): hero card, centered section tabs,
   letterspaced small-caps headings, thin gold bars, outlined
   buttons. interactions.js puts `.cp-skin` on #tab-person for
   every profile, plus `.cp-npc` or `.cp-player` for the parts
   that differ: NPCs get a Service tab (hire/work), players an
   Attire tab (their wardrobe, drawn large - the owner cares).

   The `!important`s override the inline styles the person tab's
   markup still carries from before the skin; lifting those into
   classes remains the eventual cleanup.

   Colours and fonts come from tokens.css only, so light mode works
   without a twin block: the parchment theme swaps the variables.
   ============================================================ */

/* -- section visibility ------------------------------------------------ */
/* Before any profile has been opened the tab has no .cp-skin class and the
   skin-only elements stay out of sight. Once one opens - NPC or player -
   the bar shows and one section reads at a time. */
#tab-person:not(.cp-skin) .cp-npc-only { display: none !important; }
#tab-person.cp-skin .cp-sec { display: none; }
#tab-person.cp-skin .cp-sec.active { display: block; }

/* Which tabs exist for whom: no Service for a player, no Attire for an
   NPC (an NPC keeps no wardrobe - the same rule the old card followed). */
#tab-person.cp-player [data-cps="service"] { display: none !important; }
#tab-person.cp-npc [data-cps="attire"] { display: none !important; }

/* -- the ATTIRE pane (players; maggie: "clothes visible quite nicely") -- */
#tab-person.cp-skin #cp-worn {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.2rem 2.4rem;
}
#tab-person.cp-skin .cp-worn-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--border-dim);
  padding: 0.6rem 0.2rem;
}
#tab-person.cp-skin .cp-worn-slot {
  font-family: var(--font-serif);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
#tab-person.cp-skin .cp-worn-item {
  font-family: var(--font-serif);
  font-variant: small-caps;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-align: right;
}
/* An heirloom on somebody's back: the same violet the Inventory shelf uses,
   as a border and a wash on the row, with its label after the name. */
#tab-person.cp-skin .cp-worn-row.is-heirloom {
  border: 1px solid var(--accent-violet);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding-left: 0.6rem;
  padding-right: 0.6rem;
  background: color-mix(in srgb, var(--accent-violet) 10%, var(--bg-surface));
  box-shadow: 0 0 0.6rem color-mix(in srgb, var(--accent-violet) 25%, transparent);
}
#tab-person.cp-skin .cp-worn-row .inv-heirloom-tag {
  font-family: var(--font-mono);
  font-variant: normal;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* -- the centered tab bar ---------------------------------------------- */
/* The bar itself is the shared .sec-tabs/.sec-tab control (controls.css) -
   promoted there 2026-08-11 so the Market could use it too. Here it only
   gets its placement inside the profile. */
#tab-person.cp-skin #cp-section-tabs {
  margin: 1.1rem 0.75rem 0;
  max-width: 1100px;
}

/* -- shared shapes ------------------------------------------------------ */
/* Sections sit as open text on the dark ground - the boxes-in-boxes are
   what read as clutter. Only the hero keeps its card. */
#tab-person.cp-skin .cp-sec { max-width: 1100px; padding: 0 0.75rem; }
#tab-person.cp-skin .cp-sec .panel-card {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0.25rem 0 0.75rem;
}
/* The letterspaced small-caps heading every section speaks in. */
#tab-person.cp-skin .cp-sec-title,
#tab-person.cp-skin .panel-card-title {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 1.3rem 0 0.8rem;
}
/* The "Interact" title is replaced by the section headings. (!important:
   the header row carries an inline display:flex.) */
#tab-person.cp-skin #cp-sec-relations > .panel-card > div:first-child { display: none !important; }
/* The old headings drew a rule under themselves; the skin's do not. */
#tab-person.cp-skin .panel-card-title { border-bottom: 0; padding-bottom: 0; }

/* -- hero card ----------------------------------------------------------- */
#tab-person.cp-skin .cp-head {
  max-width: 1100px;
  margin: 0.9rem 0.75rem 0 !important;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border-dim);
  background: var(--bg-panel);
  display: grid !important;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.6rem;
  align-items: start !important;
}
/* The portrait and the raven button under it are one column, spanning both
   rows; the traits sit under the name in the second column. (Since the raven
   button came in, 2026-09-22, the grid's children are these two wrappers -
   rules on #cp-portrait / #cp-traits themselves no longer place anything, and
   the traits fell into the portrait's column and stretched it.) */
#tab-person.cp-skin .cp-portrait-col { grid-row: 1 / 3; }
#tab-person.cp-skin #cp-raven-btn { width: 150px !important; }
#tab-person.cp-skin .cp-traits-col {
  grid-column: 2;
  max-width: none !important;
  align-items: flex-start !important;
}
#tab-person.cp-skin #cp-portrait {
  width: 150px !important;
  height: 192px !important;
  border-radius: 2px !important;
  border-color: var(--border-bright) !important;
}
#tab-person.cp-skin #cp-name {
  font-family: var(--font-serif) !important;
  font-variant: small-caps;
  font-weight: 400 !important;
  font-size: 2rem !important;
  letter-spacing: 0.1em;
  line-height: 1.15;
}
#tab-person.cp-skin #cp-title {
  font-family: var(--font-serif);
  font-variant: small-caps;
  font-style: normal !important;   /* the inline italic is retired with the serif-italic voice */
  font-size: 0.95rem !important;
  letter-spacing: 0.08em;
  margin-top: 0.25rem !important;
}
#tab-person.cp-skin #cp-meta {
  font-family: var(--font-ui);
  font-size: 0.68rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.7rem !important;
}
/* Chips: the relationship chip and the trait chips read as one row of
   outlined rectangles; the relationship one is the bright first chip. */
#tab-person.cp-skin #cp-rel {
  border-radius: 2px !important;
  border-color: var(--accent-gold) !important;
  background: color-mix(in srgb, var(--accent-gold) 10%, transparent) !important;
  color: var(--text-primary) !important;
  font-size: 0.66rem !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem !important;
  margin-top: 0.8rem !important;
}
#tab-person.cp-skin #cp-traits {
  justify-content: flex-start !important;
  max-width: none !important;
  margin-top: 0.45rem;
}
/* (The outlined trait chip itself is the game-wide .trait-pill look now -
   see components/character.css - so the skin no longer restyles it.) */

/* -- Relations: the Love / Friendship / Hate lines ----------------------- */
/* Each block is label + value on one line, a hairline bar beneath.
   The three children are: label div, track div, value div. */
#tab-person.cp-skin .cp-lfh { gap: 1.6rem !important; margin: 0.4rem 0 1rem !important; }
#tab-person.cp-skin .cp-lfh-block {
  display: grid;
  grid-template-columns: 1fr auto;
}
#tab-person.cp-skin .cp-lfh-block > div:nth-child(1) {
  grid-area: 1 / 1;
  font-family: var(--font-serif);
  font-size: 0.68rem !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
  color: var(--text-muted) !important;
  margin-bottom: 0.45rem !important;
}
/* The track and fill themselves are the shared bar component now (bars.css,
   one gold gradient game-wide, maggie 2026-08-11) - the skin only places them. */
#tab-person.cp-skin .cp-lfh-block > div:nth-child(2) {
  grid-area: 2 / 1 / 3 / 3;
}
#tab-person.cp-skin .cp-lfh-block > div:nth-child(3) {
  grid-area: 1 / 2;
  font-family: var(--font-mono);
  font-size: 0.72rem !important;
  margin: 0 !important;
}

/* -- Relations: tone, cap line, action tiles ----------------------------- */
/* Centered, like the section tabs above them (maggie, 2026-08-11) - the
   markup's own inline justify-content:center is left to do its work. */
#tab-person.cp-skin #cp-interact-stance { gap: 0.5rem !important; }
#tab-person.cp-skin .stance-pill {
  border-radius: 2px;
  border-color: var(--border-bright);
  padding: 0.5rem 1.1rem;
  font-family: var(--font-serif);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
/* On a phone the four tones overran the panel on both sides (render check,
   2026-09-24): they wrap, and share the row, rather than spill. */
#tab-person.cp-skin #cp-interact-stance { flex-wrap: wrap; }
@media (max-width: 480px) {
  #tab-person.cp-skin .stance-pill { padding: 0.45rem 0.5rem; letter-spacing: 0.06em; flex: 1 1 0; min-width: 0; }
}
#tab-person.cp-skin .stance-pill.selected {
  background: color-mix(in srgb, var(--accent-gold) 10%, transparent);
  border-color: var(--accent-gold);
  color: var(--text-primary);
}
#tab-person.cp-skin #cp-interact-cap {
  text-align: left !important;
  background: transparent !important;
  border: 1px solid var(--border-dim);
  border-radius: 0 !important;
  padding: 0.8rem 1rem !important;
  margin: 1.2rem 0 0.4rem !important;
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}
/* ...and only once the day's three are spent does it speak in red
   (interactions.js sets .at-cap from the server's count). */
#tab-person.cp-skin #cp-interact-cap.at-cap {
  color: var(--text-danger) !important;
  border-color: color-mix(in srgb, var(--text-danger) 35%, transparent);
  background: color-mix(in srgb, var(--text-danger) 7%, transparent) !important;
}
/* The interaction and decision tiles: quiet outlined rectangles. The icon
   span is hidden - the mockup speaks in words alone. */
#tab-person.cp-skin #cp-interact-actions { gap: 0.6rem !important; }
#tab-person.cp-skin .cp-decisions { gap: 0.6rem; }
#tab-person.cp-skin #cp-interact-actions .btn,
#tab-person.cp-skin .btn.cp-action {
  background: color-mix(in srgb, var(--bg-panel) 55%, transparent) !important;
  border: 1px solid var(--border-dim) !important;
  border-radius: 0 !important;
  min-height: 3.6rem !important;
  font-family: var(--font-serif);
  letter-spacing: 0.18em;
  color: var(--text-secondary) !important;
}
#tab-person.cp-skin .btn.cp-action { color: var(--accent-gold) !important; }
#tab-person.cp-skin #cp-interact-actions .btn:hover:not(:disabled),
#tab-person.cp-skin .btn.cp-action:hover:not(:disabled) {
  border-color: var(--accent-gold) !important;
  background: color-mix(in srgb, var(--accent-gold) 6%, transparent) !important;
}
#tab-person.cp-skin #cp-interact-actions .btn span:first-child:not(:only-child) { display: none; }
#tab-person.cp-skin #cp-interact-actions .btn span {
  font-size: 0.7rem !important;
  letter-spacing: 0.18em;
}
/* The red danger tile keeps its voice. */
#tab-person.cp-skin .btn.cp-action.danger { color: var(--text-danger) !important; border-color: var(--text-danger) !important; }

/* -- "how they regard you" block in the hero ----------------------------- */
#tab-person.cp-skin #cp-regard .bar-label {
  font-family: var(--font-serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* -- Service (the npcCard inside #cp-npc-actions) ------------------------ */
/* The card repeats the name the hero already states; under the skin the
   name and title go quiet and the role tags become the section's kicker. */
#tab-person.cp-skin .npc-card-name,
#tab-person.cp-skin .npc-card-title { display: none; }
#tab-person.cp-skin .npc-card-role,
#tab-person.cp-skin .npc-card-office {
  font-size: 0.68rem !important;
  letter-spacing: 0.22em !important;
}
/* The saying moved up into the hero (maggie, 2026-08-11: "like they
   actually say this") - #cp-quote below - so the Service pane does not
   repeat it. */
#tab-person.cp-skin .npc-card-quote { display: none; }
#tab-person.cp-skin #cp-quote {
  font-style: italic;     /* Inter - the serif italic voice is retired */
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 0.7rem;
  max-width: 46rem;
}
#tab-person.cp-skin .npc-card-price {
  font-size: 0.9rem !important;
  margin-top: 0.9rem !important;
}
#tab-person.cp-skin .npc-card-price > span:first-child {
  color: var(--accent-gold) !important;
  font-size: 1.15rem;
}
/* The "cheaper for you (275g normally): ..." aside reads as its own quiet
   italic line, not a tag squeezed in after the price. */
#tab-person.cp-skin .npc-card-price > span:not(:first-child) {
  display: block;
  flex-basis: 100%;
  font-size: 0.74rem !important;
  color: var(--text-muted) !important;
  margin-top: 0.15rem;
}
/* The figures under each named piece of work ("produces...", "+40 XP...")
   were built for a dense card; give them reading size here. */
#tab-person.cp-skin #cp-npc-actions li div[style*="0.62rem"] {
  font-size: 0.74rem !important;
  line-height: 1.5 !important;
}
/* Perk and work lists: gold diamond bullets, roomier lines. */
#tab-person.cp-skin #cp-npc-actions ul {
  list-style: none;
  padding-left: 0.2rem !important;
  font-size: 0.82rem !important;
  line-height: 1.7 !important;
}
#tab-person.cp-skin #cp-npc-actions ul > li::before {
  content: '\2726';
  color: var(--accent-gold);
  margin-right: 0.55rem;
  font-size: 0.7rem;
}
/* Every small-caps micro-heading npcCard draws inherits the section voice. */
#tab-person.cp-skin #cp-npc-actions div[style*="uppercase"] {
  font-family: var(--font-serif);
  font-size: 0.72rem !important;
  letter-spacing: 0.22em !important;
  margin-top: 1.2rem !important;
}
/* The card's buttons keep the game's own button voice (maggie, 2026-08-11:
   the ember "Take into service" must read like every other ember button). */
/* "Cannot afford" and friends: outlined red, not a dead grey slab. */
#tab-person.cp-skin #cp-npc-actions .btn.btn-primary:disabled {
  background: transparent !important;
  border: 1px solid var(--text-danger) !important;
  color: var(--text-danger) !important;
  opacity: 1 !important;
  padding: 0.55rem 1.2rem !important;
  font-size: 0.72rem !important;
}

/* -- Chronicle ----------------------------------------------------------- */
/* One column of open sections, not a two-column card grid. */
#tab-person.cp-skin .person-layout {
  display: block !important;
  padding: 0 !important;
}
/* Attribute lines borrow the relationship-bar voice. */
#tab-person.cp-skin #cp-attrs .bar-row { margin-bottom: 0.55rem; }
#tab-person.cp-skin #cp-attrs .bar-label {
  font-size: 0.8rem;      /* Inter - maggie 2026-08-11: serif labels read wrong */
  width: 7.5rem;
  color: var(--text-secondary);
}
#tab-person.cp-skin #cp-attrs .bar-value {
  font-family: var(--font-mono);
  width: 2.6rem;
}
/* The biography reads as prose, not as a caption. */
#tab-person.cp-skin #cp-bio {
  font-size: 0.92rem;     /* Inter, upright - reading text is never serif italic now */
  line-height: 1.8;
  color: var(--text-primary);
}
/* Gold diamond dividers between the open sections. */
#tab-person.cp-skin .person-layout .panel-card:not(:first-child)::before,
#tab-person.cp-skin #cp-sec-service .panel-card::after {
  content: '\2726';
  display: block;
  text-align: center;
  color: var(--accent-gold);
  font-size: 0.6rem;
  margin: 0.4rem 0 1rem;
  border-top: 0;
}

@media (max-width: 640px) {
  #tab-person.cp-skin .cp-head { grid-template-columns: 1fr; }
  #tab-person.cp-skin .cp-portrait-col { grid-row: auto; }
  #tab-person.cp-skin .cp-traits-col { grid-column: 1; }
  /* (phone tab-bar tightening lives with .sec-tabs in controls.css now) */
}

/* -- A NAME YOU CAN TAP (the QoL pass, 2026-09-18) --------------------- */
/* personLink() in ui/helpers.js renders a real <button> so it is reachable by
   keyboard and read as a control; this makes it look like the text it sits in,
   underlined the way a name in a book is, and gives it a touch target that
   clears the 44px guideline without pushing the lines apart. */
.person-link {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: var(--accent-gold); cursor: pointer;
  text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 0.15em; text-align: inherit;
}
.person-link:hover, .person-link:focus-visible { color: var(--accent-ember); text-decoration-style: solid; }
@media (pointer: coarse) { .person-link { padding: 0.25rem 0; } }
