/*
  nathanbmars.com
  Plain-CSS recreation of the old WordPress "Themify Simple" theme (gray skin).
  Sizes/colors were measured from the original site so the look carries over.
*/

:root {
  --text: #656565;        /* body copy */
  --text-strong: #555;    /* links, logo, nav, bold text */
  --heading: #000;
  --rule: #e6e6e6;
  --panel: #f7f7f7;       /* accordion title background */
  --page-width: 1160px;
  --header-h: 74px;       /* height of the compact (scrolled) header */
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 10px); }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 1.05em/1.8em "Open Sans", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  word-wrap: break-word;
}

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

a { color: var(--text-strong); text-decoration: none; }
a:hover { color: #000; }
strong { color: var(--text-strong); }

p { margin: 0 0 1em; }

h1, h2, h3 {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  line-height: 1.4em;
  color: var(--heading);
  margin: 0 0 .4em;
}

/* 30px side gutter (lines up with the nav) whenever the window is narrower than the page */
.pagewidth { width: var(--page-width); max-width: calc(100% - 60px); margin: 0 auto; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .9);
  border-bottom-color: rgba(0, 0, 0, .1);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.25em 30px 2.04em;
  transition: padding .3s ease;
}
.is-scrolled .header-inner { padding-top: 1em; padding-bottom: 1em; }

.site-logo {
  position: relative;
  margin: 0;
  font: 600 2.2em/1em "Poppins", sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.site-logo a { color: var(--text-strong); }

.main-nav {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
}
.main-nav ul { display: flex; gap: 1.1em; margin: 0; padding: 0; list-style: none; }
.main-nav a {
  display: block;
  color: var(--text-strong);
  font: 500 16.8px/1.8em "Poppins", sans-serif;
  text-transform: uppercase;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: #000; }

/* Hamburger + slide-out side menu (small screens only) */
.menu-toggle,
.menu-close,
.menu-overlay { display: none; }

/* ---------- Main content ---------- */

main {
  padding-top: 112px; /* room for the fixed header */
}
.content { padding: 58px 0; }
.content.narrow { padding-left: 10%; padding-right: 10%; }

/* About page */
.about-photo {
  float: right;
  width: 327px;
  margin: 0 0 1em 2em;
}
.clearfix::after { content: ""; display: table; clear: both; }

/* ---------- Engineering page ---------- */

.project-row {
  display: grid;
  grid-template-columns: 7fr 4fr; /* photo column ~408px at full width */
  column-gap: 3.2%;
  align-items: start;
}

.project-title {
  font-size: 30px;
  line-height: 42px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding-top: 30px;
  margin: 42px 0 6px;
}

.project-image { margin: 72px 0 1.5em; text-align: center; }
.project-image img { margin: 0 auto; }
.project-image figcaption,
.wp-caption figcaption { margin: .5em 0; line-height: 1.6em; }

/* Expandable sections (native <details>, styled like the old Themify accordion) */
.accordion {
  border: 1px solid rgba(0, 0, 0, .05);
  background: var(--panel);
  margin: 0 0 1em;
}
.accordion details + details { border-top: 1px solid rgba(0, 0, 0, .05); }

.accordion summary {
  position: relative;
  display: block;
  padding: .5em 2.6em .5em 1em;
  color: var(--text-strong);
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.4em;
  cursor: pointer;
  list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  position: absolute;
  right: 1em;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  font-size: 1.3em;
  color: #999;
}
.accordion details[open] > summary::after { content: "\2212"; }
.accordion summary:hover { color: #000; }

.accordion-content {
  background: #fff;
  color: #333;
  padding: 1em;
}
.accordion-content::after { content: ""; display: table; clear: both; }
.accordion-content p:last-child { margin-bottom: 0; }
.accordion-content ul { margin: 0 0 1em; padding-left: 1.6em; list-style: disc; }
.accordion-content li::marker { color: #000; }
.accordion-content li { margin-bottom: .5em; }

.alignright { float: right; margin: 0 0 1em 2em; }
.alignleft { float: left; margin: 0 2em 1em 0; }
.wp-caption { text-align: center; max-width: 100%; }

/* ---------- Contact page ---------- */

.form-title { font-size: 1.8em; margin-bottom: .4em; }
.required { color: #e80000; }

.contact-form .field { margin-bottom: 25px; }
.contact-form label {
  display: block;
  margin-bottom: 4px;
  font: 700 .95em/1.6em "Poppins", sans-serif;
  text-transform: uppercase;
  color: var(--text);
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  font: 400 .975em/1.5em "Open Sans", Arial, Helvetica, sans-serif;
  color: #000;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #c8c8c8;
  border-radius: 0;
  padding: 2px 2px 14px;
  outline: none;
}
.contact-form textarea {
  height: 200px;
  border: 1px solid #c8c8c8;
  padding: 10px 13px;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: #555; }

.contact-form button {
  font: 600 .95em/1.6em "Poppins", sans-serif;
  text-transform: uppercase;
  color: #fff;
  background: #555;
  border: 0;
  border-radius: 5em;
  padding: 14px 30px 12px;
  cursor: pointer;
  transition: background-color .2s ease;
}
.contact-form button:hover { background: #000; }
.hidden { display: none !important; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5em 0;
  text-align: center;
}
.back-top { margin: 1.5em auto 1.8em; }
.back-top a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 53px;
  height: 53px;
  border: 2px solid #c7c7c7;
  border-radius: 50%;
  color: #666;
  transition: border-color .3s ease, color .3s ease;
}
.back-top a:hover { border-color: #666; color: #000; }
.back-top svg { width: 22px; height: 22px; }
.back-top a:hover svg { animation: arrow-up 1s linear infinite; }
@keyframes arrow-up {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.footer-text {
  font-size: .8em;
  letter-spacing: .01em;
  padding: 0 0 1.85em;
  margin-top: 5.5em;
}
.footer-text::before {
  content: "";
  display: block;
  width: 188px;
  margin: auto;
  padding-top: 2.6em;
  border-top: 1px solid #e7e7e7;
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  main { padding-top: 70px; }
  .header-inner,
  .is-scrolled .header-inner { padding: 1em 20px; }
  .site-logo { font-size: 30px; }

  .menu-toggle {
    display: block;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 22px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .menu-toggle span,
  .menu-toggle span::before,
  .menu-toggle span::after {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--text-strong);
    content: "";
  }
  .menu-toggle span { top: 50%; margin-top: -1.5px; }
  .menu-toggle span::before { top: -8px; }
  .menu-toggle span::after { top: 8px; }

  .main-nav {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    transform: none;
    padding: 50px 25px 20px;
    background: #fff;
    overflow-y: auto;
    z-index: 111;
    transition: left .2s ease-in-out;
  }
  .menu-open .main-nav { left: 0; box-shadow: 0 0 20px rgba(0, 0, 0, .15); }
  .main-nav ul { display: block; margin: 15px 0; }
  .main-nav a { padding: .6em 0; color: #000; line-height: 1.5em; }

  .menu-close {
    display: block;
    position: absolute;
    top: 10px;
    right: 20px;
    padding: 4px;
    border: 0;
    background: none;
    font-size: 1.6em;
    line-height: 1;
    color: var(--text-strong);
    cursor: pointer;
  }
  .menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .3);
    z-index: 110;
  }
  .menu-open .menu-overlay { display: block; }
  .menu-open .site-header { z-index: 120; } /* keep the menu panel above the overlay */

  .pagewidth { max-width: 100%; padding: 0 20px; }
  .content { padding: 30px 0; }
  .content.narrow { padding-left: 0; padding-right: 0; }
}

@media (max-width: 680px) {
  .about-photo { float: none; width: 100%; max-width: 327px; margin: 0 auto 1em; }

  /* Stack as: title, dates, photo, then the rest of the text */
  .project-row { display: flex; flex-direction: column; }
  .project-row > div { display: contents; }
  .project-row > div > * { order: 3; }
  .project-row .project-title,
  .project-row .dates { order: 1; }
  .project-row .project-image { order: 2; align-self: center; }
  .project-title { font-size: 24px; line-height: 1.4em; margin: 20px 0 6px; }
  .project-image { margin: 0 0 1em; }
  .project-image img { max-width: 320px; }

  .alignright,
  .alignleft { float: none; margin: 0 auto 1em; max-width: 100%; }
  .alignright img,
  .alignleft img,
  img.alignright,
  img.alignleft { margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
