/* Nine Micron Inc - site stylesheet.
   Colours and type carried over from the WordPress (X theme) site. */

@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("../fonts/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("../fonts/lato-700.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 900; font-display: swap; src: url("../fonts/lato-900.woff2") format("woff2"); }

:root {
  --nm-red: #ed2024;      /* logo mark */
  --nm-ink: #272727;      /* headings */
  --nm-text: #7a7a7a;     /* body copy */
  --nm-blue: #1e73be;     /* links, active nav */
  --nm-green: #34b700;    /* buttons, check marks */
  --nm-green-hover: #66d617;
  --nm-line: #eeeeee;
  --nm-page: #f3f3f3;     /* behind the boxed layout */
  --nm-paper: #ffffff;
  --nm-width: 72rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--nm-page);
  color: var(--nm-text);
  font: 400 16px/1.7 "Lato", sans-serif;
}

a { color: var(--nm-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.nm-site {
  max-width: var(--nm-width);
  margin: 0 auto;
  background: var(--nm-paper);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.085);
  min-height: 100vh;
}

/* Masthead: centred logo over a centred nav bar. */
.nm-brand { display: block; text-align: center; padding: 0.75rem 1rem; }
.nm-brand img { height: 3.25rem; width: auto; max-width: 100%; }

.nm-nav {
  border-top: 1px solid var(--nm-line);
  border-bottom: 1px solid var(--nm-line);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.nm-nav ul { list-style: none; margin: 0; padding: 0; }
.nm-nav > ul { display: flex; flex-wrap: wrap; justify-content: center; }
.nm-nav li { position: relative; }
.nm-nav a {
  display: block;
  padding: 1.1rem 0.9rem;
  border-top: 3px solid transparent;
  color: #b7b7b7;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nm-nav a:hover,
.nm-nav a[aria-current="page"] {
  color: var(--nm-ink);
  border-top-color: var(--nm-blue);
  text-decoration: none;
}

/* Drop-down menus open on hover or keyboard focus. */
.nm-nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 16rem;
  background: var(--nm-paper);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}
.nm-nav li:hover > ul,
.nm-nav li:focus-within > ul { display: block; }
.nm-nav li ul a { border-top: 0; padding: 0.7rem 1rem; text-transform: none; letter-spacing: 0.04em; font-size: 0.85rem; }

/* Content */
main { padding: 3rem 3.5rem 4rem; }

h1, h2, h3 { color: var(--nm-ink); font-weight: 900; line-height: 1.2; }
h1 { font-size: 2.4rem; margin: 0 0 1rem; }

/* Section headings with a hairline running to the right edge. */
h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 2.1rem;
  margin: 2.5rem 0 1rem;
}
h2::after { content: ""; flex: 1; height: 2px; background: var(--nm-line); }

/* Call-out box */
.nm-callout {
  text-align: center;
  padding: 1.5rem 2rem 2rem;
  border: 1px solid var(--nm-line);
  border-radius: 4px;
  outline: 10px solid #f7f7f7;
  margin: 10px 0 3rem;
}
.nm-callout h2 { justify-content: center; margin: 0 0 0.5rem; }
.nm-callout h2::after { content: none; }
.nm-callout p { margin: 0 0 1.25rem; }

.nm-btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid #3daf00;
  border-radius: 3px;
  background: var(--nm-green);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 2px 0 #2a8a00;
}
.nm-btn:hover { background: var(--nm-green-hover); border-color: #81d742; text-decoration: none; }

/* Check-mark lists */
.nm-checks { list-style: none; margin: 0; padding: 0; }
.nm-checks li { position: relative; padding-left: 1.6rem; margin: 0.15rem 0; }
.nm-checks li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.45em;
  width: 0.8rem;
  height: 0.45rem;
  border-left: 2.5px solid var(--nm-green);
  border-bottom: 2.5px solid var(--nm-green);
  transform: rotate(-45deg);
}

/* Page title: centred, with hairlines either side. */
.nm-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  font-size: 2.1rem;
  margin: 0 0 1.5rem;
}
.nm-title::before, .nm-title::after { content: ""; flex: 1; height: 2px; background: var(--nm-line); }
h1.nm-title { justify-content: center; }

blockquote { margin: 1.5rem 0; padding: 0 0 0 1rem; border-left: 3px solid var(--nm-line); }

/* Section label between two rules (the old theme used blockquotes). */
.nm-label {
  margin: 2.5rem 0 1.5rem;
  padding: 1.25rem 0;
  border-left: 0;
  border-top: 1px solid var(--nm-line);
  border-bottom: 1px solid var(--nm-line);
  text-align: center;
  color: var(--nm-ink);
  font-size: 1.5rem;
  line-height: 1.3;
}

/* Column rows collapse to one column on narrow screens. */
.nm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 2rem; }

img { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--nm-line); margin: 1.5rem 0; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { border: 1px solid var(--nm-line); padding: 0.4rem 0.6rem; text-align: left; }

/* Accordions */
details { border: 1px solid var(--nm-line); border-radius: 3px; margin: 0 0 0.5rem; }
summary { padding: 0.6rem 1rem; cursor: pointer; color: var(--nm-ink); font-weight: 700; }
details[open] summary { border-bottom: 1px solid var(--nm-line); }
details > :not(summary) { margin-left: 1rem; margin-right: 1rem; }

.nm-map iframe { width: 100%; max-width: 100%; height: 22rem; border: 0; }

/* Blog */
.nm-posts { list-style: none; margin: 0; padding: 0; }
.nm-posts li { padding: 0.75rem 0; border-bottom: 1px solid var(--nm-line); }
.nm-posts a { font-size: 1.15rem; font-weight: 700; }
.nm-posts time { display: block; font-size: 0.85rem; }
.nm-post h1 { margin-bottom: 0.25rem; }
.nm-date { margin: 0 0 1.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* Home page photo carousel (static/js/slides.js). Without JavaScript
   only the first photo shows. */
.nm-slides {
  position: relative;
  aspect-ratio: 2 / 1;
  margin: -3rem -3.5rem 3rem;
  overflow: hidden;
  background: var(--nm-ink);
  border-bottom: 3px solid var(--nm-blue);
}
.nm-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.nm-slides img:first-child { opacity: 1; }
.nm-slides.is-ready img { opacity: 0; }
.nm-slides.is-ready img.is-active { opacity: 1; }
.nm-slides:focus-visible { outline: 3px solid var(--nm-blue); outline-offset: -3px; }

.nm-prev, .nm-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: 400 2rem/1 "Lato", sans-serif;
  cursor: pointer;
}
.nm-prev { left: 1rem; }
.nm-next { right: 1rem; }
.nm-prev:hover, .nm-next:hover { background: rgba(0, 0, 0, 0.7); }

.nm-dots { position: absolute; bottom: 0.9rem; left: 0; right: 0; display: flex; justify-content: center; gap: 0.5rem; }
.nm-dot {
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.nm-dot[aria-current="true"] { background: #fff; }

/* Footer */
.nm-footer {
  border-top: 1px solid var(--nm-line);
  padding: 2rem 1rem 3rem;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nm-footer ul { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.25rem 1rem; }
.nm-footer p { margin: 0; color: #b7b7b7; }

@media (max-width: 40rem) {
  main { padding: 2rem 1rem 3rem; }
  .nm-slides { margin: -2rem -1rem 2rem; }
  .nm-prev, .nm-next { width: 2.25rem; height: 2.25rem; font-size: 1.6rem; }
  .nm-prev { left: 0.5rem; }
  .nm-next { right: 0.5rem; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.6rem; }
  .nm-nav a { padding: 0.8rem 0.6rem; }
  .nm-callout { padding: 1.25rem 1rem 1.5rem; }
}
