/* ============================================
   BLOG PAGE — CUSTOM BLOG GRID
   ============================================ */

/* Grid container */
.em-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0;
  min-height: 200px;
}

/* Individual card */
.em-blog-card {
  background: var(--color-surface);
  border: 1px solid rgba(191,164,111,0.2);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, transform 0.2s ease;
}

.em-blog-card:hover {
  border-color: var(--color-gold);
  transform: translateY(-3px);
}

/* Clickable card wrapper */
.em-blog-card-link-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.em-blog-card-link-wrap:hover {
  text-decoration: none !important;
  color: inherit;
}

.em-blog-card-link-wrap a {
  text-decoration: none !important;
  color: inherit;
}

.em-blog-card-link-wrap * {
  text-decoration: none;
}

/* Force-remove all underlines on the card wrapper and every descendant.
   Needed because style.css's .page-wrapper p a { text-decoration: underline }
   carries specificity (0,2,1) and wins over the rules above. */
.em-blog-card-link-wrap,
.em-blog-card-link-wrap * { text-decoration: none !important; }

.em-blog-card-link:hover { text-decoration: underline !important; }

.page-wrapper .em-blog-card .em-blog-card-title {
  color: var(--color-cream);
}

.em-blog-card-link-wrap:hover .em-blog-card-title {
  color: var(--color-gold);
}

/* Featured image area */
.em-blog-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--color-surface-dark);
  flex-shrink: 0;
}

.em-blog-card-thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.em-blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.em-blog-card:hover .em-blog-card-thumb img {
  transform: scale(1.04);
}

/* Placeholder when no featured image is set */
.em-blog-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-surface), var(--color-surface-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  min-height: 160px;
}

/* Card body */
.em-blog-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Category pill */
.em-blog-card-category {
  display: inline-block;
  background: rgba(191,164,111,0.12);
  color: var(--color-gold);
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(191,164,111,0.3);
  text-decoration: none;
}

/* Card title — override global h2 styles */
.page-wrapper .em-blog-card .em-blog-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-cream);
  line-height: 1.4;
  margin-bottom: 10px;
  margin-top: 0;
  text-align: left;
}

.page-wrapper .em-blog-card .em-blog-card-title a {
  color: var(--color-cream);
  text-decoration: none;
}

.page-wrapper .em-blog-card .em-blog-card-title a:hover {
  color: var(--color-gold);
}

/* Excerpt */
.em-blog-card-excerpt {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 16px;
  margin-top: 0;
  flex: 1;
  text-decoration: none !important;
}

/* Meta line (date · read time) */
.em-blog-card-meta {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #5a5a5a;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

/* Read more link */
.em-blog-card-link {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  transition: color 0.2s ease, gap 0.2s ease;
}

.em-blog-card-link:hover {
  color: var(--color-gold-hover);
  gap: 10px;
}

/* ============================================
   BLOG PAGE — FILTER BAR
   ============================================ */

.em-blog-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
  align-items: center;
}

.em-blog-filter-btn {
  padding: 9px 20px;
  border: 2px solid rgba(191,164,111,0.3);
  background: transparent;
  color: var(--color-body);
  border-radius: 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
  line-height: 1.4;
}

.em-blog-filter-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: transparent;
}

.em-blog-filter-btn.active {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-bg);
}

/* ============================================
   BLOG PAGE — POST COUNT + STATE MESSAGES
   ============================================ */

.em-blog-post-count {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #5a5a5a;
  margin-bottom: 24px;
  margin-top: 0;
  min-height: 20px;
}

.em-blog-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  color: #5a5a5a;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
}

.em-blog-state p {
  color: #5a5a5a;
  font-size: 15px;
  text-align: center;
  margin: 0;
}

/* CSS-only loading spinner */
.em-blog-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: em-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes em-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   BLOG PAGE — LOAD MORE BUTTON
   ============================================ */

.em-blog-load-more {
  text-align: center;
  margin: 40px 0;
}

.em-blog-load-more-btn {
  display: none;
  background: transparent;
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 32px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
}

.em-blog-load-more-btn:hover {
  background: var(--color-gold);
  color: var(--color-bg);
}

.em-blog-load-more-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   BLOG PAGE — SKELETON LOADING CARDS
   ============================================ */

.em-blog-skeleton {
  pointer-events: none;
  cursor: default;
}

.em-skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, var(--color-surface) 25%, #242424 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: em-shimmer 1.4s infinite;
  flex-shrink: 0;
}

.em-skeleton-line {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--color-surface) 25%, #242424 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: em-shimmer 1.4s infinite;
  width: 100%;
}

.em-skeleton-short {
  width: 30%;
  height: 10px;
  margin-bottom: 14px;
}

.em-skeleton-title {
  height: 18px;
  width: 90%;
  margin-bottom: 8px;
}

.em-skeleton-title-2 {
  width: 60%;
  margin-bottom: 16px;
}

.em-skeleton-medium {
  width: 55%;
  margin-bottom: 14px;
}

.em-skeleton-tiny {
  width: 25%;
  height: 12px;
  margin-bottom: 0;
}

@keyframes em-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   BLOG — THE POST GRID PLUGIN
   ============================================ */
.tpg-el-container,
.tpg-grid,
.rt-tpg-container {
  background-color: var(--color-bg);
}

.tpg-post-card,
.rt-tpg-container .tpg-post-card {
  background-color: var(--color-surface);
  border: 1px solid rgba(191,164,111,0.2);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.tpg-post-card:hover,
.rt-tpg-container .tpg-post-card:hover {
  border-color: var(--color-gold);
}

.tpg-el-title,
.tpg-el-title a,
.rt-tpg-container .tpg-el-title,
.rt-tpg-container .tpg-el-title a {
  font-family: 'Montserrat', sans-serif;
  color: var(--color-cream);
  font-weight: 700;
  font-size: 18px;
}

.tpg-el-title a:hover,
.rt-tpg-container .tpg-el-title a:hover {
  color: var(--color-gold);
  text-decoration: none;
}

.tpg-el-excerpt,
.rt-tpg-container .tpg-el-excerpt {
  font-family: 'Montserrat', sans-serif;
  color: var(--color-body);
  font-size: 15px;
  line-height: 1.7;
}

.tpg-el-meta,
.tpg-el-meta span,
.rt-tpg-container .tpg-el-meta,
.rt-tpg-container .tpg-el-meta span {
  font-family: 'Montserrat', sans-serif;
  color: var(--color-muted);
  font-size: 13px;
}

.tpg-el-meta a,
.rt-tpg-container .tpg-el-meta a {
  color: var(--color-gold);
}

.tpg-el-button a,
.rt-tpg-container .tpg-el-button a {
  background-color: var(--color-gold);
  color: var(--color-cream);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 20px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  border: none;
}

.tpg-el-button a:hover,
.rt-tpg-container .tpg-el-button a:hover {
  background-color: var(--color-gold-hover);
  color: var(--color-cream);
}

.tpg-pagination .page-numbers,
.rt-tpg-container .tpg-pagination .page-numbers {
  background-color: var(--color-surface);
  color: var(--color-body);
  border: 1px solid rgba(191,164,111,0.2);
  font-family: 'Montserrat', sans-serif;
}

.tpg-pagination .page-numbers.current,
.tpg-pagination .page-numbers:hover,
.rt-tpg-container .tpg-pagination .page-numbers.current,
.rt-tpg-container .tpg-pagination .page-numbers:hover {
  background-color: var(--color-gold);
  color: var(--color-bg);
  border-color: var(--color-gold);
}


/* ============================================
   RESPONSIVE — TABLET (max 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .em-blog-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   RESPONSIVE — MOBILE (max 600px)
   ============================================ */
@media (max-width: 600px) {
  .em-blog-grid { grid-template-columns: 1fr; }

  .em-blog-filter-bar {
    gap: 8px;
  }

  .em-blog-filter-btn {
    font-size: 12px;
    padding: 8px 14px;
  }

  .em-blog-card-body {
    padding: 16px;
  }

  .page-wrapper .em-blog-card .em-blog-card-title {
    font-size: 15px;
  }
}

/* ============================================
   FEATURED RESOURCES GRID
   3 cards side-by-side on desktop/tablet,
   stacked on mobile. Equal heights, aligned
   buttons, proper inner padding.
   ============================================ */
.featured-resources-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  margin-bottom: 40px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Individual card — scoped so it does not
   affect blog grid cards elsewhere. */
.featured-resources-grid .featured-resource-card {
  border: 1px solid #967b45 !important;
  border-radius: 10px !important;
  background: #1a1a1a !important;
  padding: 24px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  height: 100% !important;
}

/* Top content area grows to fill available space,
   which pushes the button to the bottom edge. */
.featured-resources-grid .featured-resource-content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Card title — override global centered h3 */
.page-wrapper .featured-resources-grid .featured-resource-title {
  margin: 0 0 12px 0 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #F5F1E9 !important;
  text-align: center !important;
  line-height: 1.35 !important;
}

/* Card description */
.page-wrapper .featured-resources-grid .featured-resource-desc {
  font-size: 0.9rem !important;
  color: #b0a898 !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  text-align: left !important;
}

/* CTA button — margin-top: auto pushes it to
   the bottom of the card so all three buttons
   line up horizontally regardless of text length. */
.page-wrapper .featured-resources-grid .featured-resource-btn {
  margin: 20px auto 0 auto !important;
  text-align: center !important;
  display: block !important;
  text-decoration: none !important;
  font-size: 0.9rem !important;
  width: fit-content !important;
  align-self: center !important;
}

.featured-resources-grid a {
  text-decoration: none !important;
}

/* Tablet */
@media (max-width: 900px) {
  .featured-resources-grid {
    gap: 14px !important;
  }
  .featured-resources-grid .featured-resource-card {
    padding: 20px 18px !important;
  }
}

/* Mobile: stack to single column */
@media (max-width: 600px) {
  .featured-resources-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
}
