/* MPS Blog Styles */

/* ==========================================================================
   Blog Pages - Container styling
   ========================================================================== */

.mpsblog-article-detail,
.mpsblog-listing,
.mpsblog-category {
  max-width: 1600px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ==========================================================================
   Blog Pages - Page header with arrow icon (listing, category, article)
   ========================================================================== */

.page-content:has(.mpsblog-article-detail),
.page-content:has(.mpsblog-listing),
.page-content:has(.mpsblog-category) {
  margin-top: 50px;
}

body:has(.mpsblog-article-detail) .page-header,
body:has(.mpsblog-listing) .page-header,
body:has(.mpsblog-category) .page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 50px;
  margin-bottom: 30px;
  max-width: 1600px;
  margin-inline: auto;
  padding-inline: 20px;
}

body:has(.mpsblog-article-detail) .page-header::before,
body:has(.mpsblog-listing) .page-header::before,
body:has(.mpsblog-category) .page-header::before {
  content: "";
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background-color: var(--mps-primary, #50a15e);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px;
}

body:has(.mpsblog-article-detail) .page-header h1,
body:has(.mpsblog-listing) .page-header h1,
body:has(.mpsblog-category) .page-header h1 {
  margin: 0;
  font-size: 47px;
  font-weight: 300;
  text-transform: uppercase;
  color: var(--mps-black, #242424);
}

/* Mobile & Tablet: smaller header */
@media (max-width: 767px) {
  body:has(.mpsblog-article-detail) .page-header,
  body:has(.mpsblog-listing) .page-header,
  body:has(.mpsblog-category) .page-header {
    gap: 15px;
  }

  body:has(.mpsblog-article-detail) .page-header::before,
  body:has(.mpsblog-listing) .page-header::before,
  body:has(.mpsblog-category) .page-header::before {
    width: 40px;
    height: 40px;
    background-size: 20px;
  }

  body:has(.mpsblog-article-detail) .page-header h1,
  body:has(.mpsblog-listing) .page-header h1,
  body:has(.mpsblog-category) .page-header h1 {
    font-size: 28px;
  }
}

/* Creative Elements Widget Styles */
.mpsblog-ce-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.mpsblog-ce-card {
  background: var(--mps-gray-light, #f6f6f6);
  overflow: hidden;
  font-family: "Roboto Condensed", sans-serif;
}

.mpsblog-ce-card-image {
  display: block;
  overflow: hidden;
  position: relative;
}

/* Mask overlay via ::after pseudo-element */
.mpsblog-ce-card-image::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 3;
  bottom: 0;
  left: 0;
  background-image: url("../images/mask-blog-article-min.webp");
  background-size: cover;
  background-position: bottom left;
  background-repeat: no-repeat;
  pointer-events: none;
}

.mpsblog-ce-card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

/* Hover effects */
.mpsblog-hover-zoom:hover img {
  transform: scale(1.1);
}

.mpsblog-hover-opacity:hover img {
  opacity: 0.8;
}

.mpsblog-ce-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.mpsblog-ce-card-categories {
  font-size: 0.85em;
  margin-bottom: 8px;
  order: -2;
  align-self: flex-start;
  background-color: var(--mps-gray, #dedede);
  padding: 4px 10px;
  color: var(--mps-black, #242424);
}

.mpsblog-ce-card-categories a {
  color: var(--mps-black, #242424) !important;
  text-decoration: none;
}

.mpsblog-ce-card-title {
  font-size: 1.25rem;
  margin: 0 0 10px 0;
  line-height: 1.4;
  text-transform: uppercase;
  font-weight: 400;
}

.mpsblog-ce-card-title a {
  color: var(--mps-primary, #50a15e);
  text-decoration: none;
}

.mpsblog-ce-card-title a:hover {
  color: var(--mps-primary, #50a15e);
}

.mpsblog-ce-card-meta {
  color: var(--mps-black, #242424);
  font-size: 0.9em;
  margin-bottom: 10px;
}

.mpsblog-ce-card-excerpt {
  color: var(--mps-black, #242424);
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 15px;
}

.mpsblog-ce-read-more {
  display: inline-block;
  color: var(--mps-black, #242424);
  font-weight: 600;
  text-decoration: none;
}

/* CE Widget - Category Badge (single category) */
.mpsblog-ce-card-category {
  font-size: 0.85em;
  margin-bottom: 8px;
  background-color: #fff;
  color: var(--mps-black, #242424) !important;
  padding: 4px 10px;
  text-decoration: none;
  order: -2;
  align-self: flex-start;
}

/* CE Widget - Date (displayed above title) */
.mpsblog-ce-card-date {
  color: var(--mps-black, #242424);
  font-size: 0.9em;
  margin-bottom: 8px;
  order: -1;
}

/* CE Widget - View All Button */
.mpsblog-ce-view-all-wrapper {
  margin-top: 30px;
  text-align: center;
}

.mpsblog-ce-view-all-wrapper.align-left {
  text-align: left;
}

.mpsblog-ce-view-all-wrapper.align-right {
  text-align: right;
}

.mpsblog-ce-view-all {
  display: inline-block;
  padding: 12px 30px;
  background-color: #50a15e;
  color: #fff;
  text-decoration: none;
  border-radius: 0px;
  font-weight: 300;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.mpsblog-ce-view-all:hover {
  background-color: #3d8049;
  color: #fff;
}

/* CE Widget - No Articles Message */
.mpsblog-ce-no-articles {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

/* CE Widget - Responsive Grid */
@media (max-width: 1024px) {
  .mpsblog-ce-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .mpsblog-ce-grid {
    grid-template-columns: 1fr;
  }
}

/* End Creative Elements Widget Styles */

.mpsblog-listing,
.mpsblog-category,
.mpsblog-article-detail {
  padding: 20px 0;
}

/* Articles Grid */
.mpsblog-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

/* Article Card - Style aligné avec la homepage (widget CE) */
.mpsblog-article-card {
  background: var(--mps-gray-light, #f6f6f6);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  transition: none;
  font-family: "Roboto Condensed", sans-serif;
}

.mpsblog-article-card:hover {
  transform: none;
  box-shadow: none;
}

.mpsblog-article-card .mpsblog-article-image {
  display: block;
  overflow: hidden;
  position: relative;
}

/* Mask overlay vert sur l'image */
.mpsblog-article-card .mpsblog-article-image::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 3;
  bottom: 0;
  left: 0;
  background-image: url("../images/mask-blog-article-min.webp");
  background-size: cover;
  background-position: bottom left;
  background-repeat: no-repeat;
  pointer-events: none;
}

.mpsblog-article-card .mpsblog-article-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.mpsblog-article-card:hover .mpsblog-article-image img {
  transform: scale(1.1);
}

.mpsblog-article-card .mpsblog-article-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.mpsblog-article-categories,
.mpsblog-article-category {
  font-size: 0.85em;
  margin-bottom: 8px;
  align-self: flex-start;
}

.mpsblog-category-link {
  background-color: #fff;
  color: var(--mps-primary, #50a15e) !important;
  padding: 4px 10px;
  text-decoration: none;
  display: inline-block;
}

.mpsblog-category-link:hover {
  text-decoration: none;
  color: var(--mps-primary, #50a15e) !important;
}

.mpsblog-category-link.active {
  font-weight: bold;
}

.mpsblog-article-date {
  color: var(--mps-black, #242424);
  font-size: 0.9em;
  margin-bottom: 8px;
}

.mpsblog-article-title {
  font-size: 1.25rem;
  margin: 0 0 10px 0;
  line-height: 1.4;
  text-transform: uppercase;
  font-weight: 400;
}

.mpsblog-article-title a {
  color: var(--mps-primary, #50a15e);
  text-decoration: none;
}

.mpsblog-article-title a:hover {
  color: var(--mps-primary, #50a15e);
}

.mpsblog-read-more {
  display: inline-block;
  color: var(--mps-black, #242424);
  font-weight: 600;
  text-decoration: none;
}

.mpsblog-read-more:hover {
  text-decoration: none;
  color: var(--mps-black, #242424);
}

/* Article Detail */
.mpsblog-article-detail .mpsblog-article-image {
  margin-bottom: 30px;
}

.mpsblog-article-detail .mpsblog-article-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 8px;
}

.mpsblog-article-meta {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.mpsblog-article-meta .mpsblog-article-date {
  margin-right: 20px;
}

.mpsblog-article-detail .mpsblog-article-content {
  line-height: 1.8;
  margin-bottom: 40px;
}

.mpsblog-article-detail .mpsblog-article-content img {
  max-width: 100%;
  height: auto;
}

/* Related Articles */
.mpsblog-related-articles {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #eee;
}

.mpsblog-related-articles h3 {
  margin-bottom: 20px;
}

.mpsblog-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.mpsblog-related-item {
  background: #f6f6f6;
  border-radius: 8px;
  overflow: hidden;
}

.mpsblog-related-item .mpsblog-related-image img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.mpsblog-related-item h4 {
  padding: 15px;
  margin: 0;
  font-size: 0.95rem;
}

.mpsblog-related-item h4 a {
  color: #242424;
  text-decoration: none;
}

.mpsblog-related-item h4 a:hover {
  color: #50a15e;
}

/* Category Description */
.mpsblog-category-description {
  margin-bottom: 30px;
  padding: 20px;
  background: #f6f6f6;
  border-radius: 8px;
}

/* Pagination */
.mpsblog-pagination {
  text-align: center;
  margin-top: 40px;
}

.mpsblog-pagination ul {
  display: inline-flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 5px;
}

.mpsblog-pagination li a {
  display: block;
  padding: 10px 15px;
  background: #f6f6f6;
  color: #242424;
  text-decoration: none;
  border-radius: 0;
  transition: all 0.3s ease;
}

.mpsblog-pagination li.active a,
.mpsblog-pagination li a:hover {
  background: #50a15e;
  color: #fff;
}

/* Back Link */
.mpsblog-back-link {
  margin-top: 30px;
}

.mpsblog-back-link a {
  color: #50a15e;
  text-decoration: none;
}

.mpsblog-back-link a:hover {
  text-decoration: underline;
}

/* No Articles */
.mpsblog-no-articles {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  .mpsblog-articles-grid {
    grid-template-columns: 1fr;
  }

  .mpsblog-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .mpsblog-related-grid {
    grid-template-columns: 1fr;
  }
}
