/* Shared styles for Telerik (Kendo UI) charts. See wwwroot/js/telerik-charts.js */

/* Container for the chart, download button and credits */
.telerik-chart {
    position: relative;
    background-color: #fff;
}

/* Kendo's "No data available" box has z-index 10000, so it covered the site's sticky menu (1030)
   when scrolling. Keep it just above the chart instead. */
.k-chart-overlay {
    z-index: 1;
}

/* Download button, top right */
.rc-chart-export {
    position: absolute;
    top: 4px;
    right: 10px;
    z-index: 2;
}

.rc-chart-export-toggle {
    padding: 2px 4px;
    line-height: 1;
}

    .rc-chart-export-toggle img {
        display: block;
    }

/* Line above the chart (12px, gray, centered), e.g. "(IPOs ≥ $50mm Mkt Cap)" */
.rc-chart-subtitle {
    padding: 8px 40px 0;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Clickable source line under the chart (14px, gray) */
.rc-chart-credits {
    padding: 4px 0 8px;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #999;
    text-align: center;
}

    .rc-chart-credits a {
        color: #999;
    }

@media (max-width: 479.98px) {
    .rc-chart-credits {
        font-size: 10px;
    }
}

/* Range buttons (1m, 3m, ... All), top left */
.rc-range-selector {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    /* Leave room for the download button */
    max-width: calc(100% - 60px);
}

.rc-range-button {
    padding: 1px 6px;
    border: 0;
    border-radius: 2px;
    box-shadow: none;
    background: #f7f7f7;
    color: #333;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 16px;
}

    .rc-range-button:hover {
        background: #e6e6e6;
    }

    .rc-range-button.active {
        background: #e6ebf5;
        color: #000;
        font-weight: bold;
    }

    /* Range longer than the data (disabled button) */
    .rc-range-button:disabled {
        background: #f7f7f7;
        color: #ccc;
        cursor: default;
    }

/* Title above a chart (14px, dark gray) */
.rc-chart-title {
    padding: 6px 40px 0;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #333;
    text-align: center;
}

/* With a title, the range buttons go below it */
.rc-chart-title ~ .rc-range-selector {
    top: 30px;
}

/* Link in place of the credits line, e.g. "Our ETF tracks the IPO Index" (12px, blue) */
.rc-chart-note {
    padding: 4px 0 8px;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
    font-size: 12px;
    text-align: center;
}

    .rc-chart-note a {
        color: #1485cc;
    }

/* Pie slices can be clicked (see togglePieSlice in telerik-charts.js) */
.k-chart.rc-pie-chart path {
    cursor: pointer;
}

.rc-tooltip-header {
    font-size: .8em;
}

/* Tooltips: white. !important is needed because Kendo sets the point color as an inline style. */
.k-chart-tooltip {
    /* Let the mouse pass through, so the tooltip never blocks moving along the chart */
    pointer-events: none;
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}

/* Mail charts (/charts/mail/*, photographed into PNGs for emails, Puppeteer window 506 x 243): the chart fills
   the window, with the "Source" line over its bottom margin */
.rc-mail-chart {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    background-color: #fff;
}

    .rc-mail-chart .k-chart {
        height: 100%;
    }

/* Credits line: 9px, gray, centered at the bottom */
.rc-mail-credits {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0 0 2px;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
    font-size: 9px;
    line-height: 12px;
    text-align: center;
}

    .rc-mail-credits a {
        color: #999;
        text-decoration: none;
    }

/* Mail industry pie (_TelerikMailPieChartPV), sized for 506 x 243 */
.rc-mail-title {
    position: absolute;
    top: 8px;
    right: 0;
    left: 0;
    font: bold 13px/15px arial, helvetica, clean, sans-serif;
    color: #333;
    text-align: center;
}

/* Left half of the window, so the pie is centered at 25% of the width; 155px tall at 506 x 243 */
.rc-mail-pie-plot {
    position: absolute;
    top: 46px;
    bottom: 42px;
    left: 0;
    width: 50%;
}

/* Boxed legend centered 100px right of and 10px below the middle of the window */
.rc-mail-pie-legend {
    position: absolute;
    top: calc(50% + 10px);
    left: calc(50% + 100px);
    transform: translate(-50%, -50%);
    width: 178px;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #d1d5e2;
    background-color: #fff;
    font: 12px/14px Arial, sans-serif;
    color: #333;
    white-space: nowrap;
}

/* 16px per line */
.rc-mail-pie-legend-item {
    padding: 1px 0;
}

.rc-mail-pie-legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    border-radius: 50%;
    vertical-align: -1px;
}

/* Mail index charts (_TelerikMailIndexChartPV): title and legend float over the top of the plot */
.rc-mail-index .rc-mail-title,
.rc-mail-index-legend {
    z-index: 1;
}

/* Floating legend (lower with ?title=short) */
.rc-mail-index-legend {
    position: absolute;
    top: 38px;
    right: 0;
    left: 0;
    font: 11px/14px "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
    color: #333;
    text-align: center;
    pointer-events: none;
}

.rc-mail-index--short-title .rc-mail-index-legend {
    top: 53px;
}

.rc-mail-index-legend-item + .rc-mail-index-legend-item {
    margin-left: 20px;
}

/* Line symbol: 16px wide, 2px thick, 5px before the text */
.rc-mail-index-legend-line {
    display: inline-block;
    width: 16px;
    height: 2px;
    margin-right: 5px;
    vertical-align: 3px;
}
