/* mckinleighlair.com
   Font: Jost. Layout is a 12-column grid of rows/cols with 17px block padding.
   Mobile is 800px and below. */

:root {
  --text: #000;
  --heading: #111;
  --muted: #9c9c9c;
  --tagline: #aaa;
  --link: #0d46e3;
  --gutter: 17px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 300 14px/1.8 "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .04em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.canvas { padding: 60px; }

/* ---------- header ---------- */

.site-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; }

.site-title {
  margin: 0;
  font-size: 43px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 2px;
  color: var(--heading);
}
.site-title a { color: inherit; }

.tagline { font-size: 17px; font-weight: 400; line-height: 1.7; color: var(--tagline); }

.main-nav { padding-top: 15px; flex-shrink: 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; gap: 15px; }
.main-nav > ul > li { position: relative; }
.main-nav a, .main-nav .folder-toggle {
  display: block;
  padding: 7.8px 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 2;
  letter-spacing: .06em;
  color: var(--muted);
}
.main-nav a:hover, .main-nav .folder-toggle:hover,
.main-nav li.active > a, .main-nav li.active > .folder-toggle,
.main-nav .folder:hover > .folder-toggle { color: #000; }

.main-nav .subnav {
  position: absolute;
  top: 100%;
  left: -7.5px;
  margin-top: -7.8px;
  background: #fff;
  z-index: 10;
  visibility: hidden;
  opacity: 0;
  transition: opacity .1s;
}
.main-nav .folder:hover .subnav,
.main-nav .folder:focus-within .subnav { visibility: visible; opacity: 1; }
.main-nav .subnav a { padding: 1.875px 7.5px; line-height: normal; }

.menu-toggle, .mobile-nav { display: none; }

/* ---------- content grid ---------- */

.page { margin-top: 45px; }

.row { display: flex; margin: 0 calc(-1 * var(--gutter)); }
.col { flex: 0 0 var(--w, 100%); min-width: 0; }

.block { padding: var(--gutter); }

/* first/last block padding rules */
.row .block:first-child { padding-top: 0; }
.row .block:first-child:last-child { padding-bottom: 0; }
.block + .row .block:first-child { padding-top: var(--gutter); }
.block + .row .block:first-child:last-child { padding-bottom: var(--gutter); }
.row + .row .block:first-child { padding-top: var(--gutter); }
.row + .row .block:first-child:last-child { padding-bottom: var(--gutter); }
.layout > .row:first-child > .col:first-child > .block:not(:first-child):last-child,
.block + .row .block:last-child { padding-bottom: var(--gutter); }
.row + .row:not(:last-child) .block:last-child { padding-bottom: var(--gutter); }

/* only top-level rows pull out by the gutter; nested rows sit flush in their column */
.col > .row { margin: 0; }

.spacer { min-height: 1px; }

/* ---------- text ---------- */

.text > :last-child { margin-bottom: 0; }
.text p, .text h1, .text h2, .text h3 { white-space: pre-wrap; }
.text p { margin: 0 0 14px; }
.text p:empty::before { content: "\200b"; } /* empty paragraphs keep a line */
.text h1 { margin: 0 0 13px; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: .01em; color: var(--heading); }
.text h2 { margin: 0 0 10.4px; font-size: 20.8px; font-weight: 700; line-height: 1.2; letter-spacing: .01em; color: var(--heading); }
.text strong { font-weight: 700; }

/* ---------- images ---------- */

.image { margin: 0; }
.image img { width: 100%; object-fit: cover; }
.image figcaption { padding-top: 18px; }
.image.caption-gap { padding-bottom: 18px; }
.image figcaption p { margin: 0; font-size: 12px; line-height: 1.68; }

.image.overlay { position: relative; }
.image.overlay figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 18px;
  background: rgba(0, 0, 0, .7);
  opacity: 0;
  visibility: hidden;
  transition: opacity .1s ease-out;
}
.image.overlay:hover figcaption,
.image.overlay:focus-within figcaption { opacity: 1; visibility: visible; max-height: 75%; }
.image.overlay figcaption p { color: #bbb; }
.image.overlay figcaption strong { color: #eee; }
.image.overlay figcaption a { color: #bbb; text-decoration: underline; }

/* ---------- video ---------- */

.video { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- sister-cities grid ---------- */

.grid-gallery { display: grid; grid-template-columns: repeat(var(--per-row, 4), 1fr); gap: 20px; padding-bottom: 20px; }
.grid-gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- environmental photography: justified rows ---------- */

.page-environmentalphotography .page { margin-top: 0; }
.justified { display: flex; flex-wrap: wrap; gap: 10px; }
.justified::after { content: ""; flex-grow: 1000000000; }
.jg-item { flex: var(--ar) 1 calc(var(--ar) * 400px); }
.jg-item img { width: 100%; height: auto; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  padding: 60px 80px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox button { position: absolute; color: var(--muted); font-size: 34px; line-height: 1; padding: 12px; }
.lightbox button:hover { color: #000; }
.lightbox .lb-close { top: 10px; right: 14px; }
.lightbox .lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- footer ---------- */

.site-footer { margin-top: 45px; padding: 18px 0 8px; display: flex; gap: 4.72px; }
.site-footer a { display: block; width: 16px; height: 16px; }
.site-footer svg { display: block; width: 32px; height: 32px; margin: -8px; fill: #000; }

/* ---------- mobile ---------- */

@media (max-width: 800px) {
  .canvas { padding: 20px; }

  .menu-toggle {
    display: block;
    width: 100%;
    padding: 15px 0;
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.2px;
    letter-spacing: 1.08px;
    color: var(--muted);
  }
  .mobile-nav:not([hidden]) { display: block; background: #f0f0f0; padding: 10px 0; text-align: center; }
  .mobile-nav ul { list-style: none; margin: 0; padding: 0; }
  .mobile-nav a, .mobile-nav .folder-toggle {
    font-size: 16px; font-weight: 400; line-height: 40px; letter-spacing: .06em;
    color: rgba(156, 156, 156, .7);
  }
  .mobile-nav li.active > a { color: #000; }
  .mobile-nav .folder-toggle::after { content: " +"; }
  .mobile-nav .folder-toggle[aria-expanded="true"]::after { content: " −"; }
  .mobile-nav .subnav { display: none; }
  .mobile-nav .folder-toggle[aria-expanded="true"] + .subnav { display: block; }

  .site-header { display: block; text-align: center; margin-bottom: 10px; }
  .main-nav { display: none; }

  .row { display: block; }
  .spacer { display: none; }
  .row .block:first-child { padding-top: var(--gutter) !important; }
  .row .block:last-child { padding-bottom: var(--gutter) !important; }

  .grid-gallery { grid-template-columns: repeat(2, 1fr); }
  .justified { gap: 4px; }
  .jg-item { flex: 1 1 100%; padding: 0 2px; }
  .lightbox { padding: 50px 10px; }
  .lightbox .lb-prev, .lightbox .lb-next { display: none; }
}
