/*##############################################################################
# Script:        skills.css          (stylesheet, loaded by frontend/pages/wisdom.html: its Skills tab)
# Created by:    Matthew Boucher
# Start date:    2026-10-20
# Location:      <project root>/frontend/css/skills.css   (main script: <project root>/aiacolyte.py)
# Description:   The Skills tab's own page background (the Claude Skills picture, darkened, body.is-skills); the
#                "+ Add a skill" box under the list (name only; a spinner while the AI looks the skill up) and the
#                highlight on a skill just added; the Skills tab of /wisdom as a spellbook's index: one entry per row on a gold hairline, opened by a large
#                gold initial, then the Claude skill's name, what it does and a link to its repository; a hidden skill is
#                dimmed and marked for the admin class. Stacks on a phone.
# Reads:         the colour tokens of styles.css
# Writes:        nothing
# Arguments:     none (a stylesheet cannot take flags); aiacolyte.py --checkup confirms it is in place
##############################################################################*/
/* The Skills tab reads as a spellbook's index: one entry per row on a gold hairline, each opened by a large
   illuminated initial (the page's one bold element); the name, then what it does and where to read more. */
.skills-grid {
  max-width: 920px;
  margin: 8px 0 40px;
  border-top: 1px solid var(--line);
}

.skills-card {
  display: grid;
  grid-template-columns: 4.2rem minmax(10rem, 15rem) 1fr;
  column-gap: 1.5rem;
  align-items: start;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.skills-card__initial {
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 0.9;
  color: var(--gold);
  text-align: center;
}

.skills-card__title {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.skills-card__body {
  max-width: 62ch;
}

.skills-card__desc {
  margin: 0.25rem 0 0.6rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text);
}

.skills-card__link {
  font-size: 1.05rem;
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.skills-card__link:hover,
.skills-card__link:focus-visible {
  color: var(--gold-bright);
}

.skills-card__link:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

.skills-card__hidden {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-faint);
}

.skills-card.is-hidden .skills-card__initial,
.skills-card.is-hidden .skills-card__title,
.skills-card.is-hidden .skills-card__desc {
  opacity: 0.55;
}

.skills-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.9rem;
}

@media (max-width: 700px) {
  .skills-card {
    grid-template-columns: 2.8rem 1fr;
    column-gap: 1rem;
    row-gap: 0.4rem;
    padding: 1.3rem 0;
  }

  .skills-card__initial {
    font-size: 2.4rem;
    grid-row: span 2;
  }

  .skills-card__title {
    margin-top: 0.2rem;
  }

  .skills-card__body {
    grid-column: 2;
  }
}

/* "+ Add a skill" (the admin class): one box for the name; the AI fills in the rest */
.skills-add {
  margin: 1.6rem 0 1.4rem;   /* under the list of current skills */
}

.skills-add[hidden],
.skills-add__form[hidden],
.skills-add__working[hidden] {
  display: none;
}

.skills-add__form {
  max-width: 640px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(227, 176, 75, 0.05);
  animation: skills-add-open 0.25s ease both;
}

.skills-add__form label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.skills-add__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skills-add__row input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.55em 0.75em;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.skills-add__row input:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.skills-add__hint {
  margin: 0.6rem 0 0;
  font-style: italic;
  color: var(--text-faint);
}

.skills-add__working {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0.4rem 0;
  color: var(--gold-bright);
}

.skills-add__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(227, 176, 75, 0.25);
  border-top-color: var(--gold-bright);
  border-radius: 50%;
  animation: skills-spin 0.8s linear infinite;
}

/* the skill just added: first in the list, glowing for a moment */
.skills-card.is-new {
  box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(227, 176, 75, 0.35);
  animation: skills-new 2.4s ease both;
}

@keyframes skills-spin {
  to { transform: rotate(360deg); }
}

@keyframes skills-add-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes skills-new {
  0% { transform: scale(0.97); box-shadow: 0 0 0 2px var(--gold-bright), 0 0 40px rgba(246, 216, 139, 0.7); }
  100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .skills-add__form,
  .skills-card.is-new {
    animation: none;
  }

  .skills-add__spinner {
    animation-duration: 3s;
  }
}

/* ---------- the page's background while the Skills tab is open (wisdom.js sets body.is-skills) ---------- */
/* the owner's "Claude Skills: tools for a wiser workshop" picture, fixed and darkened so every word stays easy to read;
   html raises it over the /wisdom page background (wisdom.css) whatever the file order */
html body.is-skills::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(10, 8, 7, 0.78), rgba(10, 8, 7, 0.9) 45%, rgba(10, 8, 7, 0.95)),
    url("/static/assets/img/skills-workshop.webp") center 25% / cover no-repeat;
}

@media (max-width: 800px) {
  html body.is-skills::before {
    background:
      linear-gradient(to bottom, rgba(10, 8, 7, 0.78), rgba(10, 8, 7, 0.9) 45%, rgba(10, 8, 7, 0.95)),
      url("/static/assets/img/skills-workshop-768.webp") center 25% / cover no-repeat;
  }
}

/*##############################################################################
# End of skills.css
##############################################################################*/
