/* Skip to content link - ADA/WCAG */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 99999;
}

.skip-to-content:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  padding: 10px 20px;
  background: #003366; /* 8.6:1 - AAA compliant */
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  z-index: 99999;
  border-radius: 4px;
}

/* Global focus indicator for keyboard navigation - ADA/WCAG */
*:focus-visible {
  outline: 2px solid #003366 !important;
  outline-offset: 2px !important;
}

/* Enhanced color contrast for WCAG AAA (7:1 ratio) */
:root {
  /* AAA-compliant colors (7:1 contrast on white) */
  --bs-primary-aaa: #0d5469;      /* Enhanced from #206b82 - 7.2:1 */
  --bs-secondary-aaa: #4a5258;    /* Enhanced from #6c757d - 7.1:1 */
  --bs-success-aaa: #285d28;      /* Enhanced from #3A833A - 7.3:1 */
  --bs-info-aaa: #087990;         /* Enhanced from #0dcaf0 - 7.0:1 */
  --bs-warning-aaa: #8b4513;      /* Enhanced from #fd7e14 - 7.5:1 */
  --bs-danger-aaa: #9a2520;       /* Enhanced from #d43f3a - 7.2:1 */
  --bs-link-aaa: #0d5469;         /* Enhanced link color - 7.2:1 */
  --text-muted-aaa: #4a5258;      /* Enhanced text-muted - 7.1:1 */
}

/* Apply AAA colors to text elements */
.text-primary {
  color: var(--bs-primary-aaa) !important;
}

.text-secondary {
  color: var(--bs-secondary-aaa) !important;
}

.text-success {
  color: var(--bs-success-aaa) !important;
}

.text-info {
  color: var(--bs-info-aaa) !important;
}

.text-warning {
  color: var(--bs-warning-aaa) !important;
}

.text-danger {
  color: var(--bs-danger-aaa) !important;
}

.text-muted {
  color: var(--text-muted-aaa) !important;
}

/* Alert text colors - AAA compliant */
.alert-info {
  color: var(--bs-info-aaa);
}

.alert-warning {
  color: var(--bs-warning-aaa);
}

.alert-danger {
  color: var(--bs-danger-aaa);
}

.alert-success {
  color: var(--bs-success-aaa);
}

/* Apply AAA colors to links */
a {
  color: var(--bs-link-aaa);
}

a:hover {
  color: #003d4f; /* Slightly darker on hover */
}

/* Apply AAA colors to buttons with text */
.btn-primary {
  background-color: var(--bs-primary-aaa);
  border-color: var(--bs-primary-aaa);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #0a4254;
  border-color: #0a4254;
}

.btn-outline-primary {
  color: var(--bs-primary-aaa);
  border-color: var(--bs-primary-aaa);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--bs-primary-aaa);
  border-color: var(--bs-primary-aaa);
  color: #fff;
}

.btn-info {
  background-color: var(--bs-info-aaa);
  border-color: var(--bs-info-aaa);
}

.btn-info:hover,
.btn-info:focus {
  background-color: #065d6f;
  border-color: #065d6f;
}

.btn-warning {
  background-color: var(--bs-warning-aaa);
  border-color: var(--bs-warning-aaa);
  color: #fff; /* White text on dark warning background */
}

.btn-warning:hover,
.btn-warning:focus {
  background-color: #6d340e;
  border-color: #6d340e;
  color: #fff;
}

.btn-danger {
  background-color: var(--bs-danger-aaa);
  border-color: var(--bs-danger-aaa);
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #7a1e1a;
  border-color: #7a1e1a;
}

/* WCAG AAA 2.5.5 - Minimum target size of 44x44px */
.btn,
button,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger,
.btn-light,
.btn-dark,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-danger,
.btn-link,
a.btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 1rem; /* Ensures content has proper spacing */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Small buttons also need 44x44 minimum */
.btn-sm {
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
}

/* Icon-only buttons */
.btn > i.fa,
.btn > i.fas,
.btn > i.far,
button > i.fa,
button > i.fas,
button > i.far {
  min-width: 20px; /* Icon itself */
}

/* Ensure dropdown toggles meet minimum size */
.dropdown-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* Form controls (inputs, selects) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  min-height: 44px;
  padding: 0.5rem;
}

/* Submit buttons and form buttons */
input[type="submit"],
input[type="button"],
input[type="reset"] {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 1rem;
}

/* Links that act as buttons */
a.btn-explore,
a.btn-explore-primary,
a.btn-explore-success,
a.btn-explore-info,
a.btn-explore-warning,
a.btn-explore-danger,
a.btn-explore-secondary {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Navigation links and menu items */
.nav-link,
.navbar a,
.navbar button {
  min-height: 44px;
  padding: 0.5rem 1rem;
}

/* Pagination links */
.pagination .page-link {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Close buttons, icon buttons */
.btn-close,
button[aria-label*="close"],
button[aria-label*="Close"] {
  min-width: 44px;
  min-height: 44px;
}

/* Social media icon links in footer */
.social-icons {
  min-width: 44px;
  min-height: 44px;
}

/* Mobile menu buttons */
#mobileMenuButton,
#mobileMenuClose {
  min-width: 44px;
  min-height: 44px;
}

/* Search buttons */
button[type="submit"] {
  min-width: 44px;
  min-height: 44px;
}

/* Checkboxes and radio buttons - larger touch targets */
input[type="checkbox"],
input[type="radio"] {
  min-width: 24px;
  min-height: 24px;
  margin: 10px; /* Provides additional touch area around the input */
}

/* Ensure checkbox/radio labels provide adequate touch target */
input[type="checkbox"] + label,
input[type="radio"] + label,
label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem;
  cursor: pointer;
}

/* Accordion buttons */
.accordion-button {
  min-height: 44px;
  padding: 1rem;
}

/* Card action buttons */
.card .btn {
  min-width: 44px;
  min-height: 44px;
}

/* Breadcrumb links */
.breadcrumb a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
}

/* Tab buttons */
.nav-tabs .nav-link,
.nav-pills .nav-link {
  min-height: 44px;
  padding: 0.5rem 1rem;
}

/* Resource list explore buttons */
.resource-item .btn,
.resource-item .dropdown-toggle {
  min-width: 44px;
  min-height: 44px;
}

.custom-tab-container {
  margin: 20px 0;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
}

.custom-nav-tabs {
  border-bottom: 1px solid #dee2e6;
}

.custom-nav-tabs .nav-item .nav-link {
  border: 1px solid transparent;
  border-radius: 0.375rem 0.375rem 0 0;
  margin-right: 2px;
  padding: 10px 15px;
  color: #495057;
  background-color: #e9ecef;
}

.custom-nav-tabs .nav-item .nav-link.active {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff #007bff #dee2e6;
}

.styled-tab-content {
  padding: 20px;
  border: 1px solid #dee2e6;
  border-top: none;
  background-color: #ffffff;
}

.module-content td {
  word-break: break-all;
}

.masthead {
  z-index: 9998;
  color: white;
}

/* Legacy .darkblue kept for non-sidebar usage */
.darkblue {
  background-color: #003366;
  color: white;
}

/* Remove border/shadow wrapping main content area */
.wrapper {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
/* Remove the ::before pseudo-element vertical divider line from main.css */
.wrapper::before,
.wrapper:before {
  display: none !important;
  border-right: none !important;
}
.primary .module {
  border: none !important;
  box-shadow: none !important;
}
.primary .card {
  border: none !important;
  box-shadow: none !important;
}

/* ============================
   Sidebar Filter Panel Styles
   ============================ */
.sidebar-filters {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0;
  font-family: inherit;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-header .filters-heading {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
}

.sidebar-reset {
  font-size: 0.85rem;
  color: #003366;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-reset:hover {
  text-decoration: underline;
}

/* Section container */
.sidebar-section {
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-section:last-child {
  border-bottom: none;
}

/* Section toggle button */
.sidebar-section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  min-height: 44px;
}

.sidebar-section-toggle:hover {
  background: #f8f9fa;
}

.sidebar-section-toggle:focus-visible {
  outline: 2px solid #003366;
  outline-offset: -2px;
}

.sidebar-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}

.sidebar-chevron {
  font-size: 0.75rem;
  color: #666;
  transition: transform 0.2s ease;
}

.sidebar-section-toggle.collapsed .sidebar-chevron {
  transform: rotate(-90deg);
}

/* Section body */
.sidebar-section-body {
  padding: 0 20px 16px;
}

.sidebar-section-body fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

/* Filter search input */
.sidebar-filter-search {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid rgba(0, 0, 0, 0.42);
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 10px;
  box-sizing: border-box;
  min-height: 44px;
  background-color: #ffffff;
}

.sidebar-filter-search:focus {
  outline: 2px solid #003366;
  outline-offset: -1px;
  border-color: #003366;
}

/* Filter list — vertical stack */
.sidebar-filter-list {
  display: flex;
  flex-direction: column;
}

/* Override CKAN's label:after { content: ":" } for sidebar */
.sidebar-filters label:after {
  content: "" !important;
  display: none !important;
}

.sidebar-filters .sidebar-date-field label:after {
  content: "" !important;
  display: none !important;
}

/* Filter item (checkbox / radio row) */
.sidebar-filter-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  min-height: 36px;
  font-size: 0.9rem;
  color: #1a1a1a;
  line-height: 1.4;
}

.sidebar-filter-item input[type="checkbox"],
.sidebar-filter-item input[type="radio"] {
  margin-top: 3px;
  min-width: 18px;
  min-height: 18px;
  accent-color: #003366;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-filter-label {
  flex: 1;
  user-select: none;
  font-weight: normal;
}

.sidebar-filter-count {
  color: #595959;
  font-size: 0.85rem;
}

/* Hidden items (for show-more) */
.sidebar-hidden-item {
  display: none !important;
}

/* Show more button */
.sidebar-show-more {
  display: block;
  width: 100%;
  padding: 8px 0;
  background: none;
  border: none;
  color: #333;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: right;
  min-height: 36px;
}

.sidebar-show-more:hover {
  color: #003366;
  text-decoration: underline;
}

.sidebar-show-more:focus-visible {
  outline: 2px solid #003366;
  outline-offset: 2px;
}

/* Nested checkboxes (for collections) */
.sidebar-nested-checkboxes {
  padding-left: 28px;
}

.sidebar-radio-item {
  font-weight: 500;
}

/* Date range */
.sidebar-date-range {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-date-field label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

.sidebar-date-field input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid rgba(0, 0, 0, 0.42);
  border-radius: 4px;
  font-size: 0.85rem;
  min-height: 44px;
  box-sizing: border-box;
  background-color: #ffffff;
}

.sidebar-date-field input[type="date"]:focus {
  outline: 2px solid #003366;
  outline-offset: -1px;
  border-color: #003366;
}

.sidebar-date-apply {
  align-self: flex-end;
  padding: 8px 24px;
  background: #003366;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
}

.sidebar-date-apply:hover {
  background: #00264d;
}

.sidebar-date-apply:focus-visible {
  outline: 2px solid #003366;
  outline-offset: 2px;
}

/* Loading placeholder */
.sidebar-loading {
  padding: 10px 0;
  color: #999;
  font-size: 0.85rem;
}

/* Map container */
#sidebar-map {
  border-radius: 4px;
}

/* Breadcrumb refresh */
.breadcrumb-item a {
  color: #003366;
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #555;
  background: none !important;
}

/* Accessibility: focus-visible on all interactive elements */
.sidebar-filters *:focus-visible {
  outline: 2px solid #003366;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sidebar-chevron {
    transition: none;
  }
  .sidebar-section-body {
    transition: none;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  .sidebar-section {
    border-color: #000;
  }
  .sidebar-filter-search,
  .sidebar-date-field input[type="date"] {
    border-color: #000;
  }
  .sidebar-filter-item input[type="checkbox"],
  .sidebar-filter-item input[type="radio"] {
    outline: 1px solid #000;
  }
}

/* End sidebar filter panel styles */

.active a {
  position: relative;
  display: inline-block;
}

.loading-bar {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.loading-bar::after {
  content: "";
  width: 30px;
  height: 30px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
.homepage,
.module-search {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.search-input-group {
  display: none !important;
}

.api-help {
  background: #fff8f0;
  border: 1px solid #ffeedd;
  border-radius: 4px;
  margin-top: 10px;
  padding: 15px;
}

.api-help code {
  background: #fff;
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid #ffe0c0 !important;
  color: #d35400 !important;
}

.btn-warning {
  color: black;
  background-color: #f39c12 !important;
  border-color: #e08e0b !important;
}

.btn-warning:hover {
  background-color: #e08e0b !important;
  border-color: #d35400 !important;
}

.dropdown-a {
  position: relative;
  z-index: 99999;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  width: auto;
  background-color: white;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  border-radius: 5px;
  padding: 10px;
}

.dropdown-content a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: black;
}

.dropdown-content i {
  margin-right: 10px;
}

.dropdown-content a:hover {
  color: #005fce;
}

.navbar-buttons a {
  margin-right: 10px;
}

.custom-nav .mainlink {
  align-items: center;
  box-sizing: border-box;
  color: rgb(255, 255, 255);
  cursor: pointer;
  display: flex;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 400;
  height: 45px;
  line-height: 21px;
  padding: 12px;
  text-align: start;
  text-decoration-color: rgb(255, 255, 255);
  text-decoration-line: none;
  text-decoration-style: solid;
  text-decoration-thickness: auto;
  text-size-adjust: 100%;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.masthead .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-navbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.site-search {
  margin-right: 20px;
  /* Adjust as needed */
}

#main-navigation-toggle {
  float: right;
  width: 100%;
}

.modal.show {
  z-index: 999999 !important;
}

.btn.btn-success {
  background-color: var(--bs-success-aaa);
  border-color: var(--bs-success-aaa);
  color: #fff;
}

.btn.btn-success:hover {
  background-color: #1f4a1f;
  border-color: var(--bs-success-aaa);
  color: #fff;
}

#dataset-search-form {
  padding-bottom: 0px !important;
}

#dataset-search-form .search-input-group {
  display: none !important;
}

/* Legacy nav-item styles (kept for non-sidebar pages) */
.nav-item a .item-label {
  white-space: break-spaces !important;
}

/* User Guide Styles */
.usa-prose .card {
  border: none;
  transition: transform 0.2s;
}

.usa-prose .card:hover {
  transform: translateY(-2px);
}

.usa-prose .card-title {
  color: var(--bs-primary);
  font-size: 1.75rem;
}

.usa-prose .card-title i {
  margin-right: 0.5rem;
}

.usa-prose .list-group-item i {
  margin-right: 0.5rem;
}

.usa-prose img {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin: 1rem auto;
  display: block;
}

.usa-prose .accordion-button:not(.collapsed) {
  background-color: var(--bs-primary);
  color: white;
}

.usa-prose code {
  background: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  color: var(--bs-primary);
}

.usa-prose .lead {
  font-size: 1.25rem;
  color: #666;
}

/* Custom Explore Button Styles */
.btn-explore {
  padding: 0.5rem 1rem !important;
  border-radius: 0.375rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease-in-out !important;
  border: 2px solid transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  font-size: 0.9rem !important;
  width: auto !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

/* Unified dark blue style for all variants */
.btn-explore-primary,
.btn-explore-success,
.btn-explore-info,
.btn-explore-warning,
.btn-explore-danger,
.btn-explore-secondary {
  background-color: #003366 !important;
  color: white !important;
  border-color: #003366 !important;
}

.btn-explore-primary:hover,
.btn-explore-success:hover,
.btn-explore-info:hover,
.btn-explore-warning:hover,
.btn-explore-danger:hover,
.btn-explore-secondary:hover {
  background-color: #002244 !important;
  color: white !important;
  border-color: #002244 !important;
}

/* Fix button hover effects inside cards */
.card .btn-explore:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.account.avatar {
  display: none !important;
}

.masthead .navbar .logo img {
  max-height: 100px !important;
}

.logo {
  color: white !important;
}

.debug,
#flDebugToolbarHandle , #flDebugToolbar {
  display: none !important;
}

.main {
  background: none !important;
}

a,
p,
div,
span,
h1,
h2,
h3,
h4,
h5,
h6,
li,
b,
ul,
td,
tr,
th,
tbody,
thead {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

li.disabled a {
  text-decoration: none !important;
  margin-left: 15px;
  margin-right: 15px;
}


.dataset-resources a {
  text-decoration: none;
}

/* Legacy active nav styles (kept for non-sidebar pages) */
.module-narrow .nav-item.active > a,
.module-narrow .nav-item.active > a span,
.module-narrow .nav-aside li.active a,
.module-narrow .nav-aside li.active a span {
  background-color: #1F4297 !important;
  border-color: #060504 !important;
  color: white !important;
}

.module-narrow .nav-item.active > a:before, .module-narrow .nav-aside li.active a:before {
  border-left-color: #1F4297 !important;
}

/* Alert Styles */
.alert {
  position: relative;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}

.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffecb5;
}

.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

.alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

.alert i {
  margin-right: 0.5rem;
}

.alert p {
  margin-bottom: 0;
}

.alert.shadow-sm {
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

#dataset-search-form h1::before {
  font-family: "Font Awesome 5 Free";
  content: "\f1c0";  /* Unicode for fa-database icon */
  font-weight: 900;  /* Required for solid icons */
  margin-right: 0.5rem;
  color: #003366;  /* Matches your theme's blue color */
  display: inline-block;
}

.no-underline {
  text-decoration: none !important;
}

.loader-badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  background-color: #17a2b8;
  text-decoration: none;
  margin-left: 5px;
  text-transform: uppercase;
}

/* Style the overview stats cards */
.stats-overview .card {
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  border: none;
}

.stats-overview .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
}

.stats-overview .card-body {
  padding: 1.5rem;
}

.stats-overview h2,
.stats-overview h3 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: white;
}

.stats-overview p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
}

.stats-overview i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Style the popular resources table */
#popular-resources i {
  margin-right: 0.5rem;
  color: #6c757d; /* Muted gray color */
}

#popular-resources a {
  text-decoration: none;
}

/* Modern background colors - AAA compliant */
.bg-primary {
  background-color: var(--bs-primary-aaa) !important; /* AAA-compliant blue */
  color: #fff !important; /* Ensure white text on dark backgrounds */
}

.bg-success {
  background-color: var(--bs-success-aaa) !important; /* AAA-compliant green */
  color: #fff !important;
}

.bg-info {
  background-color: var(--bs-info-aaa) !important; /* AAA-compliant cyan */
  color: #fff !important;
}

.bg-warning {
  background-color: var(--bs-warning-aaa) !important; /* AAA-compliant orange */
  color: #fff !important;
}

.bg-danger {
  background-color: var(--bs-danger-aaa) !important; /* AAA-compliant red */
  color: #fff !important;
}


.zindex100 {
  z-index: 100;
}

.nav-child a {
  z-index: 50;
}

/* Hide datastore status badge in resource list */
.loader-badge,
.resource-item .loader-badge {
  display: none !important;
}

@media (max-width: 768px) {
  .stats-overview .card {
    margin: 10px auto;
    max-width: 80%;
    position: relative;
    display: block;
  }

  .masthead .navbar .logo img {
    width: 100% !important;
  }

}

/* ============================================================================
   Context-Sensitive Help System - WCAG AAA 3.3.5
   ============================================================================ */

/* Help icon styling */
.form-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  color: var(--bs-info-aaa, #087990);
  cursor: help;
  font-size: 16px;
  vertical-align: middle;
  transition: color 0.2s ease;
}

.form-help-icon:hover,
.form-help-icon:focus {
  color: var(--bs-primary-aaa, #0d5469);
  outline: 2px solid var(--bs-primary-aaa, #0d5469);
  outline-offset: 2px;
  border-radius: 50%;
}

/* Help text styling */
.form-help-text,
.help-block,
.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted-aaa, #4a5258);
  line-height: 1.5;
}

.form-help-text code {
  font-size: 0.875rem;
  padding: 2px 4px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 3px;
}

/* Expandable help section */
.help-section {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f0f7fb;
  border-left: 4px solid var(--bs-info-aaa, #087990);
  border-radius: 4px;
  display: none; /* Hidden by default */
}

.help-section.show {
  display: block;
}

.help-section h3,
.help-section h4 {
  color: var(--bs-primary-aaa, #0d5469);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.help-section ul {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

.help-section li {
  margin-bottom: 0.25rem;
  color: var(--text-muted-aaa, #4a5258);
}

.help-section p:last-child,
.help-section ul:last-child {
  margin-bottom: 0;
}

/* Help section toggle button */
.help-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  background-color: #e7f3f8;
  color: var(--bs-info-aaa, #087990);
  border: 1px solid var(--bs-info-aaa, #087990);
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.help-section-toggle:hover,
.help-section-toggle:focus {
  background-color: var(--bs-info-aaa, #087990);
  color: #fff;
  text-decoration: none;
  outline: 2px solid var(--bs-primary-aaa, #0d5469);
  outline-offset: 2px;
}

.help-section-toggle i {
  font-size: 1rem;
}

/* Inline help examples */
.help-example {
  display: block;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--text-muted-aaa, #4a5258);
}

.help-example strong {
  color: var(--bs-primary-aaa, #0d5469);
}

/* Label with help icon */
.label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tooltip customization */
.tooltip {
  font-size: 0.875rem;
}

.tooltip-inner {
  max-width: 300px;
  text-align: left;
  padding: 0.75rem;
  background-color: var(--bs-primary-aaa, #0d5469);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tooltip-inner ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
}

.tooltip-inner li {
  margin-bottom: 0.25rem;
}

/* Help alert boxes */
.help-alert {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 4px;
  border-left: 4px solid;
  background-color: #f8f9fa;
}

.help-alert-info {
  border-left-color: var(--bs-info-aaa, #087990);
  background-color: #e7f3f8;
}

.help-alert-warning {
  border-left-color: var(--bs-warning-aaa, #8b4513);
  background-color: #fff3e0;
}

.help-alert-tip {
  border-left-color: var(--bs-success-aaa, #285d28);
  background-color: #e8f5e9;
}

.help-alert h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bs-primary-aaa, #0d5469);
}

.help-alert p:last-child {
  margin-bottom: 0;
}

/* Form group with help */
.form-group-with-help {
  position: relative;
}

.form-group-with-help .form-help-icon {
  position: absolute;
  top: 0;
  right: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tooltip-inner {
    max-width: 250px;
  }

  .help-section {
    padding: 0.75rem;
  }

  .help-section-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-help-icon {
    border: 1px solid currentColor;
    border-radius: 50%;
  }

  .help-section {
    border-width: 2px;
  }

  .help-section-toggle {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .form-help-icon,
  .help-section-toggle {
    transition: none;
  }
}


/* Simplify Data Categories section icons - use consistent dark blue */
.categories .fas.text-primary,
.categories .fas.text-success,
.categories .fas.text-info,
.categories .fas.text-warning,
.categories .fas.text-danger,
.categories .fas.text-secondary {
  color: #003366 !important;
}

/* Remove mountains background from footer, use solid blue like header */
.footer {
  background-image: none !important;
  background-color: #003366 !important;
}

/* Fix WCAG contrast issues for visually-hidden elements */
.visually-hidden,
.sr-only,
.visually-hidden *,
.sr-only * {
  color: #ffffff !important;
  background-color: #003366 !important;
}

/* Ensure button/link spans inherit proper background from parent (except in visually-hidden) */
.btn span:not(.visually-hidden):not(.visually-hidden *),
a span:not(.visually-hidden):not(.visually-hidden *) {
  background-color: inherit;
}

/* ============================
   Dataset Detail Sidebar Styles
   ============================ */

/* Hide old CKAN module-narrow/context-info styling on dataset pages */
#dataset-sidebar .module-narrow,
#dataset-sidebar .context-info {
  border: none;
  background: none;
  box-shadow: none;
}

/* Organization info section (top, not collapsible) */
.sidebar-org-info {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-org-image {
  margin-bottom: 12px;
}

.sidebar-org-image a {
  display: inline-block;
  text-decoration: none;
}

.sidebar-org-image img {
  max-width: 160px;
  max-height: 120px;
  border-radius: 6px;
  object-fit: contain;
}

.sidebar-org-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.sidebar-org-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
  margin: 0 0 6px;
}

.sidebar-read-more {
  font-size: 0.85rem;
  color: #003366;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-read-more:hover {
  text-decoration: underline;
  color: #002244;
}

/* Social sharing links */
.sidebar-social-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.sidebar-social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #003366;
  text-decoration: none;
  padding: 4px 0;
  min-height: 44px;
}

.sidebar-social-links a:hover {
  color: #002244;
  text-decoration: underline;
}

.sidebar-social-links a i {
  font-size: 1.2rem;
}

/* License text */
.sidebar-license-text {
  font-size: 0.9rem;
  color: #333;
  margin: 0;
  line-height: 1.5;
}

.sidebar-license-text a {
  color: #003366;
  text-decoration: none;
}

.sidebar-license-text a:hover {
  text-decoration: underline;
}

/* Tag list (pill badges) */
.sidebar-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 0.82rem;
  color: #333;
  text-decoration: none;
  line-height: 1.4;
  min-height: auto;
}

.sidebar-tag:hover {
  background: #e0e0e0;
  color: #003366;
  text-decoration: none;
}

/* Back to Datasets link */
.sidebar-back-link {
  padding: 14px 20px;
  border-top: 1px solid #e0e0e0;
}

.sidebar-back-link a {
  font-size: 0.9rem;
  color: #003366;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.sidebar-back-link a:hover {
  color: #002244;
  text-decoration: underline;
}

/* Hide old CKAN sidebar modules on dataset detail pages */
.secondary .module-narrow .module-heading {
  display: none;
}

/* Override context-info dark styling when inside dataset-sidebar */
#dataset-sidebar ~ .module-narrow,
#dataset-sidebar ~ .context-info {
  display: none;
}

/* ── Dataset Stats Inline Display ── */
.dataset-stats-inline {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.dataset-stat-separator {
  color: #767676;
  margin: 0 10px;
  font-weight: 300;
}

.dataset-stat-dot {
  color: #767676;
  margin: 0 8px;
  font-size: 1.1em;
  line-height: 1;
}

.dataset-stat-item {
  white-space: nowrap;
  color: #555;
}

.dataset-stat-item i {
  margin-right: 3px;
  color: #003366;
}

.dataset-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

/* ============================================================
   DATASET LANDING PAGES — Custom full-width landing pages
   for the 7 TaxSys datasets
   ============================================================ */

.dataset-landing {
  --dl-accent: #003366;
  --dl-accent-light: #f0f5fa;
}

/* --- Section 1: Hero Banner --- */
.dl-hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
}

.dl-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.dl-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,51,102,0.88), rgba(33,93,158,0.72));
  z-index: 1;
}

.dl-hero-overlay {
  position: relative;
  z-index: 2;
  padding: 60px 15px;
  color: #fff;
  max-width: 720px;
}

/* --- Hero Entrance Animations --- */
@keyframes dlFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dlSlideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

.dl-fade-in {
  opacity: 0;
  animation: dlFadeIn 0.4s ease-out forwards;
}
.dl-fade-delay-1 { animation-delay: 0s; }
.dl-fade-delay-2 { animation-delay: 0.15s; }
.dl-fade-delay-3 { animation-delay: 0.3s; }
.dl-fade-delay-4 { animation-delay: 0.55s; }

.dl-slide-in-right {
  opacity: 0;
  animation: dlSlideInRight 0.5s ease-out 0.5s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .dl-fade-in,
  .dl-slide-in-right {
    opacity: 1;
    animation: none;
    transform: none;
  }
}

/* --- Hero Split Layout (two-column: content + API widget) --- */
.dl-hero-split {
  position: relative;
  z-index: 2;
  padding: 60px 15px;
  color: #fff;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.dl-hero-content {
  flex: 1;
  max-width: 640px;
  min-width: 0;
}

/* --- Hero API Widget (frosted glass card) --- */
.dl-hero-api-widget {
  flex: 0 0 680px;
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 20px;
}

.dl-api-header {
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dl-api-body {
  padding: 16px 20px 20px;
}

.dl-api-endpoint {
  margin-bottom: 14px;
}

.dl-api-endpoint:last-of-type {
  margin-bottom: 16px;
}

.dl-api-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.dl-api-url-row {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
}

.dl-api-url-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.2);
  border: none;
  outline: none;
}

.dl-api-copy-btn {
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.15s;
  min-height: 36px;
  min-width: 36px;
}

.dl-api-copy-btn:hover,
.dl-api-copy-btn:focus {
  background: rgba(255,255,255,0.25);
}

.dl-api-footer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}

.dl-api-example-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
  min-height: 34px;
  min-width: 34px;
}

.dl-api-example-btn:hover,
.dl-api-example-btn:focus {
  background: rgba(255,255,255,0.25);
  color: #fff;
  text-decoration: none;
}

.dl-api-docs-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.dl-api-docs-link:hover,
.dl-api-docs-link:focus {
  color: #fff;
  text-decoration: underline;
}

.dl-breadcrumb ol {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0 0 20px 0;
  font-size: 0.85rem;
}

.dl-breadcrumb li::after {
  content: '/';
  margin-left: 8px;
  opacity: 0.5;
}

.dl-breadcrumb li:last-child::after {
  display: none;
}

.dl-breadcrumb a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

.dl-breadcrumb a:hover,
.dl-breadcrumb a:focus {
  color: #fff;
  text-decoration: underline;
}

.dl-breadcrumb li[aria-current] {
  color: rgba(255,255,255,0.6);
}

.dl-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  line-height: 1.15;
  color: #fff;
}

.dl-hero-tagline {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.9);
  margin: 0 0 8px 0;
  font-weight: 400;
}

.dl-hero-headline-stat {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  margin: 0 0 12px 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.dl-hero-summary {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.75);
  margin: 0 0 20px 0;
  line-height: 1.6;
  max-width: 600px;
}

.dl-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.dl-btn-primary {
  background: #fff;
  color: #1a1a2e;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.dl-btn-primary:hover,
.dl-btn-primary:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  background: rgba(255,255,255,0.25);
  color: #fff;
  text-decoration: none;
}

.dl-btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.dl-btn-secondary:hover,
.dl-btn-secondary:focus {
  background: rgba(255,255,255,0.25);
  color: #fff;
  text-decoration: none;
}

.dl-hero-updated {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  margin: 0;
  display: inline;
}

.dl-hero-updated .automatic-local-datetime {
  color: inherit;
  font-weight: 600;
}

.dl-hero-dbsize {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  margin-left: 16px;
}

/* --- Sections shared --- */
.dl-section {
  padding: 60px 0;
}

.dl-section-white {
  background: #fff;
}

.dl-section-gray {
  background: #f8f9fa;
}

.dl-section-accent {
  background: var(--dl-accent-light, #f0f5fa);
}

.dl-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 32px 0;
}

/* --- Section 2: Stats Grid --- */
.dl-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.dl-stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  border-top: 4px solid #003366;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dl-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.dl-stat-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  opacity: 0.4;
}

.dl-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.1;
  margin-bottom: 4px;
}

.dl-stat-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dl-stat-placeholder {
  opacity: 0.5;
}

/* --- Roll Year Selector --- */
.dl-roll-year-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.dl-roll-year-label {
  font-weight: 600;
  font-size: 14px;
  color: #555;
  white-space: nowrap;
}

.dl-roll-year-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.dl-roll-year-pills {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  max-width: min(940px, 100%);
  padding: 2px;
}

.dl-roll-year-pills::-webkit-scrollbar {
  display: none;
}

.dl-roll-year-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 20px;
  border: 1.5px solid #d0d5dd;
  background: #fff;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 48px;
  line-height: 1.4;
  flex-shrink: 0;
}

.dl-roll-year-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #d0d5dd;
  background: #fff;
  color: #555;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s ease;
}

.dl-roll-year-arrow:hover:not(.disabled) {
  border-color: var(--dl-accent, #215D9E);
  color: var(--dl-accent, #215D9E);
  background: rgba(33, 93, 158, 0.04);
}

.dl-roll-year-arrow:focus-visible {
  outline: 2px solid var(--dl-accent, #215D9E);
  outline-offset: 2px;
}

.dl-roll-year-arrow.disabled {
  opacity: 0.35;
  cursor: default;
}

.dl-roll-year-pill:hover {
  border-color: var(--dl-accent, #215D9E);
  color: var(--dl-accent, #215D9E);
  background: rgba(33, 93, 158, 0.04);
}

.dl-roll-year-pill.active {
  background: var(--dl-accent, #215D9E);
  color: #fff;
  border-color: var(--dl-accent, #215D9E);
  font-weight: 600;
}

.dl-roll-year-pill:focus-visible {
  outline: 2px solid var(--dl-accent, #215D9E);
  outline-offset: 2px;
}

/* --- Apportionment selector (Apportionment Data) — reuses the roll-year strip,
       pill, and arrow styles above; adds a fiscal-year divider + caption line. --- */
.dl-appt-fy {
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dl-accent, #1B7A4B);
  padding: 0 8px;
  margin-left: 2px;
  border-left: 2px solid rgba(0, 0, 0, 0.08);
  opacity: 0.92;
}

/* Fiscal-year selection box — scopes the apportionment pills to a fiscal year. */
.dl-appt-fy-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dl-appt-fy-select-label {
  font-weight: 600;
  font-size: 14px;
  color: #555;
  white-space: nowrap;
}

.dl-appt-fy-select {
  min-height: 36px;
  padding: 6px 34px 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #d0d5dd;
  background-color: #fff;
  color: #1a1a2e;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  /* Native chevron replaced with an accent caret. */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.dl-appt-fy-select:hover {
  border-color: var(--dl-accent, #1B7A4B);
}

.dl-appt-fy-select:focus-visible {
  outline: 2px solid var(--dl-accent, #1B7A4B);
  outline-offset: 2px;
}

.dl-appt-caption {
  font-size: 13px;
  color: #555;
  text-align: center;
  max-width: 720px;
  line-height: 1.5;
}

.dl-appt-caption #dl-appt-current {
  font-weight: 600;
  color: #1a1a2e;
}

.dl-stats-grid {
  transition: opacity 0.15s ease;
}

.dl-stats-grid.dl-stats-switching {
  opacity: 0.3;
}

/* --- Section 3: Multi-Chart Layout --- */
.dl-chart-section {
  padding: 60px 0;
}

.dl-chart-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.dl-chart-col {
  flex: 1.2;
  min-width: 0;
}

.dl-chart-col-sm {
  flex: 1.2;
  min-width: 0;
}

.dl-text-col {
  flex: 0 0 340px;
  max-width: 340px;
}

.dl-text-col-lg {
  flex: 0 0 340px;
  max-width: 340px;
}

.dl-chart-container {
  position: relative;
  height: 360px;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dl-chart-container.dl-chart-tall {
  height: 480px;
}

.dl-chart-text-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #003366;
  margin: 0 0 16px 0;
}

.dl-chart-text-desc {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
  margin: 0 0 20px 0;
}

.dl-chart-with-legend {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dl-chart-circular {
  flex: 0 0 320px;
  max-width: 320px;
  height: 320px;
}

.dl-chart-with-legend .dl-chart-legend {
  flex: 1;
  min-width: 0;
}

.dl-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 6px;
}

.dl-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --- Geo / Map Charts (Leaflet) --- */
.dl-geo-map {
  height: 450px;
  border-radius: 12px;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  border: 2px solid rgba(0,51,102,0.12);
}
.dl-geo-legend {
  background: rgba(255,255,255,0.95);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 220px;
  backdrop-filter: blur(4px);
}
.dl-geo-legend h4 {
  margin: 0 0 6px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #003366;
}
.dl-geo-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.dl-geo-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}
.dl-geo-legend-swatch.dl-geo-legend-rect {
  border-radius: 3px;
}
.dl-geo-legend small {
  display: block;
  margin-top: 6px;
  color: #666;
  font-size: 0.78rem;
}
.dl-geo-popup strong {
  color: #003366;
}
.dl-geo-popup .dl-geo-popup-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #215D9E;
  margin-top: 2px;
}
.dl-geo-popup .dl-geo-popup-rank {
  display: inline-block;
  background: linear-gradient(135deg, #003366, #215D9E);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}
/* Hover tooltip on geo map markers */
.dl-geo-tooltip {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}
/* Horizontal bar chart below geo map */
.dl-geo-bar-wrap {
  margin-top: 2rem;
  height: 340px;
  background: #fff;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,51,102,0.08);
}

/* --- Paired Charts (two charts side-by-side) --- */
.dl-chart-pair-row {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
}

.dl-chart-pair-item {
  flex: 1;
  min-width: 0;
}

.dl-chart-pair-canvas {
  position: relative;
  height: 300px;
  max-width: 340px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dl-chart-pair-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #003366;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Paired circular charts: chart + legend side-by-side */
.dl-chart-pair-item .dl-chart-with-legend {
  gap: 16px;
}

.dl-chart-pair-item .dl-chart-circular {
  flex: 0 0 220px;
  max-width: 220px;
  height: 220px;
}

.dl-chart-pair-item .dl-chart-legend {
  text-align: left;
}

.dl-chart-pair-desc {
  max-width: 800px;
  margin: 0 auto;
  color: #444;
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: center;
}

/* --- Research Article --- */
.dl-research-subtitle {
  font-size: 1.3rem;
  font-weight: 600;
  color: #003366;
  margin: 0 0 20px 0;
}

.dl-research-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 18px;
  max-width: 800px;
}

/* --- Research Inline Image --- */
.dl-research-img {
  float: right;
  width: 280px;
  height: 210px;
  object-fit: cover;
  border-radius: 12px;
  margin: 4px 0 16px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.dl-research-img.dl-float-left {
  float: left;
  margin: 4px 24px 16px 0;
}
@media (max-width: 991px) {
  .dl-research-img { width: 220px; height: 165px; margin: 4px 0 12px 18px; }
  .dl-research-img.dl-float-left { margin: 4px 18px 12px 0; }
}
@media (max-width: 575px) {
  .dl-research-img, .dl-research-img.dl-float-left { float: none; width: 100%; height: 180px; margin: 0 0 16px 0; border-radius: 10px; }
}

/* --- Research Stat Highlights --- */
.dl-stat-highlight {
  font-weight: 700;
  color: var(--accent, #003366);
  background: linear-gradient(to top, rgba(0, 51, 102, 0.08) 38%, transparent 38%);
  padding: 0 2px;
  border-radius: 2px;
}

/* --- Data Dictionary (always visible) --- */
.dl-dict-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #003366;
  margin-bottom: 16px;
}

.dl-dict-section .dl-dict-body {
  display: block;
}

/* --- Section 4: Highlights --- */
.dl-highlights-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.dl-highlights-list {
  flex: 1;
}

.dl-highlight-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dl-highlight-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  font-size: 1rem;
  color: #333;
  line-height: 1.5;
  border-bottom: 1px solid #eee;
}

.dl-highlight-bullets li:last-child {
  border-bottom: none;
}

.dl-bullet {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
}

.dl-callout-cards {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dl-callout-card {
  background: #f8f9fa;
  border-left: 5px solid #003366;
  border-radius: 0 8px 8px 0;
  padding: 28px 32px;
}

.dl-callout-value {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.dl-callout-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Section 5: About --- */
.dl-about-content p {
  font-size: 1rem;
  color: #333;
  line-height: 1.7;
  margin: 0 0 16px 0;
  max-width: 800px;
}

.dl-about-link {
  margin-top: 20px;
}

.dl-about-link a {
  color: var(--dl-accent, #003366);
  font-weight: 600;
  text-decoration: none;
}

.dl-about-link a:hover,
.dl-about-link a:focus {
  text-decoration: underline;
}

/* --- Mixed Row: content + chart side-by-side --- */
.dl-mixed-row {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.dl-mixed-text {
  flex: 1;
  min-width: 0;
}

.dl-mixed-chart {
  flex: 0 0 420px;
  max-width: 420px;
}

.dl-research-content-p {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 16px;
}

.dl-about-p {
  font-size: 1rem;
  color: #333;
  line-height: 1.7;
  margin: 0 0 16px 0;
}

/* --- Section 6: Use Cases --- */
.dl-usecases-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.dl-usecase-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dl-usecase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.dl-usecase-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.dl-usecase-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px 0;
}

.dl-usecase-desc {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

/* --- Mixed Row: Research + Who Benefits inline --- */
.dl-mixed-usecases {
  flex: 0 0 460px;
  max-width: 460px;
}

.dl-usecases-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.dl-usecases-inline-grid .dl-usecase-card {
  padding: 22px 18px;
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dl-usecases-inline-grid .dl-usecase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent, #215D9E), color-mix(in srgb, var(--accent, #215D9E) 60%, #fff));
}

.dl-usecases-inline-grid .dl-usecase-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #215D9E);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.dl-usecases-inline-grid .dl-usecase-icon {
  font-size: 1.4rem;
  margin-bottom: 12px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-light, #f0f5fa);
}

.dl-usecases-inline-grid .dl-usecase-title {
  font-size: 0.95rem;
}

.dl-usecases-inline-grid .dl-usecase-desc {
  font-size: 0.82rem;
}

/* --- Section 7: Resources --- */
.dl-resources-split {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.dl-resources-downloads {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.dl-resources-dictionary {
  flex: 0 0 520px;
  max-width: 520px;
}

.dl-resources-dictionary .dl-dict-section {
  margin-top: 0;
}

.dl-resources-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.dl-resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dl-resource-icon {
  font-size: 1.8rem;
  color: #888;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.dl-resource-info {
  flex: 1;
  min-width: 0;
}

.dl-resource-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 2px 0;
}

.dl-resource-format {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.dl-resource-desc {
  font-size: 0.85rem;
  color: #666;
  margin: 4px 0 0 0;
}

.dl-btn-download {
  background: var(--dl-accent, #003366);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.dl-btn-download:hover,
.dl-btn-download:focus {
  background: #003366;
  color: #fff;
  text-decoration: none;
}

/* Per-apportionment download cards (Apportionment Data): labeled dropdown that
   repoints the card's Download button at the selected apportionment's file. */
.dl-appt-dl-card {
  align-items: flex-start;
}

.dl-appt-dl-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.dl-appt-dl-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
}

.dl-appt-dl-select {
  width: 100%;
  max-width: 460px;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.9rem;
  color: #1a1a2e;
  background: #fff;
  border: 1px solid #8a8a8a;
  border-radius: 6px;
}

.dl-appt-dl-select:focus-visible {
  outline: 2px solid var(--dl-accent, #003366);
  outline-offset: 2px;
  border-color: var(--dl-accent, #003366);
}

/* Data Dictionary Accordion */
.dl-dict-accordion {
  margin-bottom: 32px;
}

.dl-dict-accordion h3 {
  margin: 0;
}

.dl-dict-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  cursor: pointer;
  gap: 12px;
}

.dl-dict-toggle:hover,
.dl-dict-toggle:focus {
  background: #f8f9fa;
}

.dl-dict-toggle[aria-expanded="true"] .dl-dict-chevron {
  transform: rotate(180deg);
}

.dl-dict-chevron {
  transition: transform 0.2s;
}

.dl-dict-body {
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 520px;
}

.dl-dict-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.dl-dict-summary-item {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.dl-dict-summary-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  font-weight: 600;
}

.dl-dict-summary-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.dl-dict-summary:empty {
  display: none;
}

.data-dictionary .dl-dict-summary {
  margin-top: 8px;
}

.dl-dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dl-dict-table th {
  background: #f8f9fa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #ddd;
}

.dl-dict-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #eee;
  color: #444;
}

.dl-dict-table tr:hover td {
  background: #fafafa;
}

.dl-dict-scroll-hint {
  text-align: center;
  font-size: 0.82rem;
  color: #888;
  margin: 10px 0 0 0;
  padding: 0;
}

/* Metadata */
.dl-metadata {
  margin-top: 24px;
  margin-bottom: 0;
}

.dl-metadata h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 12px 0;
}

.dl-metadata-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.dl-meta-item {
  display: flex;
  gap: 8px;
}

.dl-meta-item dt {
  font-weight: 600;
  color: #666;
  font-size: 0.88rem;
  min-width: 100px;
}

.dl-meta-item dd {
  margin: 0;
  font-size: 0.88rem;
  color: #333;
}

.dl-back-link {
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.dl-back-link a {
  color: var(--dl-accent, #003366);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.dl-back-link a:hover,
.dl-back-link a:focus {
  text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 991px) {
  .dl-hero-overlay {
    padding: 40px 15px;
  }

  .dl-hero-split {
    flex-direction: column;
    padding: 40px 15px;
  }

  .dl-hero-content {
    max-width: none;
  }

  .dl-hero-api-widget {
    flex: none;
    width: 100%;
    max-width: 600px;
  }

  .dl-mixed-row {
    flex-direction: column;
  }

  .dl-mixed-chart {
    flex: none;
    max-width: none;
    width: 100%;
  }

  .dl-mixed-usecases {
    flex: none;
    max-width: none;
    width: 100%;
  }

  .dl-resources-split {
    flex-direction: column;
  }

  .dl-resources-dictionary {
    flex: none;
    max-width: none;
    width: 100%;
  }

  .dl-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dl-geo-map {
    height: 350px;
  }
  .dl-geo-bar-wrap {
    height: 300px;
    padding: 1rem;
  }

  .dl-chart-row {
    flex-direction: column;
  }

  .dl-chart-col,
  .dl-chart-col-sm,
  .dl-text-col,
  .dl-text-col-lg {
    flex: 1;
    max-width: none;
  }

  .dl-chart-with-legend {
    flex-direction: column;
  }

  .dl-chart-circular {
    flex: none;
    max-width: none;
    width: 100%;
    height: 320px;
  }

  .dl-chart-pair-row {
    flex-direction: column;
  }

  .dl-chart-pair-canvas {
    max-width: none;
  }

  /* When pair items stack, restore side-by-side chart+legend with full-size chart */
  .dl-chart-pair-item .dl-chart-with-legend {
    flex-direction: row;
  }

  .dl-chart-pair-item .dl-chart-circular {
    flex: 0 0 280px;
    max-width: 280px;
    height: 280px;
    width: auto;
  }

  .dl-highlights-row {
    flex-direction: column;
  }

  .dl-callout-cards {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    max-width: none;
    width: 100%;
  }

  .dl-callout-card {
    flex: 1;
    min-width: 200px;
  }

  .dl-usecases-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 575px) {
  .dl-hero h1 {
    font-size: 1.6rem;
  }

  .dl-hero-tagline {
    font-size: 1rem;
  }

  .dl-hero-api-widget {
    max-width: none;
  }

  .dl-api-url-input {
    font-size: 0.7rem;
  }

  .dl-geo-map {
    height: 280px;
  }
  .dl-geo-bar-wrap {
    height: 260px;
    padding: 0.8rem;
  }

  .dl-mixed-chart .dl-chart-container {
    height: 280px;
  }

  .dl-mixed-chart .dl-chart-circular {
    height: 240px;
    max-width: 240px;
  }

  .dl-section {
    padding: 40px 0;
  }

  .dl-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .dl-roll-year-selector {
    flex-direction: column;
    gap: 8px;
  }

  .dl-roll-year-pill {
    padding: 5px 14px;
    font-size: 13px;
  }

  .dl-stat-value {
    font-size: 1.5rem;
  }

  .dl-chart-container {
    height: 280px;
  }

  .dl-usecases-grid {
    grid-template-columns: 1fr;
  }

  /* Stack chart + legend vertically on small screens */
  .dl-chart-pair-item .dl-chart-with-legend {
    flex-direction: column;
  }

  .dl-chart-pair-item .dl-chart-circular {
    flex: none;
    max-width: none;
    width: 100%;
    height: 240px;
  }

  .dl-callout-cards {
    flex-direction: column;
  }

  .dl-callout-card {
    min-width: auto;
  }

  .dl-resource-card {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   Dataset Card Grid - Modern Card View for Search Results
   ========================================================================== */

.dataset-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (max-width: 991.98px) {
  .dataset-card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.dataset-card-grid .dataset-item {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.dataset-card-grid .dataset-item:last-of-type {
  border-bottom: none;
}

.dataset-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.08);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  color: inherit;
  height: 100%;
  border: 1px solid rgba(0, 51, 102, 0.08);
}

.dataset-card:hover,
.dataset-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 51, 102, 0.18);
  text-decoration: none !important;
  color: inherit;
}

.dataset-card:focus-visible {
  outline: 3px solid #003366 !important;
  outline-offset: 2px !important;
}

.dataset-card-image {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.dataset-card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dataset-card:hover .dataset-card-bg {
  transform: scale(1.08);
}

.dataset-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 51, 102, 0.15) 0%,
    rgba(0, 51, 102, 0.65) 100%
  );
  transition: background 0.3s ease;
}

.dataset-card:hover .dataset-card-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 51, 102, 0.1) 0%,
    rgba(0, 51, 102, 0.55) 100%
  );
}

.dataset-card-image-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  z-index: 2;
}

.dataset-card-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dataset-card-format-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: background 0.2s ease;
}

.dataset-card:hover .dataset-card-format-badge {
  background: rgba(255, 255, 255, 0.35);
}

.dataset-card-format-badge[data-format="csv"] {
  background: rgba(40, 167, 69, 0.75);
  border-color: rgba(40, 167, 69, 0.5);
}
.dataset-card-format-badge[data-format="json"] {
  background: rgba(200, 150, 0, 0.85);
  border-color: rgba(200, 150, 0, 0.5);
  color: #fff;
}
.dataset-card-format-badge[data-format="xml"] {
  background: rgba(220, 53, 69, 0.75);
  border-color: rgba(220, 53, 69, 0.5);
}
.dataset-card-format-badge[data-format="sqlite"] {
  background: rgba(0, 123, 255, 0.75);
  border-color: rgba(0, 123, 255, 0.5);
}
.dataset-card-format-badge[data-format="xlsx"] {
  background: rgba(33, 136, 56, 0.75);
  border-color: rgba(33, 136, 56, 0.5);
}

.dataset-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dataset-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #003366;
  margin: 0 0 8px 0;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.dataset-card:hover .dataset-card-title {
  color: #215D9E;
}

.dataset-card-desc {
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.5;
  margin: 0 0 auto 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dataset-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e8edf2;
  font-size: 0.78rem;
  color: #5a6977;
}

.dataset-card-date i {
  color: #003366;
  margin-right: 4px;
}

.dataset-card-stats-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.dataset-card-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f0f5fa;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: #003366;
  font-weight: 600;
  white-space: nowrap;
}

.dataset-card-stat-badge i {
  font-size: 0.65rem;
}

@keyframes cardFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dataset-card-grid .dataset-item {
  animation: cardFadeUp 0.5s ease forwards;
  opacity: 0;
}

.dataset-card-grid .dataset-item:nth-child(1) { animation-delay: 0.05s; }
.dataset-card-grid .dataset-item:nth-child(2) { animation-delay: 0.1s; }
.dataset-card-grid .dataset-item:nth-child(3) { animation-delay: 0.15s; }
.dataset-card-grid .dataset-item:nth-child(4) { animation-delay: 0.2s; }
.dataset-card-grid .dataset-item:nth-child(5) { animation-delay: 0.25s; }
.dataset-card-grid .dataset-item:nth-child(6) { animation-delay: 0.3s; }
.dataset-card-grid .dataset-item:nth-child(7) { animation-delay: 0.35s; }
.dataset-card-grid .dataset-item:nth-child(8) { animation-delay: 0.4s; }
.dataset-card-grid .dataset-item:nth-child(9) { animation-delay: 0.45s; }
.dataset-card-grid .dataset-item:nth-child(10) { animation-delay: 0.5s; }

@media (max-width: 575.98px) {
  .dataset-card-image {
    height: 140px;
  }

  .dataset-card-body {
    padding: 14px 16px 16px;
  }

  .dataset-card-title {
    font-size: 0.95rem;
  }

  .dataset-card-stats-info {
    margin-left: 0;
    width: 100%;
    margin-top: 4px;
  }
}

