/*
 * blog_editor_v2.css — НОВОСТИ-ЗАВЕДЕНИЯ-1 (02.10.2026).
 *
 * Современный компактный редактор текста новости заведения + окно
 * «Добавить новость» + выбор картинки с превью. Никаких внешних библиотек:
 * редактор — свой (contenteditable + document.execCommand), поэтому файл
 * маленький и работает без сети.
 *
 * Палитра и шрифты — как у сайта (Proxima Nova, синий #00aeef, тёмный #101c22).
 * Телефон (375x812): одна колонка, кнопки не меньше 44 px, кегль не меньше 14 px,
 * горизонтальной прокрутки нет.
 */

/* ---------- редактор ---------- */
.cb-ed { border: 1px solid #d6e0e5; border-radius: 4px; background: #fff; overflow: hidden; }
.cb-ed-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #f4f8fa; border-bottom: 1px solid #e2eaee; }
.cb-ed-btn {
  min-width: 44px; min-height: 44px; padding: 0 10px;
  font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 15px; line-height: 1;
  color: #2b3a42; background: #fff; border: 1px solid #d6e0e5; border-radius: 4px; cursor: pointer;
}
.cb-ed-btn:hover { border-color: #00aeef; color: #00aeef; }
.cb-ed-btn b, .cb-ed-btn i, .cb-ed-btn u { pointer-events: none; }
.cb-ed-area {
  min-height: 150px; max-height: 46vh; overflow-y: auto; padding: 12px 14px;
  font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 15px; line-height: 1.5; color: #2b3a42;
  outline: none;
}
.cb-ed-area:empty:before { content: attr(data-placeholder); color: #9aa7b0; }
.cb-ed-area ul, .cb-ed-area ol { margin: 6px 0 6px 22px; }
.cb-ed-area p { margin: 0 0 8px; }
.cb-ed-area a { color: #00aeef; }

/* ---------- поле выбора картинки ---------- */
.cb-pic { margin-top: 6px; }
.cb-pic-input {
  display: block; width: 100%; padding: 10px; box-sizing: border-box;
  font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 14px; color: #2b3a42;
  background: #f4f8fa; border: 1px dashed #b9c7cf; border-radius: 4px; cursor: pointer;
}
.cb-pic-hint { margin-top: 6px; font-size: 14px; line-height: 1.4; color: #8b969c; }
.cb-pic-preview { margin-top: 10px; }
.cb-pic-preview img { display: block; max-width: 100%; max-height: 220px; border-radius: 4px; }
.cb-pic-preview .cb-pic-del { display: inline-block; margin-top: 6px; font-size: 14px; color: #00aeef; }
.cb-pic-err { margin-top: 8px; font-size: 14px; line-height: 1.4; color: #d5372f; }

/* ---------- окно «Добавить новость» ---------- */
.cb-nm { position: fixed; inset: 0; z-index: 1200; display: none; }
.cb-nm.open { display: block; }
.cb-nm-bg { position: absolute; inset: 0; background: rgba(10, 18, 22, .55); }
.cb-nm-win {
  position: relative; margin: 4vh auto 0; width: 640px; max-width: calc(100% - 24px);
  max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.cb-nm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e2eaee;
  font-family: 'Proxima Nova Bold', Arial, sans-serif; font-size: 18px; color: #101c22;
}
.cb-nm-x { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1; color: #8b969c; text-decoration: none; }
.cb-nm-x:hover { color: #00aeef; }
.cb-nm-body { padding: 14px 16px 4px; }
.cb-nm-field { margin-bottom: 14px; }
.cb-nm-label { display: block; margin-bottom: 6px; font-family: 'Proxima Nova Bold', Arial, sans-serif;
  font-size: 14px; color: #101c22; }
.cb-nm-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 16px 16px; }
.cb-nm-btn {
  min-height: 44px; padding: 0 18px; border-radius: 4px; cursor: pointer;
  font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 15px;
  color: #2b3a42; background: #f4f8fa; border: 1px solid #d6e0e5;
}
.cb-nm-btn-main { color: #fff; background: #00aeef; border-color: #00aeef; }
.cb-nm-btn-main:hover { background: #0096cc; border-color: #0096cc; }
.cb-nm-btn[disabled] { opacity: .6; cursor: default; }

/* кнопка «Добавить новость» в шапке раздела */
.cb-nm-open {
  display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; padding: 0 18px;
  font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 15px; text-transform: none;
  letter-spacing: 0; color: #fff; background: #00aeef; border-radius: 4px; text-decoration: none;
}
.cb-nm-open:hover { background: #0096cc; }
.cb-nm-head-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }

/* сообщение о результате добавления */
.cb-nm-note { margin: 0 0 18px; padding: 12px 14px; border-radius: 4px; font-size: 15px; line-height: 1.4; }
.cb-nm-note-ok { color: #1c6b3a; background: #eaf7ef; border: 1px solid #bfe4cd; }
.cb-nm-note-err { color: #a3271f; background: #fdeceb; border: 1px solid #f3c4c0; }

@media (max-width: 640px) {
  .cb-nm-win { margin-top: 0; max-height: 100vh; border-radius: 0; width: 100%; max-width: 100%; }
  .cb-nm-head { font-size: 17px; }
  .cb-nm-open { width: 100%; justify-content: center; }
  .cb-nm-foot .cb-nm-btn { flex: 1 1 100%; }
}

/* =====================================================================
   НОВОСТИ-РЕДАКТИРОВАНИЕ-1 (02.10.2026)
   1) строка записи в ленте заведения (place/blog_v2.tpl): вместо слипшихся
      текстовых ссылок «Удалить Редактировать» — кнопки с отступами и тап-зоной
      не меньше 44 px, в том числе на телефоне;
   2) окно ПРАВКИ записи: поле заголовка, блок текущей картинки с кнопкой
      «Удалить картинку», красная кнопка «Удалить запись».
   Правила ниже только ДОБАВЛЯЮТ классы: вид карточки заведения и окна
   «Добавить новость» не меняется.
   ===================================================================== */

/* ---------- строка записи: кнопки действий ---------- */
#place-blog-card .journal-actions { float: right; display: flex; flex-wrap: wrap; gap: 10px; }
#place-blog-card .commentsLink { float: left; }
#place-blog-card .journal-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; box-sizing: border-box;
  font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 14px; line-height: 1;
  color: #2b3a42; background: #f4f8fa; border: 1px solid #d6e0e5; border-radius: 4px;
  text-decoration: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
#place-blog-card .journal-btn:hover { border-color: #00aeef; color: #00aeef; }
#place-blog-card .journal-btn-edit { color: #0077a3; background: #eef8fd; border-color: #9fd8ee; }
#place-blog-card .journal-btn-edit:hover { color: #fff; background: #00aeef; border-color: #00aeef; }
#place-blog-card .journal-btn-del { color: #a3271f; background: #fdf1f0; border-color: #f0c2be; }
#place-blog-card .journal-btn-del:hover { color: #fff; background: #d5372f; border-color: #d5372f; }
#place-blog-card .commentsLink a.journal-btn { color: #0077a3; background: #eef8fd; border-color: #9fd8ee; }
#place-blog-card .commentsLink a.journal-btn:hover { color: #fff; background: #00aeef; border-color: #00aeef; }

/* кнопка «Добавить запись» в шапке ленты — тот же вид, что «Добавить новость» */
#place-blog-card .journal-add .cb-nm-open { width: auto; min-height: 44px; color: #fff; font-size: 15px; }

/* ---------- окно правки: заголовок, текущая картинка, опасные кнопки ---------- */
.cb-nm-input {
  display: block; width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 12px;
  font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 15px; color: #2b3a42;
  background: #fff; border: 1px solid #d6e0e5; border-radius: 4px;
}
.cb-nm-input:focus { outline: none; border-color: #00aeef; }
.cb-nm-opt { font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 13px; color: #8b969c; }
.cb-pic-cur { margin-bottom: 10px; }
.cb-pic-cur img { display: block; max-width: 100%; max-height: 220px; margin-bottom: 8px; border-radius: 4px; }
.cb-pic-note { font-family: 'Proxima Nova Regular', Arial, sans-serif; font-size: 14px; color: #8b969c; }
.cb-nm-btn-danger { color: #a3271f; background: #fdf1f0; border-color: #f0c2be; }
.cb-nm-btn-danger:hover { color: #fff; background: #d5372f; border-color: #d5372f; }
.cb-blog-del { margin-left: auto; }

/* Кнопки окна всегда на виду: если содержимое не влезло в экран, прокручивается
   только середина, а «Сохранить»/«Отмена»/«Удалить запись» остаются внизу окна. */
.cb-nm-win .cb-nm-foot {
  position: sticky; bottom: 0; z-index: 2;
  padding-top: 12px; background: #fff; border-top: 1px solid #e2eaee;
}

/* телефон: кнопки строки — в одну колонку во всю ширину, ничего не вылезает */
@media (max-width: 640px) {
  #place-blog-card .journal-actions { float: none; width: 100%; margin-bottom: 10px; }
  #place-blog-card .journal-actions .journal-btn { flex: 1 1 100%; }
  #place-blog-card .commentsLink { float: none; width: 100%; }
  #place-blog-card .commentsLink a.journal-btn { width: 100%; }
  #place-blog-card .journal-add .cb-nm-open { width: 100%; justify-content: center; }
  .cb-blog-del { margin-left: 0; }
  /* на телефоне превью ниже — окно правки целиком влезает в экран */
  .cb-pic-preview img, .cb-pic-cur img { max-height: 160px; }
  .cb-ed-area { min-height: 120px; max-height: 34vh; }
}
