:root {
      --bg: #ffffff;
      --fg: #000000;
      --accent: #555;
      --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* --- Base reset --- */
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 'Fira Mono', monospace;
      background: var(--bg);
      color: var(--fg);
      line-height: 1.6;
      padding: 1.5rem clamp(1rem, 3vw, 2rem);
    }

    /* --- Header --- */
    header {
      margin-bottom: 2rem;
      text-align: center;
    }

    h1 {
      font-size: clamp(1.5rem, 4vw, 2.5rem);
      font-weight: 700;
      margin-bottom: 0.25rem;
    }

    header p {
      color: var(--accent);
      font-size: 0.9rem;
    }

    /* --- Gallery Grid --- */
    .gallery {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
      gap: 1rem;
    }

    .gallery a {
      position: relative;
      overflow: hidden;
      border-radius: 8px;
      display: block;
    }

    .gallery img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .gallery a:hover img {
      transform: scale(1.05);
      box-shadow: var(--shadow);
    }

    /* --- Lightbox styles --- */
    .lightbox {
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      visibility: hidden;
      opacity: 0;
      transition: opacity 0.3s ease;
      z-index: 1000;
    }

    .lightbox.show {
      visibility: visible;
      opacity: 1;
    }

    .lightbox img {
      max-width: 90vw;
      max-height: 90vh;
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    /* --- Footer --- */
    footer {
      margin-top: 2rem;
      text-align: center;
      font-size: 0.8rem;
      color: var(--accent);
    }

    /* --- Dark Mode --- */
    @media (prefers-color-scheme: dark) {
      :root {
        --bg: #111;
        --fg: #eee;
        --accent: #888;
        --shadow: 0 4px 16px rgba(255, 255, 255, 0.08);
      }
    }
    
    
    
/* --- New --- */    


.gallery-section {
  margin-bottom: 3rem;
}

.gallery-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--accent);
  text-align: center;
}

/* دکمه‌های فیلتر */
.filter-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem 0 2rem;
  flex-direction: row-reverse;
}

.filter-buttons button {
  padding: 5px 10px;
    margin: 10px 5px;
    background: none;
    border: none;
    font-size: small;
    font-family: rubik;
    cursor: pointer;
}

.filter-buttons button:hover {
  color: #e0464e;
}

.filter-buttons button.active {
  color: #e0464e;
}


/* فقط یک کلاس کمکی برای مخفی‌کردن */
.hidden { display: none; }

/* استایل لودرِ پایین صفحه (می‌توانی GIF بذاری) */
.loader {
  margin: 2rem auto;
  width: 40px;
  height: 40px;
  border: 4px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }



/* ناوبر ثابت بالا/راست (بدون تغییر) */
.navbar {
  margin: 5px;
  position: fixed;
  top: 0;
  right: 0;
  width: fit-content;
  border-radius: 30px;
  background: #fff;
  z-index: 1000;
  padding: 0.4rem 0.8rem;
  font-family: "Rubik", sans-serif;
}

/* فهرست اصلی */
.nav-links {
      list-style: none;
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    flex-direction: row-reverse;
}

/* آیتم‌ها */
.nav-links a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: #e0464e; }

/* ---------- زیرمنو ---------- */
.has-dropdown { position: relative; }

/* منوی مخفی */
.dropdown {
  list-style: none;
  position: absolute;
  right: 0;          /* برای راست‌چین */
  top: 185%;         /* کمی پایین‌تر از آیتم والد */
  background: #fff;
  border: 1px solid #e2e2e2;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  padding: 0.4rem 0;
  min-width: 150px;
  display: none;     /* پنهان پیش‌فرض */
  z-index: 1100;
  overflow: hidden;
}
.dropdown li { padding: 0; margin: 0; }
.dropdown a {
  display: block;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
}
.dropdown a:hover { background: #f5f5f5; color: #e0464e; }

/* نمایش زیرمنو در دسکتاپ (هاور) */
@media (hover: hover) {
  .has-dropdown:hover > .dropdown { display: block; border-radius: 20px; }
}

/* نمایش زیرمنو در موبایل با تپ/کلیک */
.has-dropdown > a {
  cursor: pointer;
}
.has-dropdown.open > .dropdown { 
  display: block; 
  border-radius: 20px;
}

/* موبایل: کمی کوچک‌تر و فشرده‌تر */
@media (max-width: 600px) {
  .nav-links { gap: 0.6rem; font-size: 0.75rem; }
  .dropdown a { font-size: 0.74rem; }
}
