/* Font (Persian) */
@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@200;300;400;500;600;700;800&display=swap");

:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --primary: #2563eb;
  --primary2: #0ea5e9;
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
html{ direction:ltr; overflow-x:hidden; }
body{
  /* overflow-x:hidden; */
  direction: rtl;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.8;
}


button, input, select, textarea{
  font-family: inherit;
  font-size: inherit;
}

a{ color: inherit; text-decoration: none; }

img{ max-width:100%; height:auto; }


.container{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

/* Hero */
.hero{
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px 24px;
  background:
    radial-gradient(800px 200px at 20% 0%, rgba(14,165,233,.22), transparent 55%),
    radial-gradient(700px 220px at 90% 10%, rgba(37,99,235,.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.72));
  box-shadow: var(--shadow);
}

.hero-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  flex-wrap: wrap;
}


/* Brand (logo + title) */
.hero-brand{
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-brand .site-logo{
  width: 92px;
  height: 44px;
  object-fit: contain;
  border-radius: 14px;
  padding: 6px;
  background: rgba(255,255,255,.65);
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
}

@media (max-width: 620px){
  .hero-brand .site-logo{ width: 76px; height: 38px; }
}

.hero-title{
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.hero-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.actions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}

/* Buttons */
.btn{
  font-family: inherit;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15,23,42,.10);
  border-color: rgba(37,99,235,.35);
}

.btn-primary{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #f4f2f3;
  border-color: rgba(255,255,255,.0);
}

.btn-primary:hover{
  box-shadow: 0 14px 30px rgba(37,99,235,.22);
}

/* Search */
.searchbar{
  margin-top: 16px;
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}

.input{
  font-family: inherit;
  flex: 1 1 320px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  outline: none;
  font-size: 18px;
}

.input:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Cards */
.grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 980px){ .grid{ grid-template-columns: repeat(2, 1fr);} }
@media (max-width: 620px){ .grid{ grid-template-columns: 1fr;} }

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
  min-width: 0; /* خیلی مهم: اجازه می‌دهد کارت در grid جمع شود */
}

.card h3{
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
}

.meta{ color: var(--muted); font-size: 13px; margin-bottom: 10px; }

.empty{
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed rgba(15,23,42,.20);
  border-radius: 16px;
  background: rgba(255,255,255,.6);
  color: var(--muted);
}
.empty h3{
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

/* Uniform card image */
/* Stop image stretching (no deform) */
.card img {
  width: 100% !important;
  height: auto !important;
}

/* If you have a wrapper for the photo, this makes it uniform + no stretch */
.photo-frame{
  width: 100%;
  aspect-ratio: 4 / 3;     /* اگر مربع می‌خوای: 1 / 1 */
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0,0,0,0.04);
  margin-bottom: 10px;
  position: relative; /* لازم برای absolute شدن overlay */
}

.photo-frame > img{
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;        /* کلید اصلی: بدون کشیدگی */
  object-position: center;
}


/* stamp overlay for deceased people */
.photo-stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.photo-stamp img {
  width: min(85%, 360px);
  height: auto;
  opacity: 0.9;
  transform: rotate(-18deg);
}


/* Text spacing inside cards */
.person-card {
  padding: 16px;
}

.person-card h3 {
  margin: 10px 0 6px;
}

.person-card .meta,
.person-card p {
  margin: 0;
  line-height: 1.9;
}

.person-card p {
  margin-top: 8px;
  opacity: 0.95;
}

/* "More" expandable section */
.more { margin-top: 12px; }
.more-btn {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.02);
}
.more-btn::-webkit-details-marker { display: none; }

.more-text::before { content: "نمایش بیشتر"; }
.more[open] .more-text::before { content: "بستن"; }

.more-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.more-body .row { margin-top: 8px; line-height: 1.9; }

/* Headline overlay on photo (bottom of image) */

.photo-overlay{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 10px 12px;
  color: #e11d48;
  font-weight: 900;
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);

  z-index: 4;

  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  backdrop-filter: blur(1px);

  /* حداکثر دو خط، باقی… */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}


/* Site header */
.site-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 12px 14px;
  margin: 16px 0 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.site-header--navonly{
  justify-content: rtl;
}

.site-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

.site-logo{
  height: 64px;
  width:auto;
  display:block;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.12));
}

.site-nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

@media (max-width: 720px){
  .site-header{
    flex-direction:column;
    align-items:stretch;
  }
  .site-nav{
    justify-content:center;
  }
}

/* Top banner (logo left + banner right; stack on mobile) */
.top-banner{
  margin: 0 0 14px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(900px 260px at 20% 0%, rgba(14,165,233,.18), transparent 55%),
    radial-gradient(800px 280px at 90% 10%, rgba(37,99,235,.14), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.76));
  box-shadow: var(--shadow);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-banner-logo{
  width: 180px;
  max-width: 38%;
  height: auto;
  max-height: 180px;
  display: block;
  object-fit: contain;
}

.top-banner-image{
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
}

@media (max-width: 720px){
  .top-banner{
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .top-banner-logo{
    width: 200px;
    max-width: 85%;
  }
  .top-banner-image{
    max-width: 100%;
  }
}



/* شکستن متن‌ها/لینک‌های طولانی داخل "نمایش بیشتر" */
.more-body,
.more-body .row,
.more-body a{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.more-body a{
  display: inline-block;
  max-width: 100%;
}


/* =========================
   Contact form (clean layout)
   ========================= */
.form-card{
  max-width: 820px;
  margin: 18px auto;
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

@media (max-width: 720px){
  .form-grid{ grid-template-columns: 1fr; }
}

.form-field label{
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
  color: var(--muted);
}

.form-span{ grid-column: 1 / -1; }

.form-card input,
.form-card select,
.form-card textarea{
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.90);
  outline: none;
  font-size: 18px;
}

.form-card textarea{
  min-height: 220px;
  resize: vertical;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.form-card input[type="file"]{
  padding: 10px;
  background: rgba(255,255,255,.70);
}

.form-actions{
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* =========================
   Make Django form widgets match our inputs
   ========================= */

input[type="text"], input[type="url"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  outline: none;
  font-size: 14px;
  font-family: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
input[type="file"]{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(15,23,42,.20);
  background: rgba(255,255,255,.75);
  font-family: inherit;
}
@media (max-width: 620px){
  .grid[style*="repeat(2"]{ grid-template-columns: 1fr !important; }
}
