/* Annual Forage tab: data-as-of line, About block, policy history, print statement
   (2026-10-09, McLane - the same treatment the PRF tab got; see assets/af-dash.js).
   Everything is scoped to .afd-* classes or #panel-af / #afAsOf so nothing leaks. */

/* ---------------------------------------------------------- as-of + print button */
.afd-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0.15rem 0 0.9rem; }
.afd-asof { font-size: 12px; font-weight: 600; color: #5e6470; text-decoration: none; }
.afd-asof strong { color: #26261f; }
.afd-asof:hover { text-decoration: underline; }
.afd-print {
  font: 600 12.5px var(--font-ui, sans-serif); color: var(--ec-navy); background: #fff;
  border: 1px solid #c9d3df; border-radius: 7px; padding: 6px 12px; cursor: pointer; min-height: 32px;
}
.afd-print:hover { background: #eef3f8; }
.afd-print:focus-visible { outline: 2px solid var(--ec-navy); outline-offset: 1px; }
@media (pointer: coarse) { .afd-print { min-height: 44px; } }

/* ------------------------------------------------------------------ policy history */
.afd-hist { margin-top: 40px; padding-top: 24px; border-top: 5px solid var(--ec-navy); }   /* like PRF: hard line between this year and past years */
.afd-h { font-size: 16px; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 10px; color: #26261f; }
.afd-h-sub { font-size: 11px; font-weight: 600; color: #6b7280; letter-spacing: 0; margin-left: 4px; }
.afd-caps { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #6b7280; font-weight: 700; margin: 14px 0 6px; }
.afd-caps-sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: #8a8f99; }
.afd-hbox { border: 1px solid #ddd6c4; border-radius: 8px; background: #fff; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 900px; }
.afd-htbl { border-collapse: collapse; border-style: hidden; width: 100%; font-variant-numeric: tabular-nums; }
.afd-htbl thead th { position: static; text-transform: uppercase; }
.afd-htbl tbody tr:hover { background: transparent; }
.afd-htbl th, .afd-htbl td { padding: 6px 9px; text-align: right; white-space: nowrap; border: 1px solid #ddd6c4; font-size: 12px; }
.afd-htbl .ivh { background: #12497e; color: #eaf2fa; font-size: 10px; font-weight: 700; text-align: center; padding: 7px 6px; border-color: #2b5c8e; letter-spacing: 0.05em; }
.afd-htbl .ivh.yr { background: #ece7d8; color: #6b6656; border-color: #ddd6c4; text-align: left; }
.afd-htbl th.yr { text-align: left; background: #f6f3ea; font-weight: 800; color: #26261f; }
.afd-htbl td.strong { font-weight: 800; }
.afd-htbl .pos { color: #2f7d4f; }
.afd-htbl .neg { color: #bc4a40; }
.afd-htbl tr.htot td, .afd-htbl tr.htot th { background: #dfe9f3; color: var(--ec-navy); font-weight: 800; border-top: 2px solid #9db4ca; }
.afd-htbl tr.htot td.pos { color: #2f7d4f; }
.afd-htbl tr.htot td.neg { color: #bc4a40; }
.afd-htbl.hmat td, .afd-htbl.hmat th { padding: 5px 7px; font-size: 11px; }
.afd-htbl.hmat td.blank { color: #b8b3a5; font-weight: 500; }
.afd-htbl.hmat th.yr.sub { padding-left: 22px; font-weight: 600; color: #5c5848; }
.afd-htbl.hmat tr.hsub td, .afd-htbl.hmat tr.hsub th { background: #f3efe4; font-weight: 800; border-top: 2px solid #cfc8b4; border-bottom: 2px solid #cfc8b4; }
.afd-hnote { font-size: 11.5px; color: #5e6470; margin: 8px 0 0; max-width: 900px; }

/* -------------------------------------------------------------------- about block */
.afd-about { margin-top: 34px; padding: 18px 20px 16px; border: 1px solid #d8d3c4; border-radius: 10px; background: #fbfaf6; scroll-margin-top: 90px; }
.afd-about .afd-h { margin: 0 0 10px; font-size: 15px; }
.afd-about-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.afd-about-list dt { font-weight: 700; color: #26261f; }
.afd-about-list dd { margin: 0; color: #3f3d35; }
.afd-about-legal { font-size: 12px; line-height: 1.55; color: #4a473e; margin: 0; padding-top: 10px; border-top: 1px dashed #d8d3c4; }
@media (max-width: 640px) { .afd-about-list { grid-template-columns: 1fr; } .afd-about-list dd { margin-bottom: 6px; } }

/* app bar: AF dates replace the market "quotes refreshed" stamp while the AF tab is open */
#afAsOf { display: none; }
body:has(#panel-af.active) #afAsOf { display: block; }
body:has(#panel-af.active):has(#afAsOf) #asOf { display: none; }

/* ---------------------------------------------------------------------------- print */
.afd-printhead { display: none; }
@media print {
  @page { size: landscape; margin: 0.4in; }
  body:has(#panel-af.print-target) header.appbar,
  body:has(#panel-af.print-target) .foot-portal-note,
  #panel-af .afd-tools, #panel-af .toggle, #panel-af .cy-row, #panel-af .af-nextchip,
  #panel-af .outlook, #panel-af .map-frame, #panel-af .af-maphead, .review-pill, #staffBar { display: none !important; }
  #panel-af.print-target { zoom: 0.74; }
  /* growing-season cards two across on the landscape page (one column on screen) */
  #panel-af .af-gscards { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; align-items: start; }
  #panel-af .af-gscard { max-width: none !important; margin: 0 !important; }
  #panel-af .afd-printhead {
    display: flex !important; align-items: center; justify-content: space-between; gap: 20px;
    background: var(--ec-navy) !important; color: #fff; padding: 12px 18px; border-bottom: 3px solid var(--ec-gold);
    margin: 0 0 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #panel-af .afd-printlogo { height: 34px; width: auto; }
  #panel-af .afd-printright { text-align: right; }
  #panel-af .afd-printname { font-size: 18px; font-weight: 800; color: #fff; }
  #panel-af .afd-printsub { font-size: 10.5px; color: #dce4ec; margin-top: 2px; }
  /* readable table heads (the app-wide print rule paints every th navy) */
  #panel-af thead th, #panel-af thead th * { color: #fff !important; }
  #panel-af .af-stat, #panel-af .af-map, #panel-af .af-gscard, #panel-af .afd-htbl td, #panel-af .afd-htbl th,
  #panel-af .af-gstable td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #panel-af .af-statrow, #panel-af .af-map, #panel-af .af-gscard, #panel-af .card,
  #panel-af .afd-hist, #panel-af .afd-about { break-inside: avoid; }
  #panel-af .section-head, #panel-af .afd-h { break-after: avoid; }
  #panel-af .afd-hist { margin-top: 18px; padding-top: 12px; }
  #panel-af .afd-about { background: #fff; margin-top: 16px; }
  /* the site footer keeps its compliance text but prints small + light (no navy page);
     the equal-opportunity line is a required compliance block - it always prints */
  body:has(#panel-af.print-target) footer.site { background: #fff !important; padding: 6px 0 0 !important; margin: 0 !important; border-top: 1px solid #ccc; }
  body:has(#panel-af.print-target) footer.site * { color: #555 !important; font-size: 7.5px !important; line-height: 1.3 !important; }
  body:has(#panel-af.print-target) footer.site .foot-brand, body:has(#panel-af.print-target) footer.site .foot-links { display: none !important; }
  body:has(#panel-af.print-target) footer.site p { margin: 2px 0 !important; }
  body:has(#panel-af.print-target) .foot-bottom { display: flex !important; margin-top: 4px !important; }
  body:has(#panel-af.print-target) main, body:has(#panel-af.print-target) .tab-panel.print-target,
  body:has(#panel-af.print-target) .app { min-height: 0 !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
}

/* ------------------------------------------------- other crop years (2026-10-22) */
.afd-year { margin-top: 0.4rem; max-width: 900px; border-left: 4px solid var(--af-green, var(--ec-af)); }
.afd-year-h { font-family: var(--font-display); margin: 0; }
.afd-year-p { margin: 0.5rem 0 0; color: var(--ink, #26261f); line-height: 1.5; }
.afd-year-contact { margin: 0.7rem 0 0; font-size: 0.92em; color: var(--muted, #555b66); }
.afd-year-none { border-left-color: #c9d3df; }
.afd-year-more { margin: 0.2rem 0 0.9rem; }
@media print { .afd-year { break-inside: avoid; } }

/* finals-only "in progress" rows in the AF policy history (Rainfall's 11/05 rows) */
.afd-htbl tr.hprog th, .afd-htbl tr.hprog td { font-style: italic; }
/* the blank gap between the finished years (and their total) and the in-progress rows (McLane 11/13) */
.afd-htbl tr.hgap td { height: 16px; padding: 0; background: transparent; border: 0; }
.afd-htbl tr.hprog .afd-tag { font-size: 10px; font-weight: 600; color: var(--faint); font-style: normal; margin-left: 2px; }
