/* disease.utcrops.com
   Follows the UTIA visual standards (utiabrand.tennessee.edu/visual-standards/):
   core palette UT Orange #ff8200, Slate #333d47, Slate tint #5c666f, White;
   Montserrat as the web alternative to Gotham, Arial as fallback.
   Targets WCAG 2.1 AA. UT Orange is only 2.5:1 on white, so it is never used for
   text or links on white. It is used for accents, and on Slate (4.45:1) only for
   non-text marks such as bars and the active-sort indicator. */

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ut-orange: #ff8200;
  --slate: #333d47;
  --slate-tint: #5c666f;
  --white: #ffffff;

  /* light tints of Slate for panels and table rows (Slate text stays >= 10:1 on these) */
  --slate-05: #f3f4f5;
  --slate-10: #e6e8ea;
  --slate-20: #ccd0d4;

  --ink: var(--slate);
  --muted: var(--slate-tint);
  --line: var(--slate-20);
  --focus: var(--slate);
  --radius: 3px;
  --font: "Montserrat", Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
}

a { color: var(--slate); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--ut-orange); text-decoration-thickness: 3px; }

/* Visible focus: Slate outline with a white halo, so it shows on white, tints and Slate. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--white);
}
.site-header :focus-visible,
.site-footer :focus-visible,
.results thead :focus-visible { outline-color: var(--white); box-shadow: 0 0 0 5px var(--slate); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  background: var(--white); color: var(--slate); font-weight: 700;
  padding: 10px 14px; border: 2px solid var(--slate); border-radius: var(--radius);
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header { background: var(--slate); }
.site-header__inner {
  max-width: 1400px; margin: 0 auto;
  padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
/* Official reversed UTIA logo (for Slate backgrounds), unaltered. At 300px wide the UT icon
   is ~60px tall, well above the 36px minimum in the brand standards. */
.site-header__utia { flex: none; display: block; padding: 8px 0; }
.site-header__utia img { display: block; width: 300px; height: auto; }
.site-header__banner { flex: 0 1 720px; min-width: 0; display: block; }
.site-header__banner img { display: block; width: 100%; height: auto; border-radius: 2px; }

.orange-bar { height: 6px; background: var(--ut-orange); }

/* ---------- Page ---------- */
.page { max-width: 1400px; margin: 0 auto; padding: 28px 16px 40px; }
.page:focus { outline: none; }

/* ---------- Filters ---------- */
.filters {
  background: var(--slate-05);
  border: 1px solid var(--line);
  border-top: 4px solid var(--ut-orange);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
}
.filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px 24px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; grid-column: span 2; }
.field__label { font-size: 13px; font-weight: 700; color: var(--slate); }
.field__key { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

select {
  width: 100%;
  min-height: 42px;
  font: 400 14px/1.3 var(--font);
  color: var(--ink);
  background-color: var(--white);
  border: 1px solid var(--slate-tint);   /* 5.9:1 against white, meets 3:1 for controls */
  border-radius: var(--radius);
  padding: 8px 34px 8px 10px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
select:hover { border-color: var(--slate); box-shadow: inset 0 -2px 0 var(--ut-orange); }

.filters__actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.btn {
  font: 700 14px/1 var(--font);
  border-radius: var(--radius);
  padding: 12px 20px;
  min-height: 44px;
  cursor: pointer;
  border: 2px solid var(--slate);
}
.btn--primary { background: var(--slate); color: var(--white); border-bottom-color: var(--ut-orange); border-bottom-width: 4px; }
.btn--primary:hover { background: #1f262d; }
.btn--ghost, .btn--small { background: var(--white); color: var(--slate); }
.btn--ghost:hover, .btn--small:hover:not(:disabled) { background: var(--slate-10); }
.btn--small { font-size: 13px; padding: 10px 14px; }
.btn:disabled { color: var(--muted); border-color: var(--slate-20); cursor: not-allowed; }

/* ---------- Summary line ---------- */
.summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 22px 0 10px;
}
.summary:focus { outline: none; }
.summary__count { margin: 0; font-weight: 700; font-size: 16px; }

/* ---------- Sideways-scroll arrows (in the results bar) ---------- */
.summary__actions { display: flex; align-items: center; gap: 12px; }
.pager { display: flex; gap: 8px; }
.pager[hidden] { display: none; }
.pager__btn {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 26px/1 var(--font);
  background: var(--slate); color: var(--white); border: 1px solid var(--slate);
  cursor: pointer;
}
.pager__btn:hover:not(:disabled) { background: #1f262d; }
.pager__btn:disabled { background: var(--white); color: var(--slate-20); border-color: var(--slate-20); cursor: default; }

.table-shell { position: relative; }
.table-fade {
  position: absolute; top: 1px; bottom: 16px; width: 72px; z-index: 5;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.table-fade--left { left: var(--sticky-w, 0px); background: linear-gradient(to right, rgba(51,61,71,.18), rgba(51,61,71,0)); width: 28px; }
.table-fade--right {
  right: 1px; width: 120px;
  background: linear-gradient(to left, rgba(255,255,255,1) 15%, rgba(255,255,255,0));
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
}
.table-fade--right span {
  white-space: nowrap;
  background: var(--slate); color: var(--white); border: 2px solid var(--ut-orange);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  padding: 8px 12px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.has-more-left .table-fade--left, .has-more-right .table-fade--right { opacity: 1; }

/* Always-visible horizontal scrollbar (macOS hides it by default) */
/* Chrome and Safari: the ::-webkit-scrollbar rules below force a permanent scrollbar.
   Firefox only understands scrollbar-color, and setting it in Chrome would cancel the
   webkit rules, so it is scoped to Firefox. */
@-moz-document url-prefix() { .table-wrap { scrollbar-color: var(--slate-tint) var(--slate-10); } }
.table-wrap::-webkit-scrollbar { height: 16px; width: 12px; }
.table-wrap::-webkit-scrollbar-track { background: var(--slate-10); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--slate-tint); border-radius: 8px; border: 3px solid var(--slate-10); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--slate); }
.table-wrap::-webkit-scrollbar-corner { background: var(--slate-10); }

@media (prefers-reduced-motion: reduce) { .table-fade { transition: none; } }

/* ---------- Results table ---------- */
.table-wrap {
  overflow: auto;
  max-height: 78vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}
.results {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.results thead th,
.results thead td {
  position: sticky;
  background: var(--slate);
  color: var(--white);
  font-weight: 700;
  border-left: 1px solid #4a5560;
  padding: 8px 8px;
  vertical-align: bottom;
  z-index: 2;
}
.results__group th, .results__group td {
  top: 0;
  font-size: 12px;
  vertical-align: middle;
  background: var(--slate-tint) !important;
  border-bottom: 1px solid #4a5560;
}
.results__cols th { top: var(--group-h, 40px); border-bottom: 4px solid var(--slate); }
.results thead tr > :first-child { border-left: 0; }

.results tbody th,
.results tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--slate-10);
  vertical-align: top;
  white-space: nowrap;
}
.results tbody th { font-weight: 600; text-align: left; }
.results tbody tr:nth-child(odd) > * { background: var(--white); }
.results tbody tr:nth-child(even) > * { background: var(--slate-05); }
.results tbody tr:hover > * { background: #fff3e6; }
.results td.is-num { font-variant-numeric: tabular-nums; }
.results td:nth-child(16) { white-space: normal; min-width: 160px; }
.results .empty { padding: 32px; text-align: center; white-space: normal; color: var(--muted); }

/* Sticky cultivar column */
.results .is-sticky-col { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line); }
.results thead .is-sticky-col { left: 0; z-index: 3; border-right-color: #4a5560; }
.table-wrap.is-scrolled .results .is-sticky-col { box-shadow: 4px 0 6px -4px rgba(0,0,0,.3); }

/* Sortable column headers */
.sort-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex; align-items: flex-end; gap: 5px;
  font-weight: 700;
  color: var(--white);
  border-radius: 2px;
}
.sort-btn:hover .sort-btn__label { text-decoration: underline; text-decoration-color: var(--ut-orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sort-btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.sort-btn__icon { width: 8px; height: 12px; flex: none; position: relative; opacity: .55; }
.sort-btn__icon::before, .sort-btn__icon::after {
  content: ""; position: absolute; left: 0; border: 4px solid transparent;
}
.sort-btn__icon::before { top: -3px; border-bottom-color: currentColor; }
.sort-btn__icon::after { bottom: -3px; border-top-color: currentColor; }
.sort-btn.is-active .sort-btn__icon { opacity: 1; color: var(--ut-orange); }
.sort-btn.is-active .sort-btn__icon::before { display: none; }
.sort-btn.is-active.is-asc .sort-btn__icon::before { display: block; }
.sort-btn.is-active.is-asc .sort-btn__icon::after { display: none; }
.results__cols th[aria-sort] { border-bottom-color: var(--ut-orange); }

.footnote { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.more-links { margin: 26px 0 0; font-size: 16px; font-weight: 700; }
.more-links span { margin: 0 8px; color: var(--muted); }
.noscript { background: var(--slate-05); border-left: 4px solid var(--ut-orange); padding: 12px 14px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 32px; background: var(--slate); color: var(--white); border-top: 6px solid var(--ut-orange); }
.site-footer__inner {
  max-width: 1400px; margin: 0 auto;
  padding: 32px 16px 36px;
  display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 24px 48px; align-items: start;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 18px; }
.site-footer__logo img { display: block; width: 330px; max-width: 100%; height: auto; }
.site-footer__promise { display: block; width: 230px; max-width: 100%; height: auto; }
.site-footer__info { font-size: 14px; }
.site-footer__info p { margin: 0 0 10px; }
.site-footer a { color: var(--white); }
.site-footer a:hover { text-decoration-color: var(--ut-orange); }
.site-footer__links { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer__copy { font-size: 13px; opacity: .9; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .site-header__banner { width: 100%; flex-basis: auto; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-header__utia img { width: 260px; max-width: 100%; }
  .page { padding: 20px 16px 32px; }
  .filters { padding: 16px; }
  .filters__grid { grid-template-columns: 1fr; }
  .field--pair { grid-template-columns: 1fr; grid-column: auto; }
  .table-wrap { max-height: 72vh; }
  .results tbody th { white-space: normal; min-width: 130px; max-width: 160px; }
  .table-fade--right { width: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .orange-bar, .filters, .btn, .skip, .more-links, .site-footer, .pager, .table-fade { display: none !important; }
  .page { padding: 0; max-width: none; }
  .table-wrap { max-height: none; overflow: visible; border: 0; }
  .results { font-size: 9px; }
  .results thead th, .results thead td, .results .is-sticky-col { position: static; }
  .results thead th, .results thead td { background: #fff !important; color: #000; border-bottom: 1px solid #000; }
  .sort-btn { color: #000; }
  .results tbody th, .results tbody td { padding: 3px 4px; }
}
