/* ============================================================
   Base & Reset
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  --gutter: 32px;
}

body {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  background-color: #1a1a1a;
  background-image: url('../images/background.jpg'); /* optional: add a background texture/image */
  background-attachment: fixed;
  background-repeat: repeat;
  background-size: auto;
  color: #1a1a1a;
  line-height: 1.7;
}

/* ============================================================
   Page column — narrow ribbon centered on desktop
   ============================================================ */

.page-wrap {
  max-width: 975px;
  margin: 0 auto;
  background-color: #f5f2ee;
  min-height: 100vh;
  padding: 0 0 80px;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  padding: 0 var(--gutter) 48px;
  border-bottom: 1px solid #d8d3cc;
}

.site-title {
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0 calc(-1 * var(--gutter)) 24px;
  color: #fff;
  background-color: #000;
  display: block;
  padding: 24px var(--gutter) 24px;
}

.site-intro {
  font-size: 1.2rem;
  color: #555;
  max-width: 520px;
}

/* ============================================================
   Projects
   ============================================================ */

.projects {
  display: flex;
  flex-direction: column;
}

.project {
  padding: 52px 32px;
  border-bottom: 1px solid #d8d3cc;
}

.project-title {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 24px;
}

/* Hero image — full column width, rectangular */
.project-hero {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 24px;
  object-fit: cover;
  cursor: pointer;
}

.project-text {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 28px;
  max-width: 640px;
}

.project-text + .project-text {
  margin-top: -16px;
}

/* ============================================================
   Gallery thumbnails — square grid, click to open lightbox
   ============================================================ */

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.gallery-thumb:hover {
  opacity: 0.85;
}

/* ============================================================
   Lightbox
   ============================================================ */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  padding: 4px 8px;
}

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

/* ============================================================
   Responsive — mobile
   ============================================================ */

@media (max-width: 600px) {
  html {
    --gutter: 20px;
  }

  .site-header {
    padding: 0 var(--gutter) 36px;
  }

  .site-title {
    font-size: 2rem;
  }

  .project {
    padding: 40px var(--gutter);
  }

  .site-intro,
  .project-text {
    font-size: 1.1rem;
  }

  .project-gallery {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
  }
}
