/* IRANSans FaNum — local fonts */
@font-face {
  font-family: 'IRANSans';
  src: url('../assets/fonts/IRANSans-UltraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSans';
  src: url('../assets/fonts/IRANSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSans';
  src: url('../assets/fonts/IRANSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSans';
  src: url('../assets/fonts/IRANSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSans';
  src: url('../assets/fonts/IRANSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSans';
  src: url('../assets/fonts/IRANSans-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --dark: #1a1a1a;
  --primary: #6ec1e4;
  --primary-dark: #4054b2;
  --accent: #4054b2;
  --text: #555555;
  --heading: #1a1a1a;
  --muted: #5f6477;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: rgba(110, 193, 228, 0.2);
  --border-subtle: rgba(26, 26, 26, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 14px 40px rgba(26, 26, 26, 0.07);
  --shadow-hover: 0 18px 44px rgba(26, 26, 26, 0.1);
  --content-width: 1200px;
  --header-offset: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'IRANSans', Tahoma, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.9;
  font-size: 16px;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

.container {
  width: min(100% - 2rem, var(--content-width));
  margin: 0 auto;
  padding: 0;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 26, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(110, 193, 228, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.65rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--surface);
  text-decoration: none;
  min-width: 0;
}

.logo-link:hover {
  color: var(--surface);
}

.logo-img {
  height: 48px;
  width: auto;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 0.9rem;
  max-width: 280px;
  line-height: 1.5;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.78);
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(110, 193, 228, 0.14);
  color: var(--primary);
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--surface);
  padding: 3.5rem 0 3.25rem;
  text-align: center;
  background:
    radial-gradient(circle at top right, rgba(110, 193, 228, 0.16), transparent 34%),
    radial-gradient(circle at bottom left, rgba(64, 84, 178, 0.12), transparent 32%),
    linear-gradient(180deg, var(--dark) 0%, #222228 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.35;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--surface);
  line-height: 1.45;
}

.hero p {
  color: rgba(255, 255, 255, 0.72);
  max-width: 42rem;
  margin: 0 auto;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.85;
}

/* ── Sections ── */
.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--heading);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.section-title span {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--primary);
  margin: 0.75rem auto 0;
  border-radius: 999px;
  opacity: 0.85;
}

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(110, 193, 228, 0.32);
  box-shadow: var(--shadow-hover);
}

.card-img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(110, 193, 228, 0.1), rgba(64, 84, 178, 0.04));
  transition: transform 0.35s ease;
}

.card:hover .card-img {
  transform: scale(1.03);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem 1.2rem;
  flex: 1;
}

.card-body h3 {
  color: var(--heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.card-body p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.85;
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  background: var(--accent);
  color: var(--surface);
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(64, 84, 178, 0.18);
}

.btn:hover {
  background: var(--primary-dark);
  color: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(64, 84, 178, 0.24);
}

/* ── Article pages ── */
.article-page {
  padding: 1.75rem 0 3rem;
}

.article-sheet {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-sheet__head {
  padding: 1.5rem 1.5rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(110, 193, 228, 0.07), rgba(64, 84, 178, 0.03));
}

.article-sheet__head h1 {
  color: var(--heading);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 0.45rem;
  line-height: 1.45;
}

.article-meta {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
}

.article-sheet__body {
  padding: 1.35rem 1.35rem 1.15rem;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 2;
}

.article-sheet__body h2 {
  color: var(--heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.6rem 0 0.75rem;
  line-height: 1.5;
}

.article-sheet__body h3 {
  color: var(--heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.65rem;
  line-height: 1.5;
}

.article-sheet__body p {
  margin-bottom: 1rem;
  text-align: justify;
  text-justify: inter-word;
}

.article-sheet__body img {
  border-radius: var(--radius-sm);
  margin: 1rem auto;
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.08);
}

.article-sheet__body figure {
  margin: 1.5rem 0;
  text-align: center;
}

.article-sheet__body figcaption {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.65rem;
  font-weight: 400;
}

.article-sheet__body ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.article-sheet__body ul li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.article-sheet__body ul li:last-child {
  border-bottom: none;
}

.article-sheet__body .hero-img {
  max-height: 460px;
  width: auto;
  margin: 0 auto;
}

/* Legacy class support (about block on homepage) */
.article-content {
  background: var(--surface);
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-content h2 {
  color: var(--heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.4rem 0 0.7rem;
}

.article-content h3 {
  color: var(--heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.1rem 0 0.6rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content img {
  border-radius: var(--radius-sm);
  margin: 1rem auto;
}

.article-content figure {
  margin: 1.5rem 0;
  text-align: center;
}

.article-content figcaption {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.65rem;
}

.article-content ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.article-content ul li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.article-content ul li:last-child {
  border-bottom: none;
}

.article-content .hero-img {
  max-height: 460px;
  width: auto;
  margin: 0 auto;
}

/* ── Gallery ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.gallery img,
.gallery figure img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery figure {
  margin: 0;
}

.gallery img:hover,
.gallery figure img:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(26, 26, 26, 0.1);
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  direction: rtl;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

th,
td {
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 0.75rem;
  text-align: center;
}

th {
  background: var(--dark);
  color: var(--surface);
  font-weight: 700;
}

tr:nth-child(even) {
  background: rgba(110, 193, 228, 0.04);
}

tr:hover td {
  background: rgba(110, 193, 228, 0.07);
}

/* ── Info box ── */
.info-box {
  background: rgba(110, 193, 228, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}

.info-box p {
  margin-bottom: 0.5rem;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.info-box strong {
  color: var(--heading);
  font-weight: 700;
}

/* ── About block on homepage ── */
.about-block {
  max-width: 820px;
  margin: 0 auto;
}

/* ── Footer ── */
.site-footer {
  margin-top: 2.5rem;
  padding: 2.5rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, var(--dark) 0%, #141418 100%);
  border-top: 1px solid rgba(110, 193, 228, 0.18);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding-bottom: 1.75rem;
}

.footer-grid > div {
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.site-footer h3,
.site-footer h4 {
  color: var(--surface);
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
}

.site-footer p {
  margin-bottom: 0.5rem;
  line-height: 1.85;
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--primary);
}

.site-footer a:hover {
  color: var(--surface);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.55);
}

.text-center {
  text-align: center;
}

.article-sheet__body .text-center,
.article-content .text-center {
  text-align: center;
  text-justify: auto;
}

.specs-list {
  list-style: none;
  text-align: center;
  padding: 0;
}

.specs-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.specs-list li:last-child {
  border-bottom: none;
}

.ltr,
.phone,
a[href^="mailto:"],
a[href^="tel:"] {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ── Lightbox ── */
.gallery-lightbox .gallery-zoomable {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 14, 0.88);
  backdrop-filter: blur(4px);
}

.lightbox__stage {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(26, 26, 26, 0.75);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(64, 84, 178, 0.85);
  border-color: rgba(110, 193, 228, 0.5);
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
}

.lightbox__prev span,
.lightbox__next span {
  display: block;
  line-height: 1;
}

/* RTL: قبلی راست، بعدی چپ */
.lightbox__prev {
  right: 1rem;
}

.lightbox__next {
  left: 1rem;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .lightbox__prev,
  .lightbox__next {
    width: 2.25rem;
    height: 2.25rem;
  }

  .lightbox__prev {
    right: 0.5rem;
  }

  .lightbox__next {
    left: 0.5rem;
  }

  .lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .logo-text {
    font-size: 0.8rem;
    max-width: 200px;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .main-nav a {
    font-size: 0.8rem;
    padding: 0.45rem 0.7rem;
  }

  .hero {
    padding: 2.75rem 0 2.5rem;
  }

  .article-sheet__head,
  .article-sheet__body,
  .article-content {
    padding: 1.15rem 1rem;
  }

  table {
    font-size: 0.78rem;
  }

  th,
  td {
    padding: 0.65rem 0.45rem;
  }
}

@media (max-width: 480px) {
  .logo-text {
    display: none;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}
