/* ===========================
   Base
   =========================== */
:root {
	--nisra_blue: #3878c5;
	--nisra_navy: #00205b;
	--nisra_purple: #732777;
  --nisra_slate: #3b3b3b;
  --nisra_green: #68a41e;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;           /* better readability than 1.0 */
  font-weight: 400;
}

/* ===========================
   Sticky footer layout
   Makes footer sit at bottom when page content is short.
   Body is a column flex container; direct .container or main grows.
   =========================== */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Make the main content area expand to fill available space.
   Targets direct children commonly used as page containers. */
body > main,
body > .container,
body > .content {
  flex: 1 0 auto;
}

/* Headings per style guide */
h1 { font-size: 3rem; line-height: 1.285; font-weight: 700; }
@media (min-width: 1200px) { h1 { font-size: 3rem !important; line-height: 1.3;} }

h2 { font-size: 24px; line-height: 1.333; font-weight: 400; }
@media (min-width: 992px) { h2 { font-size: 25px; line-height: 1.32; } }

h3 { font-size: 21px; line-height: 1.143; font-weight: 400; }
@media (min-width: 992px) { h3 { font-size: 24px; line-height: 1.25; } }

h4 { font-size: 18px; line-height: 1.333; font-weight: 400; }
@media (min-width: 992px) { h4 { font-size: 21px; line-height: 1.286; } }

/* Page background (main content area) */
main { 
  background-color: #f2f5f8;
  min-height: 100vh;
 }

/* External link indicator (scope to main so footer links aren’t doubled) */
main a[target="_blank"]::after {
  content: "";
  width: 14px; height: 11px;
  margin: 5px; vertical-align: text-bottom; display: inline-block;

  /* Use the SVG as a mask; then color it with Bootstrap’s variable */
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="11" viewBox="0 0 14 11"><g fill="none" stroke="%23000" stroke-width="1"><path d="M0 3h2V0h12v8h-2v3H0zm13-2H3v6h10zM2 4H1v4h1zm-1 6h10V8H1z"/></g></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="11" viewBox="0 0 14 11"><g fill="none" stroke="%23000" stroke-width="1"><path d="M0 3h2V0h12v8h-2v3H0zm13-2H3v6h10zM2 4H1v4h1zm-1 6h10V8H1z"/></g></svg>') no-repeat center / contain;
  background-color: var(--bs-secondary-color, #6c757d); /* follows Bootstrap’s text-secondary */
}



/* ===========================
   Sidebar / Offcanvas
   =========================== */
.sidebar { background-color: #e5e5e5; }

/* Mobile/tablet width (Bootstrap offcanvas var) */
.sidebar.offcanvas { --bs-offcanvas-width: 320px; }

/* Desktop (≥992px): make offcanvas behave like static panel */
@media (min-width: 992px) {
  #sidebar.offcanvas-lg {
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    border-right: 1px solid var(--bs-border-color);
    background-color: transparent;
    box-shadow: none;
    height: 100%;
  }
  #sidebar.offcanvas-lg .offcanvas-body {
    display: block;          /* override Bootstrap flex to stack children */
    height: auto;
    max-height: none;
    overflow: visible;
  }
  #sidebar.offcanvas-lg .offcanvas-body > * { width: 100%; }
}

/* Disable offcanvas animation only when body has .offcanvas-no-anim */
.offcanvas-no-anim .offcanvas,
.offcanvas-no-anim .offcanvas-backdrop {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .offcanvas,
  .offcanvas-backdrop {
    transition: none !important;
    animation: none !important;
  }
}

/* Sidebar form widths (scoped; won’t affect forms elsewhere) */
.sidebar label,
.sidebar select { width: 100%; }

/* ===========================
   Global search overlay (inside sidebar)
   =========================== */
.sidebar-search { position: relative; }
#global-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 2000;
  max-height: 50vh;
  overflow: auto;
  display: none;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}
.sidebar-search.has-results #global-search-results { display: block; }
#global-search-results .list-group-item {
  border: 0;
  border-bottom: 1px solid var(--bs-border-color);
}
#global-search-results .list-group-item:last-child { border-bottom: 0; }

/* ===========================
   Map & Legend
   =========================== */
.map {
  height: 220px;         /* mobile default */
  width: 100%;
  position: relative;
  z-index: 0;
  margin-bottom: 2px;
}
@media (min-width: 768px) { .map { height: 410px; } }

.map-legend {
  padding-bottom: 10px;
  z-index: 1;
  margin: 0 auto;        /* center horizontally */
  display: table;
}
.legend-min,
.legend-unit,
.legend-max {
  width: 33%;
  font-size: 10pt;
  padding: 0;
}
.legend-min,
.legend-max { font-weight: bold; }
.legend-max { text-align: right; }
.legend-unit { text-align: center; }

.colour-block {
  height: 25px;
  width: 20%;
  border-left: 1px #555555 solid;
  border-top: 1px #555555 solid;
  border-bottom: 1px #555555 solid;
}
.colour-block:last-child { border-right: 1px #555555 solid; }

/* Map container min height for small vs large screens */
#map-container { min-height: 320px; }
@media (min-width: 992px) { #map-container { min-height: 420px; } }

/* ===========================
   Chart sizing
   =========================== */
#capture .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#capture .card > #map-capture,
#capture .card > #chart-capture {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

#chart-container {
  height: 410px;          /* desktop/tablet */
  position: relative;
  margin-top: 0.75rem;
  margin-bottom: 0;
}
@media (max-width: 767.98px) { #chart-container { height: 220px; } }

/* Make Chart.js canvas fill container’s fixed height */
#chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ===========================
   Brand & misc.
   =========================== */
.app-title { font-weight: 700; letter-spacing: 0.2px; }
.img-50 { width: 50px; height: 50px; }

/* Clear, consistent focus style for keyboard users */
:focus-visible {
  outline: 3px solid #D4351C !important;      /* high-contrast colour */
  outline-offset: 3px !important;
}

input:focus-visible, select:focus-visible, button:focus-visible, .map:has(canvas:focus-visible) {
  outline: 3px solid #D4351C !important;
  outline-offset: 3px !important;
  box-shadow: none !important;
}

main:focus-visible {
  outline: none !important;
}

/* ===========================
   Footer
   =========================== */
.footer {
  background-color: var(--nisra_navy);
  color: #fff;
  border-top: 4px solid var(--nisra_blue);
}
.footer a {
  color: #fff;
  text-underline-offset: 3px;
}
.footer a:hover,
.footer a:focus {
  color: #fff;
  text-decoration-thickness: 3px;
}
.footer-links { list-style: none; padding-left: 0; }
.footer-links .list-inline-item { margin: 0 .5rem; }

/* More vertical spacing in vertical lists */
.footer ul.list-unstyled li { margin-bottom: 0.5rem; }

/* Social icon hover */
.footer .list-inline-item img {
  transition: box-shadow 0.2s ease, border 0.2s ease;
}
.footer .list-inline-item img:hover {
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
  border-radius: 4px;
}

nav a {
  color: #fff;
}

nav a[target="_blank"]::after {
  content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="11" viewBox="0 0 14 11"><g fill="none" stroke="white" stroke-width="1"><path d="M0 3h2V0h12v8h-2v3H0zm13-2H3v6h10zM2 4H1v4h1zm-1 6h10V8H1z"/></g></svg>');
  display: inline-block;
  width: 14px;
  height: 11px;
  margin: 0 5px 0 5px;
  vertical-align: text-top;
}

table tr:not(:has(th)):hover {
  background-color: #f2f2f2;
}

.maplibregl-export-control {
  display: none !important;
}

.btn-primary {
  background-color: var(--nisra_purple);
  border-color: var(--nisra_purple);
  color: #fff
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #5c636a;
  border-color: #5c636a;
}

.sidebar-header {
  background-color: var(--nisra_blue);
  color: #fff;
  font-weight: normal;
  display: flex;
  align-items: center;

}

.i-button {
  height: 0.75em;
  margin-left: 0.25em;
  margin-bottom: 0.25em;
  cursor: pointer;

}

#cookie-banner {
	top: 0;
	left: 0;
	width: 100%;
	background-color:#142062;
	color:#FFF;
	padding: 10px;
	text-align: left;
    display: none;
}

.cookies-infobar {
    color: #fff;
    width: 100%;
    left: 0;
    right: 0;
    top: 0;
    padding: 10px;
    text-align: left;
}

.cookies-infobar.cookies-infobar_accepted {
    display: none;
}

.cookies-infobar_wrapper {
    margin: 10px;
}

.cookies-infobar a {
    color: inherit;
}

.cookies-infobar_btn {
  display: inline-block;
  padding: 5px 10px;
  background: #0f8243;
  text-decoration: none;
  color: #fff;
  text-transform: none;
  font-size: 1.2em;
}

a.cookies-infobar_btn, a.cookies-infobar_btn_reject {
	color: #fff !important;
}

a.cookiesbarlink {
    color: #2990FF;
}

.cookies-infobar_btn_reject {
  display: inline-block;
  padding: 5px 10px;
  background: #6d6e72;
  text-decoration: none;
  border-radius: 3px;
  color: #fff;
  text-transform: none;
  font-size: 1.2em;
}

.breadcrumb {
  color: #687178
}

.bg-navy {
  background-color: var(--nisra_navy);
}

.bg-blue {
  background-color: var(--nisra_blue);
}

.bg-green {
  background-color: var(--nisra_green);
}

.h-16px {
  height: 16px;
}

a:hover,
a:focus {
  text-decoration-thickness: 3px;
}
