/* ── ZeniGrowth Blog CSS ──────────────────────────────────────
   Brand: sky blue #0EA5E9, dark navy #0B1F3A, green accent #22C55E
   Font: system-ui stack (matches existing site)
   Scope: blog.php, blog-post.php, admin-login.php, admin.html
   ─────────────────────────────────────────────────────────── */

:root {
  --sky:        #0EA5E9;
  --sky-dark:   #0284C7;
  --sky-light:  #E0F2FE;
  --green:      #22C55E;
  --navy:       #0B1F3A;
  --white:      #FFFFFF;
  --off-white:  #F8FAFC;
  --border:     rgba(11,31,58,.1);
  --text-dark:  #0F172A;
  --text-mid:   #475569;
  --text-light: #94A3B8;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 16px rgba(11,31,58,.08);
  --transition: .2s ease;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ── PAGE HERO ────────────────────────────────────────────────── */
.zg-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #0F3460 100%);
  padding: 64px 24px;
  text-align: center;
  margin-bottom: 4rem;
}
.zg-hero h1 {
  font-size: clamp(28px, 5vw, 48px) !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-bottom: 14px !important;
  line-height: 1.15 !important;
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #ffffff !important;
}
.zg-hero p { font-size: 17px; color: rgba(255,255,255,.75); max-width: 520px; margin: 0 auto; }
.zg-hero-breadcrumb {
  font-size: 13px; color: rgba(255,255,255,.5); margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.zg-hero-breadcrumb a { color: rgba(255,255,255,.6); }
.zg-hero-breadcrumb a:hover { color: var(--sky); }
.zg-hero-breadcrumb span { color: rgba(255,255,255,.3); }

/* ── CONTAINER ───────────────────────────────────────────────── */
.zg-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.zg-section { padding: 60px 0; }

/* ── BLOG FILTERS ────────────────────────────────────────────── */
.zg-blog-filters {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 36px;
}
.zg-search-wrap { position: relative; flex: 1 1 260px; }
.zg-search-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-light); pointer-events: none;
}
.zg-search-wrap input {
  width: 100%; height: 42px; padding: 0 14px 0 40px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; outline: none; transition: var(--transition);
}
.zg-search-wrap input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.zg-cat-select {
  height: 42px; padding: 0 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-family: var(--font); font-size: 14px;
  color: var(--text-dark); background: var(--white); cursor: pointer; outline: none;
  transition: var(--transition);
}
.zg-cat-select:focus { border-color: var(--sky); }

.zg-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.zg-pill {
  padding: 6px 16px; border-radius: 99px; font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--border); color: var(--text-mid);
  cursor: pointer; transition: var(--transition); background: var(--white);
}
.zg-pill:hover { border-color: var(--sky); color: var(--sky); }
.zg-pill.active { background: var(--sky); color: var(--white); border-color: var(--sky); }

/* ── BLOG GRID ───────────────────────────────────────────────── */
.zg-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px; margin-bottom: 48px;
}
.zg-post-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition);
  display: flex; flex-direction: column;
}
.zg-post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: rgba(14,165,233,.2); }
.zg-card-img { width: 100%; height: 200px; object-fit: cover; background: var(--sky-light); }
.zg-card-img-placeholder {
  width: 100%; height: 200px; background: linear-gradient(135deg, var(--sky-light), #BAE6FD);
  display: flex; align-items: center; justify-content: center; color: var(--sky);
}
.zg-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.zg-card-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.zg-card-cat {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--sky); background: var(--sky-light); padding: 3px 10px; border-radius: 99px;
}
.zg-card-date { font-size: 12px; color: var(--text-light); }
.zg-card-title {
  font-size: 17px; font-weight: 700; color: var(--text-dark); margin-bottom: 10px;
  line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.zg-card-excerpt {
  font-size: 14px; color: var(--text-mid); line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.zg-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.zg-card-author { font-size: 12px; color: var(--text-light); }
.zg-read-more {
  font-size: 13px; font-weight: 600; color: var(--sky);
  display: flex; align-items: center; gap: 4px; transition: var(--transition);
}
.zg-read-more:hover { color: var(--sky-dark); gap: 8px; }

/* ── PAGINATION ──────────────────────────────────────────────── */
.zg-pagination {
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.zg-page-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--white); font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--text-mid); cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.zg-page-btn:hover { border-color: var(--sky); color: var(--sky); }
.zg-page-btn.active { background: var(--sky); color: var(--white); border-color: var(--sky); }
.zg-page-btn:disabled { opacity: .4; cursor: default; }

/* ── SINGLE POST ─────────────────────────────────────────────── */
.zg-post-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start;
}
.zg-post-header { margin-bottom: 28px; }
.zg-post-cat-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.zg-post-cat {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--sky); background: var(--sky-light); padding: 4px 12px; border-radius: 99px;
}
.zg-post-date { font-size: 13px; color: var(--text-light); }
.zg-post-title {
  font-size: clamp(24px, 4vw, 38px) !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
  margin-bottom: 16px !important;
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #ffffff !important;
}
.zg-post-subtitle { font-size: 17px; color: var(--text-mid); line-height: 1.7; margin-bottom: 20px; }
.zg-post-byline { font-size: 13px; color: var(--text-light); display: flex; gap: 16px; flex-wrap: wrap; }
.zg-post-featured-img {
  width: 100%; border-radius: var(--radius-lg); margin-bottom: 36px;
  max-height: 440px; object-fit: cover;
}

/* Post content typography */
.zg-post-content { font-size: 16px; line-height: 1.85; color: #1E293B; }
.zg-post-content h2 { font-size: 26px; font-weight: 700; margin: 40px 0 14px; color: var(--text-dark); }
.zg-post-content h3 { font-size: 20px; font-weight: 700; margin: 32px 0 10px; color: var(--text-dark); }
.zg-post-content h4 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; color: var(--text-dark); }
.zg-post-content p { margin-bottom: 20px; }
.zg-post-content ul, .zg-post-content ol { margin: 0 0 20px 24px; }
.zg-post-content li { margin-bottom: 8px; }
.zg-post-content blockquote {
  border-left: 4px solid var(--sky); padding: 12px 20px; margin: 28px 0;
  background: var(--sky-light); border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text-mid);
}
.zg-post-content a { color: var(--sky); text-decoration: underline; }
.zg-post-content code {
  background: #F1F5F9; border-radius: 4px; padding: 2px 6px;
  font-family: 'Courier New', monospace; font-size: 14px;
}
.zg-post-content pre {
  background: #1E293B; color: #E2E8F0; border-radius: var(--radius);
  padding: 20px; overflow-x: auto; margin: 28px 0;
}
.zg-post-content pre code { background: none; padding: 0; color: inherit; }
.zg-post-content img { border-radius: var(--radius); margin: 24px 0; max-width: 100%; }
.zg-post-content table {
  width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px;
}
.zg-post-content th {
  background: var(--off-white); padding: 10px 14px; text-align: left;
  font-weight: 700; border-bottom: 2px solid var(--border);
}
.zg-post-content td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.zg-post-content hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* Sidebar */
.zg-sidebar { position: sticky; top: 80px; }
.zg-sidebar-card {
  background: var(--off-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
  margin-top: 50px;
}
.zg-sidebar-card h3 {
  font-size: 14px !important; font-weight: 700 !important;
  color: #0F172A !important; margin-bottom: 14px !important;
  background: none !important; background-image: none !important;
  -webkit-background-clip: unset !important; background-clip: unset !important;
  -webkit-text-fill-color: #0F172A !important;
}
.zg-sidebar-cats { display: flex; flex-direction: column; gap: 6px; }
.zg-sidebar-cat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--text-mid);
  transition: var(--transition);
}
.zg-sidebar-cat:hover { background: var(--sky-light); color: var(--sky); }
.zg-sidebar-cat-count {
  font-size: 11px; background: var(--border); padding: 2px 7px;
  border-radius: 99px; color: var(--text-light);
}

/* CTA banner in sidebar */
.zg-sidebar-cta {
  background: linear-gradient(135deg, var(--navy), #0F3460);
  border-radius: var(--radius-lg); padding: 24px; text-align: center;
}
.zg-sidebar-cta h3 { font-size: 16px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.zg-sidebar-cta p { font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 16px; line-height: 1.5; }

/* Preview banner */
.zg-preview-banner {
  background: #FEF3C7; border-bottom: 2px solid #F59E0B;
  padding: 12px 24px; text-align: center; font-size: 13px; font-weight: 600; color: #92400E;
}

/* ── POST LAYOUT RESPONSIVE ──────────────────────────────────── */
@media (max-width: 960px) {
  .zg-post-layout { grid-template-columns: 1fr; }
  .zg-sidebar { position: static; }
}

/* ── EMPTY / LOADING STATES ──────────────────────────────────── */
.zg-empty {
  text-align: center; padding: 64px 24px; color: var(--text-light);
  grid-column: 1 / -1;
}
.zg-empty svg { margin: 0 auto 16px; color: var(--sky-light); }
.zg-empty h3 { font-size: 18px; color: var(--text-mid); margin-bottom: 8px; }
.zg-empty p { font-size: 14px; }
.zg-skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── ADMIN PANEL ─────────────────────────────────────────────── */
.zg-admin-layout {
  display: grid; grid-template-columns: 240px 1fr; min-height: 100vh;
}
.zg-admin-sidebar {
  background: var(--navy); padding: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.zg-admin-brand {
  padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.zg-admin-brand img { height: 28px; filter: brightness(0) invert(1); }
.zg-admin-brand span { font-size: 11px; color: rgba(255,255,255,.4); display: block; }
.zg-admin-nav { padding: 16px 12px; }
.zg-admin-nav-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .1em; padding: 4px 8px; margin-bottom: 4px;
}
.zg-admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: rgba(255,255,255,.65); transition: var(--transition); margin-bottom: 2px;
}
.zg-admin-nav a:hover, .zg-admin-nav a.active {
  background: rgba(14,165,233,.15); color: var(--sky);
}
.zg-admin-nav svg { width: 16px; height: 16px; flex-shrink: 0; }
.zg-admin-main { background: #F8FAFC; }
.zg-admin-topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.zg-admin-topbar h1 { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.zg-admin-content { padding: 32px; }

/* Stat cards */
.zg-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.zg-stat-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.zg-stat-label { font-size: 12px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.zg-stat-value { font-size: 28px; font-weight: 800; color: var(--text-dark); }
.zg-stat-card.sky .zg-stat-value { color: var(--sky); }
.zg-stat-card.green .zg-stat-value { color: var(--green); }

/* Admin table */
.zg-admin-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 24px;
}
.zg-admin-card-header {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.zg-admin-card-header h2 { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.zg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.zg-table th {
  text-align: left; padding: 11px 20px; background: var(--off-white);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-light); border-bottom: 1px solid var(--border);
}
.zg-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text-mid); }
.zg-table tr:last-child td { border-bottom: none; }
.zg-table tr:hover td { background: var(--off-white); }
.zg-status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
}
.zg-status-published { background: #DCFCE7; color: #15803D; }
.zg-status-draft { background: #FEF9C3; color: #A16207; }

/* Admin form */
.zg-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.zg-form-field { display: flex; flex-direction: column; gap: 6px; }
.zg-form-field label { font-size: 12px; font-weight: 700; color: var(--text-mid); }
.zg-form-field input, .zg-form-field select, .zg-form-field textarea {
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; color: var(--text-dark); outline: none; transition: var(--transition);
}
.zg-form-field input:focus, .zg-form-field select:focus, .zg-form-field textarea:focus {
  border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14,165,233,.1);
}
.zg-form-full { grid-column: span 2; }

/* Buttons */
.zg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition); border: 1.5px solid transparent; }
.zg-btn-sm { padding: 6px 12px; font-size: 13px; }
.zg-btn-sky { background: var(--sky); color: var(--white); }
.zg-btn-sky:hover { background: var(--sky-dark); }
.zg-btn-outline { background: transparent; border-color: var(--border); color: var(--text-mid); }
.zg-btn-outline:hover { border-color: var(--sky); color: var(--sky); }
.zg-btn-danger { background: #FEF2F2; border-color: #FECACA; color: #DC2626; }
.zg-btn-danger:hover { background: #DC2626; color: var(--white); }
.zg-btn-green { background: var(--green); color: var(--white); }
.zg-btn-green:hover { background: #16A34A; }

/* Modal */
.zg-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.zg-modal {
  background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 900px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.zg-modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--white); z-index: 1;
}
.zg-modal-header h2 { font-size: 17px; font-weight: 700; color: var(--text-dark); }
.zg-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-light); line-height: 1; }
.zg-modal-body { padding: 24px; }
.zg-modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0;
  background: var(--white);
}

/* Toast */
.zg-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--navy); color: var(--white); padding: 12px 20px;
  border-radius: var(--radius); font-size: 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; transform: translateY(100px);
  transition: transform .3s ease; pointer-events: none;
}
.zg-toast.show { transform: translateY(0); }
.zg-toast.success .zg-toast-icon { color: var(--green); }
.zg-toast.error .zg-toast-icon { color: #F87171; }

/* Rich text editor area */
#postContent { min-height: 280px; resize: vertical; font-family: 'Courier New', monospace; font-size: 13px; }

/* Admin login page */
.zg-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #0F3460 100%); padding: 24px;
}
.zg-login-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.zg-login-logo { text-align: center; margin-bottom: 28px; }
.zg-login-logo img { height: 48px; margin: 0 auto 12px; }
.zg-login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text-dark); }
.zg-login-logo p { font-size: 14px; color: var(--text-light); }
.zg-login-error {
  background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626;
  border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; display: none;
}

@media (max-width: 900px) {
  .zg-admin-layout { grid-template-columns: 1fr; }
  .zg-admin-sidebar { height: auto; position: relative; }
  .zg-form-grid { grid-template-columns: 1fr; }
  .zg-form-full { grid-column: span 1; }
}
