/* ---- Design tokens (ported from the Next.js version's app/globals.css) ---- */
:root {
  --background: #fbf7f1;
  --foreground: #2f271f;
  --accent: #ac8544;
  --accent-foreground: #fffdf9;
  --secondary: #b6767c;
  --secondary-foreground: #fffdf9;
  --muted: #f2e9db;
  --border: #e6d9c3;
}

/* ---- Reset / base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  line-height: 1.6;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--accent-foreground); }

.container { max-width: 1024px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 1rem; }
.container-md { max-width: 860px; margin: 0 auto; padding: 0 1rem; }

.text-center { text-align: center; }
.muted { color: color-mix(in srgb, var(--foreground) 60%, transparent); }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: blur(6px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  flex-wrap: wrap;
}
.brand {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent);
}
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; font-size: 0.9rem; }
.nav-link {
  position: relative;
  color: color-mix(in srgb, var(--foreground) 75%, transparent);
  transition: color 0.15s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.2s;
}
.nav-link:hover { color: var(--accent); }
.nav-link:hover::after { width: 100%; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.65rem 1.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, background-color 0.15s;
}
.btn-accent { background: var(--accent); color: var(--accent-foreground); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.btn-accent:hover { transform: scale(1.05); }
.btn-outline { background: color-mix(in srgb, var(--background) 70%, transparent); border-color: var(--border); backdrop-filter: blur(4px); }
.btn-outline:hover { background: var(--background); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }

/* ---- Ornament divider ---- */
.ornament-divider { display: flex; align-items: center; justify-content: center; gap: 0.75rem; color: var(--accent); }
.ornament-divider .line { height: 1px; width: 3rem; background: currentColor; opacity: 0.4; }
.ornament-divider .diamond { width: 0.6rem; height: 0.6rem; background: currentColor; transform: rotate(45deg); border-radius: 2px; }

/* ---- Section heading ---- */
.section-heading { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; margin-bottom: 2.5rem; }
.section-heading .eyebrow { font-size: 0.9rem; font-weight: 500; color: var(--accent); margin: 0; }
.section-heading h2 { font-size: 1.75rem; font-weight: 800; margin: 0; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-fallback-bg {
  background-image:
    radial-gradient(ellipse 60% 50% at 20% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
    radial-gradient(ellipse 55% 45% at 85% 75%, color-mix(in srgb, var(--secondary) 14%, transparent), transparent),
    linear-gradient(180deg, var(--muted), var(--background));
}
.hero-bg-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--background), color-mix(in srgb, var(--background) 70%, transparent) 60%, color-mix(in srgb, var(--background) 30%, transparent)); }
.hero-content {
  position: relative;
  min-height: 68vh;
  max-width: 1024px;
  margin: 0 auto;
  padding: 6rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
}
.hero-content .eyebrow { color: var(--accent); font-weight: 500; margin: 0; }
.hero-content h1 { font-size: 2.5rem; font-weight: 900; margin: 0; }
.hero-content p { max-width: 36rem; color: color-mix(in srgb, var(--foreground) 70%, transparent); margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 0.5rem; }
@media (min-width: 640px) { .hero-content h1 { font-size: 3rem; } }

/* ---- Grids ---- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Cards ---- */
.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.card-body { padding: 1.5rem; }
.card-service { text-align: center; }
.card-service h3 { color: var(--accent); margin: 0 0 0.5rem; }
.card-service p { margin: 0; font-size: 0.9rem; color: color-mix(in srgb, var(--foreground) 70%, transparent); }

.post-card { display: flex; flex-direction: column; overflow: hidden; }
.post-card .thumb { position: relative; aspect-ratio: 4/3; background: var(--muted); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .card-body { display: flex; flex-direction: column; gap: 0.5rem; }
.post-card h3 { margin: 0; font-weight: 700; }
.post-card .date { font-size: 0.75rem; color: color-mix(in srgb, var(--foreground) 60%, transparent); margin: 0; }

.testimonial-card { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.testimonial-card .stars { color: var(--accent); }
.testimonial-card blockquote { margin: 0; color: color-mix(in srgb, var(--foreground) 80%, transparent); }
.testimonial-card .name { margin: 0; font-weight: 700; font-size: 0.9rem; color: color-mix(in srgb, var(--foreground) 60%, transparent); }

.badge {
  display: inline-block;
  width: fit-content;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: color-mix(in srgb, var(--secondary) 15%, transparent);
  color: var(--secondary);
}

/* ---- Category pills (gallery filters) ---- */
.pill-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-bottom: 2.5rem; }
.pill {
  border-radius: 9999px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  background: var(--muted);
  transition: background-color 0.15s;
}
.pill:hover { background: var(--border); }
.pill.active { background: var(--accent); color: var(--accent-foreground); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ---- Forms ---- */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=tel], .field input[type=date], .field input[type=number],
.field textarea, .field select {
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}
.field textarea { resize: vertical; }
.error-text { color: #b91c1c; font-size: 0.9rem; }
.success-box { background: var(--muted); border-radius: 0.75rem; padding: 1.5rem; text-align: center; font-size: 0.9rem; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--muted); }
.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 3.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--foreground) 70%, transparent);
}
.site-footer .footer-name { font-size: 1.1rem; font-weight: 900; color: var(--foreground); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; }
.footer-links a:hover { color: var(--accent); }
.admin-login-link { font-size: 0.75rem; color: color-mix(in srgb, var(--foreground) 50%, transparent); }

/* ---- WhatsApp floating button ---- */
.whatsapp-button {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 50;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.whatsapp-button:hover { transform: scale(1.05); }
.whatsapp-button svg { width: 1.75rem; height: 1.75rem; fill: currentColor; }

/* ---- Post detail page ---- */
.post-header { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; margin-bottom: 2rem; }
.post-header h1 { font-size: 1.85rem; font-weight: 900; margin: 0; }
.post-cover { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.06); margin-bottom: 2.5rem; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-body { white-space: pre-line; font-size: 1.1rem; line-height: 1.9; color: color-mix(in srgb, var(--foreground) 80%, transparent); margin-bottom: 2.5rem; }
.post-embed { margin-bottom: 2.5rem; border-radius: 0.75rem; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.post-embed iframe { width: 100%; aspect-ratio: 16/9; border: 0; }
.post-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 640px) { .post-gallery { grid-template-columns: repeat(3, 1fr); } }
.post-gallery .item { position: relative; aspect-ratio: 1/1; overflow: hidden; border-radius: 0.5rem; box-shadow: 0 1px 2px rgba(0,0,0,0.06); transition: transform 0.2s; }
.post-gallery .item:hover { transform: scale(1.02); }
.post-gallery .item img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Admin ---- */
.admin-page { padding: 2.5rem 1rem; max-width: 960px; margin: 0 auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 2rem; font-size: 0.9rem; }
.admin-nav a:hover { color: var(--accent); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { text-align: right; padding: 0.5rem 0; border-bottom: 1px solid var(--border); color: color-mix(in srgb, var(--foreground) 60%, transparent); font-weight: 500; }
.admin-table td { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.admin-table td.actions { text-align: left; }
.status-pill { border-radius: 9999px; padding: 0.2rem 0.75rem; font-size: 0.8rem; border: none; cursor: pointer; }
.status-pill.published { background: #dcfce7; color: #15803d; }
.status-pill.draft { background: var(--muted); color: color-mix(in srgb, var(--foreground) 60%, transparent); }
.link-danger { color: #dc2626; background: none; border: none; cursor: pointer; font: inherit; }
.link-danger:hover { text-decoration: underline; }
.empty-row { text-align: center; padding: 2rem 0; color: color-mix(in srgb, var(--foreground) 60%, transparent); }
.thumb-preview { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.thumb-preview .thumb-item { position: relative; }
.thumb-preview img { width: 5rem; height: 5rem; border-radius: 0.5rem; object-fit: cover; }
.thumb-preview .remove-btn {
  position: absolute; top: -0.5rem; inset-inline-start: -0.5rem;
  background: #dc2626; color: #fff; border: none; border-radius: 9999px;
  width: 1.25rem; height: 1.25rem; font-size: 0.7rem; cursor: pointer; line-height: 1;
}
.checkbox-field { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.checkbox-field input { width: auto; }
