/* National Coalition theme for jDownloads. */
#main > .jd-item-page,
#main > .search:has(> .jd_top_navi) {
  width: min(var(--container), calc(100% - 64px));
  margin: 32px auto 80px;
  color: var(--ink);
  font-family: var(--font-sans);
}

.jd-item-page a:not(.jdbutton),
.search:has(> .jd_top_navi) a:not(.jdbutton),
#jdtree a {
  color: var(--navy);
}

.jd-item-page a:not(.jdbutton):hover,
.search:has(> .jd_top_navi) a:not(.jdbutton):hover,
#jdtree a:hover {
  color: var(--red);
}

.jd-item-page .jd_top_navi,
.search:has(> .jd_top_navi) .jd_top_navi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-bottom: 18px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.jd_top_navi .jd_top_navi_item,
.jd_top_navi .jd_top_navi_catbox {
  float: none;
  padding: 0;
}

.jd_top_navi .jd_top_navi_item {
  display: flex;
}

.jd_top_navi .jd_top_navi_item > a {
  display: flex;
  align-items: center;
  padding: 0;
  color: var(--navy);
  text-decoration: none;
}

.jd_top_navi .jd_top_navi_catbox {
  margin-left: auto;
}

.jd-item-page .jdbutton,
.search:has(> .jd_top_navi) .jdbutton,
.jd-item-page .btn,
.jd-search-form .btn {
  border: 1px solid var(--navy);
  border-radius: 3px;
  background: var(--navy);
  box-shadow: none;
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  text-shadow: none;
}

.jd_top_navi .jdbutton {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 13px 10px;
  border-color: transparent;
  border-radius: 0;
  background: var(--white);
  box-shadow: inset 0 -2px 0 transparent;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: none;
  color: var(--navy) !important;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.jd_top_navi .jd_top_navi_item.is-current > a > .jdbutton {
  box-shadow: inset 0 -2px 0 var(--red);
}

.jd-item-page .jd_top_navi .jdbutton:hover,
.jd-item-page .jd_top_navi .jdbutton:focus-visible,
.search:has(> .jd_top_navi) .jd_top_navi .jdbutton:hover,
.search:has(> .jd_top_navi) .jd_top_navi .jdbutton:focus-visible {
  border-color: transparent;
  background: var(--mist);
  color: var(--red) !important;
}

.jd_top_navi .jdbutton:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.jd-item-page .jdbutton:hover,
.jd-item-page .jdbutton:focus-visible,
.search:has(> .jd_top_navi) .jdbutton:hover,
.search:has(> .jd_top_navi) .jdbutton:focus-visible,
.jd-item-page .btn:hover,
.jd-search-form .btn:hover {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.jd-item-page select,
.jd-item-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.jd-item-page textarea,
.search:has(> .jd_top_navi) select,
.jd-search-form input[type="text"] {
  max-width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background-color: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
}

.jd-item-page :is(input, select, textarea, a, button):focus-visible,
.search:has(> .jd_top_navi) :is(input, select, textarea, a, button):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.jd-item-page .jd_cats_subheader,
.jd-item-page .jd_cat_subheader {
  margin: 0 0 20px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.jd-item-page .jd_cat_subheader_title39,
.jd-item-page .jd_cat_subheader,
.jd-item-page .jd_download_details_title {
  color: var(--navy);
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.5vw, 2.3rem);
  line-height: 1.25;
}

.jd-item-page .jd_subcat_count39,
.jd-item-page .jd_files_title39 {
  color: var(--muted);
  font-size: 0.9rem;
}

.jd-item-page .jd_cats_4col_wrapper {
  margin: 0 0 16px;
  padding: 18px 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.jd-item-page .jd_cats_4col {
  padding: 4px 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.jd-item-page .jd_cats_4col a {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.jd-item-page .jd_cats_4col img {
  max-width: 48px;
  height: auto;
  margin-inline: auto;
}

.jd-item-page:has(.jd-category-grid) {
  margin-top: 0;
  padding-bottom: 48px;
}

.jd-item-page:has(.jd-category-grid) .jd_top_navi {
  margin-bottom: 0;
}

.jd-item-page:has(.jd-category-grid) .jd_cats_subheader {
  margin: 0 0 32px;
  padding: 48px 32px 36px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 90% 20%, rgba(178, 34, 52, 0.07), transparent 28%),
    var(--mist-blue);
}

.jd-item-page:has(.jd-category-grid) .jd_cats_subheader::before {
  display: block;
  margin-bottom: 12px;
  color: var(--red);
  content: "RESOURCE LIBRARY";
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.jd-item-page:has(.jd-category-grid) .jd_cat_subheader_title39 {
  display: block;
  margin: 0 0 10px;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
}

.jd-item-page:has(.jd-category-grid) .jd_subcat_count39 {
  color: var(--muted);
}

.jd-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.jd-category-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.jd-category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.jd-category-image {
  display: block;
  background: #f8f4e9;
}

.jd-category-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.jd-category-card-body {
  padding: 20px 22px;
}

.jd-category-title {
  display: inline-block;
  color: var(--navy);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.jd-category-title:hover {
  color: var(--red);
}

.jd-category-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.jd-category-counts span {
  white-space: nowrap;
}

.jd-category-image:focus-visible,
.jd-category-title:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.jd-item-page .jd_content_wrapper,
.jd-item-page .jd_download_details_wrapper,
.jd-item-page .jd_download_wrapper,
.jd-item-page .jd_history_content_wrapper {
  border-color: var(--line);
}

.jd-item-page .jd_header {
  padding: 12px;
  border-color: var(--line);
  background: #f5f6f7;
}

.jd-item-page .jd_title_left,
.jd-item-page .jd_left b {
  color: var(--navy);
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.jd-item-page .jd_fields_wrapper,
.jd-item-page .jd_fields_wrapper_compact {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
}

.jd-item-page .jd_fields_caption,
.jd-item-page .jd_fields_caption_compact {
  padding: 9px 12px;
  background: var(--navy);
  box-shadow: none;
  color: #fff;
  text-align: left;
}

.jd-item-page .jd_fields {
  line-height: 1.5;
}

.jd-item-page .jd_field_row,
.jd-item-page .jd_field_row_compact {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  word-break: normal;
}

.jd-item-page .jd_field_title {
  color: var(--navy);
}

.jd-item-page .jd_summary_list {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.jd-item-page .jd_summary_list .divTableHeading {
  background: var(--navy);
  color: #fff;
}

.jd-item-page .jd_summary_list :is(.divTableHead, .divTableCell) {
  padding: 8px 10px;
  border-color: var(--line);
  overflow-wrap: anywhere;
}

.jd-item-page .jd_back_button,
.jd-item-page .jd_footer,
.search:has(> .jd_top_navi) .jd_footer {
  margin-top: 24px;
  color: var(--muted);
}

.jd-search-form .container {
  width: 100%;
  max-width: none;
  padding: 0;
}

.jd-search-form .card {
  border: 1px solid var(--line) !important;
  border-top: 3px solid var(--gold) !important;
  border-radius: 3px;
  background: #fff;
}

.jd-search-form label,
.jd-search-form legend {
  color: var(--navy);
}

.jd-search-form .input-group-text {
  border-color: var(--line-dark);
  background: #f5f6f7;
  color: var(--navy);
}

@media (max-width: 640px) {
  #main > .jd-item-page,
  #main > .search:has(> .jd_top_navi) {
    width: calc(100% - 32px);
    margin: 20px auto 48px;
  }

  .jd_top_navi .jd_top_navi_catbox {
    flex: 1 1 100%;
    margin: 4px 0 0;
  }

  .jd-item-page .jd_cats_4col_wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 0;
  }

  .jd-item-page .jd_cats_4col_inner_wrapper {
    display: contents;
  }

  .jd-item-page .jd_cats_4col {
    float: none;
    width: auto;
  }

  .jd_cats_4col_inner_wrapper > .jd_cats_4col:nth-child(odd) { grid-column: 1; }
  .jd_cats_4col_inner_wrapper > .jd_cats_4col:nth-child(even) { grid-column: 2; }
  .jd_cats_4col_inner_wrapper:nth-child(1) > .jd_cats_4col:nth-child(-n+2) { grid-row: 1; }
  .jd_cats_4col_inner_wrapper:nth-child(2) > .jd_cats_4col:nth-child(-n+2) { grid-row: 2; }
  .jd_cats_4col_inner_wrapper:nth-child(3) > .jd_cats_4col:nth-child(-n+2) { grid-row: 3; }
  .jd_cats_4col_inner_wrapper:nth-child(4) > .jd_cats_4col:nth-child(-n+2) { grid-row: 4; }
  .jd_cats_4col_inner_wrapper:nth-child(1) > .jd_cats_4col:nth-child(n+3) { grid-row: 5; }
  .jd_cats_4col_inner_wrapper:nth-child(2) > .jd_cats_4col:nth-child(n+3) { grid-row: 6; }
  .jd_cats_4col_inner_wrapper:nth-child(3) > .jd_cats_4col:nth-child(n+3) { grid-row: 7; }
  .jd_cats_4col_inner_wrapper:nth-child(4) > .jd_cats_4col:nth-child(n+3) { grid-row: 8; }
  .jd-item-page .jd_cats_4col_wrapper > .jd_clear { display: none; }
  .jd_cats_4col_wrapper:has(.jd_cats_4col_inner_wrapper:first-child > .jd_cats_4col:nth-child(3):empty) .jd_cats_4col_inner_wrapper > .jd_cats_4col:nth-child(n+3) {
    display: none;
  }

  .jd-item-page:has(.jd-category-grid) .jd_cats_subheader {
    margin-bottom: 24px;
    padding: 36px 16px 28px;
  }

  .jd-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
  }

  .jd-category-card-body {
    padding: 16px;
  }

  .jd-category-title {
    font-size: 1.05rem;
  }
}

@media (max-width: 420px) {
  .jd-category-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
