/* ============================================================
   WYSIWYG Editor v1.4.0
   All classes are prefixed with wys_
   ============================================================ */

.wys_editor {
  border: 1px solid #d8dde6;
  border-radius: 12px;
  background: #ffffff;
  overflow: visible;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wys_editor:focus-within {
  border-color: #7aa7ff;
  box-shadow: 0 0 0 3px rgba(80, 132, 255, 0.16);
}

.wys_toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: #f7f8fa;
  border-bottom: 1px solid #e3e7ee;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.wys_toolbar_group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  margin-right: 4px;
  border-right: 1px solid #dfe3ea;
}

.wys_toolbar_group:last-child {
  border-right: 0;
}

.wys_button,
.wys_select,
.wys_color {
  min-height: 34px;
  border: 1px solid #d5dae3;
  background: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
}

.wys_button,
.wys_select {
  min-width: 34px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 600;
}

.wys_button:hover,
.wys_select:hover,
.wys_color:hover {
  background: #eef3ff;
  border-color: #9dbbff;
}

.wys_button:active,
.wys_button.wys_active {
  background: #dbe8ff;
  border-color: #6f9fff;
}

.wys_button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wys_color {
  width: 38px;
  padding: 3px;
  cursor: pointer;
}

.wys_dropdown {
  position: relative;
  display: inline-flex;
}

.wys_dropdown_button {
  min-width: 92px;
  justify-content: space-between;
  text-align: left;
}

.wys_dropdown_button::after {
  content: "▾";
  margin-left: 8px;
  font-size: 0.75em;
}

.wys_dropdown_menu {
  position: absolute;
  z-index: 9999;
  top: calc(100% + 4px);
  left: 0;
  min-width: 170px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #d5dae3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.14);
}

.wys_dropdown_item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wys_dropdown_item:hover,
.wys_dropdown_item:focus {
  background: #eef3ff;
  outline: none;
}

.wys_edit_area {
  min-height: 240px;
  padding: 18px;
  outline: none;
  overflow: auto;
  color: #111827;
  background: #ffffff;
}

.wys_edit_area:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.wys_source_area {
  width: 100%;
  min-height: 240px;
  padding: 18px;
  border: 0;
  outline: none;
  resize: vertical;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
  background: #ffffff;
}

.wys_statusbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: #6b7280;
  background: #f7f8fa;
  border-top: 1px solid #e3e7ee;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.wys_hidden {
  display: none !important;
}

/* ============================================================
   Shared content styles for editor + public display
   Use .wys_content around public HTML output
   ============================================================ */

.wys_content,
.wys_edit_area {
  font-size: 16px;
  line-height: 1.65;
}

.wys_content *,
.wys_edit_area * {
  box-sizing: border-box;
}

.wys_content p,
.wys_edit_area p {
  margin: 0 0 1em;
}

.wys_content h1,
.wys_edit_area h1 {
  margin: 0.85em 0 0.45em;
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 800;
}

.wys_content h2,
.wys_edit_area h2 {
  margin: 0.85em 0 0.45em;
  font-size: 1.85rem;
  line-height: 1.2;
  font-weight: 800;
}

.wys_content h3,
.wys_edit_area h3 {
  margin: 0.85em 0 0.45em;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 750;
}

.wys_content h4,
.wys_edit_area h4 {
  margin: 0.85em 0 0.45em;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 750;
}

.wys_content h5,
.wys_edit_area h5 {
  margin: 0.85em 0 0.45em;
  font-size: 1.1rem;
  line-height: 1.35;
  font-weight: 700;
}

.wys_content h6,
.wys_edit_area h6 {
  margin: 0.85em 0 0.45em;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* v1.4: protect list indentation from admin/global CSS resets */
.wys_editor .wys_edit_area ul,
.wys_editor .wys_edit_area ol,
.wys_content ul,
.wys_content ol {
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 1em;
  margin-left: 1.75rem !important;
  padding-left: 1.25rem !important;
  list-style-position: outside !important;
}

.wys_editor .wys_edit_area ul,
.wys_content ul {
  list-style-type: disc !important;
}

.wys_editor .wys_edit_area ul ul,
.wys_content ul ul {
  list-style-type: circle !important;
}

.wys_editor .wys_edit_area ul ul ul,
.wys_content ul ul ul {
  list-style-type: square !important;
}

.wys_editor .wys_edit_area ol,
.wys_content ol {
  list-style-type: decimal !important;
}

.wys_editor .wys_edit_area ol ol,
.wys_content ol ol {
  list-style-type: lower-alpha !important;
}

.wys_editor .wys_edit_area ol ol ol,
.wys_content ol ol ol {
  list-style-type: lower-roman !important;
}

.wys_editor .wys_edit_area li,
.wys_content li {
  display: list-item !important;
  margin-bottom: 0.35em;
  padding-left: 0.15rem;
}

.wys_editor .wys_edit_area li > ul,
.wys_editor .wys_edit_area li > ol,
.wys_content li > ul,
.wys_content li > ol {
  margin-top: 0.35em;
  margin-bottom: 0.35em;
}

.wys_content blockquote,
.wys_edit_area blockquote {
  margin: 1.25em 0;
  padding: 0.85em 1em;
  border-left: 4px solid #9dbbff;
  background: #f4f7ff;
  color: #374151;
}

.wys_content a,
.wys_edit_area a {
  color: #155eef;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wys_content img,
.wys_edit_area img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.wys_content figure,
.wys_edit_area figure {
  margin: 1.25em 0;
}

.wys_content figcaption,
.wys_edit_area figcaption {
  margin-top: 0.45em;
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
}

.wys_content table,
.wys_edit_area table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
}

.wys_content th,
.wys_content td,
.wys_edit_area th,
.wys_edit_area td {
  border: 1px solid #d8dde6;
  padding: 0.65em;
  vertical-align: top;
}

.wys_content th,
.wys_edit_area th {
  background: #f7f8fa;
  font-weight: 700;
}

.wys_content hr,
.wys_edit_area hr {
  border: 0;
  border-top: 1px solid #d8dde6;
  margin: 1.5em 0;
}

.wys_content pre,
.wys_edit_area pre {
  padding: 1em;
  overflow: auto;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
}

.wys_content code,
.wys_edit_area code {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.92em;
  padding: 0.15em 0.3em;
  border-radius: 4px;
  background: #eef2f7;
}

.wys_content pre code,
.wys_edit_area pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.wys_content .wys_text_left,
.wys_edit_area .wys_text_left {
  text-align: left;
}

.wys_content .wys_text_center,
.wys_edit_area .wys_text_center {
  text-align: center;
}

.wys_content .wys_text_right,
.wys_edit_area .wys_text_right {
  text-align: right;
}

.wys_content .wys_text_justify,
.wys_edit_area .wys_text_justify {
  text-align: justify;
}
