/* Styles for Locations block (simple starter styles)
   - layout: icon left, content right, actions below content but inline with icon
*/
.fastech-locations {
  margin: 0 auto;
}

/* Make the whole locations block vertically scroll when taller than 650px */
.fastech-locations {
  max-height: 650px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on mobile */
  padding-right: 0.5rem; /* small padding so content doesn't get hidden behind scrollbars */
}
.fastech-locations__group {
  margin-bottom: 2rem;
}
.fastech-locations__group-title {
  margin: 0 0 1rem 0;
}
.fastech-locations__list {
  display: grid;
  gap: 1rem;
}
.fastech-location-item {
  display: flex;
  gap: 1rem;
  /* Stretch so icon column matches the full height of the content column */
  align-items: stretch;
}
.fastech-location-item__icon {
  /* Wider icon column so logos/images are more visible; stretches vertically */
  flex: 0 0 175px; /* wider column for logos */
  display: flex;
  align-items: stretch; /* stretch vertically to match content height */
  justify-content: center; /* center image horizontally */
  overflow: hidden;
}
.fastech-location-item__icon-svg,
.fastech-location-item__icon-img {
  display: block;
  max-width: 100%;
}
.fastech-location-item__icon-img {
  /* Make raster images fill the icon column height while keeping aspect ratio */
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}
.fastech-location-item__content {
  flex: 1 1 auto;
  padding: 0.25rem;
}
.fastech-location-item__title {
  /* tighten heading spacing */
  margin: 0 0 .25rem 0;
}
.fastech-location-item__excerpt {
  /* tighten paragraph spacing and clamp to 2 lines */
  margin: 0 0 .25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Remove default paragraph margins inside the excerpt container */
.fastech-location-item__excerpt p {
  margin: 0;
  margin-bottom: 15px;
}

/* Ensure button wrapper sizes to its inner link and doesn't collapse */
.fastech-location-item__more-button,
.fastech-location-item__navigate-button {
  display: inline-flex;
  align-items: center;
}

/* Small gap above actions so buttons don't touch the excerpt */
.fastech-location-item__actions {
  margin-top: 0.25rem;
}
.fastech-location-item__actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.fastech-location-item__more {
  color: inherit;
}
/* Prefer the core WP button appearance; only small adjustments for spacing */
.wp-block-button__link.fastech-location-item__navigate,
.wp-block-button__link.fastech-location-item__more {
  margin-top: 5px;
  border-radius: 8px;
}

.wp-block-button__link.fastech-location-item__navigate {
    background-color: #fff;
    border: var(--wp--preset--color--contrast) solid 1px;
    color: var(--wp--preset--color--contrast);
    transition: background-color 180ms ease, color 120ms ease, box-shadow 120ms ease;
}

/* Hover / focus: switch navigate button to primary color with white text */
.wp-block-button__link.fastech-location-item__navigate:hover,
.wp-block-button__link.fastech-location-item__navigate:focus {
  background-color: var(--wp--preset--color--primary, #092E6E);
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(9,46,110,0.12);
}

/* Prevent button text from wrapping and keep action buttons on a single row on mobile */
.fastech-location-item__actions {
  flex-wrap: nowrap; /* keep buttons in one row */
}

.fastech-location-item__more-button,
.fastech-location-item__navigate-button,
.wp-block-button__link.fastech-location-item__navigate,
.wp-block-button__link.fastech-location-item__more {
  white-space: nowrap; /* prevent wrapping inside the button */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* if text is too long, hide overflow */
  text-overflow: ellipsis; /* show ellipsis when truncated */
  min-width: 0; /* allow flex children to shrink */
}

/* If buttons are very long on small screens, allow them to reduce padding slightly */
@media (max-width: 420px) {
  .wp-block-button__link.fastech-location-item__navigate,
  .wp-block-button__link.fastech-location-item__more {
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 0.95rem;
  }
}

/* Mobile: hide the icon column and let content take full width to avoid horizontal scroll */
@media (max-width: 768px) {
  .fastech-locations {
    overflow-x: hidden;
  }

  .fastech-location-item {
    /* keep as a row but allow content to take full width */
    flex-direction: column;
    min-width: 0;
  }

  .fastech-location-item__icon img {
    width: 100%;
  }

  .fastech-location-item__content {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    padding: 0.25rem 0 0 0;
  }

  /* allow action buttons to wrap onto multiple lines on small screens */
  .fastech-location-item__actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .fastech-locations__group-title {
    text-align: left;
    justify-content: left;
  }

  .is-style-fastech-icon-heading::before {
    display: flex !important;
  }
}
