/* Astanagid.kz — общий стиль сайта. Сначала телефон, потом широкие экраны. */
:root {
    --brand: #14a38b;
    --brand-dark: #0e7f6c;
    --brand-soft: #e6f6f2;
    --accent: #f08a24;
    --accent-soft: #fff1e3;
    --text: #1c2430;
    --muted: #677285;
    --line: #e3e7ee;
    --bg: #f5f7fa;
    --card: #ffffff;
    --err: #c0392b;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .05);
    --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.main { padding-top: 16px; padding-bottom: 40px; min-height: 60vh; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .875rem; }
.empty { padding: 24px 0; color: var(--muted); }
.lead { font-size: 1.1rem; color: #3a4556; }

/* ---------- шапка ---------- */
.hdr { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.hdr__in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; margin-right: auto; }
.logo img { display: block; height: 32px; width: auto; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.burger { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; cursor: pointer; border-radius: 8px; }
.burger span, .burger span::before, .burger span::after { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; position: relative; transition: transform .2s; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -7px; }
.burger span::after { top: 7px; }
.nav-toggle:checked + .burger span { background: transparent; }
.nav-toggle:checked + .burger span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked + .burger span::after { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle:focus-visible + .burger { outline: 2px solid var(--brand); }

.nav { display: none; order: 3; width: 100%; flex-direction: column; padding: 4px 0 8px; border-top: 1px solid var(--line); }
.nav-toggle:checked ~ .nav { display: flex; }
.nav__item > a { display: block; padding: 10px 4px; color: var(--text); font-weight: 600; }
.nav__item > a:hover { color: var(--brand); }
.nav__drop { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
.nav__drop a { padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--text); font-size: .9rem; }
.nav__drop a span, .chip span { color: var(--muted); font-size: .8em; }
.nav__item--accent > a { color: var(--accent); }

.search { order: 2; width: 100%; display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font: inherit; color: inherit; }
.search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.search--big { margin: 0 0 24px; }
.search--big input { height: 48px; font-size: 1.05rem; background: #fff; }

@media (min-width: 960px) {
    .hdr__in { flex-wrap: nowrap; }
    .logo { margin-right: 8px; }
    .burger { display: none; }
    .nav { display: flex; order: 0; width: auto; flex-direction: row; align-items: center; gap: 4px; padding: 0; border: 0; }
    .nav__item { position: relative; }
    .nav__item > a { padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
    .nav__drop { display: none; position: absolute; top: 100%; left: 0; width: 520px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
    .nav__item--drop:hover .nav__drop, .nav__item--drop:focus-within .nav__drop { display: flex; }
    .search { order: 0; width: auto; flex: 1; max-width: 320px; margin-left: auto; }
}

/* ---------- хлебные крошки ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .875rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs__here { color: var(--text); overflow-wrap: anywhere; }

/* ---------- главная ---------- */
.hero { padding: 16px 0 8px; }
.hero__title { font-size: 1.9rem; margin-bottom: .3em; }
.hero__lead { color: var(--muted); max-width: 640px; }
@media (min-width: 768px) { .hero__title { font-size: 2.4rem; } }

.cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin: 32px 0; padding: 20px; border-radius: var(--radius); background: var(--accent-soft); }
.cta h2 { margin-bottom: .3em; }
.cta p { margin: 0; color: #5b4a3a; }
@media (min-width: 768px) { .cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 24px 28px; } }

/* ---------- чипы ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: .9rem; }
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.is-on span { color: rgba(255, 255, 255, .8); }

/* ---------- секции и сетки ---------- */
.sec { margin: 28px 0; }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec__head > a { font-size: .9rem; white-space: nowrap; }
.sec__title { margin: 0 0 12px; }
.sec__head .sec__title { margin: 0; }
.sec__title a { color: inherit; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
.list { display: flex; flex-direction: column; gap: 12px; }
.cols { display: grid; gap: 0 32px; }
@media (min-width: 960px) { .cols { grid-template-columns: 3fr 2fr; } }

/* ---------- карточки ---------- */
.card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: var(--text); transition: transform .15s, box-shadow .15s; min-width: 0; }
.card:hover { color: var(--text); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20, 30, 50, .08), 0 10px 24px rgba(20, 30, 50, .08); }
.card__img { position: relative; display: block; aspect-ratio: 318 / 200; background: var(--brand-soft); }
.card__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2.5rem; font-weight: 700; color: var(--brand); }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.card__kicker { font-size: .8rem; color: var(--brand-dark); font-weight: 600; }
.card__kicker:empty { display: none; }
.card__title { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.card:hover .card__title { color: var(--brand-dark); }
.card__meta { font-size: .875rem; color: var(--muted); }
.card__text { font-size: .9rem; color: #444f60; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.card__foot:empty { display: none; }
.card__price { font-size: .875rem; color: var(--muted); white-space: nowrap; }

.card--row { flex-direction: row; }
.card--row .card__img { flex: 0 0 38%; max-width: 200px; aspect-ratio: auto; min-height: 96px; }
.card--row .card__img img { position: absolute; inset: 0; }
.card--row .card__body { padding: 10px 12px; }

.badge { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 600; }
.badge--accent { background: var(--accent); }
.badge--muted { position: static; background: var(--line); color: var(--muted); }

.stars { color: #d5dae2; letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; }
.stars i.on { color: var(--accent); }
.stars--sm { font-size: .85rem; }

/* ---------- кнопки и формы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; max-width: 560px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.form input[type=text], .form input[type=email], .form input[type=tel], .form input[type=password], .form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: normal; background: #fff; color: inherit; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--brand); }
.form .btn { align-self: flex-start; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: normal; }
.form label small { font-weight: normal; color: var(--muted); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: 12px 14px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); }
.notice--err { background: #fdecea; color: var(--err); }

.rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; border: 0; padding: 0; margin: 0; }
.rate legend { width: 100%; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.rate input { position: absolute; opacity: 0; }
.rate label { font-size: 1.6rem; color: #d5dae2; cursor: pointer; line-height: 1; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: var(--accent); }
.rate input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }

/* ---------- отзывы ---------- */
.comments { border-top: 1px solid var(--line); padding-top: 20px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.comment p { margin: 0; overflow-wrap: anywhere; }
.comment__reply { margin: 8px 0 0 16px; padding: 8px 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.comment__reply b { display: block; font-size: 13px; margin-bottom: 2px; }
.comment-form { margin-top: 16px; }
.comment-form > summary { list-style: none; display: inline-flex; }
.comment-form > summary::-webkit-details-marker { display: none; }
.comment-form[open] > summary { display: none; }

/* ---------- листалка ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 28px 0 8px; }
.pager__num, .pager__step { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.pager__num:hover, .pager__step:hover { border-color: var(--brand); color: var(--brand-dark); }
.pager__num.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager__gap { color: var(--muted); padding: 0 4px; }

/* ---------- текст из редактора ---------- */
.prose { overflow-wrap: anywhere; }
.prose img { max-width: 100% !important; height: auto !important; border-radius: 8px; }
.prose iframe, .prose video { max-width: 100%; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose td, .prose th { padding: 6px 10px; border: 1px solid var(--line); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.prose h2, .prose h3 { margin-top: 1.2em; }
.prose > :last-child { margin-bottom: 0; }
.sec.prose { color: #3a4556; }

/* ---------- страница места ---------- */
/* телефон: заголовок и фото → адрес и телефон → описание; широкий экран: карточка справа */
.place { display: grid; grid-template-areas: "head" "side" "main"; gap: 0 24px; }
.place__head { grid-area: head; min-width: 0; }
.place__main { grid-area: main; min-width: 0; }
.place__side { grid-area: side; min-width: 0; }
.place__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: -4px; }
.place__cover, .post__cover { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; background: var(--brand-soft); }
@media (min-width: 960px) {
    .place { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; grid-template-areas: "head side" "main side"; }
    .place__side { align-self: start; position: sticky; top: 84px; }
}

.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)) 16px; padding: 0 var(--gutter); scrollbar-width: thin; }
.gallery a { flex: 0 0 88%; scroll-snap-align: start; }
.gallery a:only-child { flex-basis: 100%; }
.gallery img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--brand-soft); }
@media (min-width: 768px) {
    .gallery { margin-left: 0; margin-right: 0; padding: 0; }
    .gallery a { flex-basis: 70%; }
}

.info { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; margin: 16px 0; }
.info__row { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.info__row:last-child { border-bottom: 0; }
.info__label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.info__links { display: flex; flex-wrap: wrap; gap: 12px; font-size: .9rem; margin-top: 2px; }
.info__owner { font-size: .9rem; }
@media (min-width: 960px) { .place__side .info { margin-top: 0; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .85rem; }

/* ---------- материал ---------- */
.post { max-width: 780px; }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: .95rem; }
.post__when { color: var(--brand-dark); font-weight: 600; }
.place-mini { display: flex; flex-direction: column; gap: 2px; margin: 20px 0; padding: 14px 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.links { padding-left: 1.2em; }
.links li { margin: 6px 0; }

/* ---------- ошибки ---------- */
.oops { padding: 32px 0; max-width: 640px; }

/* ---------- подвал ---------- */
.ftr { background: #17212b; color: #b9c2ce; font-size: .9rem; margin-top: 24px; }
.ftr a { color: #dfe5ec; }
.ftr a:hover { color: var(--accent); }
.ftr__in { display: grid; gap: 24px; padding-top: 32px; padding-bottom: 24px; }
.ftr__brand img { display: block; width: 110px; height: auto; margin-bottom: 12px; }
.ftr__col { display: flex; flex-direction: column; gap: 6px; }
.ftr__col h3 { color: #fff; font-size: 1rem; margin-bottom: 4px; }
.ftr__copy { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid #2a3642; font-size: .825rem; overflow-wrap: anywhere; }
@media (min-width: 768px) { .ftr__in { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
