/* Announcement banner link styling */
.md-banner__inner a {
    color: #fff !important;
    text-decoration: none;
}

.md-banner__inner a:hover,
.md-banner__inner a:focus {
    color: #ffe680 !important;
    text-decoration: underline;
}

/* Custom primary color (used throughout the site) */
:root {
    --md-primary-fg-color: rgb(0, 17, 88);
    --md-primary-fg-color--light: rgb(51, 68, 139);
    --md-primary-fg-color--dark: rgb(0, 10, 51);
}

/* Lighter slate theme for better readability */
[data-md-color-scheme="slate"] {
    --md-hue: 220; /* Slightly lighter blue hue */
    
    /* Keep header the same dark blue in dark mode */
    --md-primary-fg-color: rgb(0, 17, 88);
    --md-primary-fg-color--light: rgb(51, 68, 139);
    --md-primary-fg-color--dark: rgb(0, 10, 51);
    
    /* Lighter link colors for dark mode */
    --md-typeset-a-color: rgb(130, 170, 255);
    
    /* Custom background color for dark mode */
    /* --md-default-bg-color: rgb(46, 48, 62); */
}

/* Increase spacing below header */
.md-header {
    margin-bottom: 1.5rem;
}

/* Unified header styles for all color schemes */
.md-content h1 {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 600;
}

.md-content h2 {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.md-content h3 {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.md-content h4 {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.md-content h5 {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.md-content h6 {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

/* Logo positioning and sizing */
.md-header__button.md-logo {
    margin-top: 2;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Increase logo size */
.md-header__button.md-logo img {
    height: 2rem !important; /* Adjust this value as needed */
    width: auto !important; /* Maintain aspect ratio */
}

/* GitHub-style section anchors */
.headerlink {
	--permalink-size: 16px; /* for font-relative sizes, 0.6em is a good choice */
	--permalink-spacing: 4px;

	width: calc(var(--permalink-size) + var(--permalink-spacing));
	height: var(--permalink-size);
	vertical-align: middle;
	background-color: var(--md-default-fg-color--lighter);
	background-size: var(--permalink-size);
	mask-size: var(--permalink-size);
	-webkit-mask-size: var(--permalink-size);
	mask-repeat: no-repeat;
	-webkit-mask-repeat: no-repeat;
	visibility: visible;
	display: none;
	mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg>');
	-webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg>');
	cursor: pointer;
}

[id]:target .headerlink {
	background-color: var(--md-typeset-a-color);
}

.headerlink:hover {
	background-color: var(--md-accent-fg-color) !important;
}

/* Position the permalinks to the right of headers */
@media screen and (min-width: 76.25em) {
	h1, h2, h3, h4, h5, h6 {
		display: flex;
		align-items: center;
		flex-direction: row;
		column-gap: 0.2em; /* fixes spaces in titles */
	}

	.headerlink {
		margin-left: 8px !important;
	}
}

/* Remove previous permalink styling */
.md-typeset .headerlink::before {
    content: none;
}

/* Hide the default hash/octothorp permalink symbol */
.md-typeset .headerlink .md-icon {
    display: none;
}

/* Show anchor on hover */
.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink,
.md-typeset h4:hover .headerlink,
.md-typeset h5:hover .headerlink,
.md-typeset h6:hover .headerlink {
    display: inline-block;
}

/* Anchor hover effect */
.md-typeset .headerlink:hover,
.md-typeset .headerlink:focus {
    color: var(--md-accent-fg-color);
}

/* Remove left padding that was for left-positioned permalinks */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
    padding-left: 0;
    margin-left: 0;
}

/* Reduce line spacing in lists */
.md-typeset ul,
.md-typeset ol {
    line-height: 1.4; /* Reduce from default ~1.6 */
}

.md-typeset ul li,
.md-typeset ol li {
    margin-bottom: 0.25rem; /* Reduce space between list items */
}

/* For nested lists */
.md-typeset ul ul,
.md-typeset ol ol,
.md-typeset ul ol,
.md-typeset ol ul {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Optional: Even tighter spacing for compact lists */
.md-typeset .compact-list {
    line-height: 1.2;
}

.md-typeset .compact-list li {
    margin-bottom: 0.1rem;
}



.md-grid {
  max-width: 1600px;
}

/* Microscope table page — reduce vertical space */
.microscope-filter-bar ~ #microscope-filters,
.microscope-filter-bar {
  margin-top: 0;
}

/* Microscope table filter UI */
.microscope-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.search-wrapper {
  position: relative;
  width: 300px;
  max-width: 100%;
}

.search-wrapper input[type="search"] {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.25rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: 0.85rem;
  width: 100%;
  outline: none;
}

.search-wrapper input[type="search"]:focus {
  border-color: var(--md-accent-fg-color);
}

/* Hide the browser's native clear button on search inputs */
.search-wrapper input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

#microscope-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.filter-group-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
  margin-right: 0.15rem;
}

.filter-chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 1rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  background: transparent;
  color: var(--md-default-fg-color--light);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
  user-select: none;
}

.filter-chip:hover {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}

.filter-chip.active {
  background: var(--md-primary-fg-color);
  color: #fff;
  border-color: var(--md-primary-fg-color);
}

#microscope-clear {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  border: none;
  background: transparent;
  color: var(--md-default-fg-color--lighter);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  border-radius: 50%;
  transition: all 0.15s;
}

#microscope-clear:hover {
  color: var(--md-accent-fg-color);
  background: var(--md-default-fg-color--lightest);
}

#result-count {
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
  margin-left: auto;
}

/* Microscope type badges */
.mic-type {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  font-weight: 400;
  white-space: nowrap;
}

.mic-type--confocal {
  background: #1565c0;
  color: #fff;
}

.mic-type--widefield {
  background: #2e7d32;
  color: #fff;
}

.mic-type--lightsheet {
  background: #6a1b9a;
  color: #fff;
}

.mic-type--stereo {
  background: #e65100;
  color: #fff;
}

.mic-type--electron-microscope {
  background: #455a64;
  color: #fff;
}

.mic-type--high-content {
  background: #00838f;
  color: #fff;
}

.mic-type--other {
  background: #757575;
  color: #fff;
}

/* Make the microscope table full width with compact rows */
#mic-data-table {
  width: 100%;
}

.md-typeset #mic-data-table td,
.md-typeset #mic-data-table th {
  padding: 4px 10px;
}

/* ── Microscope overview card grid ── */

.microscope-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .microscope-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .microscope-overview {
    grid-template-columns: 1fr;
  }
}

.mic-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.25rem;
  padding: 0.6rem 0.8rem;
}

.mic-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .mic-card-title {
  color: var(--md-typeset-a-color);
}

.mic-card hr {
  margin: 0.3rem 0;
  border: none;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.mic-card-institute {
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0.35rem 0 0.1rem;
}

.mic-card ul {
  margin: 0.1rem 0 0.25rem;
  padding-left: 1.1rem;
  list-style: disc;
}

.mic-card li {
  font-size: 0.72rem;
  line-height: 1.4;
  margin-bottom: 0.05rem;
}

.mic-card a {
  font-size: 0.72rem;
}

/* ── Microscope page action buttons ── */
[data-md-color-scheme="slate"] .md-typeset .md-button {
  border-color: var(--md-primary-fg-color--light);
  color: var(--md-typeset-a-color);
}

[data-md-color-scheme="slate"] .md-typeset .md-button:hover {
  background: var(--md-primary-fg-color--light);
  border-color: var(--md-primary-fg-color--light);
  color: #fff;
}

/* ── Wavelength badges ── */
.wavelength-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.wl-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

.wl-badge--plain {
  background: var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color);
}

/* ── Photo competition card descriptions ── */
.photo-competition .md-typeset .grid.cards > ul > li p:not(:first-child):not(:last-child),
.photo-competition .grid.cards > ul > li p:not(:first-child):not(:last-child) {
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Center the cards so an incomplete last row (e.g. a single 10th entry)
   is centered instead of left-aligned. */
.photo-competition .grid.cards > ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.photo-competition .grid.cards > ul > li {
  flex: 0 1 16rem;
  max-width: 22rem;
}

/* Make competition images look clickable (glightbox zoom). */
.photo-competition .grid.cards > ul > li img {
  cursor: zoom-in;
}