:root {
  --bg: #0b0f19;
  --panel: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: rgba(0, 0, 0, 0.35);
  --btn: rgba(255, 255, 255, 0.09);
  --btn-hover: rgba(255, 255, 255, 0.14);
  --accent: #7dd3fc;
}

body[data-theme="light"] {
  --bg: #f6f7fb;
  --panel: rgba(0, 0, 0, 0.04);
  --text: rgba(0, 0, 0, 0.86);
  --muted: rgba(0, 0, 0, 0.56);
  --border: rgba(0, 0, 0, 0.12);
  --shadow: rgba(0, 0, 0, 0.12);
  --btn: rgba(0, 0, 0, 0.06);
  --btn-hover: rgba(0, 0, 0, 0.1);
  --accent: #0ea5e9;
}

* {
  box-sizing: border-box;
}

@font-face {
  font-family: "byekan";
  src: url('../style/font/Yekan.ttf');
}

body {
  margin: 0;
  font-family: iranyekan, sans-serif, "byekan";
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* بک‌گراند شبکه */
.bg-grid {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(125, 211, 252, 0.18),
      transparent 35%
    ),
    radial-gradient(
      circle at 80% 30%,
      rgba(167, 139, 250, 0.16),
      transparent 40%
    ),
    linear-gradient(var(--bg), var(--bg));
  pointer-events: none;
  z-index: -2;
}
.bg-grid::after {
  content: "";
  position: absolute;
  inset: -40px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.25;
  z-index: -1;
}
body[data-theme="light"] .bg-grid::after {
  opacity: 0.18;
}

/* topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border);
}
body[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.65);
}

.brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
  width: min(1100px, 92vw);
  margin: 0 auto;
}
.icon-btn {
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  background: var(--btn-hover);
}
.icon-btn:active {
  transform: scale(0.98);
}

.container {
  width: min(1100px, 92vw);
  margin: 24px auto 60px;
  padding-top: 6px;
}

/* گرید تصاویر */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow);
  overflow: hidden;
}

.media {
  position: relative;
  overflow: hidden;
}

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
  transform: scale(1);
  transition: transform 0.25s ease;
  cursor: zoom-in;
}
.card:hover .thumb {
  transform: scale(1.04);
}

/* overlay برای حس کلیک */
.zoom-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.card:hover .zoom-overlay {
  opacity: 1;
}
.zoom-badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.card-body {
  padding: 14px 14px 16px;
}

.title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

/* توضیح نیم‌خط (۱ خط کوتاه) */
.desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;

  display: -webkit-box;
  -webkit-line-clamp: 1; /* یک خط کوتاه */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desc.full {
  -webkit-line-clamp: unset;
  overflow: visible;
  text-overflow: clip;
}

.more-btn {
  margin-top: 8px;
  background: var(--btn);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  width: fit-content;
  transition: background 0.15s;
}
.more-btn:hover {
  background: var(--btn-hover);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 18px;
}
.lightbox.open {
  display: flex;
}

.lightbox-panel {
  width: min(980px, 96vw);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 12, 20, 0.72);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

body[data-theme="light"] .lightbox-panel {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 0, 0, 0.1);
}

.lightbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
body[data-theme="light"] .lightbox-top {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.lightbox-title {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.close-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
body[data-theme="light"] .close-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
}

.lightbox-img-wrap {
  padding: 12px;
}
.lightbox-img {
  width: 100%;
  height: min(72vh, 720px);
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  display: block;
}
