/*
Theme Name: ПравоКонсалт
Description: Лёгкая тема в стиле iOS для сервиса юридических консультаций и подготовки документов.
Version: 1.0.1
Author: ПравоКонсалт
Text Domain: pravoconsult
*/

html {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Компенсация margin-top от WP Admin Bar, чтобы страница не прокручивалась по вертикали */
html:has(body.admin-bar) {
  height: calc(100% - 32px);
}

@media screen and (max-width: 782px) {
  html:has(body.admin-bar) {
    height: calc(100% - 46px);
  }
}

body {
  height: 100% !important;
  max-height: 100% !important;
  margin: 0;
  background-color: #F2F2F7;
  color: #1C1C1E;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Полупрозрачное матовое стекло верхней панели iOS */
.ios-glass-header {
  background: rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}

.ios-glass-overlay {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

/* Карточка с ультратонкой границей и мягкой тенью iOS */
.ios-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(27, 54, 93, 0.035);
}

/* Фиксация блока чата вплотную к нижней границе экрана на десктопе */
@media (min-width: 1024px) {
  .pc-chat-shell {
    height: calc(100% - 10px) !important;
  }
}

/* Тонкая полоса прокрутки (только для ленты сообщений чата и модалок) */
.ios-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.ios-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.ios-scroll::-webkit-scrollbar-thumb {
  background: rgba(28, 28, 30, 0.14);
  border-radius: 9999px;
}
.ios-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(28, 28, 30, 0.28);
}

/* Полное скрытие полосы прокрутки у боковых колонок (скролл колёсиком сохраняется) */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Юридическая типографика листа A4 */
.a4-paper {
  font-family: "Times New Roman", Georgia, serif;
  color: #1C1C1E;
  font-size: 13.5px;
  line-height: 1.5;
}
.a4-paper mark.placeholder-field {
  background-color: #FEF7E0;
  color: #875A0A;
  border: 1px solid #EED18B;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
  font-size: 11.5px;
}

/* Размытие закрытой части документа до оплаты */
.doc-blur-lock {
  filter: blur(4.5px);
  -webkit-filter: blur(4.5px);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  transition: filter 0.45s ease;
}

/* Анимации сообщений и индикатора набора */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-msg {
  animation: fadeSlideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pulseDot {
  0%, 80%, 100% {
    transform: scale(0.75);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.typing-dot {
  animation: pulseDot 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details[open] .chevron-rotate {
  transform: rotate(180deg);
}
/* Поддержка динамической высоты и нижней безопасной зоны iOS Safari */
html {
  height: 100dvh;
}
html:has(body.admin-bar) {
  height: calc(100dvh - 32px);
}
@media screen and (max-width: 782px) {
  html:has(body.admin-bar) {
    height: calc(100dvh - 46px);
  }
}

.pc-safe-bottom {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* Запрет авто-зума iOS Safari при фокусе на поле ввода */
@media (max-width: 639px) {
  #composerTextarea {
    font-size: 16px !important;
  }
}

button, a, input, textarea {
  touch-action: manipulation;
}