.article-editor {
  width: 100%;
  color: #0f172a;
}

.article-editor .btn-secondary {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
  backdrop-filter: none;
}

.article-editor .btn-secondary:hover {
  border-color: #f2994a;
  background: #fff7ed;
  color: #0f172a;
}

.article-editor-header,
.article-editor-actions,
.article-editor-languages,
.article-editor-insert,
.article-editor-toolbar,
.article-writing-topbar,
.article-editor-cover-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-editor-header {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-editor-writing {
  min-height: 70vh;
  padding: 1rem 0;
  background: #ffffff;
}

.article-editor-title,
.article-editor-canvas {
  width: min(100%, 880px);
  margin-right: auto;
  margin-left: auto;
}

.article-editor-title {
  display: block;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: #0f172a;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
}

.article-editor-title::placeholder,
.article-editor-canvas > p:only-child:empty::before {
  color: #94a3b8;
}

.article-editor-canvas {
  min-height: 50vh;
  border: 0;
  box-shadow: none;
  outline: none;
  color: #1e293b;
  font-size: 1.05rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.article-editor-canvas table,
.article-editor-canvas pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.article-editor-canvas > * {
  margin: 0 0 0.85rem;
}

.article-editor-canvas ul,
.article-editor-canvas ol {
  padding-left: 1.5rem;
}

.article-editor-canvas ul {
  list-style: disc;
}

.article-editor-canvas ol {
  list-style: decimal;
}

.article-editor-canvas h2 {
  margin-top: 1.75rem;
  font-size: 1.6rem;
  font-weight: 700;
}

.article-editor-canvas h3 {
  margin-top: 1.25rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.article-editor-canvas blockquote {
  padding-left: 1rem;
  border-left: 3px solid #f2994a;
  color: #475569;
  font-style: italic;
}

.article-callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border-left-width: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.article-callout-info {
  border-left-color: #3b82f6;
  background-color: #eff6ff;
  color: #1e3a8a;
}

.article-callout-warning {
  border-left-color: #f59e0b;
  background-color: #fffbeb;
  color: #78350f;
}

.article-callout-success {
  border-left-color: #10b981;
  background-color: #ecfdf5;
  color: #064e3b;
}

.article-accordion {
  margin: 1.25rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem 1rem;
}

.article-accordion summary {
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  outline: none;
}

.article-accordion-body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #334155;
}

.article-editor-canvas pre {
  padding: 0.85rem 1.25rem;
  border-radius: 0.5rem;
  background: #0f172a;
  color: #f2994a;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.article-editor-canvas figure,
.slider-slide {
  position: relative;
  margin: 1.25rem 0;
  text-align: center;
}

.article-editor-canvas img.is-uploading,
.slider-slide img.is-uploading {
  opacity: 0.45;
  filter: grayscale(80%) blur(0.5px);
  transition: opacity 0.2s ease, filter 0.2s ease;
  cursor: wait;
}

figure.is-uploading,
.slider-slide.is-uploading {
  position: relative;
}

figure.is-uploading::after,
.slider-slide.is-uploading::after {
  content: "Загрузка...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  pointer-events: none;
  z-index: 25;
}

.article-editor-canvas img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
  border-radius: 0.5rem;
}

.article-editor-canvas figcaption {
  min-height: 1.5rem;
  margin-top: 0.5rem;
  color: #64748b;
  font-size: 0.85rem;
  outline: none;
}

.article-editor-canvas figcaption:empty::before {
  content: "Добавить подпись и описание фото...";
  color: #94a3b8;
}

.article-slider {
  position: relative;
  overflow: hidden;
  margin: 2rem 0;
  border-radius: 1rem;
  background: transparent;
  width: 100%;
}

.slider-track {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
}

.slider-track::-webkit-scrollbar {
  display: none;
}

.slider-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  scroll-snap-align: start;
}

.slider-slide img {
  max-height: 44rem;
  width: 100%;
  object-fit: contain;
  border-radius: 1rem;
  display: block;
}

.slider-caption {
  margin-top: 0.5rem;
  color: #64748b;
  font-size: 0.8rem;
  text-align: center;
  outline: none;
}

.slider-prev,
.slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  transition: all 180ms ease;
  user-select: none;
  border: none;
  cursor: pointer;
}

.slider-prev:hover,
.slider-next:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.08);
  color: #f2994a;
}

.slider-prev {
  left: 1rem;
}

.slider-next {
  right: 1rem;
}

.slider-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  user-select: none;
}

.slider-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.45);
  transition: all 180ms ease;
  cursor: pointer;
  border: none;
  padding: 0;
}

.slider-dot.is-active,
.slider-dot[aria-current="true"] {
  background: #f2994a;
  transform: scale(1.25);
}

.article-slider:focus-visible,
.slider-prev:focus-visible,
.slider-next:focus-visible,
.slider-dot:focus-visible {
  outline: 3px solid #f2994a;
  outline-offset: 3px;
}

.slider-prev:disabled,
.slider-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .slider-track {
    scroll-behavior: auto;
  }

  .slider-dot,
  .slider-prev,
  .slider-next {
    transition: none;
  }
}

.article-editor-toolbar {
  position: fixed;
  z-index: 100;
  gap: 0.15rem;
  padding: 0.25rem;
  border-radius: 0.5rem;
  background: #0f172a;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.article-editor-toolbar[hidden] {
  display: none;
}

.article-editor-toolbar button {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  color: #ffffff;
  font-size: 0.85rem;
}

.article-editor-toolbar button:hover {
  background: #334155;
  color: #f2994a;
}

.article-editor.is-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  width: 100%;
  max-width: none;
  flex-direction: column;
  overflow: auto;
  background: #ffffff;
  padding: 1.5rem 2rem;
}

body.article-editor-fullscreen-open {
  overflow: hidden;
}

.editor-table-wrapper {
  position: relative;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.5rem;
  max-width: 100%;
  overflow-x: auto;
}

.editor-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.editor-table-wrapper th,
.editor-table-wrapper td {
  border: 1px solid #cbd5e1;
  padding: 0.5rem 0.75rem;
  min-width: 4rem;
  outline: none;
  color: #0f172a;
}

.editor-table-wrapper th {
  background-color: #f8fafc;
  font-weight: 700;
  color: #0f172a;
  text-align: left;
}

.editor-table-wrapper td:focus,
.editor-table-wrapper th:focus {
  background-color: #fff7ed;
  border-color: #f2994a;
}

.editor-table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.editor-table-tools button {
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  transition: all 120ms ease;
}

.editor-table-tools button:hover {
  background: #fff7ed;
  border-color: #f2994a;
  color: #c2410c;
}
.article-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.5rem 0;
}

.article-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0.75rem;
}
