/*
 * Tiny runtime visual overrides.
 * This file is intentionally safe to deploy without a Next.js rebuild for
 * small reversible UI tweaks: colors, spacing, button sizes, shadows.
 * After a merge into stage or main it goes live in seconds: job `light` in
 * .github/workflows/deploy.yml copies it without a build.
 */

/* Hide section links and catalog stats on developer and hotel operator profiles. */
.company-profile > nav[aria-label="Разделы страницы"],
.company-profile > section:has(> div > .company-profile-stat),
.company-profile > .scroll-reveal:has(> section > div > .company-profile-stat) {
  display: none;
}

/* Compatibility for releases using the legacy wordmark markup. */
[data-site-header] .brand-wordmark,
[data-site-footer] .brand-wordmark {
  display: inline;
  font-family: var(--font-logo), system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

[data-site-header] .brand-wordmark { font-size: 19px; }
[data-site-footer] .brand-wordmark { font-size: 20px; line-height: 1.4; }
.brand-wordmark .brand-wordmark-suffix { display: none; }

:root {
  --property-lead-button-height: 50px;
  --property-lead-button-padding-x: 1.5rem;
  --property-lead-button-font-size: 15px;
  --property-lead-button-shadow: 0 10px 18px rgba(15, 16, 18, 0.16);
  --property-lead-hint-margin-top: 0.5rem;
  --property-lead-hint-padding-x: 0.5rem;
  --property-lead-hint-align: left;
  --property-lead-hint-font-size: 13px;
  --catalog-page-padding-top: 1.25rem;
  --catalog-hero-margin-bottom: 1.25rem;
  --catalog-title-font-size: inherit;
  --catalog-description-font-size: 15px;
}

.property-lead-button {
  height: var(--property-lead-button-height) !important;
  min-height: var(--property-lead-button-height) !important;
  padding-left: var(--property-lead-button-padding-x) !important;
  padding-right: var(--property-lead-button-padding-x) !important;
  box-shadow: var(--property-lead-button-shadow) !important;
}

.property-lead-button-label {
  font-size: var(--property-lead-button-font-size) !important;
}

.property-lead-hint {
  margin-top: var(--property-lead-hint-margin-top) !important;
  padding-left: var(--property-lead-hint-padding-x) !important;
  padding-right: var(--property-lead-hint-padding-x) !important;
  text-align: var(--property-lead-hint-align) !important;
  font-size: var(--property-lead-hint-font-size) !important;
}

/* Keep the public property CTA prominent without changing broker actions. */
.property-primary-button:not(.property-broker-send) {
  background: #bef264;
  color: #253024;
  box-shadow: 0 8px 22px rgb(117 154 61 / 28%);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.property-primary-button:not(.property-broker-send):hover {
  background: #d2fa8a;
  box-shadow: 0 11px 26px rgb(117 154 61 / 36%);
  transform: translateY(-1px);
}

.property-primary-button:not(.property-broker-send):focus-visible {
  background: #d2fa8a;
  color: #253024;
  box-shadow: 0 0 0 4px rgb(190 242 100 / 22%), 0 8px 22px rgb(117 154 61 / 28%);
}

.property-primary-button:not(.property-broker-send):active {
  background: #b1e458;
  box-shadow: 0 4px 12px rgb(117 154 61 / 24%);
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .property-primary-button:not(.property-broker-send) {
    transition: none;
  }

  .property-primary-button:not(.property-broker-send):hover {
    transform: none;
  }
}

.catalog-page {
  padding-top: var(--catalog-page-padding-top) !important;
}

.catalog-hero {
  margin-bottom: var(--catalog-hero-margin-bottom) !important;
}

.catalog-title {
  font-size: var(--catalog-title-font-size) !important;
}

.catalog-description {
  font-size: var(--catalog-description-font-size) !important;
}

/* Invitation archive: status and action share one row; the action has a fixed
   place at the right edge, including on rows without a restoration button. */
[aria-label="История приглашений"] .table tbody td {
  vertical-align: middle;
  padding-block: 12px;
}

[aria-label="История приглашений"] .table tr > :nth-child(4) {
  position: relative;
  min-width: 308px;
  padding-inline-end: 144px;
}

[aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"] {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #24472f;
  border-radius: 6px !important;
  background: #24472f;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(20 45 26 / 10%);
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}

[aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"]:hover:not(:disabled) {
  border-color: #365e40;
  background: #365e40;
}

[aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"]:focus-visible {
  outline: 2px solid #659a50;
  outline-offset: 3px;
}

[aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"]:disabled {
  opacity: .5;
  cursor: wait;
}

[data-theme="business"] [aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"] {
  border-color: #a8cf84;
  background: #a8cf84;
  color: #1b301d;
}

[data-theme="business"] [aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"]:hover:not(:disabled) {
  border-color: #c1e99a;
  background: #c1e99a;
}

@media (max-width: 640px) {
  [aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"] {
    min-height: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [aria-label="История приглашений"] button[aria-label^="Вернуть доступ:"] {
    transition: none;
  }
}

/* On desktop the property card covers the map's top-left controls. */
@media (min-width: 48rem) {
  [data-property-map-root]:has(> [data-map-property-panel]) > [data-map-control-column] {
    display: none;
  }
}

/* Separate developer groups from the other links in the broker panel. */
[data-broker-panel] > div[class$="__pills"] + [role="group"][aria-label="Группы застройщика"] {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(241, 243, 234, .12);
}

/* Keep infrastructure chips light against the map and reuse the marker colors. */
[data-map-infrastructure-panel] {
  width: 22rem;
  border-radius: 12px;
}

[data-map-infrastructure-panel] [role="group"] > button {
  border-color: transparent;
  border-radius: 999px;
  background: #f2f4f3;
  color: #39463f;
  font-weight: 500;
}

[data-map-infrastructure-panel] [role="group"] > button:hover {
  background: #e8eeea;
}

[data-map-infrastructure-panel] [role="group"] > button[aria-pressed="true"] {
  border-color: #b4cbb9;
  background: #dfece2;
  color: #25442f;
}

[data-map-infrastructure-panel] [role="group"] > button:focus-visible {
  outline: 2px solid #426c51;
  outline-offset: 1px;
}

@media (max-width: 639px) {
  [data-map-infrastructure-panel] [role="group"] > button {
    padding-inline: 6px;
  }
}

/* Older property pages still render a location above the title. */
[data-property-heading] > .property-location-eyebrow {
  display: none;
}

/* Keep the outer corners aligned with the padded buttons on wrapped rows. */
[role="group"][aria-label="Корпус или квартал"].rounded-2xl {
  border-radius: 1.375rem;
}

/* Match the 200px comparison card and its 12px padding on each side. */
.selection-client td.comparison-cell {
  max-width: 224px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.selection-client .selection-client-kicker {
  display: none;
}

/* Let the gallery backdrop show around photos fitted without cropping. */
.selection-client [role="dialog"][aria-label="Галерея объекта"] .bg-base-200:has(> img.object-contain) {
  background-color: transparent;
}

/* Keep the discussion expand button above the video's transparent click surface (z-index: 5). */
[data-broker-notes-sheet] button[aria-label^="Развернуть видео "] {
  z-index: 20;
}

/* Mobile usability (Yandex Webmaster NOT_MOBILE_FRIENDLY): legible >= 12px
   labels and comfortable touch targets / spacing on phones without changing desktop. */
@media (max-width: 767px) {
  nav[aria-label="Breadcrumb"] {
    font-size: 12px !important;
    line-height: 1.4;
  }

  nav[aria-label="Breadcrumb"] > ol {
    gap: 8px;
  }

  nav[aria-label="Breadcrumb"] a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding-block: 6px;
  }

  /* Article table of contents: bigger touch rows instead of 24px / 2px gap. */
  main nav:has(> ol.space-y-0\.5) > h2 {
    font-size: 12px;
  }

  main nav:has(> ol.space-y-0\.5) > ol {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  main nav:has(> ol.space-y-0\.5) > ol > li > a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding-block: 8px;
    line-height: 1.35;
  }

  /* Catalog grid/table view toggle: 44px touch targets with 8px separation. */
  .catalog-view-toggle {
    gap: 8px;
  }

  .catalog-view-toggle button {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  /* Property inventory tabs & building chips: 44px height, >= 12px badges. */
  .inventory-view-tabs {
    gap: 8px;
  }

  .inventory-view-tabs button {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .inventory-building-tabs > div {
    gap: 8px;
  }

  .inventory-building-tabs button {
    min-height: 44px;
    padding: 8px 12px;
  }

  .inventory-building-tabs button > div:last-child {
    font-size: 12px;
  }

  /* Homepage ranking cards: raise 9-11px mobile labels to >= 12px. */
  .ranking-showcase > .ranking-feature:not(:first-child) .ranking-location,
  .ranking-showcase > .ranking-feature:not(:first-child) .ranking-feature-price,
  .ranking-showcase > .ranking-feature:not(:first-child) .ranking-feature-price span,
  .ranking-feature-small h3,
  .ranking-feature-small .ranking-feature-price {
    font-size: 12px;
  }

  /* Raise remaining sub-12px micro-labels inside public page content. */
  main :is(.text-\[10px\], .text-\[11px\]) {
    font-size: 12px;
  }

  /* Footer links: taller touch targets than raw 17px text lines. */
  footer[data-site-footer] ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  footer[data-site-footer] ul a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding-block: 6px;
  }
}
