/* ==========================================================================
   platform-fonts.css : Локальные шрифты Manrope + Onest и утилиты платформы
   Все цвета строго из design-system/styles/00-tokens.css (Apple 90/9/1)
   ========================================================================== */

@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-cyrillic.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  src: url('/fonts/onest-cyrillic.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  src: url('/fonts/onest-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Встроенные интерактивные виджеты редакционных статей блога ---------- */
.hdl-cta-box {
  margin: var(--sp-8) 0;
  padding: var(--sp-6);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.hdl-cta-title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: var(--lh-h3);
  color: var(--ink);
  margin: 0 0 var(--sp-1);
}
.hdl-cta-lead {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin: 0;
  max-width: 54ch;
}
.hdl-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--inverse);
  color: var(--on-inverse) !important;
  text-decoration: none !important;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.hdl-cta-btn:hover {
  background: var(--inverse-hover);
}
.hdl-cta-btn:active {
  transform: scale(0.97);
}

.hdl-copy-card {
  margin: var(--sp-5) 0;
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.hdl-copy-body {
  margin: 0 0 var(--sp-4) !important;
  font-size: var(--text-body) !important;
  color: var(--ink) !important;
  line-height: 1.65;
}
.hdl-copy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.hdl-copy-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.hdl-copy-btn:hover {
  background: var(--inverse);
  border-color: var(--inverse);
  color: var(--on-inverse);
}
.hdl-copy-link {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-text) !important;
  text-decoration: none;
}
.hdl-copy-link:hover {
  text-decoration: underline;
}

.hdl-checklist {
  margin: var(--sp-6) 0;
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.hdl-checklist-head {
  font-size: var(--text-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  margin-bottom: var(--sp-3);
}
.hdl-check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 10px 0;
  font-size: var(--text-sm);
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.hdl-check-item:last-child {
  border-bottom: 0;
}
.hdl-check-item input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--inverse);
  flex-shrink: 0;
}
.hdl-check-item input:checked + span {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.hdl-themes-strip {
  margin: var(--sp-8) 0;
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.hdl-themes-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}
.hdl-themes-head a {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-text);
}
.hdl-themes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}
.hdl-theme-mini {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none !important;
  color: var(--ink) !important;
  transition: transform var(--dur) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.hdl-theme-mini:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}
.hdl-theme-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-press);
}
.hdl-theme-thumb img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  margin: 0 !important;
  border-radius: 0 !important;
}
.hdl-theme-meta {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hdl-theme-meta strong {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
}
.hdl-theme-meta span {
  font-size: var(--text-micro);
  color: var(--ink-muted);
}

.prose table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: var(--sp-6) 0;
  font-size: var(--text-sm);
  background: var(--surface);
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 10px var(--sp-3);
  text-align: left;
}
.prose th {
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1.5px solid var(--line-strong);
}

/* ---- Универсальное модальное окно живого предпросмотра шаблонов ---------- */
.live-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgb(17 19 24 / 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.live-preview-backdrop.open {
  display: flex;
}
.live-preview-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 1200px;
  height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-float);
}
.live-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.live-preview-stage {
  flex: 1;
  background: var(--page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  overflow: hidden;
}
.live-device-shell {
  width: 390px;
  max-width: 100%;
  height: 100%;
  max-height: 760px;
  background: var(--inverse);
  border-radius: var(--r-device);
  padding: 10px;
  box-shadow: var(--shadow-phone);
  position: relative;
  transition: width var(--dur) var(--ease), max-width var(--dur) var(--ease), border-radius var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}
.live-device-shell.desktop-mode {
  width: 100%;
  max-width: 1120px;
  max-height: 770px;
  border-radius: var(--r-md);
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-float);
}
.live-browser-chrome {
  display: none;
  height: 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  align-items: center;
  padding: 0 var(--sp-4);
  gap: var(--sp-2);
  flex-shrink: 0;
}
.live-device-shell.desktop-mode .live-browser-chrome {
  display: flex;
}
.live-chrome-dots {
  display: flex;
  gap: 6px;
}
.live-chrome-dots i {
  width: 9px;
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  display: block;
}
.live-chrome-url {
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px var(--sp-4);
  font-size: var(--text-micro);
  color: var(--ink-muted);
}
.live-device-screen {
  flex: 1;
  width: 100%;
  border-radius: var(--r-device-inner);
  overflow: hidden;
  background: var(--surface);
  position: relative;
}
.live-device-shell.desktop-mode .live-device-screen {
  border-radius: 0;
}
.live-device-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  transform-origin: 0 0;
}
.live-device-notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--inverse);
  z-index: 5;
  pointer-events: none;
}
.live-device-shell.desktop-mode .live-device-notch {
  display: none;
}

@media (max-width: 900px) {
  .hdl-themes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .live-preview-top {
    flex-wrap: wrap;
    padding: var(--sp-3);
  }
}
