/* =============================================
   THEALTH Introduction Page Stylesheet
   ============================================= */

.intro-content {
  background: var(--color-bg);
}

/* Sticky Category Quick Navigation */
.category-nav-wrapper {
  position: sticky;
  top: 70px; /* Fits header height */
  z-index: 10;
  background: var(--color-bg);
  padding: 1rem 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.category-nav-item {
  background: var(--color-white);
  border: 1px solid rgba(46, 166, 123, 0.2);
  border-radius: 30px;
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: all var(--transition-fast) ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.category-nav-item:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(46, 166, 123, 0.15);
}

/* Category Sections */
.category-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 140px; /* Offset for sticky navigation and header */
}

.category-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.category-title-inner {
  position: relative;
}

.category-count {
  font-size: 0.8rem;
  color: var(--color-text-light);
  font-weight: 600;
  background: #fafaf7;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.04);
}

/* Facility List - 2 Columns Grid by default on desktop */
.facility-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Horizontal Facility Card (Compact) */
.facility-card {
  display: flex;
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(46, 166, 123, 0.06);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015);
  overflow: hidden;
  transition: transform var(--transition-fast) ease, box-shadow var(--transition-fast) ease, border-color var(--transition-fast) ease;
}

.facility-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border-color: rgba(46, 166, 123, 0.15);
}

/* Left Image Area — fixed size enforces a consistent landscape ratio (220×160) */
.facility-image-wrapper {
  width: 220px;
  height: 160px; /* Fixed height so ALL images share the same aspect ratio */
  flex-shrink: 0;
  position: relative;
  background: #f5f5f2;
  overflow: hidden;
}

.facility-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.facility-image.hide {
  display: none;
}

.facility-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f8f5 0%, #e1f2eb 100%);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
}

.facility-image-placeholder.hide {
  display: none;
}

/* Right Content Info Area (More compact margins and text) */
.facility-info {
  flex: 1;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  position: relative; /* For absolute positioning of interview button */
}

.facility-details {
  flex: 1;
  min-width: 0; /* Prevents flex overflow */
}

.facility-name {
  font-size: 0.95rem; /* Smaller font as requested */
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.25rem 0;
  padding-right: 110px; /* Leave space for absolute interview button */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Truncate if too long in 2 cols */
}

.facility-address {
  font-size: 0.72rem; /* Smaller address font */
  color: var(--color-text-light);
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facility-address .icon-address-pin {
  width: 0.85rem !important;
  height: 0.85rem !important;
  flex-shrink: 0;
}

/* Spec Table Design (Structured 4-columns layout) */
.facility-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.68rem;
  line-height: 1.3;
  table-layout: fixed; /* Ensures equal 25% column widths */
}

.facility-spec-table th,
.facility-spec-table td {
  border: 1px solid rgba(46, 166, 123, 0.12);
  padding: 0.35rem 0.2rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.facility-spec-table th {
  background: #f4f9f6;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.65rem;
}

.facility-spec-table td {
  color: var(--color-text-muted);
  font-weight: 600;
  background: var(--color-white);
}

/* Compact Interview Link positioned absolutely on top-right */
.btn-interview {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
  text-decoration: none;
  transition: all var(--transition-fast) ease;
  white-space: nowrap;
}

.btn-interview:hover {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 5px rgba(46, 166, 123, 0.12);
}

/* Responsive Styles */
@media (max-width: 992px) {
  /* Switch to 1 column for medium screens (tablets) to preserve layout integrity */
  .facility-list {
    grid-template-columns: 1fr;
  }
  
  .facility-image-wrapper {
    width: 240px;
    height: 160px; /* Keep height fixed on tablets too */
  }
  
  .facility-name {
    font-size: 1.0rem;
    white-space: normal; /* Wrap text on single column */
    padding-right: 110px;
  }
  
  .facility-address {
    font-size: 0.75rem;
    white-space: normal;
  }
  
  .facility-spec-table th {
    font-size: 0.68rem;
  }
  
  .facility-spec-table td {
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  .category-nav-wrapper {
    position: static;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
  }
  
  .category-nav-item {
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
  }
  
  .category-section {
    margin-bottom: 2.5rem;
  }
  
  .category-title {
    font-size: 1.15rem;
  }
  
  /* Vertical alignment for mobile */
  .facility-card {
    flex-direction: column;
  }
  
  .facility-image-wrapper {
    width: 100%;
    height: 180px; /* Full-width landscape on mobile */
  }
  
  .facility-info {
    padding: 1rem;
  }
  
  .facility-name {
    padding-right: 95px; /* Adjust spacing for mobile top-right button */
  }
  
  .facility-spec-table th {
    font-size: 0.62rem;
    padding: 0.25rem 0.1rem;
  }
  
  .facility-spec-table td {
    font-size: 0.65rem;
    padding: 0.25rem 0.1rem;
  }
}
