/* 🧾 Post Editor Container */
.post-editor {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  padding: 14px;
  max-width: 800px;
  width: 95%;
  margin: 15px auto;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center;
  transition: background 0.4s, color 0.4s;
}

/* 🏷️ Title */
.post-editor h2 {
  margin-bottom: 10px;
  color: #1e293b;
  font-size: 18px;
  line-height: 1.3;
}

/* 🧰 Toolbar */
#toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

/* 🎛️ Buttons */
#toolbar button,
#toolbar label {
  flex: 1 1 110px;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.25s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  text-align: center;
  white-space: nowrap;
}

#toolbar button:hover,
#toolbar label:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #4338ca, #2563eb);
}

#toolbar input[type="file"] {
  display: none;
}

/* 📝 Editor Box */
#editor {
  width: 100%;
  min-height: 220px;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  font-family: "Consolas", monospace;
  outline: 1.8px solid #000;
  resize: vertical;
  background: #fffde7;
  color: #111;
  text-align: left;
  box-sizing: border-box;
  transition: 0.3s;
}

/* 🔢 Word Counter */
#wordCount {
  margin-top: 8px;
  font-size: 13px;
  color: #475569;
}

/* 🌙 Dark Mode */
.dark-mode {
  background: #0f172a;
  color: #f8fafc;
}
.dark-mode #editor {
  background: #1e293b;
  color: #f8fafc;
  outline-color: #94a3b8;
}

/* 📱 Small Screen (≤480px) */
@media (max-width: 480px) {
  .post-editor {
    padding: 10px;
  }
  #toolbar {
    flex-direction: row;
    gap: 5px;
  }
  #toolbar button,
  #toolbar label {
    flex: 1 1 45%;
    font-size: 12px;
    padding: 6px 8px;
  }
  #editor {
    min-height: 170px;
    font-size: 13px;
  }
  #wordCount {
    font-size: 12px;
  }
}

/* 📟 Ultra Small (≤320px = 3-inch devices) */
@media (max-width: 320px) {
  #toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  #toolbar button,
  #toolbar label {
    flex: 1 1 100%;
    width: 100%;
    font-size: 12px;
    padding: 6px;
    border-radius: 5px;
  }
  #editor {
    font-size: 12px;
    min-height: 150px;
    padding: 8px;
  }
  .post-editor h2 {
    font-size: 16px;
  }
}
