/* Quick reset of all elements */
* {
  margin: 0;
  padding: 0;
}

/* ── WCAG 2.4.1 Skip Navigation Link ──────────────────────────────────────
   Visually hidden until focused via keyboard tab. Slides down from behind
   the sticky header on focus. tabindex="-1" on #main-content moves actual
   keyboard focus into the page without adding it to the tab order.
   ───────────────────────────────────────────────────────────────────────── */
.skip-to-content {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 10000;

  display: inline-block;
  padding: 12px 28px;
  background-color: var(--green-accent);
  color: #ffffff;
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.skip-to-content:focus {
  transform: translateX(-50%) translateY(0);
  outline: none;
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 6px var(--green-accent);
}

#main-content:focus {
  outline: none;
}

/* Color variables for future use */
:root {
  --primary-background: #ffffff;
  --secondary-background: #bbdabd;
  --banner-background: var(--green-accent);
  --primary-text: #2f3335;
  --secondary-text: #f3f3f3;
  --green-accent: #356901;
  --hero-background: #f3f3f3;
  --button-color: #006699;
}

html {
  background-color: var(--primary-background);
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  color: var(--primary-text);
  font-size: 18px;
}

/*container where the hero image normally goes, overlaid by title and subtitle*/
.heroContainer {
  background-color: var(--hero-background);
  padding: 60px 20px;
  text-align: center;
  position: relative;
}
.heroContainer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  box-shadow: 0px -2px 4px rgba(0, 0, 0, 0.15);
}

/*Page titling matching Sustainability*/
h1 {
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  color: var(--primary-text);
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.2;
}

h2 {
  font-family: inherit;
  color: var(--green-accent);
}
/* Subtitle style for all pages */
.subtitle {
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  color: rgb(35, 31, 32);
  font-size: 20px;
  line-height: 26px;
  text-align: center;
  letter-spacing: 0.05em;
}
body {
  background-color: var(--primary-background);
  min-height: 100vh;
  color: black;
  box-sizing: border-box;
  padding: 0px;
  margin: 0px;
}

/* Main header CSS 
   The desktop formatting will remain in the top section
   The mobile version will exist below that, the beginning of which will be marked by a comment */

/* Desktop header CSS */
header {
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15);
}

/* Matches Sustainability's 1210px container inside a 1310px outer wrap */
.header-inner {
  max-width: 1210px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
}
.header-logo img {
  height: 100px;
  width: auto;
}

#header_main {
  background-color: #ffffff;
  height: 100px;
}

#header_meta {
  background-color: #336600;
  height: 30px;
  border-bottom: 1px solid #2a5401;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
}

/* Right-align links to the edge of the 1210px inner container */
#header_meta .header-inner {
  justify-content: flex-end;
}

#header_meta .sub_menu {
  display: flex;
  justify-content: flex-end;
  padding: 0; /* no extra padding, header-inner handles centering */
}

#header_meta .sub_menu ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

#header_meta .sub_menu li {
  line-height: 30px;
}

#header_meta .sub_menu li:last-child {
  border-right: none;
}

/*contents of upper nav bar*/
#header_meta .sub_menu a {
  display: flex;
  align-items: center;
  height: 28px;
  line-height: 23px;
  padding: 0 13px;
  font-size: 12px;
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 400;
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -3px;
  transition: all 0.15s ease-in-out;
}

#header_meta .sub_menu a:hover {
  border-bottom: 2px solid #ffffff;
  transition: all 0.2s ease-in-out;
}

#header_main nav {
  display: flex;
  gap: 20px;
  align-items: stretch;
  padding-right: 15px;
  height: 100%;
}

#header_main .header-inner {
  justify-content: flex-end;
}

/*contents of lower nav bar*/
#header_main nav > a {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 5px;
  text-decoration: none;
  font-size: 12px;
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  color: #424242;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease-in-out;
}

#header_main nav > a:hover {
  border-bottom: 2px solid var(--green-accent);
  color: var(--green-accent);
  transition: all 0.2s ease-in-out;
}

#header_main nav > a.here {
  font-weight: bold;
  border-bottom: 2px solid var(--green-accent);
  color: var(--green-accent);
}

/* Hide mobile-only elements */
.mobile-controls {
  display: none;
}

.mobile-nav {
  display: none;
}

.mobile-utility-links {
  display: none;
}

.mobile-main-links {
  display: none;
}
/* End of desktop header block */

/* Start of mobile header block */

@media (max-width: 768px) {
  /* Hide desktop-only elements of header */
  header {
    position: static;
    height: 75px;
  }

  #header_meta {
    display: none;
  }
  #header_main .desktop-nav {
    display: none;
  }

  #header_main nav.desktop-nav {
    display: none;
  }

  /* Shrink main bar to mobile height */
  #header-main {
    min-height: 75px;
    height: 75px;
    overflow: visible;
  }

  .header-logo img {
    height: 75px;
  }

  /* Show the hamburger on mobile */
  .mobile-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-right: 15px;
  }

  /* Hamburger button */
  .hamburger {
    background: #336600;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 75px;
    min-height: 75px;
    align-items: center;
    justify-content: center;
  }

  .hamburger span {
    display: block;
    width: 30px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
  }

  /* Hamburger to X for dropdown animation */
  .hamburger.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Mobile Dropdown Menu */
  @keyframes slideDown {
    from {
      max-height: 0;
    }
    to {
      max-height: 500px;
    }
  }

  @keyframes slideUp {
    from {
      max-height: 500px;
    }
    to {
      max-height: 0;
    }
  }

  #header_main .mobile-nav {
    height: auto;
    flex-direction: column;
    position: absolute;
    top: 75px;
    left: auto;
    right: 0;
    z-index: 999;
    max-height: 0;
    width: 50%;
    gap: 0;
    overflow: hidden;
    animation: slideUp 0.3s ease-in-out forwards;
    box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.1);
  }

  #header_main .mobile-nav.open {
    max-height: 500px;
    animation: slideDown 0.3s ease-in-out forwards;
  }

  /* Main Nav Links for Mobile Dropdown */
  .mobile-nav > a {
    padding: 14px 20px;
    text-decoration: none;
    font-size: 14px;
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #424242;
    border-left: 3px solid transparent;
    transition:
      background 0.15s,
      border-color 0.15s,
      color 0.15s;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .mobile-nav > a:hover,
  .mobile-nav > a.here {
    background: #f2f7ee;
    border-left-color: var(--green-accent, #336600);
    color: var(--green-accent, #336600);
  }

  /* All Nav Links for Mobile Dropdown */
  .mobile-nav.open .mobile-utility-links,
  .mobile-nav.open .mobile-main-links {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .mobile-nav.open .mobile-utility-links a,
  .mobile-nav.open .mobile-main-links a {
    display: flex;
    width: 100%;
    box-sizing: border-box;
  }

  /* Utility Nav Links for Mobile Dropdown */
  .mobile-utility-links {
    background: #336600;
    padding: 0;
  }

  .mobile-utility-links a {
    padding: 10px 20px;
    font-size: 12px;
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    color: #d4eac4;
    text-decoration: none;
    min-height: 48px;
    display: flex;
    align-items: center;
    transition:
      background 0.15s,
      color 0.15s;
  }

  .mobile-utility-links a:hover {
    background: #2a5401;
    color: #fff;
  }

  /* Main Nav Links for Mobile */
  .mobile-main-links {
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .mobile-main-links a {
    padding: 14px 20px;
    font-size: 14px;
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #424242;
    text-decoration: none;
    border-left: 3px solid transparent;
    border-bottom: none;
    min-height: 48px;
    display: flex;
    align-items: center;
    transition:
      background 0.15s,
      border-color 0.15s,
      color 0.15s;
    box-sizing: border-box;
    width: 100%;
  }

  .mobile-main-links a:hover,
  .mobile-main-links a.here {
    background: #f2f7ee;
    border-left-color: var(--green-accent, #336600);
    color: var(--green-accent, #336600);
    border-bottom: none;
  }
}

/* End of mobile header block */

/* End of header block */

#title {
  text-align: center;
  margin: 20px;
}

.pageDescription {
  text-align: center;
  margin: 2rem auto;
  max-width: 700px;
  padding: 0 1.5rem;
}
/*Filter and sort controls container*/
.controls {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(---button-color);
  border-radius: 8px;
  margin: 20px auto;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}

.controls label {
  font-weight: 600;
  color: var(--primary-text);
}

.controls select,
.controls button {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
select {
  font-family: inherit;
}

.controls select:hover,
.controls select:focus-visible {
  border-color: var(--green-accent);
  outline: 3px solid var(--green-accent);
  outline-offset: 2px;
}

.controls button {
  background-color: var(--button-color);
  font-family: inherit;
  color: white;
  border: none;
  font-weight: 600;
}

.controls button:hover {
  background-color: #2a5401;
  transform: translateY(-1px);
}

.controls button:focus-visible {
  outline: 3px solid var(--green-accent);
  outline-offset: 2px;
  background-color: #2a5401;
}

/* tag filtering panel used in compare and tableview pages */
.tag-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tag-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.tag-filter-toggle.is-active {
  background-color: #2a5401;
}

.tag-filter-count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.tag-filter-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  max-width: min(360px, 88vw);
  background: #fff;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 120;
}

.tag-filter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.tag-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #2f3335;
  justify-content: flex-start;
}

.tag-filter-option-text {
  text-transform: capitalize;
}

.tag-filter-option-input {
  flex: 0 0 24px; /*stops box from shrinking next to long strings*/
  width: 24px;
  height: 24px;
  accent-color: #2a7a2a;
}

.tag-filter-option-input.is-exclude {
  accent-color: #c62828;
}

.tag-filter-footer {
  display: flex;
  justify-content: flex-end;
}

.tag-filter-clear {
  background: #f5f5f5;
  color: #2f3335;
  border: 1px solid #d0d0d0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 15px;
}

.tag-filter-clear:hover {
  background: #ebebeb;
}

/*Calendar Dropdown (shared by compare and tableview*/
.calendar-dropdown {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-right: 1em;
}
.calendar-toggle {
  padding: 6px 12px;
  background: (var(--primary-background));
  color: #444;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
.calendar-toggle:hover {
  background: #e9ecef;
  border-color: #aaa;
}

.calendar-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.calendar-year {
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

.calendar-nav {
  box-sizing: border-box;
  min-width: 24px;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.calendar-nav:hover:not(:disabled) {
  background: #f0f0f0;
  border-color: #0066cc;
  color: #0066cc;
}
.calendar-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cal-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cal-arrow {
  box-sizing: border-box;
  min-width: 24px;
  min-height: 24px;
  background: none;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 1.2rem;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
  color: inherit;
}

.cal-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.calendar-tile {
  padding: 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-tile:hover:not(.disabled) {
  border-color: #0066cc;
  background: #f0f7ff;
}
.calendar-tile.selected {
  background: var(--green-accent);
  color: #fff;
}
.calendar-tile.disabled {
  background: #f5f5f5;
  color: #ccc;
  cursor: not-allowed;
  border-color: #e0e0e0;
}

/* --- Shared tooltip styles --- */

.tt {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  line-height: 1;
}

.tt-bubble {
  position: absolute;
  left: 50%;
  bottom: 140%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  background: #222;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.tt-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #222;
}

.tt:hover .tt-bubble,
.tt:focus .tt-bubble,
.tt:focus-within .tt-bubble {
  opacity: 1;
  visibility: visible;
}

.tt.tt-esc .tt-bubble {
  opacity: 0 !important;
  visibility: hidden !important;
}

.euiTip {
  position: relative;
  display: inline-block;
  min-width: 24px;
  min-height: 24px;
}

.euiTipIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  box-sizing: border-box;
  border-radius: 50%;
  background-color: var(--green-accent);
  border: 2px solid var(--green-accent);
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 5px;
  margin-right: 6px;
}

.euiTipBox {
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  white-space: normal;
  text-align: center;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  border: 3px solid var(--green-accent);
  color: var(--primary-text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

/* Downward arrow — outer (border color) */
.euiTipBox::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--green-accent);
}

/* Downward arrow — inner (fill color) */
.euiTipBox::after {
  content: "";
  position: absolute;
  top: calc(100% - 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ffffff;
}

.euiTip:hover .euiTipBox,
.euiTip:focus-within .euiTipBox {
  opacity: 1;
  visibility: visible;
}

.euiTip.tt-esc .euiTipBox {
  opacity: 0 !important;
  visibility: hidden !important;
}

.fa-sun {
  color: #d38819;
}

.data-error-banner {
  display: none;
  background-color: #fdf0f0;
  border: 2px solid #c62828;
  border-radius: 6px;
  color: #7a1a1a;
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem auto;
  max-width: 700px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.data-error-banner.visible {
  display: block;
}

#loadingOverlay {
  position: fixed;
  inset: 0;
  background: white;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-size: 3rem;
  color: #f5a623;
}
