:root {
  --bg: #f4efe7;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-strong: #fffdf8;
  --line: rgba(52, 42, 29, 0.12);
  --text: #2b2318;
  --muted: #746552;
  --accent: #b24a2b;
  --accent-dark: #7f2f17;
  --green: #23402d;
  --shadow: 0 20px 50px rgba(64, 39, 11, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(232, 185, 144, 0.42), transparent 32%),
    radial-gradient(circle at bottom right, rgba(73, 118, 86, 0.22), transparent 25%),
    linear-gradient(180deg, #f7f2ea 0%, #efe4d3 100%);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  display: block;
  margin-bottom: 28px;
}

.search-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.search-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px;
}

.search-card-wide {
  width: 100%;
}

.search-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.search-hint {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(35, 64, 45, 0.08);
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 700;
}

.field-label {
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 700;
}

.search-row {
  display: flex;
  gap: 12px;
}

input {
  width: 100%;
  border: 1px solid rgba(90, 64, 36, 0.15);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff8f2;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary {
  background: #ead8c8;
  color: var(--text);
}

.status {
  margin: 14px 2px 0;
  min-height: 24px;
  color: var(--muted);
}

.status[data-tone="error"] {
  color: #9d2323;
}

.status[data-tone="success"] {
  color: #1b6a41;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 24px;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #ece3d5;
  color: var(--muted);
  font-size: 0.9rem;
}

.news-list {
  display: grid;
  gap: 14px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 6px;
}

.news-item {
  padding: 18px 18px 16px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(64, 39, 11, 0.08);
}

.news-meta,
.news-actions,
.social-footer,
.action-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.news-meta,
.news-desc,
.social-time,
.social-footer,
.copy-box textarea {
  color: var(--muted);
}

.news-title {
  margin-bottom: 10px;
  font-size: 1.08rem;
  line-height: 1.4;
}

.news-desc {
  margin-bottom: 14px;
  line-height: 1.5;
}

.news-link {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.news-actions button,
.action-row button {
  min-width: 168px;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-preview {
  min-height: 560px;
}

.social-card,
.copy-box {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.social-card {
  overflow: hidden;
}

.social-head,
.social-caption,
.social-footer,
.copy-box {
  padding: 18px 18px 0;
}

.social-page {
  margin-bottom: 2px;
  font-weight: 800;
}

.social-caption {
  line-height: 1.6;
}

.poster-image-wrap {
  position: relative;
  margin: 18px;
  min-height: 420px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #48674e 0%, #152418 100%);
}

.poster-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 14, 9, 0.05) 0%, rgba(6, 12, 8, 0.72) 100%);
}

.poster-text {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  color: #fffef7;
  font-size: clamp(1.3rem, 2vw, 2.1rem);
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  font-weight: 900;
  line-height: 1.08;
  text-wrap: balance;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.placeholder-image::before {
  content: "KHONG CO ANH";
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fffef7;
  font-weight: 700;
  z-index: 2;
}

.social-footer {
  padding-bottom: 18px;
}

.social-footer a {
  color: var(--accent);
  font-weight: 700;
}

.copy-box {
  padding: 18px;
}

.copy-box textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.action-row {
  justify-content: flex-end;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed rgba(90, 64, 36, 0.2);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  padding: 22px;
}

@media (max-width: 980px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .news-list {
    max-height: none;
  }

  .search-head,
  .search-row,
  .news-actions,
  .action-row,
  .social-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
