/**
 * Maine.gov Sliver Component
 * Global header with logo, links, and Google Translate
 * Provided by: me_drupal_module_sliver module
 * Note: When changing the background-color, make sure to update the
 * background-color settings in 'src/Form/MeDrupalModuleSliverSettingsForm.php'.
 */

.block-me-drupal-module-sliver,
.block--region-sliver {
  /* State of Maine Variables */
  --som-navy-blue: #02253b;
  --som-white: #ffffff;
  --som-light-gray: #f8f9fa;
  --som-border-light: #e2e2e2;
  --som-text-light: rgba(255, 255, 255, 0.9);

  /* Sliver-specific Variables */
  --sliver-font-family: var(--font-family-primary, "Gelica", sans-serif);
  --sliver-font-size: 0.875rem;
  --sliver-min-height: 2.75rem; /* 44px */
  --sliver-padding: 0.5rem;
  --sliver-gap: 0.5rem;
  --sliver-max-width: 80rem; /* 1280px */

  background-color: var(--som-navy-blue);
}

/* Mobile: Hide utility bar */
@media (max-width: 979px) {
  .block-me-drupal-module-sliver,
  .block--region-sliver {
    display: none;
  }
}

.maine__sliver-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--sliver-font-family);
  padding-inline: 1rem;
  max-width: var(--sliver-max-width);
  margin: 0 auto;
  min-height: var(--sliver-min-height);
}

/* Logo */
.maine__sliver-logo {
  flex-shrink: 0;
}

.maine__sliver-logo a {
  display: block;
  min-width: var(--sliver-min-height);
  min-height: var(--sliver-min-height);
  padding: var(--sliver-padding);
}

.maine__sliver-logo img {
  display: block;
  min-width: 6.25rem; /* 100px */
  height: auto;
}

/* Navigation Links */
.maine__sliver-links {
  flex-grow: 1;
}

.maine__sliver-nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.maine__sliver-nav-item {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.maine__sliver-nav-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.maine__sliver-nav-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.maine__sliver-nav-item:not(:last-child)::after {
  content: '|';
  color: var(--som-text-light);
  margin-left: var(--sliver-gap);
  margin-right: var(--sliver-gap);
  font-family: var(--sliver-font-family);
  font-size: var(--sliver-font-size);
}

.maine__sliver-nav-item a {
  display: inline-flex;
  align-items: center;
  min-height: var(--sliver-min-height);
  padding: var(--sliver-padding) 0.75rem;
  text-decoration: none;
  color: var(--som-white);
  font-family: var(--sliver-font-family);
  font-size: var(--sliver-font-size);
  gap: 0.25rem;
}

.maine__sliver-nav-item a:hover,
.maine__sliver-nav-item a:focus {
  text-decoration: underline;
  color: var(--som-white);
}

/* Google Translate */
.maine__sliver-translate {
  margin-left: auto;
}

/* Google Translate Widget Component */
#google_translate_element {
  text-align: end;
}

.goog-te-gadget-simple {
  display: block !important;
  border: none !important;
  background: unset !important;
  padding: 0 !important;
  cursor: default !important;
}

.goog-te-gadget-simple .goog-te-gadget-icon {
  display: none !important;
}

.goog-te-gadget img {
  display: inline-block;
  vertical-align: middle;
}

.goog-te-gadget-simple > span {
  display: flex;
  align-items: center;
}

.goog-te-gadget-simple > span::before {
  content: ' ';
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  background-image: url('../assets/globe-icon.svg');
  background-size: cover;
  background-repeat: no-repeat;
  vertical-align: middle;
}

.goog-te-gadget a {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px !important;
  padding: 0.5rem 0.75rem !important;
  text-decoration: none !important;
  color: white !important;
}

.goog-te-gadget a:hover > span {
  text-decoration: underline !important;
}

.goog-te-gadget-simple a span {
  font-family: var(--font-family-primary, "Gelica", sans-serif) !important;
  color: white !important;
  font-size: 1rem !important;
  vertical-align: middle;
  margin-inline-end: 5px;
  border: 0 !important;
}

.goog-te-gadget-simple a span[aria-hidden='true'] {
  position: relative !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  font-size: 0 !important;
  color: transparent !important;
}

.goog-te-gadget-simple a span[aria-hidden='true']::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border-right: 3px solid white;
  border-bottom: 3px solid white;
  transform: translateY(-45%) rotate(45deg);
  transform-origin: 25% 75%;
  vertical-align: middle;
  margin-left: 0.25rem;
}

/* Hide Google Translate divider */
.goog-te-gadget span[style*="border-left"],
.goog-te-gadget-simple span[style*="border-left"] {
  display: none !important;
}

@media screen and (max-width: 768px) {
  #google_translate_element {
    text-align: center;
    margin-bottom: 1rem;
  }

  .goog-te-gadget-simple > span {
    justify-content: center;
  }
}
