/**
 * Styles pour le widget HB Posts Grid - GRILLE PRINCIPALE
 * 
 * @package Hugo_Blocks_For_Elementor
 * @since 1.0.0
 */

/* ========================================
   GRILLE PRINCIPALE
   ======================================== */

.hb-posts-grid {
  display: grid;
  width: 100%;
}

.hb-posts-grid__empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

/* ========================================
   LAYOUTS SPÉCIFIQUES
   ======================================== */

/* Layout Cards (défaut) */
.hb-posts-grid--cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Layout Masonry */
.hb-posts-grid--masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  grid-auto-rows: 10px; /* Hauteur de base pour le masonry */
}

.hb-posts-grid--masonry .hb-post-card {
  grid-row-end: span var(--masonry-height, 20);
}

/* Layout Bento */
.hb-posts-grid--bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  grid-auto-rows: 200px;
}

/* Layout Alternating */
.hb-posts-grid--alternating {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.hb-posts-grid--alternating .hb-post-card {
  display: flex;
  align-items: center;
  min-height: 400px;
}

/* ========================================
   CARTE INDIVIDUELLE
   ======================================== */

.hb-post-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Ombrage de base par défaut (sera remplacé par les styles Elementor si activé) */
.hb-post-card {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Effets hover par défaut (seront remplacés par les styles Elementor si activés) */
.hb-post-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hb-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ========================================
   VARIATIONS BENTO
   ======================================== */

.hb-post-card--small {
  grid-column: span 1;
  grid-row: span 1;
}

.hb-post-card--medium {
  grid-column: span 2;
  grid-row: span 1;
}

.hb-post-card--large {
  grid-column: span 2;
  grid-row: span 2;
}

.hb-post-card--wide {
  grid-column: span 3;
  grid-row: span 1;
}

.hb-post-card--tall {
  grid-column: span 1;
  grid-row: span 2;
}

/* ========================================
   IMAGE
   ======================================== */

.hb-post-card__image {
  position: relative;
  display: block;
  width: 100%;
  padding-bottom: 66.67%; /* Ratio 3:2 */
  overflow: hidden;
  background: #f5f5f5;
}

.hb-post-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Effet de zoom sur l'image par défaut (sera remplacé par les styles Elementor si activé) */
.hb-post-card:hover .hb-post-card__image img {
  transform: scale(1.05);
}

/* ========================================
   ZONES D'EFFET HOVER
   ======================================== */

/* Hover sur la carte complète */
.hb-posts-grid--hover-card .hb-post-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hb-posts-grid--hover-card .hb-post-card__image img {
  transition: transform 0.3s ease;
}

/* Hover sur l'image uniquement */
.hb-posts-grid--hover-image .hb-post-card {
  transition: box-shadow 0.3s ease;
}

.hb-posts-grid--hover-image .hb-post-card__image {
  transition: transform 0.3s ease;
}

.hb-posts-grid--hover-image .hb-post-card__image img {
  transition: transform 0.3s ease;
}

.hb-posts-grid--hover-image .hb-post-card:hover .hb-post-card__image {
  transform: translateY(-5px);
}

/* Hover sur le contenu uniquement */
.hb-posts-grid--hover-content .hb-post-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hb-posts-grid--hover-content .hb-post-card__content {
  transition: transform 0.3s ease;
}

.hb-posts-grid--hover-content .hb-post-card:hover .hb-post-card__content {
  transform: translateY(-5px);
}

/* ========================================
   DÉSACTIVATION DES EFFETS HOVER
   ======================================== */

.hb-posts-grid--no-hover .hb-post-card {
  transition: none !important;
}

.hb-posts-grid--no-hover .hb-post-card:hover {
  transform: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.hb-posts-grid--no-hover .hb-post-card__image img {
  transition: none !important;
}

.hb-posts-grid--no-hover .hb-post-card:hover .hb-post-card__image img {
  transform: none !important;
}

/* ========================================
   DÉSACTIVATION DE L'OMBRAGE DE BASE
   ======================================== */

.hb-posts-grid--no-base-shadow .hb-post-card {
  box-shadow: none !important;
}

/* Layout Alternating - Images */
.hb-posts-grid--alternating .hb-post-card__image {
  flex: 0 0 50%;
  padding-bottom: 0;
  height: 100%;
}

.hb-posts-grid--alternating .hb-post-card__image img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Layout Alternating - Contenu */
.hb-posts-grid--alternating .hb-post-card__content {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Layout Alternating - Alternance */
.hb-post-card--left {
  flex-direction: row;
}

.hb-post-card--right {
  flex-direction: row-reverse;
}

/* ========================================
   CONTENU
   ======================================== */

.hb-post-card__content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hb-post-card__meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.hb-post-card__separator {
  margin: 0 8px;
  color: #ccc;
}

.hb-post-card__title {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.hb-post-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.hb-post-card__title a:hover {
  color: #0073aa;
}

.hb-post-card__excerpt {
  margin: 0 0 20px 0;
  color: #666;
  line-height: 1.6;
  flex: 1;
}

.hb-post-card__link {
  display: inline-block;
  color: #0073aa;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.hb-post-card__link:hover {
  color: #005177;
  transform: translateX(3px);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Layout Cards & Masonry */
@media (max-width: 1024px) {
  .hb-posts-grid--cards,
  .hb-posts-grid--masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .hb-posts-grid--cards,
  .hb-posts-grid--masonry {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Layout Bento */
@media (max-width: 1024px) {
  .hb-posts-grid--bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hb-posts-grid--bento {
    grid-template-columns: 1fr;
  }
}

/* Layout Alternating */
@media (max-width: 768px) {
  .hb-posts-grid--alternating .hb-post-card {
    flex-direction: column;
    min-height: auto;
  }

  .hb-posts-grid--alternating .hb-post-card__image {
    flex: none;
    height: 250px;
  }

  .hb-posts-grid--alternating .hb-post-card__content {
    padding: 20px;
  }
}
