/* ============================================================
   Elementor Blog Hub – Frontend Styles
   ============================================================ */

.ebh-blog-hub {
  width: 100%;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Grid ---- */
.ebh-blog-grid {
  display: grid;
  gap: 1.5rem;
}

.ebh-cols-1 .ebh-blog-grid { grid-template-columns: 1fr; }
.ebh-cols-2 .ebh-blog-grid { grid-template-columns: repeat(2, 1fr); }
.ebh-cols-3 .ebh-blog-grid { grid-template-columns: repeat(3, 1fr); }
.ebh-cols-4 .ebh-blog-grid { grid-template-columns: repeat(4, 1fr); }

/* Newsletter always full width inside the grid */
.ebh-blog-grid .ebh-newsletter {
  grid-column: 1 / -1;
}

/* ---- Card ---- */
.ebh-blog-card {
  background: #fff;
  border: 1px solid #ecf1f7;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

.ebh-blog-card:hover {
  border-color: #cbd9e9;
  box-shadow: 0 8px 18px -8px rgba(0, 20, 40, 0.08);
}

.ebh-card-image {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #f1f5f9;
}

.ebh-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.ebh-blog-card:hover .ebh-card-image img {
  transform: scale(1.04);
}

.ebh-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Category badge */
.ebh-card-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #3b6b96;
  background: #e9f0f8;
  padding: 0.2rem 0.8rem;
  border-radius: 40px;
  margin-bottom: 0.7rem;
  width: fit-content;
}

/* Title */
.ebh-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  color: #0b1e33;
}

.ebh-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.ebh-card-title a:hover {
  color: #1e4a76;
}

/* Meta */
.ebh-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed #e6edf5;
}

.ebh-card-meta .ebh-read-time i {
  margin-right: 0.25rem;
  font-size: 0.7rem;
}

/* Excerpt */
.ebh-card-excerpt {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #1e2f44;
  margin: 0 0 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Read more */
.ebh-read-more {
  display: inline-block;
  font-weight: 500;
  font-size: 0.85rem;
  color: #1e4a76;
  text-decoration: none;
  margin-top: auto;
  transition: color 0.15s, border-color 0.15s;
  border-bottom: 1px solid transparent;
  width: fit-content;
}

.ebh-read-more:hover {
  border-bottom-color: currentColor;
}

/* ---- Newsletter ---- */
.ebh-newsletter {
  border-radius: 20px;
  padding: 2.5rem 2rem;
  margin: 0.25rem 0;
}

.ebh-newsletter--dark {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid #1e293b;
}

.ebh-newsletter-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.ebh-newsletter-text {
  flex: 1 1 260px;
}

.ebh-newsletter-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.ebh-newsletter-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  line-height: 1.5;
}

.ebh-newsletter-form {
  flex: 1 1 280px;
  min-width: 0;
}

/* Make common form plugins look decent inside the dark block */
.ebh-newsletter-form input[type="email"],
.ebh-newsletter-form input[type="text"] {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 60px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ebh-newsletter-form input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.ebh-newsletter-form button,
.ebh-newsletter-form input[type="submit"],
.ebh-newsletter-form .gform_button {
  background: #1e4a76 !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 0.75rem 1.8rem !important;
  border-radius: 60px !important;
  font-size: 0.9rem !important;
  cursor: pointer;
  transition: background 0.15s !important;
  white-space: nowrap;
}

.ebh-newsletter-form button:hover,
.ebh-newsletter-form input[type="submit"]:hover,
.ebh-newsletter-form .gform_button:hover {
  background: #143a5e !important;
}

/* Gravity Forms / CF7 layout helpers inside newsletter */
.ebh-newsletter-form .gform_wrapper,
.ebh-newsletter-form .wpcf7 {
  margin: 0;
}

.ebh-newsletter-form .gform_fields,
.ebh-newsletter-form .gform_body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.ebh-newsletter-form .gfield {
  margin: 0 !important;
  flex: 2 1 160px;
}

.ebh-newsletter-form .gform_footer,
.ebh-newsletter-form .gform_button_container {
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto;
}

/* ---- Pagination ---- */
.ebh-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.ebh-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ebh-pagination li {
  margin: 0;
}

.ebh-pagination a,
.ebh-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid #dce3ec;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
  text-decoration: none;
  background: #fff;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ebh-pagination a:hover {
  background: #f1f5f9;
  border-color: #b6c9de;
}

.ebh-pagination .current {
  background: #1e4a76;
  border-color: #1e4a76;
  color: #fff;
}

.ebh-pagination .dots {
  border: none;
  background: transparent;
}

/* ---- Empty state ---- */
.ebh-no-posts {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
  font-size: 1rem;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .ebh-cols-4 .ebh-blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .ebh-cols-3 .ebh-blog-grid,
  .ebh-cols-4 .ebh-blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ebh-newsletter {
    padding: 1.75rem 1.25rem;
  }

  .ebh-newsletter-inner {
    flex-direction: column;
    text-align: center;
  }

  .ebh-newsletter-form .gform_fields {
    flex-direction: column;
  }

  .ebh-newsletter-form .gfield {
    flex: 1 1 100%;
  }
}

@media (max-width: 520px) {
  .ebh-cols-2 .ebh-blog-grid,
  .ebh-cols-3 .ebh-blog-grid,
  .ebh-cols-4 .ebh-blog-grid {
    grid-template-columns: 1fr;
  }

  .ebh-card-title {
    font-size: 1.05rem;
  }
}
