/* Additions on top of the Twenty Sixteen stylesheet (twentysixteen.css). */

/* Site logo (as on the WordPress.com version of the theme) */
.site-logo-link { display: block; }
.site-logo { max-height: 112px; width: auto; }
.has-site-logo .site-title { margin-top: 0.608695652em; }
@media screen and (min-width: 44.375em) {
  .site-logo { max-height: 175px; }
  .has-site-logo .site-title { margin-top: 0.5em; }
}
@media screen and (min-width: 56.875em) {
  .has-site-logo .site-header-main { align-items: center; }
}

/* Block-editor content */
.wp-block-image { margin: 0 0 1.75em; }
.wp-block-image img { height: auto; max-width: 100%; vertical-align: bottom; }
.wp-block-image .alignleft { float: left; margin: 0.5em 1em 0.5em 0; }
.wp-block-image .alignright { float: right; margin: 0.5em 0 0.5em 1em; }
.wp-block-image .aligncenter { display: table; margin-left: auto; margin-right: auto; }
.wp-block-image figcaption, .wp-element-caption {
  color: #686868; font-size: 0.8125rem; font-style: italic; line-height: 1.6153846154; padding-top: 0.5384615385em;
}
figure { margin: 0 0 1.75em; }
.wp-block-embed iframe, .embed-youtube iframe, .embed-vimeo iframe, .entry-content iframe { max-width: 100%; }
.wp-block-embed__wrapper iframe, .embed-youtube iframe { aspect-ratio: 16 / 9; height: auto; width: 100%; }
.wp-block-group.is-layout-flex { display: flex; flex-wrap: wrap; gap: 0.5em; }
.wp-block-group.is-vertical { flex-direction: column; }
.has-text-align-center { text-align: center; }

/* Sidebar, archives and search */
.widget select { max-width: 100%; }
.archive-month { clear: both; }
#search-results { list-style: none; margin-left: 0; }
#search-results li { margin-bottom: 1.25em; }
.search-snippet { color: #686868; font-size: 0.8125rem; line-height: 1.6153846154; }
.entry-content .search-form { margin-bottom: 1.75em; }
.site-info { color: #686868; }

/* Tools pages */
.tool-logo img { max-width: 340px; max-height: 150px; width: auto; height: auto; }
.tool-card { border-top: 1px solid #d1d1d1; padding-top: 1.75em; margin-bottom: 1.75em; }
.tool-card p { margin-bottom: .75em; }

.video-embed { position: relative; padding-bottom: 56.25%; height: 0; margin-bottom: 1.75em; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; margin: 0; }
.tool-illustration { max-width: 300px; margin: 0 0 1.75em; }

/* Site font: Open Sans, as in the Green Listed, Correlate and Enrich apps */
body, button, input, select, textarea, .required,
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.post-password-form label,
.main-navigation,
.post-navigation,
.post-navigation .post-title,
.pagination,
.image-navigation, .comment-navigation,
.site .skip-link,
.widget .widget-title,
.widget_recent_entries .post-date,
.tagcloud a,
.site-title,
.entry-title,
.entry-footer,
.sticky-post,
.page-title,
.page-links,
.comments-title, .comment-reply-title,
.comment-metadata,
.comment-reply-link,
.comment-form label,
.no-comments,
.site-footer .site-title:after {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
::-webkit-input-placeholder { font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
:-moz-placeholder { font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
::-moz-placeholder { font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
:-ms-input-placeholder { font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

/* Refresh: tighter line spacing, smaller titles, headings in the apps' green */
body { line-height: 1.6; }
.entry-title, .entry-title a, .page-title,
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 { color: #5d9239; }
.entry-title a:hover, .entry-title a:focus { color: #4c782e; }
.entry-title { font-size: 1.625rem; line-height: 1.25; }
.entry-content h2 { font-size: 1.375rem; }
.entry-content h3 { font-size: 1.1875rem; }
@media screen and (min-width: 44.375em) {
  .entry-title { font-size: 1.875rem; line-height: 1.25; }
}
@media screen and (min-width: 61.5625em) {
  .entry-title { font-size: 2rem; line-height: 1.25; }
  .entry-content h2 { font-size: 1.5rem; line-height: 1.3; }
  .entry-content h3 { font-size: 1.25rem; line-height: 1.3; }
}

.pub-list li { margin-bottom: .6em; }

/* Less empty space between the menu and the page title */
@media screen and (min-width: 44.375em) {
  .site-header { padding-bottom: 1.25em; }
  .site-header-menu { margin-bottom: 0.5em; }
}
@media screen and (min-width: 61.5625em) {
  .site-header { padding-top: 3.5em; padding-bottom: 1em; }
}

/* The logo already says "Wermeling Lab": keep the text title for screen readers only */
.site-branding .site-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-branding .site-description { display: block; margin-top: 0.6em; }
/* Never let the wide logo run past the edge of a narrow screen */
.site-logo { max-width: 100%; height: auto; }
/* Centre the tagline under the (symmetric) logo */
.site-branding { width: -moz-fit-content; width: fit-content; max-width: 100%; }
.site-branding .site-description { text-align: center; }

/* Phones: left-align body text; justified text leaves wide gaps between words on narrow screens */
@media screen and (max-width: 44.374em) {
  .entry-content p, .entry-content li, .entry-content div, .entry-summary p { text-align: left !important; }
}

/* Phones and narrow screens: show the menu as a compact wrapping row instead of behind a button,
   and tighten the space between the logo and the page title */
@media screen and (max-width: 56.874em) {
  .menu-toggle { display: none; }
  .site-header .site-header-menu { display: block; margin: 0.5em 0 0; }
  .site-header .main-navigation .primary-menu { display: flex; flex-wrap: wrap; gap: 0 1.1em; border: 0; margin: 0; }
  .site-header .main-navigation .primary-menu::before,
  .site-header .main-navigation .primary-menu::after { display: none; }
  .site-header .main-navigation li { border: 0; }
  .site-header .main-navigation a { padding: 0.3em 0; font-size: 0.9375rem; white-space: nowrap; }
  .site-header .main-navigation .current-menu-item > a { font-weight: 700; }
  .site-header { padding-top: 1.5em; padding-bottom: 0.75em; }
  .site-branding { margin-top: 0; margin-bottom: 0.25em; }
}

/* Text with a small badge beside it: the text keeps a straight edge and the badge sits centred next to it */
.entry-content p.with-badge { display: flex; align-items: center; gap: 1.5em; }
.entry-content p.with-badge > span { flex: 1 1 auto; min-width: 0; }
.entry-content p.with-badge > img.badge { flex: 0 0 auto; width: 96px; height: auto; margin: 0; }

/* Phones: pictures go above the text they belong to instead of beside it, so the text is not squeezed */
@media screen and (max-width: 44.374em) {
  .entry-content img.alignright, .entry-content img.alignleft,
  .entry-content figure.alignright, .entry-content figure.alignleft,
  .entry-content .wp-caption.alignright, .entry-content .wp-caption.alignleft {
    float: none; display: block; margin: 0.5em auto 1.25em; max-width: 62%; height: auto;
  }
  .entry-content p.with-badge { gap: 1em; }
  .entry-content p.with-badge > span { text-align: left !important; }
  .entry-content p.with-badge > img.badge { width: 72px; }
}

/* Phones: menu items as evenly filled bordered tabs; smaller portrait on the Welcome page */
@media screen and (max-width: 56.874em) {
  .site-header .main-navigation .primary-menu { gap: 0.4em; }
  .site-header .main-navigation li { flex: 1 1 auto; }
  .site-header .main-navigation a {
    padding: 0.4em 0.75em; text-align: center; border: 1px solid #c9d8b6; border-radius: 6px;
    font-size: 0.875rem; color: #33521c; background: #fff;
  }
  .site-header .main-navigation .current-menu-item > a { background: #5d9239; border-color: #5d9239; color: #fff; font-weight: 600; }
  .site-header .site-header-menu { margin-top: 0.75em; }
}
@media screen and (max-width: 44.374em) {
  .entry-content img.wp-image-1500 { max-width: 45%; }
}
@media screen and (max-width: 44.374em) {
  .entry-content p.same-row-on-phone { display: inline-block; margin-right: 1.75em; }
}

/* Phones: lay the ten menu tabs on a fixed grid so their edges line up from row to row
   (2 + 4, then three equal tabs twice, then two halves). Depends on the order in _data/menu.yml. */
@media screen and (max-width: 56.874em) {
  .site-header .main-navigation .primary-menu { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.45em; }
  .site-header .main-navigation li { grid-column: span 2; min-width: 0; }
  .site-header .main-navigation li:nth-child(2) { grid-column: span 4; }
  .site-header .main-navigation li:nth-child(9),
  .site-header .main-navigation li:nth-child(10) { grid-column: span 3; }
  .site-header .main-navigation a { padding: 0.45em 0.2em; font-size: 0.8125rem; }
  .site-header { padding-bottom: 1.75em; }
}
@media screen and (max-width: 23.5em) {
  .site-header .main-navigation a { font-size: 0.71875rem; padding-left: 0.1em; padding-right: 0.1em; }
}

/* Discovery pipeline on the Projects page: numbered step cards with arrows between them */
.pipeline-figure { margin: 0 0 1.75em; }
.entry-content ol.pipeline { list-style: none; margin: 0 0 0.75em; padding: 0; display: grid; grid-template-columns: 1fr; gap: 1.9em; counter-reset: none; }
.pipeline-step {
  position: relative; margin: 0; padding: 0.9em 1em 0.9em 3.4em; min-height: 3.6em;
  border: 1px solid #c9d8b6; border-radius: 10px; background: #f8fbf3; line-height: 1.4; font-size: 0.9375rem;
}
.pipeline-step strong { display: block; font-weight: 600; color: #1a1a1a; }
.pipeline-num {
  position: absolute; left: 0.8em; top: 0.8em; width: 1.9em; height: 1.9em; border-radius: 50%;
  background: #5d9239; color: #fff; font-weight: 700; font-size: 0.9375rem; line-height: 1.9em; text-align: center;
}
.pipeline-note { display: block; margin-top: 0.3em; color: #555; font-size: 0.875rem; }
.pipeline-chips { display: flex; flex-wrap: wrap; gap: 0.35em; margin-top: 0.55em; }
.pipeline-chips > span { padding: 0.15em 0.6em; border-radius: 1em; background: #fff; border: 1px solid #c9d8b6; color: #33521c; font-size: 0.8125rem; }
.pipeline-step::after {
  content: "\2193"; position: absolute; left: 50%; bottom: -1.55em; transform: translateX(-50%);
  color: #5d9239; font-size: 1.25rem; line-height: 1; font-weight: 700;
}
.pipeline-step.pipeline-loop::after { content: "\21C5"; }
.pipeline-step:last-child::after { content: none; }
@media screen and (min-width: 44.375em) {
  .entry-content ol.pipeline { grid-template-columns: repeat(3, 1fr); gap: 1.6em 2.2em; }
  .pipeline-step::after { content: "\2192"; left: auto; right: -1.5em; bottom: auto; top: 50%; transform: translateY(-50%); }
  .pipeline-step.pipeline-loop::after { content: "\21C4"; }
  .pipeline-step:nth-child(3n)::after { content: none; }
}

/* Pipeline: drawn diagram on wide screens, step cards on phones (text in the diagram would be too small there) */
.pipeline-svg, .pipeline-img { display: none; width: 100%; height: auto; margin: 0 0 0.75em; font-family: "Open Sans", -apple-system, "Segoe UI", sans-serif; }
@media screen and (min-width: 44.375em) {
  .pipeline-svg, .pipeline-img { display: block; }
  .entry-content .pipeline-figure ol.pipeline { display: none; }
}

/* Pipeline: show the supplied figure at every screen size (tap to open it full size); the step cards are kept in the page but hidden */
.pipeline-img { display: block; width: 100%; height: auto; margin: 0 0 0.75em; }
.entry-content .pipeline-figure ol.pipeline { display: none; }
.entry-content a.pipeline-link { box-shadow: none; border: 0; display: block; }

/* All posts: one long list with the date after each title */
.post-list li { margin-bottom: 0.4em; }
.post-list-date { color: #686868; font-size: 0.8125rem; white-space: nowrap; margin-left: 0.4em; }

/* Keep short bits such as "(2025- )" on one line */
.nowrap { white-space: nowrap; }
/* Phones: centre the picture itself (not only its frame) and use one modest size for portraits */
@media screen and (max-width: 44.374em) {
  .entry-content figure.alignright, .entry-content figure.alignleft { max-width: 100%; text-align: center; }
  .entry-content figure.alignright img, .entry-content figure.alignleft img { display: block; margin: 0 auto; max-width: 150px; height: auto !important; }
  .entry-content figure.alignright img.wp-image-795 { max-width: 200px; }
}

/* Phones: Team name lines a little smaller so that name, role and years fit on one line */
@media screen and (max-width: 44.374em) {
  .entry-content p.member-name { font-size: 0.9em; }
}

/* Footer note about visit statistics */
.privacy-note { display: block; margin-top: 0.5em; font-size: 0.8125rem; }
