/* ==========================================================================
   Minimalist Photography Portfolio
   ========================================================================== */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #9a9a9a;
  --gap: 10px;
  --page-pad: 4%;
}

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

html {
  scrollbar-gutter: stable;
}

html.lightbox-open {
  overflow: hidden;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- Header & Navigation -------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
  padding: 36px var(--page-pad) 32px;
}

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.7;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: #111111;
}

/* --- Main Page Container -------------------------------------------------- */

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--page-pad) 64px;
}

.about-page {
  max-width: 720px;
  padding-top: 24px;
}

.about-page h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.about-page a {
  color: var(--text);
}

/* --- 5-Column Masonry Gallery --------------------------------------------- */

.gallery {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 5;
  column-gap: var(--gap);
}

.gallery li {
  break-inside: avoid;
  margin-bottom: var(--gap);
}

.gallery-empty {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 40px 0;
}

.tile-link {
  display: block;
  overflow: hidden;
  cursor: zoom-in;
  background-color: #f4f4f4;
}

.tile-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.tile-link:hover .tile-img {
  opacity: 0.92;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-figure {
  margin: 0;
  padding: 48px 64px;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: calc(100vw - 128px);
  max-height: calc(100vh - 110px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  display: none;
}

.lightbox-btn {
  position: fixed;
  background: none;
  border: none;
  color: #1a1a1a;
  font-size: 2rem;
  line-height: 1;
  padding: 12px 16px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.lightbox-btn:hover {
  opacity: 1;
}

.lightbox-btn:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.lightbox-close {
  top: 12px;
  right: 16px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

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

@media (max-width: 900px) {
  .gallery {
    column-count: 3;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 24px 5%;
    gap: 16px;
  }

  .site-nav {
    gap: 16px;
  }

  .gallery {
    column-count: 1;
    column-gap: 8px;
  }

  .gallery li {
    margin-bottom: 8px;
  }

  .lightbox-figure {
    padding: 48px 16px;
  }

  .lightbox-img {
    max-width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile-img,
  .lightbox {
    transition: none;
  }
}
