/* Article List Mosaique - Styles - Préfixe ALM */

.alm-container {
  max-width: 100%;
  margin: 20px auto;
  padding: 0 20px;
}

.alm-no-articles {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-style: italic;
  font-size: 16px;
}

/* Grille mosaïque - 20 colonnes */
.alm-mosaique-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 8px;
  margin: 0 auto;
}

/* Bloc header 4x4 (occupe 4 colonnes et 4 lignes) */
.alm-header-block {
  grid-column: span 3;
  grid-row: span 4;
  /*background: linear-gradient(135deg, var(--ast-global-color-1, #0073aa) 0%, color-mix(in srgb, var(--ast-global-color-1, #0073aa) 70%, black) 100%);*/

  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid #5A0000;
  ;
}

.alm-header-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.alm-header-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  text-align: center;
}

.alm-header-title {
  color: var(--ast-global-color-1);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 15px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.3;
  width: 100%;
}

.alm-header-image {
  max-width: 80%;
  max-height: 90%;
  object-fit: cover;
  border-radius: 5px;
  filter: brightness(1.1);
  flex: 1;
}

/* Cartes articles - 1 colonne et 2 lignes (moitié de la hauteur du header 4x4) */
.alm-card {
  grid-column: span 1;
  grid-row: span 2;
  aspect-ratio: 1/2;
  cursor: pointer;
  border-radius: 5px;
  overflow: hidden;
  background: #f5f5f5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  position: relative;
}

.alm-card:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
  z-index: 10;
}

.alm-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.alm-card-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

.alm-card:hover .alm-card-image {
  transform: scale(1.1);
}

.alm-card-no-image {
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alm-no-image-icon {
  font-size: 32px;
  opacity: 0.3;
}

.alm-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
  padding: 12px 8px 8px;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.alm-card:hover .alm-card-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 70%, transparent 100%);
}

.alm-card-title {
  color: white;
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Modal */
.alm-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /*background: rgba(0, 0, 0, 0.8);*/
  z-index: 99999;
  animation: alm-fade-in 0.3s ease;
  overflow-y: auto;
  padding: 20px;
}

.alm-modal-overlay.alm-active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

@keyframes alm-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.alm-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: alm-slide-up 0.3s ease;
  position: relative;
  margin: 0 auto;
}

@keyframes alm-slide-up {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.alm-modal-header {
  position: sticky;
  top: 0;
  background: var(--ast-global-color-4, #ffffff);
  padding-top: 25px;
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.alm-modal-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--ast-global-color-1, #0073aa);
  padding-right: 50px;
  line-height: 1.3;
}

.alm-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 45px;
  height: 45px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ast-global-color-1, #0073aa);
  font-size: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.alm-modal-close:hover {
  background: var(--ast-global-color-1, #0073aa);
  color: white;
  transform: rotate(90deg);
}

.alm-modal-body {
  padding: 30px;
  max-height: calc(90vh - 100px);
  overflow-y: auto;
}

.alm-loading-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--ast-global-color-1, #0073aa);
  font-size: 18px;
  font-weight: 600;
}

/* NOUVEAUX STYLES POUR LES INFORMATIONS DU SHORTCODE DANS LA MODAL */
.alm-modal-header-info {
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(0, 115, 170, 0.05) 0%, rgba(0, 115, 170, 0.02) 100%);
  border-radius: 8px;
  border-left: 2px solid var(--ast-global-color-1, #0073aa);
  display: flex;
  align-items: center;
  gap: 20px;
}

.alm-modal-header-image {
  max-width: 80px;
  max-height: 80px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alm-modal-header-category {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ast-global-color-1, #0073aa);
  line-height: 1.5;
}

.alm-modal-image {
  float: left;
  max-width: 250px;
  max-height: 300px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 40px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alm-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  color: #666;
}

.alm-modal-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alm-modal-meta-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.alm-modal-categories,
.alm-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.alm-modal-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.alm-modal-category,
.alm-modal-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  text-decoration: none;
  transition: all 0.2s ease;
}

.alm-modal-category:hover,
.alm-modal-tag:hover {
  background: var(--ast-global-color-1, #0073aa);
  color: white;
  transform: translateY(-2px);
}

.alm-modal-content-text {
  font-size: 16px;
  /*line-height: 1.8;*/
  color: #444;
  margin-bottom: 25px;
}

.alm-modal-content-text p {
  margin-bottom: 15px;
}

.alm-modal-content-text img {
  max-width: 250px;
  max-height: 300px;
  border-radius: 8px;
  margin: 20px 0;
  margin-top: 0px;
}

.alm-modal-content-text h1,
.alm-modal-content-text h2,
.alm-modal-content-text h3,
.alm-modal-content-text h4 {
  color: var(--ast-global-color-1, #0073aa);
  margin-top: 25px;
  margin-bottom: 15px;
}

.alm-modal-footer {
  padding: 20px 30px;
  text-align: center;
}

.alm-modal-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--ast-global-color-1, #0073aa);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alm-modal-link:hover {
  background: color-mix(in srgb, var(--ast-global-color-1, #0073aa) 85%, black);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Scrollbar personnalisée pour modal */
.alm-modal-body::-webkit-scrollbar {
  width: 10px;
}

.alm-modal-body::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 5px;
}

.alm-modal-body::-webkit-scrollbar-thumb {
  background: var(--ast-global-color-1, #0073aa);
  border-radius: 5px;
}

.alm-modal-body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ast-global-color-1, #0073aa) 80%, black);
}

/* Responsive - Tablettes */
@media (max-width: 1400px) {
  .alm-mosaique-grid {
    grid-template-columns: repeat(15, 1fr);
  }
}

@media (max-width: 1200px) {
  .alm-mosaique-grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .alm-header-block {
    grid-column: span 3;
    grid-row: span 2;
  }
}

@media (max-width: 992px) {
  .alm-mosaique-grid {
    grid-template-columns: repeat(10, 1fr);
  }

  .alm-header-title {
    font-size: 20px;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .alm-container {
    padding: 0 10px;
  }

  .alm-mosaique-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }

  .alm-header-block {
    grid-column: span 2;
    grid-row: span 2;
  }

  .alm-header-title {
    font-size: 16px;
  }

  .alm-header-image {
    max-height: 50%;
  }

  .alm-card-title {
    font-size: 9px;
    -webkit-line-clamp: 2;
  }

  .alm-modal-overlay {
    padding: 10px;
    padding-top: 20px;
  }

  .alm-modal-header {
    padding: 20px;
  }

  .alm-modal-title {
    font-size: 20px;
  }

  .alm-modal-body {
    padding: 20px;
  }

  .alm-modal-content-text {
    font-size: 15px;
  }

  .alm-modal-header-info {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }

  .alm-modal-header-image {
    max-width: 60px;
    max-height: 60px;
  }
}

@media (max-width: 480px) {
  .alm-mosaique-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .alm-header-block {
    grid-column: span 2;
    grid-row: span 2;
  }

  .alm-header-title {
    font-size: 14px;
  }

  .alm-card-title {
    font-size: 8px;
  }

  .alm-modal-title {
    font-size: 18px;
    padding-right: 40px;
  }

  .alm-modal-close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}