/* ============================================================
   LÀNG ĐỒNG TRÌ — editor (phone-first)
   ============================================================ */

body { padding-bottom: 40px; }

/* ---------- login ---------- */

.editor-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.editor-login .editor-card { width: min(400px, 100%); }

/* ---------- shared ---------- */

.editor-card {
  background: var(--white);
  border: 1px solid #e8dfc9;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.editor-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }

.editor-brand__avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--red), var(--red-dark));
  color: #f4ead4;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-brand__title { font-family: var(--serif); font-size: 1.35rem; color: var(--red-dark); line-height: 1.2; }
.editor-brand__sub { font-size: 0.82rem; color: var(--ink-soft); margin-top: 2px; }

.editor-h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--red-dark);
  margin-bottom: 6px;
}

.editor-hint { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 14px; }

.editor-field { margin-bottom: 14px; }
.editor-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
@media (max-width: 480px) { .editor-row { grid-template-columns: 1fr; } }

.editor-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.editor-req { color: var(--red); }

.editor-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #ddd2b8;
  border-radius: 10px;
  padding: 12px 14px;
  -webkit-appearance: none;
  appearance: none;
}

textarea.editor-input { resize: vertical; min-height: 120px; }

.editor-input:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 2px rgba(201, 168, 106, 0.25);
}

.editor-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 4px 0 14px;
  cursor: pointer;
}
.editor-check input { width: 20px; height: 20px; accent-color: var(--red); }

/* ---------- buttons ---------- */

.editor-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.editor-btn:active { transform: scale(0.98); }
.editor-btn:disabled { opacity: 0.6; cursor: default; }

.editor-btn--primary {
  margin-top: 10px;
  background: var(--red);
  color: #fff;
}
.editor-btn--primary:hover { background: var(--red-dark); }

.editor-btn--ai {
  margin-top: 10px;
  background: linear-gradient(150deg, #3d2a1a, #2b1c12);
  color: #f4ead4;
}
.editor-btn--ai:hover { background: linear-gradient(150deg, #4a3220, #3d2a1a); }

.editor-btn--preview {
  background: var(--parchment-2);
  color: var(--ink);
  padding: 10px 16px;
  width: auto;
  font-size: 0.9rem;
}
.editor-btn--publish {
  background: linear-gradient(150deg, #b3392e, var(--red-dark));
  color: #fff;
  font-size: 1.12rem;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(163, 38, 29, 0.35);
}

.editor-ai-revise { margin-top: 16px; border-top: 1px dashed #e8dfc9; padding-top: 14px; }

/* ---------- preview ---------- */

.editor-preview { margin-top: 14px; }

/* ---------- topbar ---------- */

.editor-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 253, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5dcc6;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.editor-topbar__back,
.editor-topbar__out {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--red);
  cursor: pointer;
  padding: 8px;
}

.editor-topbar__title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--ink); }

.editor__body { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ---------- status ---------- */

.editor-status {
  background: var(--white);
  border: 1px solid #e8dfc9;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 14px;
}
.editor-status[hidden] { display: none; }
.editor-status--ok { border-left-color: #3d6b2e; background: #f2f7ec; }
.editor-status--error { border-left-color: var(--red); background: #fbefec; }
.editor-status a { font-weight: 600; }

.editor-error {
  color: var(--red);
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}
.editor-error[hidden] { display: none; }

.editor-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- google login ---------- */

.editor-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 14px 0 12px;
}
.editor-divider::before,
.editor-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e8dfc9;
}
.editor-divider[hidden] { display: none; }

#google-button {
  width: 100%;
  display: flex;
  justify-content: center;
}
#google-button[hidden] { display: none; }
#google-button iframe { border-radius: 12px !important; overflow: hidden; }

/* ================= ADMIN POST LIST ================= */

.admin-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }

.admin-post { border-radius: 12px; }

.post__title-inline {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.4;
}

.admin-post__pin { font-size: 0.9em; }

.admin-post__preview {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.admin-post__actions {
  display: flex;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid #ece4d0;
  background: #fdfaf2;
}

.admin-btn {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.admin-btn:disabled { opacity: 0.6; cursor: default; }

.admin-btn--edit {
  background: var(--parchment-2);
  color: var(--ink);
}
.admin-btn--edit:hover { background: #e6dcc0; }

.admin-btn--delete {
  background: #f3e3e0;
  color: var(--red-dark);
}
.admin-btn--delete:hover { background: #e9cdc8; }

/* ---------- new-post + form buttons ---------- */

.editor-btn--new {
  background: linear-gradient(150deg, #b3392e, var(--red-dark));
  color: #fff;
  font-size: 1.05rem;
  padding: 15px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(163, 38, 29, 0.3);
}

.editor-h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--red-dark);
  margin-bottom: 6px;
}

.editor-ai-box {
  border: 1px dashed #ddd2b8;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  background: #fdfaf2;
}

.editor-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.editor-form-actions .editor-btn--publish { flex: 3; margin-bottom: 0; }

.editor-btn--cancel {
  flex: 1;
  background: var(--parchment-2);
  color: var(--ink);
  margin-bottom: 14px;
}
