/* === Layout === */
.divi-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 2rem;
}

/* Uniform buttons across posts + info cards */
.divi-post-grid .post-card .read-more,
.divi-post-grid .info-card .info-card-submit,
.divi-post-grid .info-card .info-card-link-button {
  /* pick your global button colors here */
  --btn-bg: #ffffff;
  --btn-text: #222222;
  --btn-border: #222222;

  display: inline-block;
  padding: 0.6em 1.2em;
  background: var(--btn-bg) !important;
  color: var(--btn-text) !important;
  border: 1px solid var(--btn-border) !important;
  border-radius: 10px;
  text-decoration: none !important;
  box-shadow: none !important;
}

.divi-post-grid .post-card .read-more:hover,
.divi-post-grid .info-card .info-card-submit:hover,
.divi-post-grid .info-card .info-card-link-button:hover {
  background: #f5f5f5 !important;
  /* subtle hover */
}

/* === Shared Card Styles === */
.post-card,
.info-card {
  border: 1px solid #ddd;
  padding: 1rem;
  background-color: var(--info-bg, #fff);
  color: var(--info-text, #000);
  transition: box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100%;
  min-height: 300px;
}

.post-card:hover,
.info-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-card>a:first-of-type,
.post-card>h3 {
  margin-top: 0.5em;
}

.info-card .card-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0.5em 0 1em;
  color: var(--info-text, #000);
}

.info-card .card-description {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--info-text, #000);
}

/* === Buttons === */
.info-card-submit,
.info-card-link-button {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  font-size: 1rem;
  font-weight: normal;
  color: #fff;
  background-color: var(--info-button, #333);
  border: 1px solid #000;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.25s ease-in-out;
  white-space: nowrap;
  width: auto;
  max-width: 100%;
}

.info-card-submit:hover,
.info-card-link-button:hover {
  opacity: 0.85;
}

/* === Form Styles === */
.info-card-form {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

.info-card-form input[type="email"] {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 80%;
  box-sizing: border-box;
}

.info-card-form .form-response {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.info-card-form .form-response.success {
  color: #237c38;
}

.info-card-form .form-response.error {
  color: #c0392b;
}

/* === Read More === */
.divi-post-grid .read-more {
  display: inline-block;
  padding: 0.45em 1em;
  background-color: #e7ece8;
  color: #5c5c5c;
  border: 1px solid #cfd4d2;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease-in-out;
}

.divi-post-grid .read-more:hover {
  background-color: #dce2df;
  color: #2c2c2c;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* === Category Labels === */
.post-category-labels {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
}

.post-category-label {
  background-color: #ccc;
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px !important;
  border-radius: 6px;
  text-transform: capitalize;
  line-height: 1;
}

/* === Pagination === */
.rrx-pagination {
  text-align: center;
  margin-top: 2em;
}

.rrx-pagination .page-numbers {
  display: inline-block;
  margin: 0 6px;
  padding: 8px 14px;
  border-radius: 6px;
  background-color: #f1f1f1;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease;
}

.rrx-pagination .page-numbers.current {
  background-color: #000;
  color: #fff;
  font-weight: bold;
}

.rrx-pagination .page-numbers:hover {
  background-color: #333;
  color: #fff;
}

/* Force the top category labels to layer over a fixed container */
.post-image-wrapper {
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Ensure image is responsive */
.post-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* Prevent content shifting caused by absolute labels */
.post-card {
  box-sizing: border-box;
  padding-top: 2.5rem;
  /* Makes space for the label if needed */
}

/* Prevent overlap from absolutely positioned category badges */
.post-category-labels {
  pointer-events: none;
  /* Avoid layout breaking interactions */
}

/* Background-image card behavior (matches hero look) */
.post-card {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Improve readability over photos */
.post-card.has-thumb {
  color: #111;
  text-shadow: none;
}

.post-card.has-thumb h3 a {
  color: #111;
}

.post-card.has-thumb .read-more {
  background-color: #e7ece8;
  color: #5c5c5c;
  border-color: #cfd4d2;
}

/* Match hero overlay on grid cards */
.post-card.has-thumb {
  position: relative;
  color: #000;
  /* black text like hero */
  text-shadow: none;
}

.post-card.has-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.5) 100%);
  z-index: 0;
  /* sits under content */
}

/* ensure card content sits above the overlay */
.post-card.has-thumb>* {
  /* position: relative; */
  z-index: 1;
}
