/* Grade-table standard (includes/grade-bands.php marks a table with a gpa-bands-* class; loaded on any page whose
 * content has one). Digant 2026-10-15 12:30-13:06, "Let's lock it in" (playbook D-91), the same design as the grade
 * images (scripts/design/calc-share/grade_table.py):
 *   - palette option 1: per band a text colour, a tint and a bright bar colour (--gpa-grade-<band>(-bg|-bar) tokens
 *     when the theme defines them);
 *   - a narrow band strip on the left naming each band (Excellent, Good, Average, Low pass, Fail), no key, no bars;
 *   - a pronounced heading row; every column centred;
 *   - body text in a softer gray at regular weight, the grade in a same-width tinted pill with the letter centred and
 *     + or − hanging after it; a heavier line between bands;
 *   - an optional highlighted row (gpa-gtable-hl-N), filled in its band colour, the only bold row (amber uses dark text:
 *     white on amber is about 2.1:1).
 * Every selector carries two id :not()s, so it beats the 2026-10-10 rules still in content/country-page.css on servers
 * that keep the old copy, and the theme's table styles. */
#page #main .entry-content figure.gpa-gtable tr.is-band-a { --band: var(--gpa-grade-a, #0F766E); --band-bg: var(--gpa-grade-a-bg, #E0F5F1); --band-bar: var(--gpa-grade-a-bar, #0D9488); --band-on: #fff; }
#page #main .entry-content figure.gpa-gtable tr.is-band-b { --band: var(--gpa-grade-b, #075985); --band-bg: var(--gpa-grade-b-bg, #E0F2FE); --band-bar: var(--gpa-grade-b-bar, #0284C7); --band-on: #fff; }
#page #main .entry-content figure.gpa-gtable tr.is-band-c { --band: var(--gpa-grade-c, #92400E); --band-bg: var(--gpa-grade-c-bg, #FEF3C7); --band-bar: var(--gpa-grade-c-bar, #F59E0B); --band-on: #451A03; }
#page #main .entry-content figure.gpa-gtable tr.is-band-d { --band: var(--gpa-grade-d, #9A3412); --band-bg: var(--gpa-grade-d-bg, #FFEDD5); --band-bar: var(--gpa-grade-d-bar, #EA580C); --band-on: #fff; }
#page #main .entry-content figure.gpa-gtable tr.is-band-f { --band: var(--gpa-grade-f, #9F1239); --band-bg: var(--gpa-grade-f-bg, #FFE4E6); --band-bar: var(--gpa-grade-f-bar, #E11D48); --band-on: #fff; }

#page #main .entry-content figure.gpa-gtable:not(#gx):not(#gy) {
  background: #fff !important; border: 1px solid var(--gpa-border, #e5e7eb) !important; border-radius: 16px !important;
  overflow: hidden !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06) !important;
}
#page #main .entry-content figure.gpa-gtable table:not(#gx):not(#gy) {
  width: 100% !important; margin: 0 !important; border: 0 !important;
  border-collapse: collapse !important; border-spacing: 0 !important; table-layout: auto !important;
  font-variant-numeric: tabular-nums;
}
#page #main .entry-content figure.gpa-gtable :is(th, td):not(#gx):not(#gy) {
  text-align: center !important; vertical-align: middle !important; border: 0 !important;
  border-bottom: 1px solid #EEF2F7 !important; background: #fff !important;
}
#page #main .entry-content figure.gpa-gtable :is(th, td)::before { content: none !important; display: none !important; }
/* Heading row */
#page #main .entry-content figure.gpa-gtable thead th:not(#gx):not(#gy) {
  background: #E8EDF5 !important; color: #1E293B !important; border-bottom: 2px solid #CBD5E1 !important;
  font-size: 13px !important; line-height: 1.3 !important; font-weight: 800 !important; letter-spacing: .08em !important;
  text-transform: uppercase !important; padding: 13px 14px !important; vertical-align: bottom !important; text-wrap: balance;
}
/* Body: softer gray, regular weight */
#page #main .entry-content figure.gpa-gtable tbody td:not(#gx):not(#gy) {
  color: #475569 !important; font-size: 16px !important; line-height: 1.35 !important; font-weight: 400 !important;
  padding: 10px 14px !important; height: 48px;
}
#page #main .entry-content figure.gpa-gtable tbody tr:hover td:not(#gx):not(#gy) { background: #F8FAFC !important; }
#page #main .entry-content figure.gpa-gtable tbody tr.is-band-end :is(td, th):not(#gx):not(#gy) { border-bottom: 2px solid #E2E8F0 !important; }
#page #main .entry-content figure.gpa-gtable tbody tr:last-child :is(td, th):not(#gx):not(#gy) { border-bottom: 0 !important; }
/* The band strip */
#page #main .entry-content figure.gpa-gtable .gpa-gtable__band:not(#gx):not(#gy) {
  width: 26px !important; min-width: 26px; padding: 6px 0 !important; background: var(--band-bar, #fff) !important;
  border-bottom: 2px solid #fff !important;
}
#page #main .entry-content figure.gpa-gtable thead .gpa-gtable__band:not(#gx):not(#gy) { background: #E8EDF5 !important; border-bottom: 2px solid #CBD5E1 !important; }
#page #main .entry-content figure.gpa-gtable tbody .gpa-gtable__band > span {
  display: block; margin: 0 auto; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap;
  color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1;
}
#page #main .entry-content figure.gpa-gtable .gpa-gtable__sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
/* The grade pill: same width, letter centred, + or − hanging after it */
#page #main .entry-content figure.gpa-gtable .gpa-gtable__pill:not(#gx):not(#gy) {
  position: relative; display: inline-block; min-width: 52px; padding: 3px 10px; border-radius: 999px; box-sizing: border-box;
  text-align: center; white-space: nowrap; background: var(--band-bg); color: #475569; font-weight: 500; font-size: 16px; line-height: 1.3;
}
#page #main .entry-content figure.gpa-gtable .gpa-gtable__sg { position: absolute; margin-left: 1px; }
#page #main .entry-content figure.gpa-gtable .gpa-gtable__pill .gpa-gtable__l { display: inline-block; min-width: 1em; text-align: center; }
/* Fixed widths for the parts beside a letter, so digits of different widths never shift the letter (13:21) */
#page #main .entry-content figure.gpa-gtable .gpa-gtable__num { display: inline-block; width: 2em; text-align: left; }
#page #main .entry-content figure.gpa-gtable td.is-band-cell .gpa-gtable__let ~ .gpa-gtable__pill:not(#gx):not(#gy) { width: 52px; min-width: 0; padding-left: 0; padding-right: 0; }
#page #main .entry-content figure.gpa-gtable .gpa-gtable__p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Every letter in one fixed box, the letter centred and + or − hanging after it, so a column of A, A−, B+ lines up */
#page #main .entry-content figure.gpa-gtable .gpa-gtable__let { position: relative; display: inline-block; width: 1.5em; text-align: center; }
#page #main .entry-content figure.gpa-gtable .gpa-gtable__let .gpa-gtable__sg { position: absolute; margin-left: 1px; }
#page #main .entry-content figure.gpa-gtable .gpa-gtable__dot { display: inline-block; width: 1em; text-align: center; color: #94A3B8; }
#page #main .entry-content figure.gpa-gtable td.gpa-gtable__nw:not(#gx):not(#gy),
#page #main .entry-content figure.gpa-gtable td.is-band-cell:not(#gx):not(#gy) { white-space: nowrap; }
/* Worked examples (five or more columns): the points stay in the pill */
#page #main .entry-content figure.gpa-gtable--compact .gpa-gtable__p:not(#gx):not(#gy) { position: static; display: inline-block; width: 2.6em; text-align: left; height: auto; overflow: visible; clip: auto; }
/* The highlighted row: its band colour, the only bold row (.is-highlight: the /gpa-scale/ converter's pick) */
#page #main .entry-content figure.gpa-gtable tbody tr:is(.is-hl, .is-highlight) td:not(#gx):not(#gy) {
  box-shadow: none !important; background: var(--band-bar) !important; color: var(--band-on) !important; font-weight: 800 !important; border-bottom-color: var(--band-bar) !important;
}
#page #main .entry-content figure.gpa-gtable tbody tr:is(.is-hl, .is-highlight) .gpa-gtable__pill:not(#gx):not(#gy) { background: #fff; color: var(--band); font-weight: 800; }
/* Links in a grade table (a GPA linked to its page) keep the table's colour, underlined in the band colour */
#page #main .entry-content figure.gpa-gtable tbody a:not(#gx):not(#gy) {
  color: inherit !important; font-weight: inherit !important; text-decoration: underline !important; text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important; text-decoration-color: color-mix(in srgb, var(--band-bar, #94A3B8) 70%, transparent) !important;
}
#page #main .entry-content figure.gpa-gtable tbody tr:is(.is-hl, .is-highlight) a:not(#gx):not(#gy) { text-decoration-color: currentColor !important; }
/* Captions (sources, notes) */
#page #main .entry-content figure.gpa-gtable figcaption:not(#gx):not(#gy) {
  margin: 0 !important; padding: 12px 16px !important; text-align: left !important; font-size: 13px !important; line-height: 1.45 !important;
  color: var(--gpa-text-muted, #6b7280) !important; background: #F8FAFC !important; border-top: 1px solid #EEF2F7 !important;
}
#page #main .entry-content figure.gpa-gtable .gpa-bands-key { display: none !important; }
#page #main .entry-content figure.gpa-gtable .gpa-gtable__sub { display: none; }
@media (max-width: 640px) {
  #page #main .entry-content figure.gpa-gtable thead th:not(#gx):not(#gy) { font-size: 11px !important; padding: 10px 6px !important; letter-spacing: .04em !important; }
  #page #main .entry-content figure.gpa-gtable tbody td:not(#gx):not(#gy) { font-size: 15px !important; padding: 8px 6px !important; height: 44px; overflow-wrap: break-word; }
  #page #main .entry-content figure.gpa-gtable .gpa-gtable__band:not(#gx):not(#gy) { width: 22px !important; min-width: 22px; }
  #page #main .entry-content figure.gpa-gtable tbody .gpa-gtable__band > span { font-size: 9.5px; letter-spacing: .04em; }
  #page #main .entry-content figure.gpa-gtable .gpa-gtable__pill:not(#gx):not(#gy) { min-width: 42px; padding: 2px 7px; font-size: 15px; }
  #page #main .entry-content figure.gpa-gtable .gpa-gtable__dot { width: 1em; }
  #page #main .entry-content figure.gpa-gtable .gpa-gtable__sub { display: block; margin-top: 2px; font-size: 13px; color: #64748B; white-space: normal; }
  /* The 2026-10-10 rules hid :nth-child(2)/(3), which the strip shifts: show those again, hide by column class */
  #page #main .entry-content figure.gpa-gtable-sub-2 :is(th, td):nth-child(2):not(.gpa-gtable__c2):not(#gx):not(#gy),
  #page #main .entry-content figure.gpa-gtable-sub-3 :is(th, td):nth-child(3):not(.gpa-gtable__c3):not(#gx):not(#gy) { display: table-cell !important; }
  #page #main .entry-content figure.gpa-gtable-sub-2 .gpa-gtable__c2:not(#gx):not(#gy),
  #page #main .entry-content figure.gpa-gtable-sub-3 .gpa-gtable__c3:not(#gx):not(#gy) { display: none !important; }
  #page #main .entry-content figure.gpa-gtable--compact tbody td:not(#gx):not(#gy) { font-size: 14px !important; padding-left: 4px !important; padding-right: 4px !important; }
  #page #main .entry-content figure.gpa-gtable--compact .gpa-gtable__pill:not(#gx):not(#gy) { padding: 2px 6px; font-size: 13px; min-width: 0; }
  #page #main .entry-content figure.gpa-gtable--compact .gpa-gtable__p:not(#gx):not(#gy) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
