/* Compose editor — học Frontstore admin-cms-edit + www-cms */

.mkt-compose {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.mkt-compose--focus .mkt-compose__sidebar {
  display: none;
}

.mkt-compose--focus .mkt-compose__grid {
  grid-template-columns: 1fr;
}

.mkt-compose__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.mkt-compose__status-hint {
  font-size: 0.8125rem;
  color: #7c3aed;
}

.mkt-compose__status-hint.is-dirty {
  color: #b45309;
  font-weight: 600;
}

.mkt-compose__draft-badge {
  color: #047857;
  font-weight: 600;
}

.mkt-compose__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 991px) {
  .mkt-compose__grid {
    grid-template-columns: 1fr;
  }
}

.mkt-compose__main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.mkt-compose__title {
  width: 100%;
  font-size: 1.5rem;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.35rem 0 0.65rem;
  background: transparent;
  color: #4c1d95;
  line-height: 1.25;
}

.mkt-compose__title:focus {
  outline: none;
  border-bottom-color: #e9d5ff;
}

.mkt-compose__title::placeholder {
  color: #c4b5fd;
}

.mkt-compose__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mkt-compose__stats {
  font-size: 0.75rem;
  color: #a78bfa;
  font-variant-numeric: tabular-nums;
}

.mkt-compose__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.mkt-compose__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #e9d5ff;
  border-radius: 0.375rem;
  background: #fff;
  color: #6d28d9;
  cursor: pointer;
  font-size: 0.875rem;
}

.mkt-compose__icon-btn:hover,
.mkt-compose__icon-btn.is-active {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.mkt-compose__tabs {
  display: inline-flex;
  border: 1px solid #e9d5ff;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}

.mkt-compose__tab {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #7c3aed;
  cursor: pointer;
}

.mkt-compose__tab.is-active {
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 600;
}

.mkt-compose__pane {
  min-width: 0;
  min-height: 480px;
}

.mkt-compose__preview {
  border: 1px solid #e9d5ff;
  border-radius: 0.5rem;
  background: #fff;
  overflow: hidden;
  height: 100%;
  min-height: inherit;
}

.mkt-compose__preview iframe {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border: 0;
  display: block;
}

.mkt-compose__sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mkt-compose__panel {
  border: 1px solid #e9d5ff;
  border-radius: 0.5rem;
  background: #fff;
  padding: 1rem;
}

.mkt-compose__panel-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a78bfa;
  margin-bottom: 0.75rem;
}

.mkt-compose__radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mkt-compose__radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #5b21b6;
  cursor: pointer;
}

.mkt-compose__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  font-size: 0.8125rem;
  color: #7c3aed;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3e8ff;
  margin-bottom: 0.5rem;
}

.mkt-compose__meta-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a78bfa;
}

/* CMS article body — học Frontstore www-cms.css */
.cms-article-body {
  --cms-prose-font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cms-prose-size: 1.0625rem;
  --cms-prose-lh: 1.72;
  --cms-heading: #1f2937;
  --cms-body: #374151;
  --cms-muted: #6b7280;
  --cms-link: #db2777;
  font-family: var(--cms-prose-font);
  font-size: var(--cms-prose-size);
  line-height: var(--cms-prose-lh);
  color: var(--cms-body);
  max-width: 68ch;
}

.cms-article-body a {
  color: var(--cms-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cms-article-body h1,
.cms-article-body h2,
.cms-article-body h3,
.cms-article-body h4 {
  color: var(--cms-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  scroll-margin-top: 1.5rem;
}

.cms-article-body h1:first-child,
.cms-article-body h2:first-child,
.cms-article-body h3:first-child {
  margin-top: 0;
}

.cms-article-body h2 {
  font-size: 1.375rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.375em;
}

.cms-article-body h3 {
  font-size: 1.125rem;
}

.cms-article-body p {
  margin-bottom: 1.25em;
}

.cms-article-body ul,
.cms-article-body ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.cms-article-body ul {
  list-style-type: disc;
}

.cms-article-body ol {
  list-style-type: decimal;
}

.cms-article-body li {
  margin-bottom: 0.35em;
}

.cms-article-body blockquote {
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  border-left: 4px solid var(--cms-link);
  background: rgba(236, 72, 153, 0.08);
  color: var(--cms-muted);
  font-style: italic;
}

.cms-article-body img,
.cms-article-body video,
.cms-article-body iframe {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.25em 0;
}

.cms-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9375rem;
}

.cms-article-body th,
.cms-article-body td {
  border: 1px solid #e5e7eb;
  padding: 0.625rem 0.75rem;
  text-align: left;
}

.cms-article-body th {
  background: #f9fafb;
  font-weight: 600;
}

.cms-article-body code {
  font-size: 0.9em;
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  background: #f3f4f6;
}

.cms-article-body pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

.cms-article-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Article page shell */
.mkt-article-view__header h1 {
  font-size: clamp(1.375rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #4c1d95;
  line-height: 1.28;
  margin: 0 0 0.75rem;
}

.mkt-article-view__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  color: #7c3aed;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9d5ff;
}

.mkt-article-view__crumbs {
  font-size: 0.8125rem;
  color: #a78bfa;
  margin-bottom: 1rem;
}

.mkt-article-view__crumbs a {
  color: #7c3aed;
  text-decoration: none;
}

.mkt-article-view__crumbs a:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .dark .cms-article-body,
  html.dark .cms-article-body {
    --cms-heading: #f3f4f6;
    --cms-body: #e5e7eb;
    --cms-muted: #9ca3af;
  }

  .dark .cms-article-body h2,
  html.dark .cms-article-body h2 {
    border-bottom-color: #374151;
  }

  .dark .cms-article-body code,
  html.dark .cms-article-body code {
    background: #374151;
  }
}
