/* Ethan Maddy Photography. Started as an exact match of the 22slides "mesa" layout the
   site used until 2026, then moved toward its own look (October 2026): EB Garamond from
   ethanmaddy.com, a centered header, wider and tighter photo grids. */

:root {
  /* Menu, titles and captions: EB Garamond, the serif ethanmaddy.com uses. */
  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --color-text: #bfbfbf;
  --color-nav: #f5f5f5;
  --color-headings: #cccccc;
  --color-background: #222222;
  --color-overlay: rgba(34, 34, 34, 0.95);
  --color-accent: #728a8b;
  --nav-size: 20px;
  --logo-width: 308px;
  --mobile-header-spacing: 45px;
  --mobile-logo-height: 65px;
  --mobile-nav-button-size: 65px;
  --mobile-header-height: calc(var(--mobile-header-spacing) * 2 + var(--mobile-logo-height));
}

* { box-sizing: border-box; margin: 0; padding: 0; text-rendering: optimizeLegibility; }
html { font-size: 18px; }
body {
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: normal;
  line-height: 1.5em;
  min-height: 100vh;
  overscroll-behavior-x: contain;
  animation: page-in .25s ease-out;
}
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
a { color: var(--color-accent); text-decoration: none; }
img { pointer-events: none; }
ul { list-style-type: none; }
picture { display: contents; }

.container { display: flex; flex-direction: column; min-height: 100vh; position: relative; }
.content--main { flex-grow: 1; }
.content h2 {
  color: var(--color-headings);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: .18em;
  line-height: 1.3em;
  text-transform: uppercase;
}
.content * + h2 { margin-top: .5em; }

/* Header: the logo centered, with the menu below it. */
.header { padding: 45px 0 20px; position: relative; z-index: 5; }
.header__container {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 50px;
  width: 100%;
}
.logo { align-self: center; position: relative; white-space: nowrap; z-index: 5; }
.logo__link { display: block; }
/* The logo is centered on PHOTOGRAPHY, not on its full width: the y of Maddy swings far
   to the right, so the artwork shifts right by 6.71% of its width (tools/logo_from_ai.py). */
.logo__image { display: inline-block; transform: translateX(6.71%); width: var(--logo-width); }
.logo__image img { display: block; height: auto; width: 100%; }
.nav { align-self: center; display: flex; }
.nav__menu { display: flex; justify-content: center; }
.nav__item { align-items: center; display: flex; }
/* Uppercase and spaced like "PHOTOGRAPHY" in the logo. */
.nav__link {
  color: var(--color-nav);
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .2em;
  line-height: 1em;
  padding: 14px 18px;
  text-align: center;
  text-transform: uppercase;
  transition: color .15s ease-out;
}
.nav__item--selected .nav__link, .nav__link:hover { color: var(--color-accent); }
.nav__toggle { display: none; }

/* Menu button (phones): the "E" from ethanmaddy.com. A short accent line between two
   long ones; open, the short line slips away and the long ones cross. */
.nav__toggle span {
  background: currentColor;
  border-radius: 1px;
  height: 1.5px;
  left: 21.5px;
  position: absolute;
  top: 31.75px;
  transition: transform .32s cubic-bezier(.65, 0, .35, 1), width .25s ease, opacity .2s ease;
  width: 22px;
}
.nav__toggle span:nth-child(1) { transform: translateY(-6.5px) rotate(0); }
.nav__toggle span:nth-child(2) { background: var(--color-accent); width: 11px; }
.nav__toggle span:nth-child(3) { transform: translateY(6.5px) rotate(0); }
/* Mouse only: a tap leaves :hover stuck on touch screens. */
@media (hover: hover) { .nav__toggle:hover span:nth-child(2) { width: 22px; } }
.navopen .nav__toggle span:nth-child(1) { transform: translateY(0) rotate(45deg); }
.navopen .nav__toggle span:nth-child(2) { opacity: 0; width: 0; }
.navopen .nav__toggle span:nth-child(3) { transform: translateY(0) rotate(-45deg); }
.nav__toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -4px; }
@media (prefers-reduced-motion: reduce) { .nav__toggle span { transition: none; } }

/* Footer */
.footer { font-family: var(--font-display); font-size: 16px; line-height: 1.5em; padding: 20px 0; position: relative; text-align: center; z-index: 1; }
.footer__container { margin: 0 auto; max-width: 1200px; padding: 0 50px; }
.social { display: flex; }
.footer .social { display: inline-flex; margin-bottom: 10px; }
.social__link { align-items: center; color: var(--color-nav); display: flex; font-size: var(--nav-size); padding: 10px; }
.social__link:hover { color: var(--color-accent); }
.social__icon { height: 1em; width: 1em; }
.footer__link { color: inherit; transition: color .15s ease-out; }
.footer__link:hover { color: var(--color-accent); }

/* Slideshow (Home, About). The frame has the first photo's shape, up to 80% of the
   screen height, and photos are shown whole inside it. */
.gallery--slideshow { position: relative; min-height: 50px; -webkit-user-select: none; user-select: none; }
.gallery--slideshow .gallery__container {
  margin: 0 auto;
  max-width: 4000px;
  padding: 0 40px;
  width: 100%;
}
.gallery--slideshow .gallery__images {
  aspect-ratio: var(--ratio, 3 / 2);
  max-height: 80vh;
  position: relative;
  width: 100%;
}
.gallery--slideshow .gallery__item {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  transition: opacity 1s ease-out;
  width: 100%;
}
.gallery--slideshow .gallery__item--active { opacity: 1; }
.gallery--slideshow .gallery__item--hidden { z-index: -100; }
.gallery--slideshow .gallery__img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}
/* Home: edge to edge, 80% of the screen tall (49% on phones), with photos cropped to
   fill the frame around their focal point. */
.gallery--fill .gallery__container { padding: 0; }
.gallery--fill .gallery__images { aspect-ratio: auto; height: 80vh; max-height: none; }
.gallery--fill .gallery__img { object-fit: cover; object-position: var(--object-position, 50% 50%); }

/* Gallery name and the way back, above each gallery's grid: the back link at the grid's
   left edge, the name at its right edge. */
.pagetitle__container {
  align-items: baseline;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1600px;
  padding: 20px 0 0;
  width: 90%;
}
.pagetitle__back { color: var(--color-text); font-family: var(--font-display); font-size: 18px; transition: color .15s ease-out; }
.pagetitle__back:hover { color: var(--color-accent); }
.pagetitle__title { color: var(--color-headings); font-family: var(--font-display); font-size: 26px; font-weight: 400; line-height: 1.5em; text-align: right; }

/* Grid (Favorites and the six galleries): 90% of the screen, up to 1600px, 8px gaps */
.gallery--grid { min-height: 50px; }
.gallery--grid .gallery__container { margin: 0 auto; max-width: 1600px; padding: 20px 0; width: 90%; }
.gallery--grid .gallery__images { display: grid; gap: 8px; grid-auto-rows: 1fr; grid-template-columns: repeat(3, 1fr); }
.gallery--grid .gallery__item {
  aspect-ratio: 1;
  background: #2b2b2b; /* shows until the photo loads */
  color: inherit;
  cursor: pointer;
  display: block;
  position: relative;
  transition: opacity .15s ease-out;
}
.gallery--grid .gallery__item:hover { opacity: .9; }
.gallery--grid .gallery__img,
.collection__img {
  display: block;
  height: 100%;
  left: 0;
  object-fit: cover;
  object-position: var(--object-position, 50% 50%);
  position: absolute;
  top: 0;
  transition: opacity .25s ease-out;
  width: 100%;
}
.js .gallery--grid .gallery__img, .js .collection__img { opacity: 0; }
.js .gallery--grid .gallery__img.loaded, .js .collection__img.loaded { opacity: 1; }

/* Collection (Gallery page): two columns of wide covers, each with its name below */
.collection--grid { min-height: 50px; }
.collection--grid .collection__container {
  margin: 0 auto;
  max-width: 1400px;
  padding: 20px 0;
  width: 90%;
}
.collection--grid .collection__images { display: grid; gap: 28px 24px; grid-template-columns: repeat(2, 1fr); }
.collection--grid .collection__item {
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity .15s ease-out;
}
.collection--grid .collection__item:hover { opacity: .8; }
.collection--grid .collection__imagecontainer { aspect-ratio: 3 / 2; background: #2b2b2b; position: relative; }
.collection--grid .collection__caption {
  color: var(--color-headings);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.4em;
  text-align: center;
}

/* Big button (Home) */
.button--bigbutton .button__container {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 0 auto;
  max-width: 4000px;
  padding: 45px 0;
}
.button--bigbutton .button__button {
  background: transparent;
  border: 1px solid;
  border-radius: 0;
  color: var(--color-accent);
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  gap: 5px;
  letter-spacing: .2em;
  max-width: 100%;
  padding: 14px 44px;
  text-align: center;
  text-transform: uppercase;
  transition: color .15s ease-out;
  width: max-content;
}
.button--bigbutton .button__button:hover { color: var(--color-nav); }

/* Text (About) */
.text__container {
  display: flex;
  gap: 40px;
  margin: 0 auto;
  max-width: 885px;
  min-width: 500px;
  padding: 25px 120px;
  text-align: left;
  width: 70%;
}
.text__blurb { display: flex; flex-basis: 0; flex-direction: column; flex-grow: 1; gap: 1em; }
.text__container a { text-decoration: underline; }

/* 404 */
.notfound__container { padding: 100px 0 300px; text-align: center; }

/* Lightbox */
.overlay {
  height: 100vh;
  height: 100dvh;
  left: 0;
  opacity: 0;
  padding: 75px;
  position: fixed;
  top: 0;
  transition: opacity .2s ease-out;
  width: 100vw;
  z-index: 100;
  background: var(--color-overlay);
}
.overlay--show { opacity: 1; }
.overlay__container {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  position: relative;
  width: 100%;
}
/* Each photo appears once it has loaded, with a short fade and no zoom. */
.overlay__img {
  display: block;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  min-height: 0;
  object-fit: contain;
  opacity: 0;
  transition: opacity .15s ease-out;
}
.overlay__img--show { opacity: 1; }
.overlay__paging {
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  color: var(--color-text);
  display: flex;
  height: 100vh;
  height: 100dvh;
  justify-content: center;
  opacity: .4;
  outline: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity .25s ease-out;
  width: 50vw;
  z-index: 2;
}
.overlay__paging:hover { opacity: 1; }
.overlay__paging svg { fill: none; stroke: currentColor; height: 20px; width: 100px; }
.overlay__paging--next { cursor: e-resize; justify-content: flex-end; right: 0; }
.overlay__paging--back { cursor: w-resize; justify-content: left; left: 0; }
.overlay__paging--hidden { cursor: default; opacity: 0 !important; }
.overlay__paging--close { height: 75px; right: 0; top: 0; transform: none; width: 75px; cursor: pointer; }
.overlay__paging--close svg { height: 15px; }
.overlay__counter {
  color: var(--color-text);
  font-size: 13px;
  left: 0;
  letter-spacing: .15em;
  line-height: 75px;
  opacity: .7;
  padding: 0 30px;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 3;
}
body.overlay-open { overflow: hidden; }

/* Touch screens never hover, so the arrows stay bright and get a shadow over photos. */
@media (hover: none) {
  .overlay__paging { opacity: .85; }
  .overlay__paging svg { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .7)); stroke-width: 6; }
}

@media (max-width: 800px), (max-width: 1600px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  .overlay { padding: 0; }
}

@media (max-width: 800px) {
  .gallery--grid .gallery__container { padding-left: 12px; padding-right: 12px; width: 100%; }
  .gallery--grid .gallery__images { grid-template-columns: repeat(2, 1fr); }
  .pagetitle__container { padding-left: 12px; padding-right: 12px; width: 100%; }
  .collection--grid .collection__container { padding-left: 12px; padding-right: 12px; width: 100%; }
  .collection--grid .collection__images { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .gallery--slideshow .gallery__container { max-width: 100%; padding-left: 0; padding-right: 0; }

  .text__container { flex-direction: column; min-width: 200px; padding: 40px; width: 100%; }

  .header {
    background: linear-gradient(var(--color-background), var(--color-background));
    padding: 0;
    position: sticky;
    top: 0;
    transition: transform .35s ease-out;
    width: 100vw;
  }
  .body--scrollingdown .header { transform: translateY(-100%); }
  .header__container { align-items: center; flex-direction: row; justify-content: space-between; padding: var(--mobile-header-spacing) 30px; width: auto; }
  .logo { flex-grow: 1; flex-shrink: 1; white-space: normal; }
  .logo__image { align-items: center; display: flex; height: var(--mobile-logo-height); transform: none; width: auto; }
  .logo__image img { height: 56px; width: auto; }
  .nav {
    animation: mobile-nav .5s ease-out;
    background: var(--color-background);
    display: none;
    height: calc(100vh - var(--mobile-header-height));
    left: 0;
    overflow-y: scroll;
    padding: 20px;
    position: absolute;
    top: 100%;
    width: 100vw;
  }
  .nav__toggle {
    -webkit-tap-highlight-color: transparent;
    background: none;
    border: 0;
    color: var(--color-nav);
    cursor: pointer;
    display: block;
    flex-shrink: 0;
    height: var(--mobile-nav-button-size);
    padding: 0;
    position: relative;
    width: var(--mobile-nav-button-size);
  }
  .gallery--fill .gallery__images { height: 49vh; }
  .nav__menu { flex-direction: column; }
  .nav__item { flex-direction: column; justify-content: center; }
  .nav__link { font-size: 24px; padding: 22px 20px; width: 100%; }
  .footer__container { padding: 0 30px; }

  .navopen .content, .navopen .footer { display: none; }
  .navopen .nav { display: block; }
}
@keyframes mobile-nav { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
