/* Caravanways — سایت عمومی.
   هیچ چیزی از بیرون بارگذاری نمی‌شود (فونت هم روی خود سرور است) تا در قطعی اینترنت سالم بماند. */

@font-face {
  font-family: Vazirmatn;
  src: url('/assets/fonts/vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #faf6ef;
  --paper-2: #f2ebdf;
  --card: #fffdf9;
  --ink: #241f1a;
  --muted: #736858;
  --line: #e6dccb;
  --land: #e8dfd0;
  --land-dim: #ddd3c2;
  --land-stroke: #faf6ef;
  --sea: #f5efe4;
  --accent: #b4482a;
  --accent-2: #d98b4a;
  --accent-soft: #eab896;
  --deep: #14565c;
  --accent-ink: #fff;
  --radius: 16px;
  --shadow-s: 0 1px 2px rgb(60 40 20 / 7%);
  --shadow: 0 2px 4px rgb(60 40 20 / 5%), 0 10px 28px rgb(60 40 20 / 8%);
  --shadow-l: 0 4px 10px rgb(60 40 20 / 7%), 0 24px 60px rgb(60 40 20 / 10%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17150f;
    --paper-2: #201d16;
    --card: #221f18;
    --ink: #f0e9dc;
    --muted: #a99d89;
    --line: #35301f;
    --land: #332f26;
    --land-dim: #2a2720;
    --land-stroke: #17150f;
    --sea: #1b1912;
    --accent: #e0774f;
    --accent-2: #d8a05f;
    --accent-soft: #8d5338;
    --deep: #52b3b8;
    --accent-ink: #17150f;
    --shadow-s: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow: 0 2px 4px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
    --shadow-l: 0 4px 10px rgb(0 0 0 / 35%), 0 24px 60px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Vazirmatn, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
}
body.lang-fa, [lang='fa'] { font-family: Vazirmatn, Tahoma, sans-serif; }

a { color: inherit; }
a:focus-visible, summary:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--deep); outline-offset: 2px; border-radius: 6px;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.3; }

main { max-width: 1160px; margin: 0 auto; padding: 0 20px 64px; }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.12rem; margin: 6px 0 0; }
.block { margin-top: 56px; }
.block > h2 { font-size: 1.45rem; margin: 0 0 6px; }
.block > .muted { margin: 0 0 18px; }
.block > h2 + .cards, .block > h2 + .travellers { margin-top: 18px; }
.section-sub { font-size: 1.05rem; color: var(--muted); margin: 34px 0 14px; font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }

.button {
  display: inline-block; padding: 7px 16px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); background: var(--card); font-size: .92rem; font-weight: 600;
}
.button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- نوار بالا */

.topbar {
  display: flex; align-items: center; gap: 18px;
  max-width: 1160px; margin: 0 auto; padding: 16px 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; text-decoration: none; letter-spacing: .2px; font-size: 1.08rem;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 30%, var(--accent-2), var(--accent) 65%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.nav { display: flex; gap: 6px; margin-inline-start: auto; }
.nav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--paper-2); }

.langs { position: relative; }
.langs summary {
  list-style: none; cursor: pointer; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 999px; font-size: .9rem; white-space: nowrap; background: var(--card);
}
.langs summary::-webkit-details-marker { display: none; }
.langs ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30;
  margin: 0; padding: 6px; list-style: none; min-width: 160px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.langs li a { display: block; padding: 7px 12px; border-radius: 9px; text-decoration: none; }
.langs li a:hover { background: var(--paper-2); }
.langs li a[aria-current] { font-weight: 700; color: var(--accent); }

/* ---------- سربرگ صفحه‌ها */

.hero { text-align: center; padding: 46px 0 10px; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); margin: 0 0 10px; letter-spacing: -.5px; }
.hero .lead { font-size: 1.2rem; }
.page-head { padding: 26px 0 10px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0; }
.crumbs { padding-top: 14px; font-size: .92rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- جستجو */

.search-box { display: flex; gap: 8px; max-width: 560px; margin: 22px auto 0; }
.page-head .search-box { margin-inline: 0; }
.search-box input {
  flex: 1; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: inherit; font: inherit; box-shadow: var(--shadow-s);
}
.search-box button {
  padding: 11px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700;
}
.search-box button:hover { background: color-mix(in srgb, var(--accent) 85%, black); }
#search-status { margin-top: 18px; }
#search-results { margin-top: 10px; }

/* ---------- نقشه */

.map-stage {
  position: relative; margin: 26px auto 0; padding: 18px;
  background: linear-gradient(180deg, var(--sea), var(--card));
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-l);
}
.map-stage.sub { max-width: 720px; }
.map-stage.sub.small { max-width: 480px; }
.map { display: block; width: 100%; height: auto; overflow: visible; }

.map .place {
  fill: var(--land); stroke: var(--land-stroke); stroke-width: .7; stroke-linejoin: round;
  transition: fill .18s ease;
}
.map-sub .place { stroke-width: 1.1; fill: var(--land-dim); }
.map .place.has { fill: var(--accent-soft); }
.map a .place.has { cursor: pointer; }
.map a:hover .place.has, .map a:focus-visible .place.has { fill: var(--accent); }
.map .place.current { fill: var(--accent); }
.map a:focus-visible { outline: none; }

.map .pin { pointer-events: none; }
.map .pin .halo { fill: var(--accent); opacity: .18; }
.map .pin .dot { fill: var(--accent); }
.map .pin text {
  fill: #fff; font-size: 9px; font-weight: 700; text-anchor: middle;
  font-family: Vazirmatn, system-ui, sans-serif;
}
.map-sub .pin text { font-size: 13px; }

.map-hint { text-align: center; color: var(--muted); font-size: .92rem; margin: 10px 0 2px; }
.map-tip {
  position: fixed; z-index: 40; pointer-events: none; padding: 5px 11px; border-radius: 9px;
  background: var(--ink); color: var(--paper); font-size: .85rem; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 14px)); box-shadow: var(--shadow);
}

.stats {
  display: flex; justify-content: center; gap: 36px; flex-wrap: wrap;
  margin-top: 26px; color: var(--muted); font-size: .98rem;
}
.stats b { display: block; font-size: 1.9rem; color: var(--ink); line-height: 1.1; font-weight: 800; }
.stats span { text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.chips a {
  display: inline-flex; gap: 8px; align-items: center; text-decoration: none; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .94rem;
}
.chips a:hover { border-color: var(--accent); }
.chips span { color: var(--accent); font-weight: 700; }

/* صفحهٔ کشور: نقشه در وسط، پروفایل نویسنده‌ها در گوشهٔ بالای سمت شروع (راست در فارسی) */
.country-stage { position: relative; margin-top: 26px; }
.country-stage .map-stage { margin-top: 0; }
.map-rail {
  position: absolute; inset-block-start: 16px; inset-inline-start: 16px; z-index: 5;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
  box-shadow: var(--shadow); max-width: 230px; backdrop-filter: blur(4px);
}
.map-rail h2 { font-size: .9rem; margin: 0 0 8px; color: var(--muted); font-weight: 700; }
.map-rail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.map-rail li a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 6px 8px; border-radius: 12px;
}
.map-rail li a:hover { background: var(--paper-2); }
.map-rail li b { display: block; font-size: .95rem; line-height: 1.3; }
.map-rail li .muted { font-size: .8rem; }

/* ---------- مسافرها */

.avatar {
  border-radius: 50%; object-fit: cover; flex: none; background: var(--paper-2);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--accent-soft);
}
.avatar.sm { width: 26px; height: 26px; }
.avatar.md { width: 44px; height: 44px; }
.avatar.lg { width: 72px; height: 72px; }
.avatar.xl { width: 112px; height: 112px; }
.avatar.letter {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #fff; font-weight: 800;
}
.avatar.letter.sm { font-size: .8rem; }
.avatar.letter.md { font-size: 1.1rem; }
.avatar.letter.lg { font-size: 1.7rem; }
.avatar.letter.xl { font-size: 2.6rem; }

.travellers { display: flex; flex-wrap: wrap; gap: 14px; }
.travellers.wide { gap: 18px; }
.traveller {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none;
  width: 140px; padding: 18px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-s); transition: transform .15s ease, border-color .15s ease;
}
.traveller:hover { transform: translateY(-2px); border-color: var(--accent); }
.traveller-name { font-weight: 700; text-align: center; line-height: 1.35; }
.traveller-count { color: var(--muted); font-size: .85rem; }

.profile { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 26px 0 6px; }
.profile h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0; }
.profile .links { display: flex; gap: 10px; margin: 8px 0 0; }
.profile .links a { font-size: .9rem; color: var(--accent); }

/* ---------- کارت سفرنامه */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.card-link { display: flex; flex-direction: column; text-decoration: none; flex: 1; }
.card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--paper-2); }
.noimg { background: linear-gradient(140deg, var(--paper-2), var(--land)); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 12px; }
.card .meta { color: var(--muted); font-size: .82rem; }
.card-title { font-size: 1.13rem; font-weight: 700; line-height: 1.45; }
.card:hover .card-title { color: var(--accent); }
.card .summary {
  color: var(--muted); font-size: .94rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-author {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line);
  text-decoration: none; font-size: .88rem; color: var(--muted);
}
.card-author:hover { color: var(--accent); }
.lang-tag {
  margin-inline-start: auto; background: var(--paper-2); padding: 2px 9px;
  border-radius: 999px; font-size: .78rem;
}

/* ---------- سفرنامه */

.story { max-width: 740px; margin: 0 auto; }
.story header { padding: 18px 0 14px; }
.story h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); margin: 10px 0 12px; letter-spacing: -.4px; }
.story .lead { font-size: 1.22rem; margin-bottom: 16px; }
.byline { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.byline .muted { font-size: .88rem; }
.tr-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.tr-links a {
  font-size: .85rem; padding: 3px 12px; border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none;
}
.cover { margin: 14px -20px 28px; }
.cover img { width: 100%; }
@media (min-width: 780px) {
  .cover { margin-inline: -70px; }
  .cover img { border-radius: var(--radius); box-shadow: var(--shadow); }
}

.prose { font-size: 1.12rem; line-height: 2; }
.lang-fa .prose { line-height: 2.15; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.55rem; margin: 2em 0 .5em; }
.prose h3 { font-size: 1.25rem; margin: 1.7em 0 .4em; }
.prose img { margin: 1.6em auto; border-radius: 12px; box-shadow: var(--shadow-s); }
.prose blockquote {
  margin: 1.6em 0; padding: .2em 1.1em; border-inline-start: 3px solid var(--accent); color: var(--muted);
}
.prose a { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }

.story-foot { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.traveller-row { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.traveller-row b { display: block; font-size: 1.05rem; }
.traveller-row .muted { font-size: .93rem; }

.untranslated { max-width: 620px; margin: 56px auto; text-align: center; }
.untranslated ul { list-style: none; padding: 0; }
.untranslated li { margin: 10px 0; }

.lang-pick { text-align: center; padding: 15vh 20px; }
.lang-pick ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.lang-pick a {
  display: inline-block; padding: 9px 22px; border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none; background: var(--card);
}

.foot {
  text-align: center; color: var(--muted); font-size: .86rem;
  padding: 28px 20px 44px; border-top: 1px solid var(--line); max-width: 1160px; margin: 0 auto;
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  main { padding-inline: 16px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding-inline: 16px; }
  .nav { order: 3; width: 100%; justify-content: center; margin-inline-start: 0; }
  .langs { margin-inline-start: auto; }
  .map-stage { padding: 10px; border-radius: 16px; }
  .stats { gap: 22px; }
  .stats b { font-size: 1.5rem; }
  .traveller { width: calc(50% - 7px); }
  .map-rail {
    position: static; max-width: none; margin-bottom: 14px; backdrop-filter: none;
  }
  .map-rail ul { flex-direction: row; flex-wrap: wrap; }
  .map-rail li a { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; }
  .cards { grid-template-columns: 1fr; }
  .profile { gap: 16px; }
  .prose { font-size: 1.06rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}

/* ---------- پرچم کشور مسافر */
.flag {
  width: 21px; height: 16px; object-fit: cover; border-radius: 3px; display: inline-block;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 12%);
  vertical-align: middle;
}
.flag.big { width: 32px; height: 24px; vertical-align: -3px; margin-inline-start: 8px; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.avatar-wrap .flag.on-avatar {
  position: absolute; inset-block-end: -2px; inset-inline-end: -4px;
  width: 18px; height: 14px; box-shadow: 0 0 0 2px var(--card);
}
.avatar-wrap.sm .flag.on-avatar { width: 13px; height: 10px; inset-inline-end: -3px; }
.avatar-wrap.lg .flag.on-avatar { width: 22px; height: 17px; }
.avatar-wrap.xl .flag.on-avatar { width: 30px; height: 23px; inset-block-end: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 4px; color: var(--muted); font-size: .95rem; }
.facts span { display: inline-flex; align-items: center; gap: 7px; }
.langs summary, .langs li a, .tr-links a, .untranslated li a { display: inline-flex; align-items: center; gap: 7px; }
.langs li a { display: flex; }
.country-head h1 { display: inline-flex; align-items: center; gap: 12px; }
.card .meta, .story .crumbs a, .crumbs a { gap: 6px; }
.card .meta .flag { vertical-align: -2px; }

/* فرم خبرنامه */
.subscribe-form { max-width: 440px; display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.subscribe-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.subscribe-form input {
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: inherit; font: inherit; font-weight: 400;
}
.subscribe-form button {
  align-self: flex-start; padding: 11px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700;
}
.form-note { max-width: 440px; color: var(--muted); }
.form-note.ok { color: var(--deep); font-weight: 600; }
.form-note.bad { color: var(--accent); font-weight: 600; }

/* ---------- لایک و نظر */
.reactions { display: flex; gap: 12px; margin: 32px 0 8px; }
.like-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: inherit; font: inherit; font-weight: 600;
  transition: border-color .15s ease, color .15s ease, transform .1s ease;
}
.like-btn:hover { border-color: var(--accent); color: var(--accent); }
.like-btn:active { transform: scale(.97); }
.like-btn.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.like-btn .heart { font-size: 1.15rem; line-height: 1; }
.like-btn .like-count { color: var(--muted); font-weight: 700; }
.like-btn.on .like-count { color: var(--accent); }

.comments { max-width: 720px; margin: 36px auto 0; }
.comments h2 { font-size: 1.3rem; margin: 0 0 14px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 18px; }
.comment {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow-s);
}
.comment-head { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.comment-body { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.9; }
.comment-reply {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--paper-2); border-inline-start: 3px solid var(--accent);
}
.comment-reply .tag {
  font-size: .75rem; background: var(--accent); color: var(--accent-ink);
  padding: 2px 9px; border-radius: 999px;
}
.comment-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.comment-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.comment-form input, .comment-form textarea {
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: inherit; font: inherit; font-weight: 400; resize: vertical;
}
.comment-form button {
  align-self: flex-start; padding: 10px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700;
}
