/* ==========================================================================
   تشکل قرآنی حافظان صادق — طراحی سایت عمومی (نسخه‌ی حرفه‌ای)
   سبک ایرانی–اسلامی مدرن، بدون هیچ وابستگی خارجی (CDN/فونت/آیکون بیرونی).
   فونت‌ها به‌صورت پویا از پنل مدیریت تزریق می‌شوند (Theme::styleTag).
   ========================================================================== */

:root {
  --emerald-900: #0a3b2b;
  --emerald-800: #0d4a37;
  --emerald-700: #12543e;
  --emerald-600: #1a6f52;
  --emerald-500: #2f8f6d;
  --gold-600: #b3922c;
  --gold-500: #d4af37;
  --gold-400: #e3c766;
  --cream: #fbfaf6;
  --paper: #ffffff;
  --ink: #17241f;
  --ink-soft: #4f635c;
  --line: #e7e2d6;
  --radius-xl: 26px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(13, 74, 55, 0.06);
  --shadow: 0 12px 34px rgba(13, 74, 55, 0.10);
  --shadow-lg: 0 26px 60px rgba(13, 74, 55, 0.18);
  --container: 1200px;
  --grad-emerald: linear-gradient(140deg, var(--emerald-700) 0%, var(--emerald-900) 100%);
  --grad-gold: linear-gradient(120deg, var(--gold-400), var(--gold-600));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--emerald-700); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-600); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; color: var(--emerald-900); font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }

/* ---------- Decorative helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 800; letter-spacing: .08em;
  color: var(--gold-600); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--grad-gold); border-radius: 2px; }
.section-title-lg { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.divider-motif { display: flex; justify-content: center; margin: 6px 0 34px; }
.divider-motif svg { opacity: .8; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: .8em 1.8em; border-radius: 999px; font-weight: 700; font-size: .96rem;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  font-family: inherit;
}
.btn-primary { background: var(--grad-gold); color: #3a2f06; box-shadow: 0 8px 22px rgba(212,175,55,.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(212,175,55,.42); color: #3a2f06; }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline:hover { background: #fff; color: var(--emerald-800); transform: translateY(-2px); }
.btn-ghost { background: rgba(18,84,62,.08); color: var(--emerald-700); }
.btn-ghost:hover { background: var(--emerald-700); color: #fff; }
.btn-lg { padding: 1em 2.3em; font-size: 1.05rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 59, 43, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(212,175,55,.18);
}
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 22px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 1.05rem; margin-inline-end: auto; }
.brand:hover { color: #fff; }
.brand-mark { display: flex; }
.brand-logo { height: 44px; width: auto; max-width: 180px; max-height: 44px; object-fit: contain; border-radius: 8px; }
.brand-text { line-height: 1.3; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { color: #dbeee6; padding: .55em 1em; border-radius: 999px; font-weight: 600; font-size: .95rem; position: relative; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.is-active { color: var(--gold-400); }
.nav-link.is-active::after {
  content: ""; position: absolute; inset-inline: 22%; bottom: 4px; height: 2px;
  background: var(--grad-gold); border-radius: 2px;
}
.nav-login-btn { margin-inline-start: 10px; padding: .55em 1.5em; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 40px; background: rgba(255,255,255,.08); border: none; border-radius: 10px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; width: 20px; margin: 0 auto; background: #fff; border-radius: 2px; transition: .25s; }
.lang-switcher { position: relative; }
.lang-current { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); color: #fff; padding: .5em 1em; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit; font-size: .88rem; }
.lang-current:hover { background: rgba(255,255,255,.18); }
.lang-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-lg); list-style: none; margin: 0; padding: 8px; min-width: 150px; display: none; z-index: 60; }
.lang-switcher.is-open .lang-menu { display: block; animation: fadeDown .18s ease; }
.lang-menu li a { display: block; padding: .55em .9em; border-radius: 8px; color: var(--ink); font-size: .92rem; }
.lang-menu li a:hover, .lang-menu li a.is-current { background: var(--cream); color: var(--emerald-700); }

/* ---------- Sections ---------- */
.section { padding: 78px 0; position: relative; }
.section-surface { background: var(--paper); }
.section-tint { background: linear-gradient(180deg, #f4f7f3, var(--cream)); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head.left { text-align: start; margin-inline: 0; }
.section-subtitle { color: var(--ink-soft); font-size: 1.05rem; }
.page-header { padding: 54px 0 8px; }
.page-title { font-size: clamp(1.7rem, 3vw, 2.2rem); position: relative; padding-inline-start: 18px; }
.page-title::before { content: ""; position: absolute; inset-inline-start: 0; top: .15em; bottom: .15em; width: 6px; background: var(--grad-gold); border-radius: 4px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; text-align: center; overflow: hidden;
  padding: 120px 0 130px;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(212,175,55,.20), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(47,143,109,.35), transparent 55%),
    var(--grad-emerald);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .10; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='1'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z'/%3E%3Cpath d='M40 14 L66 40 L40 66 L14 40 Z'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
}
.hero::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 90px;
  background: linear-gradient(180deg, transparent, var(--cream));
}
.hero-inner { position: relative; z-index: 2; max-width: 820px; margin: 0 auto; }
.hero .eyebrow { color: var(--gold-400); justify-content: center; }
.hero-title { color: #fff; font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: .35em; letter-spacing: -0.02em; }
.hero-title .accent { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { color: #d8e8e1; font-size: clamp(1.05rem, 2vw, 1.28rem); max-width: 640px; margin: 0 auto 1.8em; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(212,175,55,.4); }
.card-link { color: inherit; display: flex; flex-direction: column; height: 100%; }
.card-link:hover { color: inherit; }
.card-media { aspect-ratio: 16/10; background: var(--line); overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-media-placeholder { width: 100%; height: 100%; background: var(--grad-emerald); position: relative; }
.card-media-placeholder::after {
  content: ""; position: absolute; inset: 0; opacity: .25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 4 L56 30 L30 56 L4 30 Z' fill='none' stroke='%23d4af37'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}
.card-body { padding: 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-date { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--gold-600); font-weight: 700; margin-bottom: 10px; }
.card-title { font-size: 1.14rem; margin-bottom: .5em; color: var(--emerald-900); }
.card-excerpt { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1em; flex: 1; }
.card-readmore { color: var(--emerald-600); font-weight: 800; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.card:hover .card-readmore { color: var(--gold-600); }

/* ---------- Stats ---------- */
.stats-content, .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; }
.stat-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 20px; text-align: center; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--grad-gold); }
.stat-number { font-size: 2.6rem; font-weight: 900; line-height: 1; background: var(--grad-emerald); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { color: var(--ink-soft); font-weight: 600; margin-top: 10px; }

/* ---------- Feature / services cards ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px; }
.feature-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(47,143,109,.16), rgba(212,175,55,.16)); color: var(--emerald-700); margin-bottom: 18px; }
.feature-icon svg { width: 28px; height: 28px; }
.feature-card h3 { font-size: 1.16rem; }
.feature-card p { color: var(--ink-soft); font-size: .96rem; margin: 0; }

/* ---------- About ---------- */
.about-split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 46px; align-items: center; }
.about-media { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); position: relative; aspect-ratio: 4/3; }
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about-media-placeholder { width: 100%; height: 100%; background: var(--grad-emerald); }
.rich-content { font-size: 1.03rem; color: var(--ink-soft); }
.rich-content h2, .rich-content h3 { color: var(--emerald-900); margin-top: 1.4em; }
.rich-content img { border-radius: var(--radius-sm); margin: 1em 0; }
.rich-content a { color: var(--emerald-600); font-weight: 600; text-decoration: underline; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.gallery-tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--line); aspect-ratio: 4/3; box-shadow: var(--shadow-sm); }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery-tile:hover img { transform: scale(1.08); }
.gallery-tile-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--emerald-600), var(--gold-500)); }
.gallery-tile-title { position: absolute; inset-inline: 0; bottom: 0; background: linear-gradient(180deg, transparent, rgba(6,30,22,.82)); color: #fff; padding: 34px 16px 14px; font-size: .95rem; font-weight: 700; }
.gallery-grid-full .gallery-tile-full { aspect-ratio: auto; background: none; box-shadow: none; }
.gallery-media { aspect-ratio: 16/9; background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.gallery-media img, .gallery-media video, .gallery-media iframe { width: 100%; height: 100%; object-fit: cover; border: none; }
.gallery-tile-full figcaption { padding: 12px 4px; }
.gallery-tile-full .gallery-tile-title { position: static; background: none; color: var(--emerald-900); padding: 0; display: block; }
.gallery-tile-full .gallery-tile-desc { display: block; color: var(--ink-soft); font-size: .88rem; margin-top: 4px; }
.external-video-link { display: flex; align-items: center; justify-content: center; height: 100%; background: var(--emerald-700); color: #fff; word-break: break-all; padding: 10px; text-align: center; font-size: .85rem; }

/* ---------- Category chips ---------- */
.category-filter { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }
.chip { padding: .5em 1.2em; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); font-size: .9rem; font-weight: 600; background: var(--paper); }
.chip:hover, .chip.is-active { background: var(--grad-emerald); border-color: transparent; color: #fff; }

/* ---------- Detail ---------- */
.detail-container { max-width: 820px; }
.detail-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.detail-meta { color: var(--ink-soft); font-size: .92rem; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.detail-category { font-weight: 700; color: var(--emerald-600); }
.detail-cover { border-radius: var(--radius-xl); overflow: hidden; margin: 22px 0 30px; box-shadow: var(--shadow); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.page-link { padding: .6em 1em; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); font-size: .92rem; background: var(--paper); font-weight: 600; }
.page-link:hover { border-color: var(--emerald-500); color: var(--emerald-700); }
.page-link.is-active { background: var(--grad-emerald); border-color: transparent; color: #fff; }

/* ---------- Contact ---------- */
.contact-info-block { margin-top: 34px; padding: 32px; background: var(--paper); border-radius: var(--radius-xl); box-shadow: var(--shadow); border: 1px solid var(--line); }
.contact-info-list { list-style: none; padding: 0; margin: 0 0 20px; }
.contact-info-list li { padding: 12px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.contact-info-list li:last-child { border-bottom: none; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; }
.social-link { padding: .5em 1.2em; border-radius: 999px; background: rgba(18,84,62,.08); color: var(--emerald-700); font-size: .85rem; font-weight: 600; }
.social-link:hover { background: var(--emerald-700); color: #fff; }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 56px 40px; text-align: center; color: #fff; background: var(--grad-emerald); box-shadow: var(--shadow-lg); }
.cta-band::before { content: ""; position: absolute; inset: 0; opacity: .12; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 2 L58 30 L30 58 L2 30 Z' fill='none' stroke='%23d4af37'/%3E%3C/svg%3E"); background-size: 60px; }
.cta-band > * { position: relative; z-index: 2; }
.cta-band h2 { color: #fff; }

/* ---------- Empty / 404 ---------- */
.empty-state { color: var(--ink-soft); text-align: center; padding: 40px 0; }
.not-found { text-align: center; padding: 110px 0; }
.not-found h1 { font-size: 2.4rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--emerald-900); color: #bfd6cc; padding: 40px 0 26px; margin-top: 20px; }
.footer-inner { text-align: center; }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; }
.footer-inner p { margin: 6px 0; font-size: .9rem; }
.footer-motif { display: flex; justify-content: center; margin-bottom: 18px; opacity: .55; }

/* ---------- Entrance animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about-split { grid-template-columns: 1fr; gap: 28px; }
  .about-media { order: -1; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; inset-inline: 0; top: 68px; flex-direction: column; align-items: stretch;
    gap: 4px; background: var(--emerald-900); padding: 16px 18px 24px;
    box-shadow: var(--shadow-lg); transform: translateY(-140%); transition: transform .28s ease;
    max-height: calc(100vh - 68px); overflow-y: auto;
  }
  .main-nav.is-open { transform: translateY(0); }
  .nav-link { padding: .8em 1em; border-radius: 12px; }
  .nav-link.is-active::after { display: none; }
  .nav-link.is-active { background: rgba(255,255,255,.1); }
  .nav-login-btn { margin: 8px 0 0; justify-content: center; }
  .brand-logo { height: 36px; max-height: 36px; max-width: 130px; }
}
@media (max-width: 620px) {
  .section { padding: 54px 0; }
  .hero { padding: 84px 0 96px; }
  .contact-info-block { padding: 22px; }
  .cta-band { padding: 40px 22px; }
  .brand-logo { height: 32px; max-height: 32px; max-width: 110px; }
}
