/* ==========================================================================
   Allison Henry — Portfolio
   ========================================================================== */

:root {
  --color-bg: #9c9a96;
  --color-text: #ffffff;
  --color-text-strong: #ffffff;
  --color-text-muted: #ffffff;
  --color-nav: #ffffff;
  --color-border: rgba(255, 255, 255, 0.35);
  --color-overlay: rgba(156, 154, 150, 0.97);

  /* Fixed dark neutral for content that sits on white sub-surfaces
     (form fields, FPO placeholders) rather than directly on the page. */
  --color-ink: #3c3c3c;
  --color-ink-muted: #969696;

  --font-display: 'Albert Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Albert Sans', 'Helvetica Neue', Arial, sans-serif;

  --container-max: 1400px;
  --gutter: 80px;

  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 0.25s var(--ease);
  --transition-slow: 0.6s var(--ease);
}

/* ---- Reset ------------------------------------------------------------- */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sticky footer: main grows to fill any leftover space so the footer
   always sits at the bottom of the viewport, even on short pages. */
main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

/* The header/logo/nav are excluded from page-load and page-transition
   fades on purpose — they should read as static site chrome, not content. */
main,
body > .site-footer {
  opacity: 0;
  transition: opacity var(--transition-slow);
}

body.is-visible main,
body.is-visible > .site-footer {
  opacity: 1;
}

body.is-leaving main,
body.is-leaving > .site-footer {
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

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

img:not(.lightbox-image) {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

img:not(.lightbox-image).is-loaded {
  opacity: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.site-header {
  position: relative;
  z-index: 950;
  padding: 72px 0 0;
  margin-bottom: 80px;
  background: var(--color-bg);
}

/* Shares .container's max-width/gutter so the logo lines up exactly
   with the paragraph and image columns below it. */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  position: relative;
  z-index: 901;
  display: inline-block;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 0.01em;
  color: var(--color-text-strong);
}

.site-nav-link {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-nav);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.site-nav-link:hover,
.site-nav-link[aria-current="page"] {
  color: var(--color-text-strong);
  border-bottom-color: var(--color-text-strong);
}

.site-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 901;
  width: 26px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--color-text-strong);
}

.nav-close {
  display: none;
}

body.nav-open {
  overflow: hidden;
}

/* ---- Fade-in reveal ------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Hero (index) --------------------------------------------------------- */

.hero {
  margin: 12px auto 0;
  max-width: 620px;
}

.hero-link {
  display: block;
  overflow: hidden;
}

.hero-link img {
  width: 100%;
  height: auto;
}

/* ---- Work grid (masonry) --------------------------------------------------- */

.intro-layout {
  padding: 40px 0 20px;
}

.work-intro {
  max-width: 760px;
}

.work-intro p {
  font-size: 16px;
  font-family: var(--font-body);
  line-height: 1.75;
  color: var(--color-text);
  font-weight: 300;
  margin: 0 0 20px;
}

.work-intro p:last-child {
  margin-bottom: 0;
}

.contact-btn {
  display: inline-block;
  margin-top: 32px;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--color-text-strong);
  color: var(--color-text-strong);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.contact-btn:hover {
  background: var(--color-text-strong);
  color: var(--color-ink);
}

.intro-image {
  width: 100%;
  margin-top: 32px;
}

.intro-image img {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 761px) {
  .intro-layout {
    display: flex;
    align-items: flex-start;
    gap: 48px;
  }

  .work-intro {
    flex: 0 0 auto;
    max-width: none;
    width: calc((100% - 498px) * 2 / 3 + 72px);
  }

  .intro-image {
    flex: 0 0 337.5px;
    width: 337.5px;
    margin-top: 0;
  }
}

.masonry-grid {
  columns: 2;
  column-gap: 96px;
  padding: 40px 0 100px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 96px;
}

.masonry-link {
  display: block;
}

.masonry-link img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 680px) {
  .intro-layout {
    padding: 24px 0 12px;
  }

  .intro-image {
    margin-top: 0;
  }

  .work-intro {
    margin-top: 24px;
  }

  .contact-btn {
    margin-bottom: 24px;
  }

  .masonry-grid {
    columns: 1;
    padding: 24px 0 64px;
  }
}

/* ---- Collection detail ------------------------------------------------------ */

.collection-header {
  padding: 10px 0 40px;
  max-width: 720px;
}

.collection-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-text-strong);
  margin: 0 0 24px;
}

.collection-description {
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  font-weight: 300;
  margin: 0;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 64px 76px;
  padding-bottom: 110px;
}

.collection-item {
  cursor: zoom-in;
}

.collection-item-figure {
  overflow: hidden;
}

.collection-item img {
  width: 100%;
  height: auto;
  display: block;
}

.collection-item-caption {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 300;
  color: var(--color-text-muted);
}

/* FPO placeholder used on collection pages that don't have final imagery yet */
.collection-item--fpo {
  cursor: default;
}

.collection-item-fpo {
  width: 100%;
  aspect-ratio: 621 / 415;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-item-fpo span {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

/* ---- Simple content pages (About / Journal / Contact) ---------------------- */

.page-content {
  max-width: 720px;
  padding: 10px 0 140px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-text-strong);
  margin: 0 0 24px;
}

.page-content p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  font-weight: 300;
  margin: 0 0 20px;
}

.page-content a.inline-link {
  border-bottom: 1px solid var(--color-text-muted);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.page-content a.inline-link:hover {
  color: var(--color-text-strong);
  border-color: var(--color-text-strong);
}

.journal-empty {
  color: var(--color-text-muted);
  font-size: 15px;
  font-style: normal;
}

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

.site-footer {
  padding: 24px 0 72px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-centered {
  justify-content: center;
}

.footer-inner a,
.footer-inner p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  transition: color var(--transition-fast);
}

.footer-inner a:hover {
  color: var(--color-text-strong);
}

/* ---- About page ----------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.about-layout {
  display: flex;
  flex-direction: column;
  padding: 10px 0 160px;
}

.about-image {
  width: 100%;
}

.about-image img {
  width: 100%;
  height: auto;
}

.about-text {
  padding: 32px 0 0;
}

.about-text p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  font-weight: 300;
  margin: 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

@media (min-width: 761px) {
  .about-layout {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 30px 0 190px;
  }

  .about-text {
    order: 1;
    flex: 0 1 480px;
    margin-right: -110px;
    position: relative;
    top: -110px;
    z-index: 2;
    padding: 0;
  }

  .about-image {
    order: 2;
    flex: 0 0 446px;
    width: 446px;
    height: 685px;
    position: relative;
    z-index: 1;
    overflow: hidden;
  }

  .about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* ---- Collection pager ------------------------------------------------------------ */

.collection-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--color-border);
  padding: 36px 0 90px;
}

.collection-pager-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-nav);
  transition: color var(--transition-fast);
}

.collection-pager-link:hover {
  color: var(--color-text-strong);
}

.collection-pager-next {
  margin-left: auto;
  text-align: right;
}

.collection-pager-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---- Lightbox ----------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0s;
}

.lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 100px;
}

.lightbox-image-wrap {
  position: relative;
  max-width: 100%;
  max-height: calc(100% - 50px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.35s var(--ease), transform 0.3s var(--ease);
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.12);
}

.lightbox-image.is-visible {
  opacity: 1;
  transform: scale(1);
}

.lightbox-caption {
  margin-top: 22px;
  font-size: 14px;
  font-weight: 300;
  color: var(--color-text-muted);
  text-align: center;
  min-height: 18px;
}

.lightbox-counter {
  position: absolute;
  top: 26px;
  left: 32px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 12px;
  transition: transform var(--transition-fast);
}

.lightbox-close {
  top: 18px;
  right: 22px;
}

.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg {
  width: 22px;
  height: 22px;
  display: block;
}

.lightbox-prev {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover {
  transform: translateY(-50%) translateX(-3px);
}

.lightbox-next {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next:hover {
  transform: translateY(-50%) translateX(3px);
}

body.lightbox-open {
  overflow: hidden;
}

/* ---- Responsive ---------------------------------------------------------------- */

@media (max-width: 900px) {
  .collection-grid {
    gap: 48px;
  }

  .lightbox-stage {
    padding: 70px 60px;
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 68px;
  }

  .site-logo {
    font-size: 17px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0.35s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0s;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 30px;
  }

  .site-nav .site-nav-link {
    font-size: 18px;
    letter-spacing: 0.16em;
  }

  .nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    padding: 12px;
    color: var(--color-text-strong);
  }

  .nav-close svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .masonry-item {
    margin-bottom: 48px;
  }

  .collection-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 80px;
  }

  .collection-header {
    padding: 4px 0 32px;
  }

  .collection-title,
  .page-title {
    font-size: 19px;
  }

  .page-content {
    padding: 4px 0 100px;
  }

  .lightbox-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto auto;
    row-gap: 16px;
    height: 100%;
    padding: 56px 20px 28px;
  }

  .lightbox-counter {
    position: static;
    grid-row: 1;
    grid-column: 1 / 3;
    justify-self: center;
  }

  .lightbox-image-wrap {
    grid-row: 2;
    grid-column: 1 / 3;
    max-height: 100%;
    justify-self: center;
  }

  .lightbox-caption {
    grid-row: 3;
    grid-column: 1 / 3;
    margin-top: 0;
  }

  .lightbox-prev {
    position: static;
    grid-row: 4;
    grid-column: 1;
    justify-self: end;
    margin-right: 25px;
    transform: none;
  }

  .lightbox-next {
    position: static;
    grid-row: 4;
    grid-column: 2;
    justify-self: start;
    margin-left: 25px;
    transform: none;
  }

  .lightbox-prev:hover {
    transform: translateX(-3px);
  }

  .lightbox-next:hover {
    transform: translateX(3px);
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}
