/* ==========================================================================
   Solutions Grid Component Stylesheet
   File: template-parts/components/solutions-grid.css
   ========================================================================== */

/* 1. Container Layout
   -------------------------------------------------------------------------- */
.solutions-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: inherit;
  box-sizing: border-box;
}

/* Hide Pure CSS Filter Radio Inputs */
.solutions-container input[type="radio"] {
  display: none;
}

/* 2. Filter Wrapper & Navigation Tabs (Desktop)
   -------------------------------------------------------------------------- */
.filter-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 50px;
  box-sizing: border-box;
}

.filter-nav {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border-bottom: 1px solid #e2e2e2;
  box-sizing: border-box;
}

/* Filter Tab Buttons */
.filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.5px;
  color: #4a4a4a;
  background-color: transparent;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  white-space: normal;
  min-width: 200px;
  max-width: 280px;
  flex-shrink: 0;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
  margin-bottom: -1px;
  box-sizing: border-box;
}

.filter-btn:hover {
  color: #a81c1c;
}

/* 3. Mobile Navigation Arrows (STRICTLY HIDDEN ON DESKTOP)
   -------------------------------------------------------------------------- */
.nav-arrow {
  display: none !important; /* Default state: Hidden on desktop */
}

/* 4. Solutions Grid & Equal Height Cards Layout
   -------------------------------------------------------------------------- */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr; /* Forces all cards across all rows to match the height of the tallest card */
  gap: 30px;
}

.solution-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px 30px 30px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Pins the button strictly to the bottom */
  align-items: center;
  text-align: left;
  height: 100%; /* Enforces full row height stretch */
  box-sizing: border-box;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.solution-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.card-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-grow: 1; /* Fills remaining height to anchor the button dynamically */
}

/* Card Icon */
.card-icon {
  width: 80px;
  height: 80px;
  margin: 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Card Title */
.card-title {
  color: #a81c1c;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 16px 0;
}

/* 5. Card Description (WYSIWYG Formatted Content)
   -------------------------------------------------------------------------- */
.card-description {
  color: #666666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 30px;
  width: 100%;
}

.card-description p {
  margin: 0 0 10px 0;
}

.card-description p:last-child {
  margin-bottom: 0;
}

.card-description ul,
.card-description ol {
  margin: 0 0 10px 0;
  padding-left: 20px;
  text-align: left;
}

.card-description a {
  color: #a81c1c;
  text-decoration: underline;
}

/* Card Red Circular Arrow Link */
.card-btn {
  width: 44px;
  height: 44px;
  background-color: #a81c1c;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
  margin-top: auto;
}

.card-btn:hover {
  background-color: #801313;
  transform: scale(1.08);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet (2 Columns) */
@media (max-width: 992px) {
  .solutions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Mobile & Small Tablet (< 768px) */
@media (max-width: 768px) {
  /* Side Gutters prevent tab text from scrolling under the absolute arrows */
  .filter-wrapper {
    padding: 0 44px;
  }
  .solutions-container{
    padding:0px;
  }
  

  /* Horizontal Touch Scroll for Filter Tabs */
  .filter-nav {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    scroll-snap-type: x mandatory;
  }

  .filter-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
  }

  .filter-btn {
    scroll-snap-align: start;
    min-width: 130px;
    padding: 12px 14px;
    font-size: 11px;
  }

  /* Activate Red Navigation Arrows inside side gutters */
  .nav-arrow {
    display: flex !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #a81c1c;
    color: #ffffff;
    border: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 3px 8px rgba(168, 28, 28, 0.35);
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  .nav-arrow:hover {
    border-color: #ffffff;
    background-color: #fff;
    color: #a81c1c;
  }

  .nav-arrow:active {
    background-color: #801313;
  }

  .nav-arrow.left {
    left: 4px;
  }

  .nav-arrow.right {
    right: 4px;
  }

}

/* Mobile Phone (1 Column) */
@media (max-width: 640px) {
  .solutions-grid {
    grid-template-columns: 1fr;
  }
}