/* ==========================================================
   Fixed left sidebar + one continuous photo grid.

   The grid is fluid: 3 columns at most, dropping to 2 and
   then 1 as the window narrows and the sidebar turns into a top
   header with a Menu button on phones.
   Colors and fonts are tokens at the top; change them freely.
   ========================================================== */

:root {
  --bg: #ffffff;
  --text: #151515;
  --nav: #151515;
  --nav-secondary: #3a3a3a;
  --muted: #6b6b6b;
  --accent: #1b3a63;           /* active tab + Menu button (deep navy) */
  --accent-hover: #2b6fe0;     /* brighter blue when hovering a link */
  --placeholder: #dcdcdc;
  --overlay: rgba(255, 255, 255, 0.97);

  --font-body: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;

  --sidebar-w: 250px;          /* width of the left column on desktop */
  --sidebar-left: 40px;        /* space to the left of the name */
  --page-right: 75px;          /* space to the right of the grid */
  --top: 68px;                 /* space above the grid on desktop */
  --gap: 8px;                  /* space between photos */
  --col-min: 260px;            /* smallest a photo column gets before the grid drops a column */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ==========================================================
   DESKTOP / LARGE WINDOW  (sidebar on the left)
   ========================================================== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  padding: 44px 8px 40px var(--sidebar-left);
  overflow-y: auto;
  background: var(--bg);
  z-index: 20;
}

#page {
  margin-left: var(--sidebar-w);
  padding: var(--top) var(--page-right) 70px 0;
}

/* ---------- Name + tagline ---------- */
.site-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.logo-subtitle {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;   /* shows as capitals without you retyping it */
  letter-spacing: 0.09em;      /* a little air keeps caps from feeling loud */
  line-height: 1.5;
}

/* ---------- Section tabs ---------- */
#siteNav { margin-top: 44px; }

#mainNavigation { padding-left: 5px; }

#mainNavigation a {
  display: block;
  padding: 4px 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--nav);
  transition: color 0.15s;
}

#mainNavigation a.active { color: var(--accent); }
#mainNavigation a:hover { color: var(--accent-hover); }

/* Space between the section tabs and About & Contact / Print/Web Clips */
#secondaryNavigation { margin-top: 44px; padding-left: 4px; }

#secondaryNavigation a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--nav-secondary);
  transition: color 0.15s;
}
#secondaryNavigation a.active { color: var(--accent); }
#secondaryNavigation a:hover { color: var(--accent-hover); }

/* ---------- Social icons ---------- */
.social-links {
  margin-top: 40px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.social-links a { display: inline-flex; color: var(--text); transition: color 0.15s; }
.social-links a:hover { color: var(--accent-hover); }
.social-links svg { display: block; }

.menu-toggle { display: none; }

/* ==========================================================
   PHOTO GRID: up to 3 columns; each sidebar tab shows its own grid
   ========================================================== */
.grid {
  display: grid;
  /* never more than 3 columns; photos simply get bigger on wide screens */
  grid-template-columns: repeat(auto-fill, minmax(max(var(--col-min), calc((100% - 2 * var(--gap)) / 3)), 1fr));
  gap: var(--gap);
}

.grid[hidden] { display: none; }   /* only the selected tab's grid is shown */

.tile {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--placeholder);
  position: relative;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* upright photos: the 3:2 thumbnail crops toward the top so faces stay in frame */
.tile[data-orientation="vertical"] img { object-position: 50% 25%; }

/* very slight darkening on hover */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
  pointer-events: none;
}
.tile:hover::after,
.tile:focus-visible::after { background: rgba(0, 0, 0, 0.1); }

/* ==========================================================
   ABOUT & CONTACT PAGE
   ========================================================== */
.about { max-width: 1180px; }
.about[hidden] { display: none; }

/* one row: photo + contact info | bio | contact form */
.about {
  display: grid;
  grid-template-columns: 210px minmax(280px, 1fr) minmax(280px, 360px);
  gap: 48px;
  align-items: start;
}

.about h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.about h3 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- left column: photo, email, socials ---------- */
.about-photo { display: flex; flex-direction: column; gap: 28px; }

/* headshot in a circle */
.headshot {
  width: 210px;
  height: 210px;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--placeholder);
  flex: none;
}
.headshot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;   /* keeps the face centered if the photo is tall */
}

.about-contact-info p { margin: 0 0 20px; }
.about-contact-info p:last-child { margin-bottom: 0; }

.text-link {
  color: var(--text);
  border-bottom: 1px solid #bdbdbd;
  transition: color 0.15s, border-color 0.15s;
}
.text-link:hover { color: var(--accent-hover); border-color: var(--accent-hover); }

.contact-social li + li { margin-top: 8px; }
.contact-social a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: color 0.15s;
}
.contact-social a:hover { color: var(--accent-hover); }
.contact-social svg { display: block; flex: none; }

/* ---------- middle column: bio ---------- */
.bio p {
  margin: 0 0 1.05em;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
}
.bio p:last-child { margin-bottom: 0; }

/* ---------- form ---------- */
.contact-form { max-width: none; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid #c9c9c9;
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 140px; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 111, 224, 0.18);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.btn {
  padding: 12px 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.6; cursor: default; }

.form-status { margin: 0; font-size: 14px; }
.form-status.is-error { color: #a4262c; }
.form-status.is-ok { color: #1f6b3a; }
.form-status a { text-decoration: underline; }

/* ==========================================================
   ENLARGED PHOTO VIEWER
   ========================================================== */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 76px 24px;
}
.viewer[hidden] { display: none; }

.viewer-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 0;
}

.viewer-media { display: flex; min-height: 0; max-width: 100%; }

.viewer-media img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.viewer-media .placeholder {
  width: min(900px, calc(100vw - 152px));
  max-height: calc(100vh - 190px);
  aspect-ratio: 3 / 2;
  background: var(--placeholder);
}

.viewer-figure figcaption {
  max-width: 70ch;
  text-align: center;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.viewer-count { color: var(--muted); font-size: 12px; }

.viewer-close,
.viewer-nav {
  position: absolute;
  color: #888;
  line-height: 1;
  transition: color 0.15s;
}
.viewer-close:hover,
.viewer-nav:hover { color: var(--accent-hover); }

.viewer-close { top: 12px; right: 22px; font-size: 40px; padding: 4px 8px; }

.viewer-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  padding: 12px 16px;
}
.viewer-prev { left: 6px; }
.viewer-next { right: 6px; }

body.viewer-open { overflow: hidden; }

/* ==========================================================
   PHONE / NARROW WINDOW  (sidebar becomes a top header)
   ========================================================== */
@media (max-width: 640px) {
  :root { --gap: 8px; --top: 16px; }

  #header {
    position: relative;
    width: 100%;
    padding: 24px 16px 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  #logo { order: 1; padding-right: 72px; }

  .site-title { font-size: 30px; margin-bottom: 6px; }

  .logo-subtitle { font-size: 11.5px; }

  .social-links { order: 2; margin-top: 12px; padding-left: 0; }

  #siteNav { order: 3; display: none; margin-top: 22px; }
  #siteNav.open { display: block; }

  #mainNavigation { padding-left: 0; }
  #mainNavigation a { font-size: 17px; padding: 5px 0; }
  #secondaryNavigation { margin-top: 26px; padding-left: 0; }

  .menu-toggle {
    display: block;
    position: absolute;
    top: 24px;
    right: 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
  }

  #page { margin-left: 0; padding: 44px 16px 48px; }

  .headshot { width: 170px; height: 170px; }
  .bio p { font-size: 16.5px; }

  .viewer { padding: 52px 8px 16px; }
  .viewer-media .placeholder { width: calc(100vw - 16px); }
  .viewer-media img { max-height: calc(100vh - 210px); }
  .viewer-nav { font-size: 44px; padding: 8px; background: var(--overlay); border-radius: 4px; }
  .viewer-prev { left: 2px; top: 40%; }
  .viewer-next { right: 2px; top: 40%; }
}

/* About page stacks once the window gets narrower: photo, then bio, then form.
   This breakpoint is wider than the grid's own minimums so the three columns
   move to a single column before the middle (bio) column gets squeezed. */
@media (max-width: 1200px) {
  .about { grid-template-columns: 1fr; gap: 40px; }
  .about-photo { flex-direction: row; align-items: flex-start; gap: 32px; }
}

@media (max-width: 560px) {
  .about-photo { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile::after { transition: none; }
}
