:root {
  --pink: #ff6f91;
  --pink-light: #ffe3ec;
  --coral: #ff9a76;
  --cream: #fff8f3;
  --gold: #d4a94b;
  --ink: #3a2c31;
  --ink-soft: #7a6a70;
  --white: #ffffff;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(255, 111, 145, 0.12);
  --font-head: 'Playfair Display', serif;
  --font-body: 'Poppins', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 760px; }

a { color: inherit; text-decoration: none; }

/* ---------- HEADER ---------- */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
}
.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--pink);
  white-space: nowrap;
}
.logo span { color: var(--coral); }
.logo-dot { color: var(--gold); }

.main-nav {
  display: flex;
  gap: 20px;
  flex: 1;
  flex-wrap: wrap;
}
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}
.main-nav a:hover { color: var(--pink); border-color: var(--pink); }

.search-form {
  display: flex;
  align-items: center;
  background: var(--pink-light);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
}
.search-form input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 130px;
}
.search-form button {
  border: none;
  background: var(--pink);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- HERO ---------- */
.hero-post {
  display: block;
  margin: 28px 0;
  border-radius: 24px;
  min-height: 340px;
  background: linear-gradient(135deg, var(--pink), var(--coral));
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 10%, rgba(0,0,0,0.05) 70%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}
.hero-overlay h1 {
  font-family: var(--font-head);
  font-size: 2.1rem;
  margin: 10px 0;
}
.hero-overlay p { max-width: 560px; opacity: 0.9; }

.badge {
  display: inline-block;
  background: var(--white);
  color: var(--pink);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
  letter-spacing: 0.02em;
}

/* ---------- SECTION TITLES ---------- */
.section-title, .page-heading {
  font-family: var(--font-head);
  font-size: 1.7rem;
  margin: 36px 0 20px;
  color: var(--ink);
}
.page-heading { font-size: 2rem; }

/* ---------- POST GRID ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.post-card:hover { transform: translateY(-4px); }
.post-card-image {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  height: 160px;
  background: linear-gradient(135deg, var(--pink-light), #ffd6e0);
  background-size: cover;
  background-position: center;
}
.post-card-body { padding: 16px 18px 20px; }
.post-card-body h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin: 0 0 8px;
  line-height: 1.35;
}
.post-card-body p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.read-more {
  color: var(--pink);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ---------- AD SLOTS ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, #f3e9e4, #f3e9e4 10px, #efe2dc 10px, #efe2dc 20px);
  border: 1px dashed #d8c6bd;
  border-radius: 12px;
  text-align: center;
  color: #9c8880;
  font-size: 0.75rem;
  margin: 28px 0;
}
.ad-slot-horizontal { padding: 28px 0; }
.ad-slot-inline {
  grid-column: 1 / -1;
  padding: 24px 0;
}
.ad-label { text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- SINGLE POST ---------- */
.single-post h1 {
  font-family: var(--font-head);
  font-size: 2.2rem;
  margin: 12px 0 6px;
}
.post-meta { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 20px; }
.post-cover {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 20px;
  max-height: 420px;
  object-fit: cover;
}
.post-content { font-size: 1.02rem; }
.post-content p { margin: 0 0 18px; }
.post-content img { max-width: 100%; border-radius: 12px; margin: 12px 0; }
.post-content h2, .post-content h3 { font-family: var(--font-head); margin-top: 28px; }
.post-content blockquote {
  border-left: 4px solid var(--pink);
  padding-left: 16px;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- PAGINATION / EMPTY ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 40px 0;
  font-size: 0.9rem;
}
.pagination a { color: var(--pink); font-weight: 600; }
.empty-state, .not-found {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.not-found h1 { font-family: var(--font-head); font-size: 3rem; color: var(--pink); }

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--white);
  margin-top: 60px;
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid #f0e3dc;
}
.footer-brand {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--pink);
}
.footer-brand span { color: var(--coral); }
.footer-cats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.copyright { font-size: 0.78rem; color: #b3a29a; }

/* ================================================== */
/* ADMIN PANEL                                          */
/* ================================================== */
.admin-body {
  background: #f6f3f8;
  font-family: var(--font-body);
  margin: 0;
}
.login-box {
  max-width: 380px;
  margin: 10vh auto;
  background: white;
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--pink);
}
.login-logo span { color: var(--coral); }
.login-sub { color: var(--ink-soft); margin-bottom: 24px; font-size: 0.9rem; }
.login-error {
  background: #ffe3e3;
  color: #c0392b;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.login-box form { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.login-box label { font-size: 0.8rem; color: var(--ink-soft); margin-top: 8px; }
.login-box input, .admin-main input, .admin-main select, .admin-main textarea {
  padding: 10px 12px;
  border: 1px solid #e5dbe0;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  width: 100%;
}
.login-box button {
  margin-top: 18px;
  background: var(--pink);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px;
  background: white;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(0,0,0,0.03);
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 6px; margin-top: 30px; flex: 1; }
.admin-sidebar nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: var(--pink-light);
  color: var(--pink);
}
.logout-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #eee; padding-top: 16px; }
.admin-user { font-size: 0.82rem; color: var(--ink-soft); }
.logout-form button {
  background: #f3e9e4;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
}

.admin-main { flex: 1; padding: 36px 40px; }
.admin-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-header-row h1 { font-family: var(--font-head); margin: 0; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.stat-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num { display: block; font-size: 1.6rem; font-weight: 700; color: var(--pink); font-family: var(--font-head); }
.stat-label { font-size: 0.78rem; color: var(--ink-soft); }

.btn-primary {
  background: var(--pink);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  display: inline-block;
}
.btn-secondary {
  background: #eee;
  color: var(--ink-soft);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.88rem;
  border-bottom: 1px solid #f2ecee;
}
.admin-table th { color: var(--ink-soft); font-weight: 600; background: #fbf7f9; }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-live { background: #dcf6e6; color: #1f9d55; }
.status-draft { background: #fdf0d5; color: #b8860b; }
.table-actions { display: flex; gap: 10px; align-items: center; }
.table-actions form { display: inline; }
.table-actions a, .table-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.empty-row { text-align: center; color: var(--ink-soft); padding: 30px; }

.post-form { display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.post-form label { font-size: 0.85rem; font-weight: 600; margin-top: 14px; color: var(--ink); }
.post-form .hint { font-weight: 400; color: var(--ink-soft); font-size: 0.78rem; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; }
.checkbox-label input { width: auto; }
.current-cover { max-width: 220px; border-radius: 10px; margin-top: 8px; }
#editor { background: white; min-height: 280px; border-radius: 0 0 10px 10px; }
.ql-toolbar { border-radius: 10px 10px 0 0; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { position: fixed; left: -260px; height: 100%; z-index: 50; transition: 0.2s; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: white;
    flex-direction: column;
    padding: 16px 24px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .search-form { display: none; }
  .post-grid { grid-template-columns: 1fr; }
  .hero-overlay h1 { font-size: 1.5rem; }
  .admin-main { padding: 24px 18px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
