/* Оформление сайта yoldash.pro.
   Палитра: тёмно-зелёный и солнечно-жёлтый из знака Ýoldaş, тёплый светлый фон.
   Шрифты системные: сайт открывают с недорогих телефонов и медленного интернета. */

:root {
  --brand: #0b7a4f;
  --brand-deep: #064430;
  --brand-ink: #04281c;
  --sun: #ffd34d;
  --sun-deep: #f2b600;
  --page: #f6f4ee;
  --surface: #ffffff;
  --ink: #14211b;
  --muted: #5f6b64;
  --line: #e3dfd3;
  --tint: #e9f3ee;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 33, 27, 0.06), 0 8px 24px rgba(20, 33, 27, 0.06);
  --wrap: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #23a877;
    --brand-deep: #0a3a29;
    --brand-ink: #06231a;
    --page: #0d1411;
    --surface: #151e1a;
    --ink: #e9efe9;
    --muted: #94a39b;
    --line: #25322c;
    --tint: #14251e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 750; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; border-radius: 10px; background: var(--surface); z-index: 20; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 2px; border-radius: 6px; }

/* --- Кнопки --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.button:active { transform: translateY(1px); }
.button.primary { background: var(--brand); color: #fff; }
.button.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.button.sun { background: var(--sun); color: #1c1a05; }
.button.sun:hover { background: var(--sun-deep); }
.button.ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.ghost:hover { border-color: var(--brand); color: var(--brand); }
.button.big { min-height: 52px; padding: 14px 26px; font-size: 17px; }

/* --- Шапка --- */

.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(12px); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; }
.logo-mark { width: 36px; height: 36px; flex: none; }
.main-nav { display: flex; gap: 4px; margin-right: auto; }
.main-nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: 16px; font-weight: 600; text-decoration: none; }
.main-nav a:hover { color: var(--ink); }
.main-nav a[aria-current] { background: var(--tint); color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.short { display: none; }
.lang-link { color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; }
.lang-link:hover { color: var(--brand); }

/* --- Первый экран --- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(255, 211, 77, 0.22), transparent 60%),
    linear-gradient(160deg, #0b7a4f 0%, #064430 70%, #04281c 100%);
  color: #fff;
}
/* Узор из восьмиконечных звёзд — мотив туркменского ковра, едва заметный. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.500'%3E%3Crect x='30' y='30' width='36' height='36'/%3E%3Crect x='30' y='30' width='36' height='36' transform='rotate(45 48 48)'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  pointer-events: none;
}
.hero-inner { position: relative; padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(40px, 6vw, 72px); }
.eyebrow { display: inline-block; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.hero h1 { max-width: 16ch; }
.hero-text { max-width: 52ch; margin-top: 18px; color: rgba(255, 255, 255, 0.82); font-size: clamp(17px, 2vw, 20px); }

.search { display: flex; gap: 8px; max-width: 760px; margin-top: 30px; padding: 8px; border-radius: 18px; background: #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22); }
.search input, .search select { min-width: 0; height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: #14211b; font: inherit; font-size: 16px; }
.search input { flex: 1; }
.search select { flex: none; width: 190px; border-left: 1px solid #e3dfd3; border-radius: 0; }
.search input:focus-visible, .search select:focus-visible { outline: 2px solid #0b7a4f; outline-offset: -2px; border-radius: 12px; }
.search .button { min-height: 48px; }

.stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 34px 0 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.stats dd { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* --- Разделы --- */

.section { padding: clamp(36px, 5vw, 64px) 0; }
.section.page-top { padding-top: clamp(24px, 4vw, 44px); }
.section-tint { background: var(--tint); }
.section h2 { margin-bottom: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 650; text-decoration: none; white-space: nowrap; }
.lead { max-width: 62ch; margin-top: 12px; color: var(--muted); font-size: 19px; }

.categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.category { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease; }
.category:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.category-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 8px; border-radius: 13px; background: var(--tint); font-size: 24px; }
.category-name { font-size: 17px; font-weight: 700; }
.category-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* --- Объявления --- */

.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.ad-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease; }
.ad-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
.ad-card.is-top { border-color: var(--sun-deep); box-shadow: inset 0 0 0 1px var(--sun-deep); }
.ad-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.ad-photo { width: 100%; height: 190px; object-fit: cover; background: var(--tint); }
.ad-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 16px; }
.ad-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { padding: 3px 10px; border-radius: 8px; background: var(--tint); color: var(--brand); font-size: 13px; font-weight: 700; }
.tag-seek { background: color-mix(in srgb, var(--sun) 30%, transparent); color: color-mix(in srgb, var(--sun-deep) 55%, var(--ink)); }
.tag-top { background: var(--sun); color: #1c1a05; }
.ad-price { margin-left: auto; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; text-align: right; overflow-wrap: anywhere; }
.ad-price.big { font-size: 26px; }
.ad-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; }
.ad-meta { margin-top: auto; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.more { grid-column: 1 / -1; justify-self: center; min-width: 220px; margin-top: 8px; }
.count { margin: 18px 0 14px; color: var(--muted); font-size: 15px; }

/* --- Фильтры --- */

.chips { display: flex; gap: 8px; margin: 20px -20px 0; padding: 0 20px 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--brand); }
.chip[aria-current] { border-color: var(--brand); background: var(--brand); color: #fff; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.field.grow { flex: 1 1 240px; }
.field span { color: var(--muted); font-size: 13px; font-weight: 600; }
.field input, .field select { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); color: var(--ink); font: inherit; font-size: 16px; }
.field input:focus, .field select:focus { border-color: var(--brand); outline: none; }

.empty { max-width: 520px; margin: 48px auto; text-align: center; }
.empty h1, .empty h2 { margin-bottom: 10px; }
.empty p { margin-bottom: 22px; color: var(--muted); }

/* --- Страница объявления --- */

.ad-page { max-width: 820px; }
.ad-page > h2 { margin: 44px 0 18px; }
.back { display: inline-block; margin-bottom: 16px; font-weight: 650; text-decoration: none; }
.ad-full { padding: clamp(18px, 3vw, 30px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.ad-full.is-top { border-color: var(--sun-deep); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 20px; }
.gallery img { width: 100%; height: 240px; border-radius: 12px; object-fit: cover; background: var(--tint); }
.gallery.single img { height: auto; max-height: 460px; }
.ad-title { margin: 14px 0 12px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.ad-full-text { font-size: 18px; white-space: pre-line; overflow-wrap: anywhere; }
.ad-full .ad-meta { margin-top: 16px; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hint { margin-top: 14px; color: var(--muted); font-size: 14px; }

/* --- Попутчики --- */

.trips-teaser { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr); gap: 40px; align-items: start; }
.trips-intro p { margin: 12px 0 22px; color: var(--muted); font-size: 18px; }
.trip-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; margin-top: 30px; }
.trip-columns h2 { font-size: 22px; }
.trip-day { margin: 18px 0 8px; color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.trip-day:first-child { margin-top: 0; }
.trip { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trip-main { min-width: 0; }
.trip-route { overflow-wrap: anywhere; }
.arrow { margin: 0 8px; color: var(--muted); font-weight: 400; }
.trip-meta { margin-top: 2px; color: var(--muted); font-size: 14px; }
.trip-note { margin-top: 6px; font-size: 15px; overflow-wrap: anywhere; }
.trip .button { flex: none; }

/* --- Как это работает --- */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step-number { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; border-radius: 50%; background: var(--sun); color: #1c1a05; font-weight: 800; }
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 16px; }

.cta { padding: clamp(28px, 4vw, 48px) 0; background: linear-gradient(135deg, var(--brand-deep), var(--brand-ink)); color: #fff; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta h2 { margin-bottom: 6px; }
.cta p { color: rgba(255, 255, 255, 0.78); }

/* --- Правила --- */

.prose { max-width: 760px; }
.prose h2 { margin: 36px 0 12px; }
.prose p { font-size: 18px; }
.rules-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rules-list li { position: relative; padding: 12px 16px 12px 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rules-list li::before { content: "•"; position: absolute; left: 18px; color: var(--muted); font-weight: 800; }
.rules-list.ok li::before { content: "✓"; color: var(--brand); }
.rules-list.no li::before { content: "✕"; color: var(--danger); }

/* --- Подвал --- */

.site-footer { padding: 36px 0 44px; border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-about { max-width: 420px; }
.footer-about p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; align-content: flex-start; }
.footer-nav a { color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; }
.footer-nav a:hover { color: var(--brand); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--page); font-size: 15px; transform: translateX(-50%); }

/* --- Телефон --- */

@media (max-width: 860px) {
  /* Две строки: знак с кнопкой и под ними разделы. */
  .header-row { flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; padding-bottom: 6px; }
  .main-nav { order: 3; width: 100%; margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .header-actions { margin-left: auto; gap: 12px; }
  .header-actions .button { min-height: 40px; padding: 8px 14px; font-size: 15px; }
  .logo { font-size: 20px; }
  .logo-mark { width: 32px; height: 32px; }
  .full { display: none; }
  .short { display: inline; }
  .trips-teaser { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .chips { margin: 16px -16px 0; padding: 0 16px 4px; }
  .lang-link { font-size: 14px; }
  .search { flex-wrap: wrap; border-radius: 16px; }
  .search input { flex: 1 1 100%; }
  .search select { flex: 1; width: auto; border: 1px solid #e3dfd3; border-radius: 12px; }
  .stats { gap: 12px 28px; }
  .stats dd { font-size: 26px; }
  .categories { grid-template-columns: repeat(2, 1fr); }
  .ad-grid { grid-template-columns: 1fr; }
  .filters .field { flex: 1 1 100%; min-width: 0; }
  .filters .button { width: 100%; }
  .trip { flex-direction: column; align-items: stretch; }
  .ad-actions .button { flex: 1 1 100%; }
  .cta-row .button { width: 100%; }
}

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