:root {
  --md-primary-fg-color: #353839;
  --md-primary-fg-color--light: #353839;
  --md-primary-fg-color--dark:  #353839;
}

.md-content {
  --md-typeset-a-color: hsla(231, 48%, 48%, 1);
}

/* Header customizations - using more specific selectors to avoid !important */
.md-header .md-header__inner .md-header__title {
  margin-left: 0.25rem; /* Bring text much closer to logo */
  font-weight: normal; /* Ensure title is not bold */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* Match Material theme font */
  font-size: 0.9rem; /* Reduced font size */
  padding-top: 0.5rem; /* Add top padding to push text down */  
  line-height: 1.5; /* Match body text line height */
}

.md-header .md-header__inner .md-header__title--active {
  margin-left: 0.25rem; /* Make sure the logo and title are properly aligned */
}
 
.md-header .md-header__inner .md-header__button {
  margin-left: 0.25rem; /* Reduce left margin of logo */
  margin-right: 0; /* Remove right margin to bring title closer */
}

/* Reduce overall header padding for tighter layout */
.md-header .md-header__inner {
  padding-left: 0.75rem; /* Reduce left padding */
}

/* Ensure consistent typography across the site */
.md-typeset {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
}

.md-nav__item--active > .md-nav__link {
    font-weight: bold;
    color: #129500; /* green */
}

/* Align tags to the right - using more specific selectors */
.md-content .md-tags {
  justify-content: flex-end;
  display: flex;
  width: 100%;
  text-align: right;
}

.md-content .md-tags .md-tags__list {
  justify-content: flex-end;
  display: flex;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Mermaid diagram styling */
.mermaid {
  text-align: center;
  margin: 1em 0;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Copy/Share dropdown styling */
.copy-share-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 0.5rem;
}

.copy-share-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.25rem;
  color: var(--md-default-fg-color);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.copy-share-button:hover {
  background: var(--md-default-fg-color--lightest);
  border-color: var(--md-default-fg-color--light);
}

.copy-share-button svg {
  flex-shrink: 0;
}

.copy-share-dropdown.open .copy-share-button {
  background: var(--md-default-fg-color--lightest);
  border-color: var(--md-default-fg-color--light);
}

.copy-share-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-arrow {
  transition: transform 0.2s ease;
}

.copy-share-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 280px;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: all 0.2s ease;
  z-index: 1000;
  margin-top: 0.25rem;
}

.copy-share-dropdown.open .copy-share-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.copy-share-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  position: relative;
}

.copy-share-item:last-child {
  border-bottom: none;
}

.copy-share-item:hover {
  background: var(--md-default-fg-color--lightest);
}

.copy-share-item svg:first-child {
  flex-shrink: 0;
  color: var(--md-default-fg-color--light);
}

.copy-share-item .external-link {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--md-default-fg-color--lighter);
}

.copy-share-item div {
  flex: 1;
}

.item-title {
  font-weight: 500;
  color: var(--md-default-fg-color);
  font-size: 0.9rem;
  line-height: 1.2;
}

.item-subtitle {
  color: var(--md-default-fg-color--light);
  font-size: 0.8rem;
  line-height: 1.2;
  margin-top: 0.25rem;
}

/* Notification styling */
.copy-share-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--md-primary-fg-color);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.copy-share-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.copy-share-notification.success {
  background: #4caf50;
}

.copy-share-notification.error {
  background: #f44336;
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] .copy-share-button {
  background: var(--md-default-bg-color);
  border-color: var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color);
}

[data-md-color-scheme="slate"] .copy-share-button:hover,
[data-md-color-scheme="slate"] .copy-share-dropdown.open .copy-share-button {
  background: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .copy-share-menu {
  background: var(--md-default-bg-color);
  border-color: var(--md-default-fg-color--lightest);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-md-color-scheme="slate"] .copy-share-item:hover {
  background: var(--md-default-fg-color--lightest);
}

/* Responsive adjustments */
@media screen and (max-width: 76.1875em) {
  .copy-share-dropdown {
    margin-left: 0.25rem;
  }
  
  .copy-share-button {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .copy-share-menu {
    min-width: 260px;
    right: -1rem;
  }
}

@media screen and (max-width: 44.9375em) {
  .copy-share-menu {
    min-width: 240px;
    right: -2rem;
  }
  
  .copy-share-notification {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }
}
