/* Classes section (docs/classes/): guild colours, class tree, header cards and skill tables */

/* one colour per guild, tuned for each theme */
[data-md-color-scheme="default"] {
  --flc-warrior: #b5472b; --flc-diviner: #6a4bc4; --flc-journeyman: #1f8a5b;
  --flc-tint: 9%;
}
[data-md-color-scheme="slate"] {
  --flc-warrior: #f08a6b; --flc-diviner: #b39dff; --flc-journeyman: #5fd49a;
  --flc-tint: 12%;
}
.flc-g-warrior { --flc: var(--flc-warrior); }
.flc-g-diviner { --flc: var(--flc-diviner); }
.flc-g-journeyman { --flc: var(--flc-journeyman); }

/* ---------- legend + class tree (classes/index.md) */
.md-typeset .flc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 1rem 0 0.6rem; font-size: 0.68rem; }
.flc-step { padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid var(--md-default-fg-color--lighter); }
.flc-step.flc-adv { border-style: dashed; }
.flc-step small { color: var(--md-default-fg-color--light); margin-left: 0.25rem; }
.flc-sep { color: var(--md-default-fg-color--light); }

.md-typeset .flc-tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.8rem; margin: 0 0 1.2rem; }
.md-typeset .flc-col {
  padding: 0.8rem 0.9rem 0.9rem; border-radius: 0.6rem;
  border: 1px solid color-mix(in srgb, var(--flc) 35%, transparent);
  border-top: 4px solid var(--flc);
  background: color-mix(in srgb, var(--flc) var(--flc-tint), transparent);
}
.md-typeset .flc-col > p { margin: 0; }
.md-typeset a.flc-guild { display: inline-block; font-size: 0.9rem; font-weight: 700; color: var(--flc); text-decoration: none; }
.md-typeset a.flc-guild:hover { text-decoration: underline; }
.flc-guild-sub { display: block; margin: 0.1rem 0 0.7rem; font-size: 0.64rem; color: var(--md-default-fg-color--light); }
.md-typeset .flc-line { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin: 0 0 0.4rem; position: relative; }
.md-typeset .flc-line > p { display: contents; }
.md-typeset a.flc-node {
  display: flex; align-items: center; min-height: 2.1rem; padding: 0.3rem 0.55rem; border-radius: 0.35rem;
  font-size: 0.68rem; font-weight: 600; line-height: 1.25; text-decoration: none; color: var(--md-default-fg-color);
  background: var(--md-default-bg-color); border: 1px solid color-mix(in srgb, var(--flc) 40%, transparent);
  transition: border-color .15s, transform .15s;
}
.md-typeset a.flc-node.flc-adv { border-style: dashed; color: var(--flc); }
.md-typeset a.flc-node:hover, .md-typeset a.flc-node:focus-visible { border-color: var(--flc); transform: translateY(-1px); }
/* small arrow between a class and its advanced class */
.md-typeset .flc-line::after {
  content: "›"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -55%);
  font-size: 0.8rem; color: var(--flc); pointer-events: none;
}

/* ---------- header card on class and guild pages */
.md-typeset .flc-hero {
  margin: 0 0 1.4rem; padding: 0.9rem 1.1rem 0.6rem; border-radius: 0.6rem;
  border: 1px solid color-mix(in srgb, var(--flc) 35%, transparent);
  border-left: 5px solid var(--flc);
  background: color-mix(in srgb, var(--flc) var(--flc-tint), transparent);
}
.md-typeset .flc-hero > p { margin: 0.3rem 0 0.7rem; }
.md-typeset .flc-path { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.72rem; }
.md-typeset .flc-path p { display: contents; }
.md-typeset .flc-path strong { color: var(--flc); }
.flc-lv {
  font-size: 0.6rem; font-weight: 700; padding: 0 0.4rem; border-radius: 999px;
  color: var(--flc); border: 1px solid color-mix(in srgb, var(--flc) 55%, transparent);
}
.md-typeset .flc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.2rem 1.2rem; margin: 0.2rem 0 0.4rem; }
.md-typeset .flc-fact { font-size: 0.7rem; }
.md-typeset .flc-fact > p { margin: 0.15rem 0; }
.flc-fact-label {
  display: block; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

/* ---------- class cards on guild pages */
.md-typeset .flc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.7rem; margin: 0 0 1.2rem; }
.md-typeset .flc-card {
  padding: 0.7rem 0.9rem; border-radius: 0.5rem; font-size: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--flc) 35%, transparent); border-top: 3px solid var(--flc);
}
.md-typeset .flc-card p { margin: 0.2rem 0; }
.md-typeset a.flc-card-title { font-size: 0.82rem; font-weight: 700; color: var(--flc); text-decoration: none; }
.md-typeset a.flc-card-title:hover { text-decoration: underline; }
.flc-card-adv { display: block; font-size: 0.64rem; color: var(--md-default-fg-color--light); }

/* ---------- skill tables */
.md-typeset .flc-grp {
  margin: 1rem 0 0.2rem; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}
.md-typeset .tabbed-block > .flc-grp:first-child, .md-typeset .tabbed-block > p:first-child + .flc-grp { margin-top: 0.4rem; }
.md-typeset img.flc-ico { width: 32px; height: 32px; max-width: none; vertical-align: middle; object-fit: contain; }
.md-typeset table:not([class]) td:first-child:has(img.flc-ico) { width: 40px; padding-left: 0.4em; padding-right: 0.4em; }
.flc-use { display: inline-block; padding: 0 0.45rem; border-radius: 999px; font-size: 0.6rem; font-weight: 600; white-space: nowrap; }
.flc-use-passive { color: var(--md-default-fg-color--light); border: 1px solid var(--md-default-fg-color--lighter); }
.flc-use-battle { color: #b5472b; background: rgba(181, 71, 43, .12); }
.flc-use-anytime { color: #1f7a8c; background: rgba(31, 122, 140, .12); }
.flc-use-outside { color: #7a5c00; background: rgba(212, 160, 23, .16); }
[data-md-color-scheme="slate"] .flc-use-battle { color: #f5a48a; background: rgba(240, 138, 107, .16); }
[data-md-color-scheme="slate"] .flc-use-anytime { color: #7fd6e6; background: rgba(95, 200, 220, .14); }
[data-md-color-scheme="slate"] .flc-use-outside { color: #f5cd6a; background: rgba(240, 190, 80, .14); }

/* phones: two-column tree rows stay readable */
@media screen and (max-width: 30em) {
  .md-typeset a.flc-node { font-size: 0.64rem; }
}

/* skill tables use the full page width so the Effect column has room */
.md-typeset .md-typeset__wrapper:has(.flc-use), .md-typeset .md-typeset__table:has(.flc-use) { display: block; width: 100%; }
.md-typeset table:not([class]):has(.flc-use) { display: table; width: 100%; font-size: 0.7rem; }
.md-typeset table:not([class]):has(.flc-use) td { vertical-align: middle; }
.md-typeset table:not([class]):has(.flc-use) th, .md-typeset table:not([class]):has(.flc-use) td { min-width: 0; padding: 0.5em 0.7em; }
.md-typeset table:not([class]):has(.flc-use) th:nth-child(3), .md-typeset table:not([class]):has(.flc-use) td:nth-child(3) { width: 6.5em; text-align: center; }
.md-typeset table:not([class]):has(.flc-use) th:nth-child(4), .md-typeset table:not([class]):has(.flc-use) td:nth-child(4) { width: 3.5em; }
.md-typeset table:not([class]):has(.flc-use) td:nth-child(2) { white-space: nowrap; }
.md-typeset table:not([class]):has(.flc-use) td:last-child { width: 50%; }
@media screen and (max-width: 44.984375em) {
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(2) { white-space: normal; }
}
.md-typeset table:not([class]):has(.flc-use) th:first-child, .md-typeset table:not([class]):has(.flc-use) td:first-child { width: 40px; padding-left: 0.4em; padding-right: 0.4em; }

/* phones: each skill becomes a small card (icon · name / level · MP · use / effect) */
@media screen and (max-width: 44.984375em) {
  .md-typeset table:not([class]):has(.flc-use), .md-typeset table:not([class]):has(.flc-use) tbody { display: block; width: 100%; }
  .md-typeset table:not([class]):has(.flc-use) thead { display: none; }
  .md-typeset table:not([class]):has(.flc-use) tr {
    display: grid; grid-template-columns: 40px auto auto 1fr; column-gap: 0.6rem; row-gap: 0.15rem; align-items: center;
    grid-template-areas: "ico name name name" "ico lvl mp use" "ico eff eff eff";
    padding: 0.55rem 0.2rem; border-top: 1px solid var(--md-default-fg-color--lightest);
  }
  .md-typeset table:not([class]):has(.flc-use) td {
    display: block; border: 0; padding: 0 !important; width: auto !important; text-align: left !important; white-space: normal;
  }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(1) { grid-area: ico; align-self: start; }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(2) { grid-area: name; }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(3) { grid-area: lvl; font-size: 0.64rem; color: var(--md-default-fg-color--light); }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(4) { grid-area: mp; font-size: 0.64rem; color: var(--md-default-fg-color--light); }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(5) { grid-area: use; justify-self: start; }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(6) { grid-area: eff; }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(3)::before { content: "Needs "; }
  .md-typeset table:not([class]):has(.flc-use) td:nth-child(4)::before { content: "MP "; }
}

/* skills whose icon hasn't been found yet: a small initials tile in the icon column */
.flc-noico {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; vertical-align: middle;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em; color: var(--md-default-fg-color--light);
  border: 1px dashed var(--md-default-fg-color--lighter); background: var(--md-default-fg-color--lightest);
}
