:root{
  --cream:      #EEE8D8;
  --cream-2:    #F6F2E6;
  --ink:        #1C231D;
  --deep-green: #11393B;
  --forest:     #2E5240;
  --clay:       #C25A2E;
  --clay-dark:  #A24A25;
  --gold:       #C99A45;
  --line:       rgba(31,58,44,0.16);
  --shadow:     0 12px 30px -18px rgba(28,35,29,0.35);
  --font-fa: 'Vazirmatn', sans-serif;
  --container: 1180px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--cream);
  color:var(--ink);
  font-family:var(--font-fa);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a{ color:inherit; text-decoration:none; }
img,svg{ display:block; }
h1{ margin:0; font-weight:900; }
p{ margin:0; }
button{ font-family:inherit; cursor:pointer; }

/* ---- Header ---- */
.gallery-header{
  position:sticky; top:0; z-index:50;
  background:rgba(238,232,216,0.9);
  backdrop-filter:blur(10px) saturate(1.1);
  border-bottom:1px solid var(--line);
}
.gallery-header-inner{
  max-width:var(--container);
  margin:0 auto;
  padding:14px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand-logotype{ height:32px; width:auto; }
.back-link{
  display:flex; align-items:center; gap:6px;
  font-size:0.9rem; font-weight:700;
  color:var(--forest);
  padding:8px 16px;
  border-radius:999px;
  border:1px solid var(--line);
  transition:background .15s ease, color .15s ease;
}
.back-link svg{ width:16px; height:16px; }
.back-link:hover{ background:var(--deep-green); color:var(--cream-2); border-color:var(--deep-green); }

/* ---- Intro ---- */
.gallery-main{
  max-width:var(--container);
  margin:0 auto;
  padding:44px 20px 80px;
}
.gallery-intro{ text-align:center; margin-bottom:36px; }
.gallery-intro h1{ font-size:clamp(1.8rem, 4vw, 2.4rem); color:var(--deep-green); margin-bottom:8px; }
.gallery-intro p{ color:var(--forest); opacity:0.85; }

/* ---- Masonry grid via CSS columns ---- */
.gallery-grid{
  column-count:1;
  column-gap:14px;
}
@media (min-width:520px){ .gallery-grid{ column-count:2; } }
@media (min-width:860px){ .gallery-grid{ column-count:3; } }
@media (min-width:1180px){ .gallery-grid{ column-count:4; } }

.gallery-item{
  break-inside:avoid;
  margin-bottom:14px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--line);
  background:var(--cream-2);
  box-shadow:var(--shadow);
  cursor:zoom-in;
  transition:transform .15s ease;
}
.gallery-item:hover{ transform:translateY(-3px); }
.gallery-item img{
  width:100%;
  height:auto;
  display:block;
}

/* ---- Empty state ---- */
.gallery-empty{
  text-align:center;
  padding:60px 20px;
  color:var(--forest);
}
.gallery-empty p{ margin-bottom:8px; }
.gallery-empty .muted{ opacity:0.7; font-size:0.9rem; }
.gallery-empty code{
  direction:ltr;
  display:inline-block;
  background:var(--cream-2);
  border:1px solid var(--line);
  border-radius:6px;
  padding:2px 8px;
  font-family:monospace;
}

/* ---- Lightbox ---- */
.lightbox{
  position:fixed; inset:0; z-index:300;
  background:rgba(15,20,16,0.92);
  display:flex; align-items:center; justify-content:center;
}
.lightbox[hidden]{ display:none; }
.lightbox img{
  max-width:90vw;
  max-height:85vh;
  border-radius:10px;
  box-shadow:0 30px 60px -20px rgba(0,0,0,0.6);
}
.lightbox-close{
  position:fixed; top:18px; left:18px;
  width:42px; height:42px;
  border-radius:50%;
  border:none;
  background:rgba(238,232,216,0.12);
  color:var(--cream-2);
  display:flex; align-items:center; justify-content:center;
  transition:background .15s ease;
}
.lightbox-close:hover{ background:rgba(238,232,216,0.22); }
.lightbox-close svg{ width:20px; height:20px; }

.lightbox-nav{
  position:fixed; top:50%; transform:translateY(-50%);
  width:48px; height:48px;
  border-radius:50%;
  border:none;
  background:rgba(238,232,216,0.12);
  color:var(--cream-2);
  display:flex; align-items:center; justify-content:center;
  transition:background .15s ease;
}
.lightbox-nav:hover{ background:rgba(238,232,216,0.22); }
.lightbox-nav svg{ width:22px; height:22px; }
.lightbox-nav--prev{ right:18px; }
.lightbox-nav--next{ left:18px; }

@media (max-width:640px){
  .lightbox-nav{ width:40px; height:40px; }
  .lightbox-close{ width:38px; height:38px; }
}
