/* ===== Каталог мест и страница локации ("Россия красивая") ===== */

.geo-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px var(--space-2) 64px;
  overflow-x: hidden;
}

.geo-breadcrumbs {
  font-size: 14px;
  color: var(--c-secondary);
  margin-bottom: var(--space-2);
}

.geo-breadcrumbs a {
  color: var(--c-secondary);
}

.geo-breadcrumbs a:hover {
  color: var(--c-primary);
}

.geo-header {
  margin-bottom: var(--space-3);
}

.geo-header h1 {
  font-size: 30px;
  line-height: 38px;
  font-weight: 600;
  color: var(--green-dark);
  margin: 0 0 4px;
}

.geo-title-mobile { display: none; }

.place-filters {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.place-filters::-webkit-scrollbar { display: none; }
.place-filter {
  min-height: 40px;
  padding: 0 20px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(23, 52, 4, .12);
  border-radius: 999px;
  background: var(--surface);
  color: var(--menu-inactive);
  text-decoration: none;
}
.place-filter.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.place-filter:focus-visible, .place-card:focus-visible, .place-row:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

.places-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.place-card {
  min-width: 0; overflow: hidden; display: block; color: var(--text); text-decoration: none;
  border: 1px solid rgba(23, 52, 4, .08); border-radius: 12px; background: var(--surface);
  box-shadow: 0 2px 6px rgba(23, 52, 4, .04), 0 8px 24px rgba(23, 52, 4, .05);
  transition: transform .18s ease, box-shadow .18s ease;
}
.place-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(23,52,4,.07), 0 12px 28px rgba(23,52,4,.08); }
.place-card__media { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-soft); }
.place-card__media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.place-card__body { padding: 14px 16px 16px; }
.place-card__title { min-height: 24px; font-size: 18px; line-height: 24px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.place-card__region { margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-card__count { margin-top: 9px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ochre); }
.place-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(145deg, var(--surface-raised), var(--surface-soft)); color: var(--green); }
.place-fallback__mountains { width: 52px; fill: currentColor; opacity: .8; }
.place-fallback__snow { fill: #fff; }
.places-mobile-list { display: none; }

.places-pagination { margin-top: 32px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.places-pagination a, .places-pagination span:not(.places-pagination__ellipsis) { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(23,52,4,.12); border-radius: 9px; background: var(--surface); color: var(--text); text-decoration: none; }
.places-pagination .is-active { border-color: var(--green); background: var(--green); color: #fff; }
.places-pagination a:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.geo-empty { padding: 56px 20px; text-align: center; border-radius: 12px; background: var(--surface); color: var(--text-secondary); }
.geo-empty h2 { margin: 8px 0 4px; color: var(--green-dark); font-size: 20px; font-weight: 600; }
.geo-empty p { margin: 0; }

@media (max-width: 900px) and (min-width: 601px) { .places-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 600px) {
  .geo-page { padding: 20px 16px calc(88px + env(safe-area-inset-bottom)); }
  .geo-breadcrumbs { display: none; }
  .geo-header { margin-bottom: 16px; }
  .geo-header h1 { font-size: 24px; line-height: 30px; }
  .geo-title-desktop { display: none; }
  .geo-title-mobile { display: inline; }
  .place-filters { width: calc(100% + 16px); gap: 8px; margin-bottom: 12px; padding-right: 16px; }
  .place-filter { min-height: 36px; padding: 0 16px; font-size: 14px; }
  .places-grid { display: none; }
  .places-mobile-list { display: block; background: var(--surface); }
  .place-row { min-width: 0; min-height: 76px; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(23,52,4,.08); }
  .place-row__media { width: 52px; height: 52px; flex: 0 0 52px; overflow: hidden; border-radius: 7px; background: var(--surface-soft); }
  .place-row__media img { width: 100%; height: 100%; display: block; object-fit: cover; }
  .place-row__media .place-fallback__mountains { width: 30px; }
  .place-row__text { min-width: 0; flex: 1; }
  .place-row__title { font-size: 15px; line-height: 20px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .place-row__meta { margin-top: 2px; overflow: hidden; color: var(--text-secondary); font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .place-row__chevron { flex: 0 0 auto; margin-right: 3px; color: var(--text-secondary); }
  .places-pagination { margin-top: 24px; }
}

.geo-header p {
  color: var(--c-secondary);
  font-size: 14px;
  margin: 0;
}

/* --- Region tabs --- */
.geo-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: var(--space-3);
  scrollbar-width: thin;
}

.geo-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.geo-tab.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

/* --- Catalog grid --- */
.geo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-2);
}

.geo-section[hidden] { display: none; }

.geo-section + .geo-section {
  margin-top: var(--space-3);
}

.geo-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.geo-card__cover {
  aspect-ratio: 4 / 3;
  background: var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.geo-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.geo-card__cover-placeholder {
  font-size: 13px;
  color: var(--c-secondary);
}

.geo-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.geo-card__name {
  font-size: 18px;
  font-weight: 500;
  color: var(--c-text);
}

.geo-card__region {
  font-size: 14px;
  color: var(--c-secondary);
}

.geo-card__count {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-accent);
  background: var(--c-accent-light);
  border-radius: 999px;
  padding: 3px 10px;
}

.geo-empty {
  color: var(--c-secondary);
  font-size: 14px;
  padding: var(--space-2) 0;
}

/* --- Location detail --- */
.geo-cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
}

.geo-description {
  color: var(--c-text);
  line-height: 1.6;
  margin-bottom: var(--space-3);
  max-width: 720px;
}

.geo-photos-heading {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 var(--space-2);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.geo-photos-heading .muted {
  font-size: 14px;
  font-weight: 400;
  color: var(--c-secondary);
}

/* Masonry: колонки разной высоты вместо жёсткой сетки */
.geo-masonry {
  column-count: 1;
  column-gap: var(--space-2);
}

@media (min-width: 560px) {
  .geo-masonry { column-count: 2; }
}

@media (min-width: 860px) {
  .geo-masonry { column-count: 3; }
}

.geo-masonry-item {
  display: block;
  break-inside: avoid;
  margin-bottom: var(--space-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  text-decoration: none;
  color: inherit;
}

.geo-masonry-item img {
  width: 100%;
  height: auto;
  display: block;
}

.geo-masonry-item__caption {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--c-secondary);
}

.geo-masonry-item__author {
  color: var(--c-text);
  font-weight: 600;
}
