/* Data Explorer refactor shell — layout/styling ported from the original
   application.py's assets/styles.css. Greycliff CF is the app's standard font (ported
   from the original assets/fonts/); Arial/Helvetica remain as the fallback stack. */

/* --- Greycliff CF web fonts (the original app's standard font) --- */
@font-face {
  font-family: "Greycliff";
  font-style: normal;
  font-display: swap;
  src: url("fonts/GreycliffCF-Regular.woff2") format("woff2"),
    url("fonts/GreycliffCF-Regular.woff") format("woff");
}
@font-face {
  font-family: "Greycliff Bold";
  font-display: swap;
  src: url("fonts/GreycliffCF-Bold.woff2") format("woff2"),
    url("fonts/GreycliffCF-Bold.woff") format("woff");
}
@font-face {
  font-family: "Greycliff Medium";
  font-display: swap;
  src: url("fonts/GreycliffCF-Medium.woff2") format("woff2"),
    url("fonts/GreycliffCF-Medium.woff") format("woff");
}
@font-face {
  font-family: "Greycliff Demi Bold";
  font-display: swap;
  src: url("fonts/GreycliffCF-DemiBold.woff2") format("woff2"),
    url("fonts/GreycliffCF-DemiBold.woff") format("woff");
}

div {
  font-family: "Greycliff", Arial, Helvetica, sans-serif;
}

#page-content {
  width: 100%;
}

/* --- Labor-group / inflation sub-tabs (teal border, white bg) --- */
.tab {
  font-family: "Greycliff", Arial, Helvetica, sans-serif !important;
  text-align: center;
  font-size: 1.2em;
  display: inline-flex;
  border: 1px solid #028580;
  background-color: #ffffff;
  justify-content: center;
}

.tab--selected {
  font-weight: bold;
}

/* --- The main control/chart grid: left control column, right chart --- */
.container {
  width: 100%;
  display: grid;
  column-gap: 24px;
  row-gap: 10px;
  grid-template-areas:
    'title dataviz'
    'dropdown dataviz'
    'options dataviz';
  grid-template-rows: auto auto 1fr;
  grid-template-columns: 300px 1fr;
}

/* --- Sidebar typography scale ---
   One coherent hierarchy for the left control column:
     .title            18px / 700  — the sidebar heading ("Display Options:")
     .section-header   14px / 700  — section dividers ("Select View Mode:", "Mode Options:")
     field labels      13px / 600  — set inline via _LABEL_STYLE
     control text      13px / 400  — dropdown values, radio & checkbox labels (inherited) */
.title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1c20;
  vertical-align: top;
  padding: 0 15px;
  margin: 0;
  grid-area: title;
  align-self: end;
  display: inline-block;
}

/* Big section headers ("Select View Mode:", "Transformations") — same 18px/700 dark-slate
   as the sidebar .title, each preceded by a divider rule to separate it from the block above. */
.options .section-header {
  font-size: 18px;
  font-weight: 700;
  color: #1a1c20;
  margin: 16px 0 6px 0;
  padding-top: 16px;
  border-top: 1px solid #d9d2c5;
}

/* Sub-header ("Mode Options:") — slightly larger than a field label (15px/700 dark slate),
   labels the mode-specific panel below it. */
.options .mode-header {
  font-size: 15px;
  font-weight: 700;
  color: #1a1c20;
  margin: 14px 0 6px 0;
}

/* In-panel series sub-header ("Series One:" / "Series Two:") — field-label size, bold. */
.options .series-header {
  font-size: 13px;
  font-weight: 700;
  color: #1a1c20;
  margin: 10px 0 6px 0;
}

/* Refine sub-header ("Refine by Demographic Group (Optional):") — same 15px/700 size as
   "Mode Options:" (.mode-header), preceded by a divider rule to set the refine controls
   apart from the breakdown above. */
.options .refine-header {
  font-size: 15px;
  font-weight: 700;
  color: #1a1c20;
  margin: 14px 0 6px 0;
  padding-top: 14px;
  border-top: 1px solid #d9d2c5;
}

/* Keep every control's text (dropdown values, radio & checkbox labels) at one size, so
   they don't dwarf the 13px field labels. Field labels / headers set their own size and
   win over this cascade. */
.options {
  font-size: 13px;
}

.options .Select-control,
.options .Select-menu-outer,
#chart_type .Select-control,
#chart_type .Select-menu-outer {
  font-size: 13px;
}

/* The chart-type dropdown sits outside .options (its own grid area), so match its text to
   the sidebar dropdowns for one consistent dropdown size across the whole control area. */
#chart_type {
  font-size: 13px;
}

/* The sidebar is narrow, but several fields carry fixed pixel widths from the original
   wide layout. Constrain every field wrapper + control to the column width so nothing
   overflows the sidebar (min-width:0 lets flex/grid children actually shrink). */
.options > div,
.options .dash-dropdown,
.options .Select {
  max-width: 100%;
  min-width: 0 !important;
  box-sizing: border-box;
}

/* Date pickers are the one control that needs its natural width; let them wrap instead
   of forcing the column wider. */
.options .DateInput,
.options .DateInput_1 {
  width: 105px;
}

/* The chart-type dropdown occupies the grid 'dropdown' area (was per-group ids in the
   original; the refactor uses a single #chart_type dropdown). */
#chart_type {
  padding: 0 15px;
  grid-area: dropdown;
  width: 100%;
  box-sizing: border-box;
  display: inline-block;
}

.row {
  width: 100%;
}

.two-columns {
  margin-right: 20px;
}

.options {
  vertical-align: top;
  padding: 0 15px;
  grid-area: options;
  display: inline-block;
}

.dataviz {
  vertical-align: top;
  padding: 15px;
  grid-area: dataviz;
  display: inline-block;
}

.DateInput_input {
  font-family: "Greycliff", Arial, Helvetica, sans-serif;
  font-size: 1em;
}

.DateInput, .DateInput_1 {
  width: 115px;
}

/* --- Description / info boxes below the chart (blue border, rounded) ---
   Normal block flow (no float) + border-box so each box hugs its content and
   grows/shrinks with the text and the viewport width. */
.info-block {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  overflow: hidden;
  border: 2px solid #4b5d77;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.download-button {
  font-family: "Greycliff", Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #ffffff;
  background-color: #028580;
  border: 1px solid #028580;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
}

.download-button:hover {
  background-color: #016b67;
  border-color: #016b67;
}

/* --- Responsive: collapse the grid to a single column on narrow screens --- */
@media only screen and (max-width: 980px) {
  .container {
    display: grid;
    grid-template-areas:
      'dataviz'
      'title'
      'dropdown'
      'options';
    grid-template-rows: 1fr;
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 390px) {
  .container .dataviz {
    width: 380px;
    margin-left: -52px;
  }

  .container .info-block {
    width: 260px;
    margin: 20px 0 0 40px;
  }

  .annotation-text[style] {
    font-size: 16px !important;
  }

  .annotation-text[style] > tspan {
    font-size: 12px;
  }

  .modebar-container[style] {
    position: absolute;
    top: 0px;
    left: -50px;
    width: 100%;
  }

  .js-plotly-plot .plot-container.plotly .main-svg {
    top: 30px;
  }

  .Select-control {
    max-width: 295px;
    margin: 0 0 0 -10px;
  }

  g.g-ytitle {
    transform: translate(15px, 0px);
  }

  .options .row[style] {
    display: block !important;
  }

  .two-columns[style] {
    width: 100% !important;
  }

  .two-columns[style] h3 {
    text-align: center;
  }

  .two-columns[style] input {
    text-align: center;
  }
}
