:root {
    --link-color: rgb(85, 160, 186);
    --default-alignment: center;
    --body-text-color: rgb(28, 28, 28);
    /* It would be nice to add the responsive widths as variables,
       but variables don't propagate into @media selector blocks (?).
       So just be careful to manually keep these widths consistent throughout the styles.
    --width-sm: 768px
    --width-md: 980px
    --width-lg: 1600px
     */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.66;
    text-align: var(--default-alignment);
    color: var(--body-text-color);
    margin: 0 28px;
    padding: 0;
}

.page-container {
    width: 100%;
    margin: 0 0 3rem 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Lora", serif;
    font-weight: 700;
    color: rgb(219, 4, 4)
}

h1 {
    font-size: 2.8rem;
    margin-block-start: 3rem;
    margin-block-end: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-block-start: 4.6rem;
    margin-block-end: 0.7rem;
}

#background h2 {
    margin-block-start: 3.8rem;
}

h3 {
    font-size: 1.1rem;
    margin-block-start: 4.2rem;
    margin-block-end: 0.5rem;
    font-weight: 500;
    text-align: start;
}

#background h3 {
    margin-block-start: 1.8rem;
    text-align: start;
}

/* Should links be black, or red, or default? */
a {
    color: var(--link-color);
    /*color: rgb(219, 4, 4);*/
}

strong {
    font-weight: 500;
}

.img-wrapper {
    width: 100%;
    overflow: hidden;
    border: 1px solid rgb(145, 145, 145);
}

@media (min-width: 768px) {
    .img-wrapper {
        height: 300px;
    }
}

.img-wrapper img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom;
}

.hover-container {
    position: relative;
    cursor: pointer;
    color: var(--link-color);
}

.hover-content {
    display: none;
    position: absolute;
    top: 1.2em;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-width: min(360px, calc(100vw - 2rem));
    width: max-content;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    z-index: 1000;
    text-align: left;
    font-size: 0.9em;
    color: var(--body-text-color);
}

.hover-container:hover .hover-content {
    display: block;
}

p {
    margin-top: 0.5rem;
    text-align: justify;
}

p.font-large {
    font-size: 1.4rem;
    line-height: 1.3;
    text-align: var(--default-alignment);
    margin-block-end: 0.67rem;
}

/* This isn't used. Medium text should just follow the global defaults.
.font-medium {

}
*/

.font-small{
    font-size: 0.9rem;
}

.contaminant {
    text-align: start;
}

p.short,
p.caption {
    text-align: var(--default-alignment);
}

ul {
    text-align: start;
}

#in-page-links-list {
    margin-top: 0.5rem;
}

#in-page-links-list p {
    text-align: var(--default-alignment);
}

#in-page-links-list .link-down {
    display: inline-block;
    margin: 0 0.5rem;
}

/* E.g. "Back to top" links */
a.back-link {
    display: inline-block;
    margin-top: 1.5rem;
}

a.back-link.sub-link {
    /*font-size: 0.9rem;*/
}

.link-arrow {
    margin-left: 4px;
    margin-right: 8px;
    color: var(--link-color);
}

/* The parameter chooser list should be horizontal, with pipes separating items. */
.parameter-chooser ul {
    list-style: none;
    padding: 0;
    margin: 1.2rem auto 0 auto;
    display: flex;
    justify-content: var(--default-alignment);
    gap: 0.5rem;
}

.parameter-chooser ul li:not(:last-child)::after {
    content: "|";
    margin-left: 0.5rem;
    color: rgb(145, 145, 145);
}

.parameter {
    text-align: left;
}

.visualization-container {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    align-self: start;
}


.visualization-container:has(canvas)
/* .visualization-container:has(.js-plotly-plot) */
{
    background-color: rgba(0, 0, 0, 0.02);
    padding: 13px 18px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.chart-canvas-wrapper {
    height: 400px;
    position: relative;
    margin-bottom: 0.6rem;
}

/* Plotly controls its own height via the layout config, so let the wrapper auto-size. */
.chart-canvas-wrapper:has(.js-plotly-plot) {
    height: auto;
}

#metals-by-site-exceedance-chart {
    width: 100%;
}

.chart-title {
    text-align: start;
    font-weight: 500;
    font-size: 90%;
    margin: 0 0 10px 0;
}


.concentration-chart-legend,
.exceedance-chart-legend {
    font-size: 80%;
    border-spacing: 6px 2px;
    text-align: start;
}

.chart-sample-count {
    margin-right: auto;
}

.concentration-chart-legend {
    margin: 12px 0 0 auto;
}

.concentration-legend-container {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
}

.concentration-legend-container .concentration-chart-legend {
    margin: 0;
}

.concentration-legend-container .chart-sample-count {
    font-size: 80%;
    margin-bottom: 6px;
}

.concentration-chart-legend td {
    vertical-align: middle;
    padding-left: 8px;
}

.concentration-chart-legend .chart-legend-symbol {
    text-align: center;
}

.concentration-chart-legend .chart-legend-point {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
}

.concentration-chart-legend .chart-legend-line {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 1px dashed red;
    vertical-align: middle;
}

.concentration-chart-legend .chart-legend-trend-line {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2px solid rgba(0, 0, 0, 0.5);
    vertical-align: middle;
}

.chart-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.chart-legend-vertical {
    display: flex;
    flex-direction: row;
    gap: 16px;
    justify-content: flex-end;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-comment {
    text-align: start;
    font-style: italic;
}

canvas {
    display: block;
    margin: 0 auto 0;
    width: 100%;
}

/* Special handling for map site choosers on 'mobile' width:
   Remove vertical whitespace and make it less than full width. */
@media (max-width: 767px) {
    .column-md-4.visualization-container:has(.map-legend:first-child) {
        margin: -120px 20% 0 20%;
    }
}

.side-nav {
    position: sticky;
    top: 5.7rem;
    align-self: start;
    font-size: 0.9rem;
    line-height: 2.2;
    /*font-family: Lora, serif;*/
}

.side-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 10px 0 0;
}

.side-nav ul ul {
    margin-left: 20px;
    list-style: disc;
    color: var(--link-color);
}

.side-nav ul li a {
    /*text-decoration: none;*/
    /*color: rgb(28, 28, 28);*/
}

.resources { 
    background-color:rgb(219, 4, 4);
    color: rgb(255, 255, 255);
    padding: 2rem;
    margin: 0 -28px;
    display: block;
}

.resources p {
    text-align: center;
}

.resources h2 {
    color: white;
    margin-block-start: 0.7rem;
}

.button-link {
    background-color: white;
    border: none;
    color: rgb(34, 37, 41);
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 8px;
}

/* Shrink the gap between the columns a little, and make use of
  the extra width to expand the map. */
#cadmium-in-sediment-map {
    width: calc(100% + 40px);
    height: 100%;
    margin-left: -40px;
}

#metals-by-site-exceedance-map{
    width: calc(100% + 40px);
    height: 100%;
    margin-left: -40px;
    margin-top: -60px;
}

/* Shift the text down and over top of the map SVG below it */
.map-legend {
    position: relative;
    top: 160px;
    left: -30px;
    display: inline-block;
    font-size: 0.85rem;
    color: rgb(28, 28, 28);
    z-index: 1;
}

/* References section */

ul#references-list li {
    margin: 0 0 1rem 0;
    padding-left: 1rem;
    text-indent: -1rem;
}

.reference-source {
    font-style: italic;
}

/* Footer */

.footer {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    color: rgb(220, 220, 220);
    background-color: rgb(34, 37, 41);
    padding: 1.2rem 2rem;
    margin: 0 -28px;
}

.footer-logo {
    margin-right: 2rem;
}

.footer-logo img {
    max-width: 240px;
    width: 100%;
}

.footer p {
    text-align: center;
    font-size: 0.8rem;
}

.footer-text a {
    color: white;
}

@media (max-width: 767px) {
    .footer {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 2rem;
    }

    .footer-logo {
        order: 1;
        margin-top: 1.5rem;
        margin-right: 0;
    }
}