/* ==========================================================================
   HOME NEWS - ADMIN CREATE NEWS ARTICLE CSS
   File: assets/css/news-create.css
   ========================================================================== */

/* 1. Main Page Layout (Two-Column CSS Grid) */
.editor-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.editor-main-col {
  min-width: 0;
  width: 100%;
}

.editor-sidebar-col {
  min-width: 0;
  width: 100%;
}

/* 2. Reusable White Card Containers */
.editor-card-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm, 4px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
  padding: 24px;
  margin-bottom: 24px;
  box-sizing: border-box;
  width: 100%;
}

.editor-card-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.editor-card-header h3 {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

/* 3. Reusable Form Field CSS System */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #172033;
  letter-spacing: 0.01em;
  margin: 0;
}

.form-label-required::after {
  content: " *";
  color: var(--primary-red, #D71920);
}

.form-control,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.94rem;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-control::placeholder,
.form-textarea::placeholder {
  color: #94a3b8;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--primary-red, #D71920);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.14);
}

/* Article Headline Field */
.headline-input {
  height: 46px;
  font-size: 15px;
  font-weight: 600;
}

/* URL Slug Field */
.slug-input-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.slug-input-wrapper:focus-within {
  border-color: var(--primary-red, #D71920);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.14);
  background-color: #ffffff;
}

.slug-prefix {
  padding: 0 12px;
  font-size: 0.84rem;
  color: #64748b;
  font-family: monospace;
  background-color: #f1f5f9;
  border-right: 1px solid #cbd5e1;
  height: 100%;
  display: flex;
  align-items: center;
  user-select: none;
  white-space: nowrap;
}

.slug-input-wrapper .form-control {
  border: none;
  height: 100%;
  background: transparent;
  padding: 0 12px;
  font-family: monospace;
  font-size: 0.88rem;
  color: #0f172a;
}

.slug-input-wrapper .form-control:focus {
  box-shadow: none;
  border: none;
}

/* Form Select Dropdown */
.form-select {
  height: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 10px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
}

/* Form Textarea */
.form-textarea {
  min-height: 110px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

/* 4. Full-Width Rich-Text Editor System */
.editor-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 5px 5px 0 0;
  padding: 10px 14px;
  box-sizing: border-box;
}

.editor-toolbar-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.editor-toolbar-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--primary-red, #D71920);
}

.editor-toolbar-divider {
  width: 1px;
  height: 20px;
  background-color: #cbd5e1;
  margin: 0 4px;
}

.editor-content {
  width: 100%;
  min-height: 450px;
  padding: 18px 20px;
  font-family: var(--font-headline, 'Merriweather', Georgia, serif);
  font-size: 1rem;
  line-height: 1.75;
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.editor-content:focus {
  outline: none;
  border-color: var(--primary-red, #D71920);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.14);
}

/* 5. Tag Chips Container */
.tag-input-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.tag-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px 3px 10px;
  border-radius: 3px;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  line-height: 1;
}

.tag-chip-remove:hover {
  color: var(--primary-red, #D71920);
}

/* 6. Media Upload & Preview Dropzone */
.media-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  padding: 28px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.media-dropzone:hover {
  border-color: var(--primary-red, #D71920);
  background: #fef2f2;
}

.image-preview-wrapper {
  margin-top: 14px;
  display: none;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  max-height: 240px;
  border: 1px solid #e2e8f0;
}

.image-preview-wrapper.active {
  display: block;
}

.image-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.remove-image-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.remove-image-btn:hover {
  background: var(--primary-red, #D71920);
}

/* 7. Character Counter */
.char-count-info {
  display: flex;
  justify-content: flex-end;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
}

/* 8. Publishing Workflow Sidebar Controls */
.publishing-sidebar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm, 4px);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
}

@media screen and (min-width: 1025px) {
  .sticky-sidebar-wrapper {
    position: sticky;
    top: 84px;
  }
}

.checkbox-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}

.checkbox-control {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-red, #D71920);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-label-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
}

.publishing-actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.btn-editor-action {
  width: 100%;
  height: 44px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.btn-cancel-return {
  display: block;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  padding: 8px;
  transition: color 0.15s ease;
}

.btn-cancel-return:hover {
  color: var(--primary-red, #D71920);
  text-decoration: underline;
}

/* 9. Responsive Breakpoints */
@media screen and (max-width: 1024px) {
  .editor-page-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .sticky-sidebar-wrapper {
    position: static;
  }
}

@media screen and (max-width: 768px) {
  .editor-card-box {
    padding: 18px 16px;
  }

  .editor-content {
    min-height: 350px;
    padding: 14px 16px;
  }
}
