/* Jenny Treat | Photography — Stylesheet */

/* ============================================================
   FONTS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Playfair+Display:wght@400;500&display=swap');

/* ============================================================
   CSS RESET & BASE
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
  --color-bg:      #fafafa;
  --color-surface: #ffffff;
  --color-text:    #1a1a1a;
  --color-muted:   #888888;
  --color-border:  #e8e8e8;

  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --nav-height: 64px;
  --max-width:  1200px;
  --gap:        24px;
}

/* ============================================================
   GLOBAL
   ============================================================ */

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

header nav {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  gap: 32px;
}

header nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  position: relative;
  transition: color 0.2s ease;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-text);
  transition: width 0.25s ease;
}

header nav a:hover {
  color: var(--color-text);
}

header nav a:hover::after {
  width: 100%;
}

header nav a[aria-current="page"] {
  color: var(--color-text);
}

header nav a[aria-current="page"]::after {
  width: 100%;
}

/* ============================================================
   MAIN
   ============================================================ */

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gap) 80px;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  border-top: 1px solid var(--color-border);
  padding: 24px var(--gap);
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 4px;
  margin-bottom: 40px;
}

.filter-btn {
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  cursor: pointer;
  padding: 4px 10px 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-border);
}

.filter-btn.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* Hidden gallery items */
.gallery-item {
  transition: opacity 0.3s ease;
}

.gallery-item.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   GALLERY PAGE
   ============================================================ */

.gallery-container {
  width: 100%;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  width: 100%;
}

.gallery-item {
  overflow: hidden;
  background-color: var(--color-border);
  line-height: 0;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
  opacity: 0.9;
}

/* 2 columns on tablet */
@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* 3 columns on desktop */
@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

/* ============================================================
   BIO PAGE
   ============================================================ */

.bio-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 760px;
  margin: 0 auto;
}

.bio-portrait {
  width: 100%;
  max-width: 300px;
  align-self: center;
  overflow: hidden;
}

.bio-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  filter: grayscale(8%);
  transition: filter 0.35s ease;
}

.bio-portrait:hover img {
  filter: grayscale(0%);
}

.bio-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.bio-text h1,
.bio-text h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  color: var(--color-text);
}

.bio-text p {
  font-weight: 300;
  max-width: 60ch;
  margin-bottom: 1.25em;
}

.bio-text p:last-child {
  margin-bottom: 0;
}

.contact-section {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--color-border);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.contact-section h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--color-text);
}

.contact-link {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-text);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-link:hover {
  color: var(--color-muted);
  border-color: var(--color-muted);
}

.social-links {
  display: flex;
  gap: 24px;
  margin-top: 24px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-text);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
  color: var(--color-muted);
  border-color: var(--color-muted);
}

.social-links svg {
  flex-shrink: 0;
}

/* Bio: side-by-side on tablet+ */
@media (min-width: 768px) {
  .bio-section {
    flex-direction: row;
    align-items: flex-start;
    gap: 56px;
    max-width: 900px;
  }

  .bio-portrait {
    flex-shrink: 0;
    width: 240px;
    max-width: 240px;
    align-self: flex-start;
  }

  .bio-text {
    flex: 1;
  }

  .contact-section {
    max-width: 900px;
  }
}

@media (min-width: 1024px) {
  .bio-portrait {
    width: 280px;
    max-width: 280px;
  }

  .bio-text {
    font-size: 1.0625rem;
  }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

body.lightbox-open {
  overflow: hidden;
}

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

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

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 120px);
  max-height: 100vh;
  padding: 48px 0 40px;
  overflow-y: auto;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  flex-shrink: 0;
}

.lightbox-caption {
  margin-top: 20px;
  text-align: center;
  max-width: 60ch;
  padding: 0 16px 16px;
  flex-shrink: 0;
}

.lightbox-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.lightbox-desc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.03em;
  line-height: 1.6;
}

/* Close button */
.lightbox-close {
  position: fixed;
  top: 24px;
  right: 28px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  color: rgba(255, 255, 255, 0.95);
}

/* Nav arrows */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 16px 20px;
  transition: color 0.2s ease;
  z-index: 1001;
}

.lightbox-nav:hover {
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

/* Mobile */
@media (max-width: 600px) {
  main {
    padding: 24px var(--gap) 48px;
  }

  .gallery {
    gap: 16px;
  }

  .filter-bar {
    margin-bottom: 24px;
  }

  .lightbox-inner {
    max-width: calc(100vw - 32px);
    padding: 56px 0 24px;
  }

  .lightbox-img {
    max-height: calc(100vh - 200px);
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    font-size: 1.5rem;
    padding: 12px;
  }

  .lightbox-nav {
    padding: 20px 16px;
    font-size: 1.75rem;
  }

  .lightbox-prev {
    left: 0;
  }

  .lightbox-next {
    right: 0;
  }

  .lightbox-title {
    font-size: 0.9375rem;
  }

  .lightbox-desc {
    font-size: 0.75rem;
  }

  .lightbox-caption {
    max-width: 100%;
  }

  nav {
    gap: 24px;
  }
}
