/* Google Fonts Import */
/* Removed Google Fonts @import - now handled by Next.js */

/* ============================================= */
/* == Infographics Grid ======================= */
/* ============================================= */

:root {
  /* Color Palette */
  --primary: #0891b2;
  --primary-hover: #0e7490;
  --text-dark: #1f2937;
  --text-medium: #4b5563;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --font-montserrat: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Download Button Colors */
  --grey: #6b7280;
  --Tahitian-Tide: #006C7F;
  --Light-yellow: #ffffff;
  --Tahitian-Tide-filter: invert(37%) sepia(73%) saturate(554%) hue-rotate(157deg) brightness(94%) contrast(101%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
}

.cdm-infographics-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem; /* Reduced padding for tighter layout */
  /* Updated font-family to use CSS variable */
  font-family: var(--font-montserrat), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

.cdm-infographics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px; /* Reduced gap for tighter grid */
  margin: 2rem 0;
}

/* Infographic Card - Vertical Layout */
.cdm-infographic-card {
  background: var(--bg-white);
  border-radius: 12px; /* Slightly smaller radius */
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08); /* Subtle shadow */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #f1f5f9; /* Light border for definition */
}

.cdm-infographic-card:hover {
  transform: translateY(-3px); /* Reduced hover lift */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border-color: #e2e8f0;
}

/* Card Image - Top Section */
.cdm-infographic-card__image {
  position: relative;
  padding-top: 55%; /* Slightly shorter aspect ratio to match reference */
  overflow: hidden;
  background: #f8fafc; /* Lighter background initially */
  display: flex;
  align-items: center;
  justify-content: center;
}

.cdm-infographic-card__image a {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: block;
}

.cdm-infographic-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cdm-infographic-card:hover .cdm-infographic-card__image img {
  transform: scale(1.03);
}

/* Enhanced placeholder styling to match reference */
.cdm-infographic-card__image--placeholder {
  background: #2d3748 !important; /* Dark navy like reference */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cdm-infographic-card__image--placeholder::before {
  content: "";
  width: 40px;
  height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 1v6m0 6v6m11-7h-6m-6 0H1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.6;
}

/* When there's an actual image, hide the placeholder */
.cdm-infographic-card__image:not(.cdm-infographic-card__image--placeholder)::before {
  display: none;
}

/* Card Content - Bottom Section */
.cdm-infographic-card__content {
  padding: 20px; /* Reduced padding */
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left; /* Left-align text like reference */
  min-height: 120px; /* Ensure consistent content height */
}

.cdm-infographic-card__title {
  margin: 0 0 16px; /* Reduced margin */
  font-size: 16px; /* Smaller, more compact font */
  line-height: 1.3;
  font-weight: 600; /* Slightly lighter weight */
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Download Actions - Left-aligned Button with Icon */
.cdm-infographic-card__actions {
  display: flex;
  justify-content: flex-start; /* Left-align like reference */
  margin-top: auto;
}

.cdm-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #9ca3af; /* Gray color like reference */
  padding: 8px 0; /* Minimal padding */
  border: none;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  text-transform: none; /* Remove uppercase */
  letter-spacing: 0;
}

.cdm-download-btn:hover {
  color: #6b7280; /* Darker gray on hover */
}

.cdm-download-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* Hide actions container when no PDF is available */
.cdm-infographic-card__actions:empty {
  display: none;
}

/* Pill Layout */
.cdm-pills-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  font-family: var(--font-montserrat), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

.cdm-pills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 2rem 0;
}

.cdm-pill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cdm-pill-visual {
  width: 100%;
  height: 220px; /* Reduced height from 280px to 220px for more compact pills */
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  margin-bottom: 16px; /* Reduced bottom margin from 24px to 16px */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cdm-pill-visual:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

.cdm-pill-visual a {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  display: block;
}

.cdm-pill-visual img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cdm-pill-visual:hover img {
  transform: scale(1.02);
}

.cdm-pill-info {
  width: 100%;
  max-width: 320px;
}

.cdm-pill-title {
  margin: 0 0 12px; /* Reduced bottom margin from 16px to 12px */
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
}

.cdm-pill-actions {
  display: flex;
  justify-content: center;
}

.download__btn {
  display: inline-block;
  padding-right: 1.6rem;
  position: relative;
  font-size: 16px
  font-weight: 700;
  line-height: 1.5;
  color: var(--grey);
}
.download__btn::before,
.download__btn::after {
  content: "";
  -webkit-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  transition: all 0.3s ease 0s;
}
.download__btn::after {
  right: 0;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  position: absolute;
  width: 1.6rem;
  height: 1.5rem;
  background-image: url("https://ektos.gemorah.org/wp-content/uploads/2025/09/download-icon.svg");
  background-position: center;
  background-repeat: no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
  -webkit-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  transition: all 0.3s ease 0s;
}
.download__btn:hover,
.download__btn:focus,
.download__btn:active,
.download__btn:visited {
  text-decoration: none;
}
.download__btn:hover {
  color: var(--Tahitian-Tide);
}
.download__btn:hover::after {
  -webkit-filter: var(--Tahitian-Tide-filter);
  filter: var(--Tahitian-Tide-filter);
}

.download__btn__big {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  padding-right: 3.8rem;
  position: relative;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--grey);
  -webkit-border-radius: 5rem;
  border-radius: 5rem;
  height: 7rem;
  background: var(--Tahitian-Tide);
  border: 0.2rem solid var(--Tahitian-Tide);
  color: var(--Light-yellow);
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 0 8.5rem 0 4.8rem;
}
.download__btn__big::before,
.download__btn__big::after {
  content: "";
  -webkit-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  transition: all 0.3s ease 0s;
}
.download__btn__big::after {
  right: 4.8rem;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  position: absolute;
  width: 2.8rem;
  height: 2.7rem;
  background-image: url("../../img/global/download-icon-white.svg");
  background-position: center;
  background-repeat: no-repeat;
  -webkit-background-size: contain;
  background-size: contain;
  -webkit-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  transition: all 0.3s ease 0s;
}
.download__btn__big:hover,
.download__btn__big:focus,
.download__btn__big:active,
.download__btn__big:visited {
  text-decoration: none;
}
.download__btn__big:hover {
  color: var(--Tahitian-Tide);
  background: transparent;
}
.download__btn__big:hover::after {
  -webkit-filter: var(--Tahitian-Tide-filter);
  filter: var(--Tahitian-Tide-filter);
}

.cdm-download-link:hover {
  color: var(--Light-yellow);
  text-decoration: none;
}

.cdm-download-link svg {
  width: var(--button-icon-size);
  height: var(--button-icon-size);
  opacity: 1;
  transition: all 0.2s ease;
  filter: var(--Tahitian-Tide-filter);
}

.cdm-download-link:hover svg {
  filter: brightness(0) invert(1);
}

/* Hide actions container when no PDF is available */
.cdm-pill-actions:empty {
  display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .cdm-infographics-container {
    max-width: 1000px;
    padding: 3rem 1.5rem 2rem;
  }

  .cdm-infographics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .cdm-pills-container {
    max-width: 1000px;
    padding: 3rem 1.5rem 2rem;
  }

  .cdm-pills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .cdm-pill {
    min-height: 100px;
    border-radius: 40px;
  }

  .cdm-pill__image {
    width: 100px;
    height: 100px;
    border-radius: 40px 0 0 40px;
  }

  .cdm-pill__content {
    padding: 16px 20px;
  }

  .cdm-pill__title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .cdm-pill-visual {
    height: 200px; /* Reduced height from 240px to 200px for tablet view */
    border-radius: 32px;
    margin-bottom: 14px; /* Reduced bottom margin from 20px to 14px */
  }
}

@media (max-width: 768px) {
  .cdm-infographics-container {
    padding: 2rem 1rem;
  }

  .cdm-infographics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .cdm-pills-container {
    padding: 2rem 1rem;
  }

  .cdm-pills-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cdm-pill {
    flex-direction: column;
    min-height: auto;
    border-radius: 24px;
  }

  .cdm-pill__image {
    width: 100px;
    height: 100px;
    border-radius: 24px 0 0 24px;
  }

  .cdm-pill__content {
    padding: 16px 20px;
  }

  .cdm-pill__title {
    font-size: 16px;
  }

  .cdm-pill-visual {
    height: 180px; /* Reduced height from 200px to 180px for mobile view */
    border-radius: 24px;
  }

  .cdm-pill-title {
    font-size: 16px;
    margin-bottom: 10px; /* Reduced bottom margin from 12px to 10px */
  }
}

@media (max-width: 480px) {
  .cdm-infographics-container {
    padding: 1.5rem 0.75rem;
  }

  .cdm-infographics-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cdm-pills-container {
    padding: 1.5rem 0.75rem;
  }

  .cdm-pill {
    flex-direction: column;
    min-height: auto;
    border-radius: 20px;
  }

  .cdm-pill__image {
    width: 100%;
    height: 80px;
    border-radius: 20px 20px 0 0;
  }

  .cdm-pill__content {
    padding: 12px 16px;
  }

  .cdm-pill__title {
    font-size: 14px;
  }

  .cdm-pill-visual {
    height: 160px; /* Reduced height from 180px to 160px for small mobile view */
    border-radius: 20px;
  }
}

@media (max-width: 320px) {
  .cdm-pill-visual {
    height: 140px; /* Reduced height from 160px to 140px for very small screens */
    border-radius: 20px;
  }
}
