/* Карта проектов — стили из исходного кастомного кода Tilda */

/* Переопределяем стили для кнопок зума Leaflet */
.leaflet-control-zoom {
  background-color: #FFFFFF !important;
  box-shadow: none !important;
  border: none !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  background-color: #FFFFFF !important;
  color: #120E38 !important;
  border: none !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  text-align: center !important; display: flex; justify-content: center; align-items: center;
  font-weight: bold !important;
  font-size: 18px !important;
  cursor: pointer !important;
  transition: color 0.3s ease-in-out;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
  color: #386AB6 !important;
}

.project-map-block {
  display: flex;
  gap: 1px;
  background: #ffffff;
  border-radius: 15px;
  overflow: hidden !important;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
  height: 540px;
  flex-wrap: wrap;
}

#info-box, #map {
  height: 100%;
}

#info-box {
  flex: 1;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 18px;
  background: #ffffff;
  color: #333;
  border-radius: 15px 0 0 15px;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
  line-height: 1.6;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#info-box .info-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
}

#info-box .customer {
  color: #337ab7;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 5px;
}

/* заголовки панели держатся на классе, а не на теге: по уровню это h3 внутри
   секции «Наши проекты», но размер у них свой */
#info-box .panel-title {
  font-size: 20px;
  font-weight: bold;
  line-height: 1.6;
  color: #120E38;
  margin-bottom: 5px;
}

/* название заказчика: воздух под ним вместо прежней полоски */
#info-box .customer + .panel-title { margin-bottom: 17px; }

/* полоска под названием заказчика убрана: вместо неё воздух под заголовком */

#info-box p {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 5px;
}

#info-box ul {
  margin-left: 15px;
  padding-left: 15px;
  list-style-type: disc;
}

#info-box li {
  font-size: 15px;
  margin-bottom: 5px;
}

#info-box .info-content::-webkit-scrollbar {
  width: 8px;
}

#info-box .info-content::-webkit-scrollbar-thumb {
  background-color: #337ab7;
  border-radius: 10px;
}

#info-box .info-content::-webkit-scrollbar-track {
  background-color: #f0f0f0;
  border-radius: 0px;
}

#info-box .info-content::-webkit-scrollbar-button {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

#info-box .info-content {
  scrollbar-width: thin;
  scrollbar-color: #337ab7 #f0f0f0;
}

#map {
  flex: 2;
  border-radius: 0 15px 15px 0;
  border: none;
  max-width: 100%;
}

/* заглушка вместо карты, пока нет согласия на куки: карта тянет тайлы с серверов
   Яндекса, и визит не должен уходить туда раньше ответа человека. Занимает всю
   площадь карты, поэтому вёрстка не прыгает, когда карта встаёт на место */
.map-consent {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: var(--color-muted);
}

.map-consent-text {
  font-size: 15px;
  color: var(--color-text);
}

/* согласие можно дать прямо здесь, не открывая полосу про куки: человеку нужна карта,
   а не разговор про cookie */
.map-consent-button {
  padding: 9px 20px;
  border: 1px solid var(--color-heading);
  border-radius: 18px;
  background: transparent;
  color: var(--color-heading);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.map-consent-button:hover {
  background: var(--color-heading);
  color: var(--color-on-dark);
}

.custom-marker {
  width: 15px;
  height: 15px;
  background-color: #00264d;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3);
}

.custom-cluster {
  background-color: #337ab7 !important;
  color: white !important;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  border: 2px solid white;
  font-weight: bold;
}

.leaflet-container .leaflet-control-attribution a {
  color: #4A89BE !important;
  text-decoration: none;
}

.leaflet-container .leaflet-control-attribution a:hover {
  color: #3578A0 !important;
}

.leaflet-popup-close-button {
  color: #37416B !important;
  font-size: 15px !important;
  opacity: 1 !important;
}

.leaflet-popup-close-button:hover {
  color: #4281C2 !important;
}

.leaflet-popup-content {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: break-word;
}

.leaflet-popup-content-wrapper.custom-popup {
  max-width: 350px !important;
  min-width: 200px !important;
}

#info-box { position: relative; z-index: 5; }

/* Ч/Б только фон Яндекса */
#map .ymaps-2-1-79-ground-pane,
#map [class*="ground-pane"] canvas,
#map [class*="ground-pane"] img{
  filter: grayscale(1) brightness(0.98) contrast(1.05) !important;
}

.leaflet-control-layers{ display:none !important; }

/* Маркеры/попапы поверх слоя Яндекса */
#map .leaflet-marker-pane{ z-index: 10000 !important; }
#map .leaflet-popup-pane{  z-index: 10001 !important; }
#map .ymaps-2-1-79-map{    z-index: 0 !important; }

/* Контролы карты не должны перекрывать соседние блоки */
.project-map-block, #map { position: relative; z-index: 0; }
#map .leaflet-top,
#map .leaflet-bottom { z-index: 0 !important; }

#map .leaflet-control-attribution {
  background: rgba(255,255,255,.9);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.2;
}

/* Мобильный список проектов — стили из исходного кастомного кода Tilda,
   заголовки и info-content ограничены .project-container, чтобы не задевать остальную страницу */
.project-container {
  color: #333333;
  /* у Tilda в карточке обычный межстрочник — с 1.55 текст рыхлый */
  line-height: normal;
  max-width: 600px;
  margin: 20px auto;
  padding: 10px;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  background: #ffffff;
  font-family: 'Montserrat', Arial, sans-serif;
  height: 500px;
  overflow: hidden;
}

.project-container .info-content {
  padding: 5px;
  box-sizing: border-box;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.project-container .info-content .panel-title {
  font-size: 20px;
  font-weight: bold;
  color: #120E38;
  margin-bottom: 10px;
}

.project-list p {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 5px;
  cursor: pointer;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.project-list p:hover {
  background: #f0f0f0;
}

.project-description {
  /* блок лежит внутри тёмной секции — иначе текст наследует белый цвет и пропадает */
  color: #333333;
  display: none;
  padding: 0px;
  border-radius: 10px;
  margin-top: 10px;
  flex-grow: 1;
}

.back-button {
  display: none;
  cursor: pointer;
  margin-bottom: 5px;
  align-items: center;
  padding: 0;
  background: none;
  border: none;
}

.back-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #B3B3B3;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-container .customer {
  font-size: 15px;
  font-weight: bold;
  color: #337ab7;
  margin-bottom: 7px;
}

.project-container .project-name {
  font-size: 18px;
  font-weight: bold;
  color: #120E38;
  margin-bottom: 10px;
}

.project-description ul {
  margin-top: 4px;
  /* без отступа маркеры уезжают за край блока и обрезаются */
  padding-left: 20px;
  list-style-type: disc;
}

.project-description li { margin-bottom: 2px; }


.project-container .info-content::-webkit-scrollbar {
  width: 8px;
}

.project-container .info-content::-webkit-scrollbar-thumb {
  background-color: #337ab7;
  border-radius: 10px;
}

.project-container .info-content::-webkit-scrollbar-track {
  background-color: #f0f0f0;
  border-radius: 0px;
}

/* как на Tilda: с 640px — карта, ниже — мобильный список */
@media (max-width: 639px) {
  .project-map-block { display: none; }
}

@media (min-width: 640px) {
  .project-container { display: none; }
}

/* пункты списка «в пределах видимой области» — стили были инлайновыми в JS */
#info-box .project-item {
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 1px solid #dddddd;
}

/* состояния списка — фирменным синим: #337ab7 остался от вставки карты и рядом
   с остальной синевой сайта читается чужим */
#info-box .project-item { transition: color 0.2s ease-in-out; }

#info-box .project-item:hover { color: var(--color-accent); }

body.kbd-nav #info-box .project-item:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
