/* ============================================================
   AZIZ PACKAGING LIMITED — styles-blog.css
   Blog + Admin styles. Imports brand tokens from styles.css.
   ============================================================ */

/* ---- Blog Listing Page ---- */
.blog-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  padding: 100px 24px 60px;
  text-align: center;
  color: var(--white);
}
.blog-hero .eyebrow { color: var(--orange); }
.blog-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  margin: 12px 0 16px;
  color: var(--white);
}
.blog-hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  max-width: 560px;
  margin: 0 auto;
}

.blog-section {
  padding: 72px 24px;
  background: var(--gray-50);
  min-height: 60vh;
}
.blog-container {
  max-width: 1160px;
  margin: 0 auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 52px;
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--orange);
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.blog-card-thumb {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card-thumb .thumb-placeholder {
  opacity: 0.18;
}
.blog-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.category-badge {
  display: inline-block;
  background: var(--orange-light);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}
.blog-card-body h2 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
  line-height: 1.4;
}
.blog-card-body p {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 18px;
}
.blog-card-meta {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 14px;
}
.blog-read-more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}
.blog-read-more:hover { gap: 8px; }

.blog-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-600);
}
.blog-empty h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--blue);
  margin-bottom: 12px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--orange); color: var(--orange); }
.pagination .current {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

/* ---- Single Post Page ---- */
.post-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  padding: 100px 24px 48px;
  color: var(--white);
}
.post-breadcrumb {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 20px;
}
.post-breadcrumb a { color: var(--orange); }
.post-breadcrumb a:hover { text-decoration: underline; }
.post-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.25;
  max-width: 780px;
  margin-bottom: 20px;
  color: #ffffff !important;
}
.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  flex-wrap: wrap;
}
.post-author-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--orange);
  flex-shrink: 0;
}
.post-author-bubble img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.post-layout {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* Rich text body */
.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-900);
}
.post-body h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--blue);
  margin: 2em 0 0.6em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--orange-light);
}
.post-body h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--blue);
  margin: 1.6em 0 0.5em;
}
.post-body p { margin-bottom: 1.3em; }
.post-body ul, .post-body ol {
  margin: 0 0 1.3em 1.5em;
}
.post-body li { margin-bottom: 0.4em; }
.post-body blockquote {
  border-left: 4px solid var(--orange);
  background: var(--orange-light);
  padding: 16px 20px;
  margin: 1.6em 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--blue);
}
.post-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.5em 0;
}
.post-body a { color: var(--orange); text-decoration: underline; }
.post-body strong { color: var(--blue); }

/* Related posts */
.related-section {
  background: var(--gray-50);
  padding: 56px 24px;
  border-top: 1px solid var(--gray-200);
}
.related-section h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 28px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

/* Post CTA band */
.post-cta-band {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  padding: 56px 24px;
  text-align: center;
  color: var(--white);
}
.post-cta-band h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.post-cta-band p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 28px;
}

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */
.admin-page {
  font-family: var(--font-body);
  background: #f0f4f8;
  min-height: 100vh;
  color: var(--gray-900);
}

/* Login */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
}
.admin-login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
}
.admin-login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.admin-login-logo img { height: 52px; margin: 0 auto 12px; }
.admin-login-logo h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue);
}
.admin-login-logo p { font-size: 0.82rem; color: var(--gray-400); }
.admin-field { margin-bottom: 20px; }
.admin-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-field input, .admin-field textarea, .admin-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--gray-900);
  transition: border-color var(--transition);
  background: var(--white);
}
.admin-field input:focus, .admin-field textarea:focus, .admin-field select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-light);
}
.admin-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
}
.admin-btn-primary {
  background: var(--orange);
  color: var(--white);
  width: 100%;
  justify-content: center;
}
.admin-btn-primary:hover { background: var(--orange-hover); }
.admin-btn-outline {
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--gray-200);
}
.admin-btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.admin-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
}
.admin-btn-danger:hover { background: #dc2626; color: var(--white); }
.admin-btn-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1.5px solid #86efac;
}
.admin-btn-success:hover { background: #16a34a; color: var(--white); }
.admin-btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* Dashboard layout */
.admin-topbar {
  background: var(--blue);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-topbar img { height: 34px; }
.admin-topbar h1 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-topbar a, .admin-topbar button {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
  background: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.admin-topbar a:hover, .admin-topbar button:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

.admin-main { padding: 32px 28px; max-width: 1200px; margin: 0 auto; }

/* Stats row */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--orange);
}
.admin-stat-card .stat-num {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 4px;
}
.admin-stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Post table */
.admin-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 28px;
}
.admin-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue);
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.admin-table td {
  padding: 14px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-published { background: #f0fdf4; color: #16a34a; }
.status-draft { background: var(--gray-100); color: var(--gray-400); }

/* Editor overlay */
.editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,37,80,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.editor-overlay.hidden { display: none; }
.editor-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.25);
}
.editor-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}
.editor-header h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue);
}
.editor-body { padding: 28px; }
.editor-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--white);
}
.char-counter {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-align: right;
  margin-top: 4px;
}
.char-counter.warn { color: #f59e0b; }
.char-counter.over { color: #dc2626; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toggle-row label { margin-bottom: 0; }
input[type="checkbox"].admin-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

/* Alert toast */
.admin-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.success { background: #16a34a; color: var(--white); }
.admin-toast.error { background: #dc2626; color: var(--white); }

/* Quill editor styling */
.ql-toolbar {
  border: 1.5px solid var(--gray-200) !important;
  border-bottom: none !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  font-family: inherit !important;
}
.ql-container {
  border: 1.5px solid var(--gray-200) !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  font-family: var(--font-body) !important;
  font-size: 1rem !important;
}
.ql-container:focus-within {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px var(--orange-light) !important;
}
.ql-editor { min-height: 320px; }

/* Responsive */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-main { padding: 20px 16px; }
  .admin-topbar { padding: 0 16px; }
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) { display: none; }
}
