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

.title-with-logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header h1 {
  font-size: 31px;
  color: #003366;
  margin-bottom: 0;
}

.title-with-logo .logo {
  display: block;
  align-items: center;
  width: 180px;  /* Adjust as needed */
  height: auto;
  object-fit: contain;
}

.title-with-logo h1 {
  margin: 0;
  line-height: 1.2;
  
}

.title-underline {
  width: 100%;               /* Full width of the container */
  height: 10px;               /* Adjust height for thickness */
  background-color: #f1fcff; /* Change to your preferred color */
  border: 2px solid #089ae3;
  margin-top: 5px;          /* Space between title and line */
  margin-bottom: 20px;       /* Space after the line */
  border-radius: 3px;        /* Optional: makes edges slightly rounded */
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 0px;
  padding-bottom: 0px;
  flex-wrap: wrap;
}

.top-col {
  flex: 1;
  min-width: 320px;
  margin-bottom: 0;
  padding-bottom: 0;
}

.intro-text {
  flex: 2.5;
  font-size: 14px;
  text-align: left;
  color: #003366;
}

.output-widget {
  background-color: #efefef;
  border: 1px solid #b3cce6;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  width: 160px;
  margin-bottom: 15px;
  border-left: 4px solid #005ea2;
}

.output-widget .widget-title {
  font-size: 24px;
  color: #000000;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.output-widget .output-number {
  font-size: 45px;
  font-weight: bold;
  color: #ffffff;
  line-height: 1;
}

.output-number-box {
  background-color: #0085ca;
  border-radius: 4px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget {
  background-color: #efefef;
  border-left: 4px solid #005ea2;
  padding: 4px 8px;
  padding-top: 4px;
  border-radius: 4px;
  font-size: 20px;
  font-family: "Segoe UI", Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 13px;
  text-align: center;
}

.contact-widget .widget-header,
.feedback-widget .widget-header {
  font-size: 14px;
  color: #0085ca;
  font-weight: bold;
  margin: 0 0 4px 0; /* Top margin set to 0, bottom margin small */
  line-height: 1.2;
  text-align: center;
}

.contact-widget .widget-header {
  font-size: 16px; /* You can adjust this size */
  color: #1452a8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: bold;
  margin-bottom: 4px;
  line-height: 1.2;
  text-align: center;
}

.contact-widget p {
  font-size: 14px;
  margin: 0;
  text-align: center;
}

.contact-widget a,
.feedback-widget a {
  text-decoration: underline;
}

.contact-widget a:hover,
.contact-widget a:focus-visible,
.feedback-widget a:hover,
.feedback-widget a:focus-visible {
  text-decoration-thickness: 2px;
}

.contact-widget a {
  color: #0085ca;
  font-weight: bold;
}

.contact-widget a:hover {
  text-decoration: underline;
}

.feedback-widget a {
  color: #0085ca;
  font-weight: bold;
  font-size: 14px;
}

.feedback-widget {
  display: flex;
  flex-direction: column; 
  justify-content: center;
  align-items: center;
  min-height: 85px;
  height: auto;
  padding: 0 10px;
  text-align: center;
}

.feedback-widget .widget-header {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 4px 0;
  color: #1452a8;
}

.feedback-widget .widget-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

.feedback-widget.widget {
  margin-bottom: 0 !important;
}

.feedback-widget a:hover {
  text-decoration: underline;
}

.feedback-widget p {
  margin: 0;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #f4f6f9;
  color: #2b2b2b;
}

.dashboard-container {
  max-width: 1200px;
  width: 100%;
  min-height: 100vh;
  height: auto;
  overflow: visible;
  margin: 0 auto;
  padding: 30px;
  box-sizing: border-box;
  background-color: #fff;
  overflow-y: auto;
}

.header {
  margin-bottom: 20px;
  border-bottom: 2px solid #003366;
  padding-bottom: 10px;
}

.header h1 {
  font-size: 31px;
  color: #003366;
  margin-bottom: 0;
}

.header p {
  margin-top: 5px;
  font-size: 14px;
  color: #003366;
}

.filters-container {
  background-color: #e6f0f8;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 10px;
  margin-top: 5px;
}

.filter-row {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0px;
}

.filter-group label {
  font-size: 12px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #99c2e6;
  border-radius: 20px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-group input:focus-visible,
.filter-group select:focus-visible,
.reset-btn:focus-visible,
.download-btn:focus-visible,
a:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

.filter-group input:focus-visible,
.filter-group select:focus-visible {
  box-shadow: 0 0 0 3px rgba(0,0,0,0.15);
}

#cardsContainer.cards-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
}

.card {
  background-color: #ffffff;
  border: 1px solid #d6d6d6;
  border-left: 4px solid #005ea2;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header {
  background-color: #e6f0f8;
  color: #003d66;
  font-weight: bold;
  padding: 10px;
  font-size: 16px;
}

.card-body {
  padding: 18px;
}

.card-body h2 {
  margin: 0;
  font-size: 16px;
  color: #005ea2;
}

.card-body .meta {
  font-size: 13px;
  color: #4a4a4a;
  font-style: italic;
  margin-top: 5px;
}

.card-body p {
  font-size: 13px;
  margin: 6px 0;
}

.card-body .abstract {
  color: #555;
  font-size: 12px;
  margin-top: 10px;
}

.card-body .link {
  text-align: center;
  margin-top: 15px;
}

.card-body .link a {
  background-color: #005ea2;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
}

.card-body .link a:hover {
  background-color: #003f73;
}

.dynamic-card a:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* Adjust layout for the new 5-column row */
.filter-row.four-columns {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
}

.filter-row.four-columns .filter-group {
  min-width: unset;
}

.filters-row.two {
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.reset-btn {
  display: flex;
  margin-left: auto;
  padding: 8px 16px;
  background-color: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  height: 38px;
  align-items: center;
  justify-content: center;
}

.download-btn {
  display: flex;
  margin-left: -5px;
  padding: 8px 16px;
  background-color: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  height: 38px;
  align-items: center;
  justify-content: center;
}

.reset-btn:hover {
  background-color: #005fa3;
}

.no-results {
  display: none;
  font-style: italic;
  text-align: center;
  color: #4a4a4a;
  margin-top: 10px;
  font-size: 16px;
}

.no-results-title {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #1452a8; /* red or warning-like tone */
  font-style: normal;
  margin-bottom: 1px;
  margin-top: 20px;
}

.download-btn:hover {
  background-color: #005fa3;
}

.filter-row.second-row .filter-group select,
.filter-row.second-row .filter-group input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 12px;
}
  
.filter-row.second-row .reset-btn,
.filter-row.second-row .download-btn {
  padding: 6px 10px;
  font-size: 14px;
  height: 36px;
  width: 120px;
  align-items: center;
  justify-content: center;
  vertical-align: center;
  
}

.reset-btn .material-icons,
.download-btn .material-icons {
  font-size: 20px;
  vertical-align: middle;
  margin-right: 3px;
}

.partnership-header-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  text-align: center;
  vertical-align: middle;
}

.partnership-header-icon img {
  height: 20px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.access-badge .access-text {
  color: #003d66;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.access-badge .material-icons {
  font-size: 24px;
  line-height: 1;
  color: #003d66;
}

.access-badge span:last-child {
  font-size: 12px;
  line-height: 1.1;
}

.filters-container fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 3px solid #000;
  outline-offset: 2px;
}

.card-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
}

.field-error {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}

.field-error::before {
  content: "Error: ";
  font-weight: 700;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid #000;
  z-index: 1000;
}
.skip-link:focus {
  left: 10px;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

.reset-btn:focus-visible,
.download-btn:focus-visible {
  background-color: #005fa3;
}

.header a,
.filters-container a,
.widget a {
  text-decoration-thickness: from-font;
  text-underline-offset: 2px;
}

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

.input-error {
  border: 2px solid #b50909;
}

.filter-row .filter-group button {
  margin-top: 22px; /* aligns with inputs under labels */
  min-height: 44px;
}

.filter-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
}

.filter-actions button {
  min-height: 44px;
}

@media (max-width: 900px) {
  .top-col.contact-feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .top-col.contact-feedback .widget {
    width: 100%;
    max-width: 720px; /* match filter box width */
  }
}


@media (max-width: 768px) {
  .filters-container {
    max-width: 680px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
  }

  .widget {
    max-width: 680px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}


@media (max-width: 768px) {
  /* Row 1: stack the three filters vertically */
  .filter-row.three-columns {
    flex-direction: column;
  }

  .filter-row.three-columns .filter-group {
    width: 100%;
  }
}

.dynamic-card,
.dynamic-card * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 768px) {
  .top-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .top-col {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .filter-row.three-columns,
  .filter-row.four-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .filter-actions button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  #cardsContainer { padding-left: 10px; padding-right: 10px; }
  .dynamic-card { margin: 10px auto !important; }
}

.filters-container button {
  min-height: 44px;
  padding: 10px 14px;
}

@media (max-width: 768px) {
  .top-col { min-width: 0; }
}

.reset-btn,
.download-btn,
.filter-actions button,
.filter-row.second-row .reset-btn,
.filter-row.second-row .download-btn {
  height: auto;
  min-height: 44px;
}

@media (max-width: 600px) {
  .filter-group input,
  .filter-group select {
    padding: 12px 14px;
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  .title-with-logo {
    flex-direction: column;
    align-items: center;      /* centers logo */
    text-align: center;
    gap: 2px;
  }

  .title-with-logo .logo {
    margin: 0 auto;
  }

  .title-with-logo h1 {
    text-align: center;
  }
  
  .title-underline {
    margin-top: 10px;     /* more breathing room from title */
    margin-bottom: 10px;  /* more separation from content below */
  }
}

@media (max-width: 768px) {
  .output-widget {
    width: clamp(240px, 80%, 360px);
    margin: 0 auto 15px auto;
  }
}

@media (max-width: 600px) {
  .dashboard-container {
    padding: 16px;
  }
}

#dateRange {
  min-width: 0;
}

@media (max-width: 768px) {
  #cardsContainer.cards-grid {
    grid-template-columns: minmax(0, 680px);
    justify-content: center;
  }
  .dynamic-card { width: 100%; }
}

.card-topbar { flex-wrap: nowrap; }

@media (max-width: 480px) {
  .card-topbar-right { width: auto; }
  .access-badge { margin-top: 0px; }
}

@media (max-width: 600px) {
  .dynamic-card a[rel~="noopener"] {
    display: inline-block;
    padding: 12px 16px !important;
    min-height: 44px;
    line-height: 1.2;
  }
}

@media (max-width: 600px) {
  .dynamic-card p,
  .dynamic-card .abstract {
    line-height: 1.4;
  }
}

@media (max-width: 600px) {
  .header h1 {
    font-size: 22px;
    line-height: 1.25;
  }

  .title-with-logo .logo {
    width: 200px;
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  #cardsContainer.cards-grid .dynamic-card {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important; /* overrides inline max-width: 600px */
  }
}

body { overflow-x: hidden; }

.dynamic-card { max-width: 100%; }

@media (max-width: 768px) {
  .filter-actions {
    display: flex;
    width: 100%;
    gap: 12px;
  }

  .filter-actions button {
    flex: 1 1 0;     /* 👈 each button takes half the space */
    width: 100%;
    justify-content: center;
  }

  .filter-actions .reset-btn,
  .filter-actions .download-btn {
    margin-left: 0 !important; /* cancel desktop positioning */
  }
}
@media (max-width: 768px) {
  .filter-actions {
    display: flex;
    width: 100%;
    gap: 12px;
  }

  .filter-actions button {
    flex: 1 1 0;     /* 👈 each button takes half the space */
    width: 100%;
    justify-content: center;
  }

  .filter-actions .reset-btn,
  .filter-actions .download-btn {
    margin-left: 0 !important; /* cancel desktop positioning */
  }
}

@media (max-width: 768px) {
  .top-row {
    margin-bottom: 24px;
  }
}

.access-badge {
  white-space: nowrap;        /* keep icon + text together */
  flex-shrink: 0;             /* don't let it get squished */
}

.card-topbar-left {
  min-width: 0;               /* allows flex item to shrink */
}

.card-topbar-left span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;    /* trims long header labels */
}

/* ===== REACH card topbar: keep badge pinned on same row ===== */

/* 1) Never allow the topbar to wrap */
.card-topbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}

/* 2) Left side is allowed to shrink (critical in flex layouts) */
.card-topbar-left {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* 3) Make the header label truncate instead of forcing a wrap */
.card-topbar-left span:last-child {
  display: inline-block !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 4) Right side never wraps and never shrinks */
.card-topbar-right {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content !important;
}

/* 5) Badge stays on one line as a unit */
.access-badge {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Mobile-only results banner */
.mobile-results-banner {
  display: none;                 /* hidden by default (desktop) */
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 10px 12px;
  background: #003366;           /* match your palette */
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

/* Layout inside banner */
.mobile-results-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-results-skip {
  color: #fff;
  text-decoration: underline;
  white-space: nowrap;
}

/* Show banner only on smaller screens */
@media (max-width: 520px) {
  .mobile-results-banner {
    display: flex;
  }
}

@media (max-width: 768px) {
  .mobile-results-banner {
    top: 0;
    margin: 0;
    padding: 10px 12px;
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    border-radius: 0 0 12px 12px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .mobile-results-banner { display: flex; }
}
