/* Admin Panel - Bootstrap Theme Overrides */
:root {
  --primary-custom: var(--primary-custom, #6a4d8a);
  --primary-hover: var(--primary-hover, #4a3570);
  --primary-light: var(--primary-light, #8b6cb8);
}

/* Custom accent colors */
.text-primary-custom {
  color: var(--primary-custom);
}

.bg-primary-custom {
  background-color: var(--primary-custom);
}

.bg-primary-custom {
  --bs-bg-opacity: 1;
  background-color: var(--primary-custom) !important;
}

/* Badge overrides */
.count-badge {
  --bs-badge-font-size: 1.5rem;
  --bs-badge-padding-x: 0.5rem;
  --bs-badge-padding-y: 0.25rem;
}

.courses-section-title {
  margin-bottom: 0.5rem;
}

/* Smooth transitions
 *
.stat-card a {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Stat-card grid, shared by every host's admin dashboard. Sourced from
 * the OCA8 dashboard look (admin/components.css) and made self-contained
 * so the gem looks right even on hosts without OCA8's full CSS set. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-custom, var(--primary-custom, #6a4d8a));
}

/* Gradient accent strip revealed on hover, as on the OCA8 dashboards. */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-light, var(--primary-light, #8b6cb8)) 0%, var(--primary-hover, var(--primary-hover, #4a3570)) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(106, 77, 138, 0.1);
  color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  margin-right: 1.5rem;
  flex-shrink: 0;
}

.stat-icon svg {
  height: 32px;
  width: 32px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}

/* Mobile optimization */
.stat-icon {
  margin-right: 1.5rem;
  flex-shrink: 0;
}

.stat-icon svg,
.stats-icon svg {
  color: inherit;
  height: 48px;
  width: 48px;
}

@media (max-width: 768px) {
  .stat-icon svg,
  .stats-icon svg {
    width: 36px;
    height: 36px;
  }

  .count-badge {
    --bs-badge-font-size: 1.25rem;
  }
}

/* Page header utilities */
.page-header-custom {
  background: linear-gradient(135deg, var(--primary-custom) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 2rem 0;
  margin: -20px -20px 2rem -20px;
  border-radius: 0 0 1rem 1rem;
}

/* Admin layout fixes for fixed header */
.admin-layout {
  margin-top: 56px;
}

.admin-content-wrapper {
  margin-top: 20px;
}

/* Footer */
.footer {
  background: #0a0707;
  color: white;
  padding: 40px 0;
  margin-top: 2rem;
}

.footer p {
  margin: 0 0 8px 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.footer a.text-white {
  color: white;
}

/* Content area scrolling fix */
.content {
  overflow-y: visible;
  height: auto;
  min-height: auto;
  padding: 1.5rem;
}

.content .container-fluid {
  width: 100%;
  max-width: 100%;
}

/* Ensure proper scrolling within content area */
.content > .container-fluid {
  min-height: calc(100% - 3rem);
}

/* Custom scrollbar for content area */
.content::-webkit-scrollbar {
  width: 8px;
}

.content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Smooth scrolling within content area */
.content * {
  scroll-behavior: smooth;
}

/* Ensure navbar stays fixed */
.navbar-fixed-top {
  fixed-position: top;
  left: 0;
  right: 0;
  z-index: 1050;
}

.page-header-custom h1 {
  font-weight: 700;
}

/* Table utilities */
.admin-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* Recent Logins Card */
.recent-users-card {
  transition: all 0.3s ease;
}

.recent-users-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.card-header-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--primary-custom);
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-login-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-custom);
}

.user-login-item:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: translateX(4px);
}

.user-info-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.user-avatar-mini {
  width: 40px;
  height: 40px;
  background: var(--primary-custom);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-details-mini {
  flex: 1;
  min-width: 0;
}

.user-details-mini strong {
  display: block;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-details-mini .user-email-mini {
  margin: 0;
  color: #666;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-date {
  color: var(--primary-custom);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}

.no-users {
  padding: 40px 20px;
  text-align: center;
  color: #666;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

/* Card utilities */
.course-listing-card {
  transition: all 0.3s ease;
}

.course-listing-card:hover {
  transform: translateY(-3px);
}

/* Mobile view adjustments */
@media (max-width: 767px) {
  .btn-group-toggle {
    width: 100%;
  }

  /* Mobile: make all grid columns stretch the full width of the screen */
  .content .row > *,
  .content .row > [class*="col-"] {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Neutralize bootstrap gutter negative margins so cards reach the screen edges */
  .content .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Stat cards fill their column completely */
  .content .stat-card {
    width: 100%;
    max-width: 100%;
  }
}

/* Override Bootstrap's table responsive shadow */
.table-responsive {
  border-radius: 0.5rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.075);
}

/**
 * Content Block Drag and Drop Styles
 */

/* Block Item Container */
.block-item {
  position: relative;
  transition: all 0.3s ease;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  cursor: move;
  margin-bottom: 1rem;
}

/* Verified indicator: a circular badge pinned to the block's upper-right
   corner (ContentBlock editor block cards). Background variants:
   green all supported, yellow unverified claims, red contradicted. */
.block-verified-check {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #198754;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.block-verified-check--unverified {
  background: #ffc107;
  color: #212529;
}

.block-verified-check--contradicted {
  background: #dc3545;
}

/* AI validation pills on admin blog post cards (admin/blog). Same scheme
   as the block-level verified badges: green fully validated, yellow
   unverified/never-verified claims remain, red contradicted. */
.blog-ai-validated-check {
  background: #198754;
  color: #fff;
}

.blog-ai-validated-check--unverified {
  background: #ffc107;
  color: #212529;
}

.blog-ai-validated-check--contradicted {
  background: #dc3545;
  color: #fff;
}

.block-verified-check .bi {
  display: block;
}

.block-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.block-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  border: 2px dashed var(--primary-custom);
}

/* Drag Handle */
.block-drag-handle {
  position: absolute;
  top: 10px;
  left: -15px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  border-radius: 6px;
  background: transparent;
  transition: all 0.3s ease;
  color: #64748b;

  /* Hide drag handle by default, only show when block-item is hovered */
  opacity: 0;
}

.block-item:hover .block-drag-handle {
  opacity: 1;
}

.block-drag-handle:hover {
  background: rgba(106, 77, 138, 0.1);
  color: var(--primary-custom);
}

.block-drag-handle:active {
  cursor: grabbing;
}

/* Block Content */
.block-content {
  flex-grow: 1;
}

/* Block Type Header */
.block-type {
  text-align: right;
}

.block-type h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;

  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Block Type Indicator */
.content-type-indicator {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.75rem;
  color: #94a3b8;
  opacity: 0.8;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* Content field visibility toggles */
[content-type-hidden="true"] {
  display: none !important;
}
/* ===================== Content Block Editor ===================== */

.content-block-editor h3 {
  font-weight: 700;
  color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  letter-spacing: -0.02em;
}

.content-block-card .block-drag-handle {
  position: absolute !important;
  top: 50%;
  left: 0;
  transform: translate(-55%, -50%);
  width: 36px !important;
  height: 36px !important;
  background: #fff !important;
  border: 1px solid #e2e8f0;
  border-radius: 50% !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  opacity: 0 !important;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 5;
}

.content-block-card:hover .block-drag-handle,
.content-block-card:focus-within .block-drag-handle {
  opacity: 1 !important;
}

.content-block-card .block-drag-handle:hover {
  transform: translate(-55%, -50%) scale(1.1);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
  color: var(--primary-custom, var(--primary-custom, #6a4d8a));
}

.content-block-card .block-drag-handle:active {
  cursor: grabbing;
}

.block-item.content-block-card {
  display: flex;
  align-items: center;
  padding: 14px 16px !important;
  margin-bottom: 12px !important;
  border: 1px solid #e8ecf3;
  border-left: 4px solid #cbd5e1;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
  cursor: move;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.block-item.content-block-card:hover {
  border-color: #d6dce6;
  border-left-color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.09) !important;
  transform: translateY(-1px);
}

.block-item.content-block-card.dragging {
  opacity: 0.5;
  border-left-color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  transform: scale(1.01);
}

/* Icon badge */
.content-block-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-right: 14px;
}

.content-block-icon--paragraph { background: #eef2ff; color: #4f46e5; }
.content-block-icon--video     { background: #fdf2f8; color: #db2777; }
.content-block-icon--pdf       { background: #fef2f2; color: #dc2626; }
.content-block-icon--header    { background: #ecfdf5; color: #059669; }

/* Text info */
.content-block-info {
  flex-grow: 1;
  min-width: 0;
}

.content-block-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 3px;
}

.content-block-type--paragraph { background: #eef2ff; color: #4338ca; }
.content-block-type--video     { background: #fdf2f8; color: #be185d; }
.content-block-type--pdf       { background: #fef2f2; color: #b91c1c; }
.content-block-type--header    { background: #ecfdf5; color: #047857; }

.content-block-preview {
  font-size: 0.875rem;
  color: #475569;
  white-space: pre-wrap;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  margin: 0;
  margin-top: 0.25rem;
}

.content-block-preview--editing {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
  cursor: text;
  padding: 0.25rem 0.5rem;
  background-color: #fefce8;
  min-width: 2ch;
}

.content-block-info .content-block-preview {
  cursor: pointer;
}

.inline-edit-status {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 600;
}

h1.content-block-preview { font-size: 1.6rem; font-weight: 700; }
h2.content-block-preview { font-size: 1.4rem; font-weight: 600; }
h3.content-block-preview { font-size: 1.2rem; font-weight: 600; }
h4.content-block-preview { font-size: 1.1rem; font-weight: 600; }
h5.content-block-preview { font-size: 1rem; font-weight: 600; }
h6.content-block-preview { font-size: 0.9rem; font-weight: 600; }
h1.content-block-preview,
h2.content-block-preview,
h3.content-block-preview,
h4.content-block-preview,
h5.content-block-preview,
h6.content-block-preview { color: #1e293b; margin: 0; }

/* Inline link popover */
.inline-block-link-popover {
  position: absolute;
  z-index: 2000;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.inline-block-link-popover .inline-block-link-url {
  width: 220px;
  padding: 4px 8px;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.inline-block-link-popover .inline-block-link-quick {
  max-width: 160px;
  padding: 4px 4px;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}

.inline-block-link-popover button {
  padding: 4px 10px;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}

.inline-block-link-popover button:hover {
  background: #eef2ff;
  border-color: #4f46e5;
}

.inline-block-link-popover .inline-block-popover-separator {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
}

/* Links inside editable previews and block previews */
.content-block-preview a {
  color: #4f46e5;
  text-decoration: underline;
  cursor: text;
}

.content-block-preview--empty {  color: #94a3b8 !important;
  font-style: italic;
}

/* Actions: a floating toolbar pinned to the card's bottom-right, revealed
   on hover/interaction of the block. Being absolutely positioned, it
   reserves no vertical space — the blank strip below short cards is gone. */
.content-block-actions {
  position: absolute;
  bottom: 8px;
  right: 14px;
  z-index: 1;
  display: flex;
  gap: 2px;
  padding: 3px 4px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.content-block-card:hover .content-block-actions,
.content-block-card:focus-within .content-block-actions {
  opacity: 1;
  pointer-events: auto;
}


.block-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.block-delete-btn:hover {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

/* Empty state */
.content-blocks-empty {
  text-align: center;
  padding: 40px 20px;
  border: 2px dashed #d6dce6;
  border-radius: 12px;
  color: #64748b;
  margin-bottom: 12px;
}

.content-blocks-empty .bi {
  font-size: 2rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 8px;
}

/* Add-block card */
.content-block-editor-card {
  border: none !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08) !important;
}

.content-block-editor-card .card-header {
  background: linear-gradient(135deg, var(--primary-custom, var(--primary-custom, #6a4d8a)), #8a6aa8) !important;
  padding: 0.9rem 1.25rem;
}

.content-block-editor-card .card-header h5 {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.content-block-editor-card .nav-tabs {
  background: linear-gradient(135deg, var(--primary-custom, var(--primary-custom, #6a4d8a)), #8a6aa8);
  border-bottom: none;
}

.content-block-editor-card .nav-tabs .nav-link {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0.75rem 1rem;
  margin-bottom: 0;
}

.content-block-editor-card .nav-tabs .nav-link:hover {
  color: #fff;
  border-color: transparent;
}

.content-block-editor-card .nav-tabs .nav-link.active {
  color: #fff;
  background: transparent;
  border-bottom: 3px solid #fff;
}

.content-block-editor-card .form-select.border-accent {
  border-color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  box-shadow: 0 0 0 3px rgba(106, 77, 138, 0.12);
}

/* Admin lessons index: full-width on mobile */
@media (max-width: 640px) {
  .admin-lessons-index {
    padding-left: 0;
    padding-right: 0;
  }

  .admin-lessons-index > .container {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
  }
}

/* Dropdown menu styles
 * Override Bootstrap's z-index to ensure dropdowns appear above all content including cookie banner */
.dropdown-menu {
  z-index: 10001 !important;
}

/* Ensure dropdown toggle button is clickable */
[data-bs-toggle="dropdown"] {
  pointer-events: auto;
  user-select: auto;
}

/* Ensure dropdown items are readable and clickable */
.dropdown-item {
  pointer-events: auto;
  user-select: auto;
}

/* Blog post list items */
.blog-post-item {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.blog-post-thumb {
  height: 72px;
  width: 108px;
  object-fit: cover;
  background-color: #f1f3f5;
}

.blog-post-thumb--empty {
  background: linear-gradient(135deg, #f1f3f5 60%, #e9ecef 100%);
  border: 1px dashed #ced4da;
}

.blog-post-title {
  line-height: 1.3;
}

.blog-post-item .btn {
  white-space: nowrap;
}

.min-w-0 {
  min-width: 0;
}

.min-w-0 .blog-post-title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Blog admin search box */
.blog-search {
  max-width: 34rem;
}

.blog-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 2rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.blog-search-box:focus-within {
  border-color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  box-shadow: 0 0 0 0.2rem rgba(106, 77, 138, 0.15);
}

.blog-search-icon {
  color: #adb5bd;
  flex-shrink: 0;
}

.blog-search-box:focus-within .blog-search-icon {
  color: var(--primary-custom, var(--primary-custom, #6a4d8a));
}

.blog-search-input {
  flex-grow: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.375rem 0;
  font-size: 0.95rem;
}

.btn-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #6c757d;
  background: transparent;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-clear:hover,
.btn-clear:focus {
  color: #495057;
  background-color: #f1f3f5;
}

.btn-search {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 2rem;
  background-color: var(--primary-custom, var(--primary-custom, #6a4d8a));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.btn-search:hover {
  background-color: var(--primary-hover, var(--primary-hover, #4a3570));
}

/* --- Mobile layout for blog post list items --- */
@media (max-width: 767.98px) {
  .blog-post-item .card-body {
    flex-wrap: wrap;
    align-items: stretch;
  }

  /* Thumbnail becomes a full-width banner above the content */
  .blog-post-thumb {
    width: 100%;
    height: 9rem;
    object-fit: cover;
    border-radius: 0.5rem;
    order: -1;
    flex-basis: 100%;
  }

  .blog-post-thumb--empty {
    display: none;
  }

  /* Info block takes the full row */
  .blog-post-item .flex-grow-1 {
    flex-basis: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0.25rem;
  }

  /* Compact buttons, labels kept; actions row spreads evenly */
  .blog-post-item .btn {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .blog-post-item .btn .me-1 {
    margin-right: 0 !important;
  }

  .blog-post-item .actions-row .btn span,
  .blog-post-item .actions-row .btn {
    white-space: nowrap;
  }

  /* Actions row sits below the info, spread evenly */
  .blog-post-item .card-body > .d-flex.gap-2 {
    flex-basis: 100%;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #dee2e6;
  }
}

/* Header block text alignment (mirror on the editor preview) */
.content-block-preview--center { text-align: center; }
.content-block-preview--right { text-align: right; }

/* ------------------------------------------------------------------
 * Admin contact-form listing (/admin/contact_form): two-column
 * layout (statistics/notify emails | entries) that stacks on
 * mobile, with horizontally scrollable tables instead of
 * page-blowing overflow.
 * ------------------------------------------------------------------ */
.contact-form-admin .contact-form-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
}

/* Notify-email add form: inline input + button on wide screens. */
.contact-form-admin .contact-form-notify-form {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.contact-form-admin .contact-form-notify-form input[type="email"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 0;
}

/* Tables scroll horizontally inside their card instead of blowing
 * out the page. */
.contact-form-admin .contact-form-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
  /* Single column: stats/notify email then entries. */
  .contact-form-admin .contact-form-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* Stack the notify-email form so the input never gets crushed to
   * a sliver next to the button. */
  .contact-form-admin .contact-form-notify-form {
    flex-direction: column;
    gap: 10px;
  }

  .contact-form-admin .contact-form-notify-form input[type="email"] {
    flex: none;
    width: 100%;
    box-sizing: border-box;
  }

  .contact-form-admin .contact-form-notify-form button {
    width: 100%;
  }

  /* Denser cells and a smaller floor for the actions column so the
   * five-column entries table fits a phone with minimal scroll. */
  .contact-form-admin .contact-form-entries-table td,
  .contact-form-admin .contact-form-entries-table th,
  .contact-form-admin .contact-form-notify-table td,
  .contact-form-admin .contact-form-notify-table th {
    padding: 8px 6px !important;
    white-space: nowrap;
  }

  .contact-form-admin .contact-form-entries-table,
  .contact-form-admin .contact-form-notify-table {
    font-size: 0.85rem;
  }

  .contact-form-admin .contact-form-entries-table td div[style] {
    justify-content: flex-start;
  }
}

/* Content review queue card: amber priority when pages need review. */
.stat-card-review-due {
  border-color: #f0ad4e;
  background: #fffaf3;
}
.stat-card-review-due::before {
  background: linear-gradient(90deg, #f0ad4e, #ff9800);
}
.stat-card-review-due .stat-number {
  color: #d58512;
}
