/*
 * jabnet.css - project-owned styles.
 *
 * assets/css/style.css is the purchased theme, compiled from a SCSS source that
 * is now older than the CSS itself. Appending our own rules there would make it
 * impossible to tell theme from project later, so everything we write lives
 * here instead, loaded after the theme so it can override it.
 *
 * Every class is prefixed jb-. Colours, fonts and radii come from the theme
 * tokens declared at style.css :root, never from a hardcoded value.
 *
 * Contents
 *   1. Section rhythm
 *   2. Profile panel        (team/detail.php)
 *   3. Prose + read-more    (team/detail.php)
 *   4. Skills               (team/detail.php)
 */

:root {
  /* Same shadow tint the theme uses on .about-card and .team-card. */
  --jb-shadow-tint: 8, 14, 28;
}

/* ------------------------------------------------------------------ *
 * 1. Section rhythm
 * ------------------------------------------------------------------ */

.jb-section {
  margin-top: 56px;
}

@media (max-width: 767.98px) {
  .jb-section {
    margin-top: 40px;
  }
}

/* ------------------------------------------------------------------ *
 * 2. Profile panel
 *
 * The theme's white panel lives on .about-card, which team/detail.php never
 * emits, so the profile block used to sit raw on the page's #eeeeee body.
 * ------------------------------------------------------------------ */

.jb-panel {
  background-color: var(--white-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(var(--jb-shadow-tint), 0.07);
}

.jb-profile {
  height: 100%;
}

/* The theme paints .border-title with --smoke-color2 (#F1F1F1), which is
   invisible against the page's own #eeeeee body. */
.jb-section > .border-title {
  border-bottom-color: var(--th-border-color);
}

.jb-profile__photo {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
  object-fit: cover;
}

.jb-profile .about-card_top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.jb-profile .about-card_title {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.jb-profile .about-card_desig {
  color: var(--theme-color);
  font-weight: 600;
  margin-bottom: 0;
}

/* 44px targets with 8px between them, per the accessibility baseline. */
.jb-profile .header-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jb-profile .header-social a {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--th-border-color);
  color: var(--title-color);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.jb-profile .header-social a:hover,
.jb-profile .header-social a:focus-visible {
  background-color: var(--theme-color);
  border-color: var(--theme-color);
  color: var(--white-color);
}

/* The theme styles the bare <blockquote> element itself: a 125px orange
   ::before panel, 165px of left padding, and `border: none !important`. All
   three have to be undone here, which is what the one !important is for. */
.jb-profile__quote {
  margin: 0 0 24px;
  padding: 16px 20px;
  overflow: visible;
  font-size: 16px;
  font-weight: 400;
  border-left: 3px solid var(--theme-color) !important;
  border-radius: 0 12px 12px 0;
  background-color: var(--smoke-color);
}

.jb-profile__quote::before {
  display: none;
}

.jb-profile__quote p {
  margin: 0;
  font-style: italic;
  color: var(--title-color);
}

/* The theme pins this to two equal columns, which forces a long phone number
   onto a second line. Let it drop to one column when the panel is narrow. */
.jb-profile .team-info-wrap {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 767.98px) {
  .jb-panel {
    padding: 24px;
  }
}

/* ------------------------------------------------------------------ *
 * 3. Prose + read-more
 * ------------------------------------------------------------------ */

.jb-prose {
  max-width: 68ch;
  color: var(--body-color);
  line-height: 1.8;
  /* A pasted URL or a long unbroken token must not widen the page. */
  overflow-wrap: anywhere;
}

.jb-prose > *:last-child {
  margin-bottom: 0;
}

.jb-prose p,
.jb-prose ul,
.jb-prose ol {
  margin-bottom: 1.25em;
}

.jb-prose ul,
.jb-prose ol {
  padding-left: 1.4em;
}

.jb-prose li {
  margin-bottom: 0.5em;
}

.jb-prose h2,
.jb-prose h3,
.jb-prose h4,
.jb-prose h5 {
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  color: var(--title-color);
}

.jb-prose a {
  color: var(--theme-color);
  text-decoration: underline;
}

.jb-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Scrollable container so a wide table cannot scroll the page sideways. */
.jb-prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
}

/* The panel hugs the reading measure instead of stretching the full container:
   a wide card holding a 68ch column of text just looks half empty. */
.jb-bio {
  max-width: 46rem;
}

.jb-bio .jb-prose {
  max-width: none;
}

/* .is-clamped is added by script only, so with JS off the full text shows. */
.jb-bio__body.is-clamped {
  position: relative;
  max-height: 14em;
  overflow: hidden;
}

.jb-bio__body.is-clamped::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5em;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--white-color));
}

.jb-bio__toggle {
  margin-top: 16px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--theme-color);
  border-radius: 100px;
  background-color: transparent;
  color: var(--theme-color);
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.jb-bio__toggle:hover,
.jb-bio__toggle:focus-visible {
  background-color: var(--theme-color);
  color: var(--white-color);
}

/* ------------------------------------------------------------------ *
 * 4. Skills
 *
 * Deliberately NOT named .progress-bar: assets/js/main.js runs an unscoped
 * document.querySelector(".progress-bar") for a slider timer, and would grab
 * the first skill meter on any page that ever gains that slider.
 * ------------------------------------------------------------------ */

.jb-skills {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.jb-skill {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 20px;
  background-color: var(--white-color);
  border: 1px solid var(--th-border-color);
  border-radius: 14px;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.jb-skill:hover {
  border-color: var(--theme-color);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(var(--jb-shadow-tint), 0.08);
}

.jb-skill__name {
  font-family: var(--title-font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--title-color);
  /* Own line, own flow. Nothing is absolutely positioned here, which is what
     stops a long skill name from colliding with its value label. */
  overflow-wrap: anywhere;
}

.jb-skill__value {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 100px;
  color: var(--theme-color2);
  /* rgba first as the fallback; color-mix keeps the wash correct when a
     body.theme-* class swaps --theme-color out from under us. */
  background-color: rgba(243, 112, 33, 0.1);
  background-color: color-mix(in srgb, var(--theme-color) 12%, transparent);
}

.jb-skill__track {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: auto;
  border-radius: 100px;
  background-color: var(--smoke-color3);
  overflow: hidden;
}

.jb-skill__fill {
  display: block;
  height: 100%;
  width: var(--jb-fill, 0%);
  border-radius: inherit;
  background-image: linear-gradient(90deg, var(--theme-color), var(--theme-color2));
}

.jb-skill__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
  margin-top: auto;
}

.jb-skill__step {
  display: block;
  height: 8px;
  border-radius: 100px;
  background-color: var(--smoke-color3);
}

.jb-skill__step.is-on {
  background-color: var(--theme-color);
}

/* Fills grow from 0 only once the list is on screen. The base rule above is
   the final width, so with JS off the meters are simply correct and static. */
.jb-skills.jb-animate .jb-skill__fill {
  width: 0;
  transition: width 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.jb-skills.jb-animate.is-visible .jb-skill__fill {
  width: var(--jb-fill, 0%);
}

.jb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.jb-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid var(--th-border-color);
  border-radius: 100px;
  background-color: var(--smoke-color);
  color: var(--title-color);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.jb-chip i {
  color: var(--success-color);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .jb-skill,
  .jb-skills.jb-animate .jb-skill__fill,
  .jb-bio__toggle,
  .jb-profile .header-social a {
    transition: none;
  }

  .jb-skill:hover {
    transform: none;
  }

  .jb-skills.jb-animate .jb-skill__fill {
    width: var(--jb-fill, 0%);
  }
}
