/* ============================================================
   CRAFTSMAN CARPENTRY — Gallery Stylesheet (galeriacss.css)
   Design: Refined Artisan | Warm Oak & Walnut Palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

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

:root {
  --walnut:      #1E1108;
  --oak:         #7C5230;
  --honey:       #B8803A;
  --honey-light: #D4A862;
  --cream:       #F5EFE6;
  --warm-white:  #FDFAF6;
  --text:        #2C1A0E;
  --text-muted:  #8B6E5A;
  --border:      rgba(124, 82, 48, 0.2);
  --shadow-sm:   0 2px 12px rgba(30, 17, 8, 0.12);
  --shadow-md:   0 8px 32px rgba(30, 17, 8, 0.18);
  --shadow-lg:   0 20px 60px rgba(30, 17, 8, 0.28);
  --radius:      10px;
  --transition:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ── Header ─────────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 60px;
  height: 80px;
  background: var(--walnut);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
  border-bottom: 2px solid var(--honey);
}

#logo-container {
  display: flex;
  align-items: center;
}

#logo {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  font-style: italic;
  color: var(--honey-light);
  letter-spacing: 1px;
}

nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#main-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

#main-nav a {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

#main-nav a:hover {
  color: var(--honey-light);
  background: rgba(184, 128, 58, 0.12);
}


/* ── Gallery Grid ───────────────────────────────────────── */
main {
  padding: 48px 40px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

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

/* ── Gallery Item ───────────────────────────────────────── */
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  background: var(--walnut);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, filter 0.4s ease;
  filter: brightness(0.9) saturate(0.85);
}

.gallery-item:hover img {
  transform: scale(1.07);
  filter: brightness(1) saturate(1.05);
}



/* ── Image Modal ────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(12, 6, 2, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-overlay {
  position: absolute;
  inset: 0;
}

.modal-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  gap: 20px;
}

.modal-img {
  max-width: 80vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: block;
  animation: imgIn 0.3s ease;
}

@keyframes imgIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 28px;
  font-size: 32px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition), transform var(--transition);
  z-index: 10;
  font-weight: 300;
}

.modal-close:hover {
  color: var(--honey-light);
  transform: rotate(90deg);
}

.modal-prev,
.modal-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 14px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  transition: all var(--transition);
  user-select: none;
  z-index: 10;
  font-weight: 400;
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

.modal-prev:hover,
.modal-next:hover {
  background: var(--honey);
  border-color: var(--honey);
  color: var(--warm-white);
  transform: translateY(-50%) scale(1.05);
}

.modal-category {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 20px;
  background: rgba(184, 128, 58, 0.85);
  backdrop-filter: blur(8px);
  color: var(--warm-white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 20px;
  white-space: nowrap;
}


/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  header {
    padding: 0 16px;
    height: auto;
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px;
  }

  nav {
    align-items: center;
  }

  main {
    padding: 24px 16px 60px;
  }

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

  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }

  .modal-img {
    max-width: 92vw;
  }
}
