/* 
  On Drupal, this must be stored in a CSS injector or in the abstract field of the node 
  On production it is stored in
  https://www.cedefop.europa.eu/en/admin/config/development/asset-injector/css/ced_mio_regional_skills_index_visualisation
  On staging:
  https://staging.cedefop.europa.eu/en/admin/config/development/asset-injector/css/mio_charts_regional_skills_ecosystem_map
  
  
*/



/* Drupal styling overriding */
div.group-main-content.body { width: 100%;  }
.body.group-main-content ol.cl-breadcrumb  { margin-left:0; }
.body.group-main-content ol.cl-breadcrumb a { border-bottom: none; }
.body.group-main-content ol.cl-breadcrumb a:hover,
.body.group-main-content ol.cl-breadcrumb a:active,
.body.group-main-content ol.cl-breadcrumb a:focus {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  border: 0;
}

/* this is because the body of the Drupal dashboard pages does not have margins */
.node--type-dashboard-page .field-node--body  { margin: 0 2rem;}

/* END OF Drupal styling overriding */


/* TomSelect styling overriding */

/*
  Native-select fallback mode:
  Drupal may still initialise TomSelect and add classes that visually hide the
  original <select> (for example ts-hidden-accessible). Force the native control
  visible and hide the generated TomSelect wrapper next to it.
*/
.metric-filter #metric-select.ts-hidden-accessible {
  position: static !important;
  left: auto !important;
  width: 36rem !important;
  height: auto !important;
  padding: 0.5rem 0.75rem !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
  opacity: 1 !important;
}

.metric-filter #metric-select + .ts-wrapper,
.metric-filter #metric-select ~ .ts-wrapper {
  display: none !important;
}

/* END OF TomSelect styling overriding */


/* breadcrumb */

.cl-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.75rem; 
    list-style: none;
    margin: 0;
    padding: 0;
}

.cl-breadcrumb-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cl-breadcrumb-link {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.cl-breadcrumb-link,
.cl-breadcrumb-link:link,
.cl-breadcrumb-link:visited,
.cl-breadcrumb-link:hover,
.cl-breadcrumb-link:active,
.cl-breadcrumb-link:focus {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  border: 0;
}

.cl-breadcrumb-title {
    line-height: 1.2;
}

.cl-breadcrumb-type {
  display: block;
    font-size: 0.85rem;
    line-height: 1.2;
    color: #666;
}

.cl-breadcrumb-separator {
    font-size: 3rem;
    color: #999;
}


/* dashboard styles */

.metric-select {  width: 36rem; margin: 0;  }



:root {
  --bg-a: #f4f8ff;
  --bg-b: #dbeafe;
  --ink-1: #0b1f3a;
  --color-dynamic-test: #34507a;
  --color-static-text: #1f252d;
  --card: #ffffffcc;
  --line: #b7c8e6;
  --shadow: 0 24px 60px rgba(31, 78, 149, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--color-static-text);
  background:
    radial-gradient(circle at 12% 10%, #ffffff 0%, transparent 42%),
    radial-gradient(circle at 82% 88%, #bfdbfe 0%, transparent 38%),
    linear-gradient(140deg, var(--bg-a), var(--bg-b));
}

.custom-dv {
  padding: 24px;
}

.blueRoundBorder {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.header {
  padding: 20px 24px 8px;
}

.eyebrow {
  margin: 0;
  color: var(--color-static-text);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.74rem;
}

h1 {
  margin: 6px 0 4px;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  color: var(--color-static-text);
}

.dashboard-section {
  padding: 0 24px;

}

.metric-filter {
  display: grid;
  gap: 8px;
  
}

.filter-label {
  color: var(--color-static-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.custom-dv h3 { margin-top: 0;}

.map-container {
  width: 100%;
  display: flex;
  /* justify-content: center; */
}

.cl-NUTS2-map {
  /* Source of truth for map height: this sets the map container box in layout. */
   width: 95%; 
  height: clamp(320px, 55vh, 560px);
  min-height: 320px;
  /* Clip any transient chart canvas mismatch during resize. */
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  text-align: center;
}

@media (max-width: 900px) {
  .country-regions-chart {
    height: 320px;
  }
}



.cl-rendered-selection { padding: 0 24px 10px;  }

.data-driven-area--hidden {
  display: none;
}

.region-display {  color: var(--color-dynamic-test);  font-size: 1.1rem;   }

.cl-rendered-selection h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--color-static-text);
}

.data-section {
  padding: 14px 24px 16px;
  border-top: 1px solid var(--line);
}



.data-section h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--color-static-text);
}

.selected-metric-name {
  margin: 0;
  color: var(--color-static-text);
  
}

.country-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.country-view-control {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--color-static-text);
  font-size: 0.88rem;
}

.country-view-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.country-view-option input {
  margin: 0;
}

.country-regions-chart {
  flex: 1 1 66%;
  width: 100%;
  height: 360px;
  min-height: 280px;
  min-width: 14rem;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.country-regions-layout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}


.selection-results .metric-value { text-align: center; }

.cl-layout-2-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.cl-map-and-quick-values > .cl-selected-parameters-and-values {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
}

.cl-layout-3-columns  {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.country-view-panel--hidden {
  display: none;
}

.country-regions-table {
  min-width: 10rem;
  flex: 1 1 34%;
  overflow: auto;
  background: #fdfefe;
}

.country-regions-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

.country-regions-table th,
.country-regions-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(183, 200, 230, 0.55);
  text-align: left;
  font-size: 0.9rem;
}

.country-regions-table thead th {
  background: #eef5ff;
  color: var(--color-static-text);
  font-weight: 700;
}

.country-regions-table td.rank-cell {
  text-align: center;
  white-space: nowrap;
}

.rank-value {
  font-variant-numeric: tabular-nums;
}

.rank-indicators {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.rank-indicator-battery {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 18px;
  border: 1px solid #5b6f8f;
  border-radius: 2px;
  background: #fff;
  padding: 1px;
  overflow: visible;
}

.rank-indicator-battery::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -3px;
  width: 4px;
  height: 2px;
  border-radius: 1px;
  background: #5b6f8f;
}

.rank-indicator-battery-fill {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
}

.rank-indicator-battery-fill--green {
  background: #22c55e;
}

.rank-indicator-battery-fill--yellow {
  background: #f59e0b;
}

.rank-indicator-battery-fill--red {
  background: #ef4444;
}


.small-info {
  font-size: 0.78rem;
  font-weight: 400;
}

.country-regions-table tbody tr.is-selected {
  background: #fff4d6;
}

.country-regions-table tbody tr.is-aggregate td {
  font-weight: 800;
}

.country-regions-table tbody tr:last-child td {
  border-bottom: 0;
}

.country-regions-status {
  margin: 10px 0 0;
  color: var(--color-static-text);
  font-size: 0.9rem;
}

.chart-footer {
  margin: 10px 0 0;
  color: var(--color-static-text);
  font-size: 0.9rem;
  line-height: 1.35;
}


.metric-card {
  flex: 1 1 calc(33.333% - 7px);
  min-width: 8rem;
  padding: 10px 12px;
  margin-top: 10px; margin-bottom: 10px;
  background: #ffffffa3;
}

.metric-label {
  margin: 0 0 6px;
  color: var(--color-static-text);
  font-size: 0.82rem;
  font-weight: 700;
}



.cl-container-map-with-title { margin-left: 24px; }

.metric-value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-dynamic-test);
}

.status {
  margin: 0;
  padding: 10px 24px 16px;
  color: var(--color-static-text);
  font-size: 0.9rem;
}

[data-dynamic-key],
.metric-value,
.country-regions-table tbody {
  color: var(--color-dynamic-test);
}


@media (max-width: 760px) {
  .country-header-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .country-view-control {
    width: 100%;
    justify-content: flex-start;
  }

  .country-regions-layout {
    flex-direction: column;
  }

  .cl-layout-2-columns {
    grid-template-columns: 1fr;
  }

  .country-regions-table,
  .country-regions-chart {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .custom-dv {
    padding: 12px;
  }

  .header,
  .metric-filter,
  .cl-rendered-selection,
  .status {
    padding-left: 14px;
    padding-right: 14px;
  }

  .regions-of-country-section {
    padding-left: 14px;
    padding-right: 14px;
  }
}
