/**
 * Services Landing Page Styles
 */

.olympus-services-landing {
  padding: 0;
  width: 100%;

  /* Variables locales avec fallback */
  --services-icon-color: var(
    --services-primary,
    var(--wp--preset--color--primary, #2e2f85)
  );

  --services-primary-contrast-color: var(
    --services-primary-contrast,
    var(--wp--preset--color--contrast, #ffffff)
  );

  --services-secondary-contrast-color: var(
    --services-secondary-contrast,
    var(--wp--preset--color--base, #000000)
  );
}

.olympus-services-landing .services-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile first : 1 colonne pleine largeur */
  gap: 20px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .olympus-services-landing .services-grid {
    /* 
       Sur desktop : 3 colonnes strictes.
       Ainsi, même s'il n'y a qu'un seul élément, il ne prendra que 1/3 de la largeur (1 colonne).
       Il ne prendra "jamais toute la row".
    */
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .olympus-services-landing .services-grid {
    /* 
        Ajustement tablette : Si 3 colonnes font trop serré (< 300px par col), 
        on passe à 2 colonnes (donc 1/2 largeur).
     */
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Common Styles --- */
.olympus-services-landing .service-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  transition: all 0.3s ease;
  border-radius: 10px;
  background-color: var(--services-primary);
  min-width: 0; /* autorise le shrink pour éviter le débordement */
}

.olympus-services-landing .no-image-placeholder span {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  color: color-mix(in srgb, var(--services-primary), black 10%);
  opacity: 0.5;
  text-align: center;
  padding: 10px;
}

.olympus-services-landing .service-title {
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.olympus-services-landing .service-icon {
  color: var(--services-icon-color); /* Default color from variable */
  flex-shrink: 0;
}

/* --- Theme 1 (Default) --- */
/* Simple layout already handled by common styles */

.olympus-services-landing.theme-landingpage1 .service-image-wrapper {
  min-height: 150px;
  width: 100%;
  max-width: 250px; /* limite haute pour garder le look initial sans forcer la largeur */
  background-color: var(
    --services-secondary
  ); /* Fond plein, pas de transparence */
  opacity: 0.8;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.olympus-services-landing.theme-landingpage1 .service-image-wrapper {
  width: 100%;
  height: 100%;
}

.olympus-services-landing.theme-landingpage1 .service-item {
  padding: 14px;
  background-color: var(--services-primary); /* Couleur pleine comme thème 2 */
  border: 1px solid var(--services-secondary); /* Bordure pleine */
  color: var(--services-primary-contrast-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.olympus-services-landing.theme-landingpage1 .service-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  width: 100%;
  justify-content: space-between;
}

.olympus-services-landing.theme-landingpage1 .service-title {
  font-weight: 600;
  color: var(--services-primary-contrast-color); /* Texte en contraste */
}

.olympus-services-landing.theme-landingpage1 .service-booking-btn {
  align-self: flex-end;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background-color: var(--services-secondary);
  color: var(--services-secondary-contrast-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.olympus-services-landing.theme-landingpage1 .service-booking-btn:hover {
  transform: scale(1.05);
  background-color: color-mix(in srgb, var(--services-secondary), black 10%);
}

/* --- Theme 2 (landingpage2) --- */
.olympus-services-landing.theme-landingpage2 .service-item {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background-color: var(--services-primary);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid
    color-mix(in srgb, var(--services-secondary), transparent 85%);
}

.olympus-services-landing.theme-landingpage2 .service-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.olympus-services-landing.theme-landingpage2 .service-image-wrapper {
  width: 100%;
  height: 220px;
  background-color: color-mix(
    in srgb,
    var(--services-secondary),
    transparent 90%
  );
  position: relative;
  background-repeat: no-repeat;
  background-size: cover;
}

.olympus-services-landing.theme-landingpage2 .service-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.olympus-services-landing.theme-landingpage2 .no-image-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.olympus-services-landing.theme-landingpage2
  .service-item:hover
  .service-image-wrapper
  img {
  transform: scale(1.05);
}

.olympus-services-landing.theme-landingpage2 .service-content-wrapper {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.olympus-services-landing.theme-landingpage2 .service-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--services-primary-contrast-color);
  text-align: center;
}

.olympus-services-landing.theme-landingpage2 .service-booking-btn {
  width: 100%;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  background-color: var(--services-secondary);
  color: var(--services-secondary-contrast-color);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
  margin-top: auto;
}

.olympus-services-landing.theme-landingpage2 .service-booking-btn:hover {
  background-color: color-mix(in srgb, var(--services-secondary), black 10%);
  transform: scale(1.02);
}
