/* Adoption container */
.adoption-container {
    display: flex;
    gap: 1.5rem;
    flex-wrap: nowrap;   /* <-- changed from wrap to nowrap */
    align-items: flex-start;
    max-width: 1600px;    /* center whole page and limit width on wide screens */
    margin: 2rem auto;   /* horizontally center */
    padding: 0 1rem;     /* small side padding for narrow viewports */
    box-sizing: border-box;
}

/* Search bar and intro container */
.search-bar-and-intro {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

/* Search bar styling */
.search-bar {
    width: 100%;
    max-width: 30rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 0;
}

.search-bar input[type="text"] {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 2px solid #bbb;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

.search-bar input[type="text"]:focus {
    border-color: #0077cc;
    outline: none;
}

/* Adoption intro styling */
.adoption-intro {
  flex: 2 1 0;
  font-size: 1.15rem;
  color: #444;
  margin: 0;
  padding-left: 0.5rem;
  line-height: 1.6;
  white-space: normal; /* allow wrapping within the centered page */
  overflow-x: hidden;
}

@media (max-width: 900px) {
  .search-bar {
    max-width: none;
  }

  .adoption-intro {
    display: none; /* hide intro on smaller screens to save space */
  }
}

/* Main content area */
.adoption-main {
    flex: 1;
    width: 100%;
}

/* Pet grid layout */
.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1.5rem;
    margin-right: 1rem;   /* ✅ prevents text from pushing into the edge */
    box-sizing: border-box;
    overflow-wrap: break-word; /* ✅ wrap long words instead of overflowing */
}

/* Pet cards */
.pet-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

.pet-card .pet-name {
  /* font-size: 1.5rem; */
  font-weight: 600;
  color: #222;
  margin-top: 0.2rem;
  margin-bottom: 0.5rem;
}

.pet-card p {
    margin: 0.25rem 0;
    font-size: 1rem;
    color: #444;
}


.pet-card .label {
    font-weight: 500;       /* medium weight, not bold */
    color: #666;            /* softer grey tone */
    margin-right: 0.3rem;
    display: inline-block;
    min-width: 4.5rem;      /* optional: align fields neatly */
}

.pet-card .pet-description {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    color: #555;
    font-size: 0.95rem;
    margin: 0.5rem 0 0 0;
}

.pet-card img {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Centred "No pets found" message */
.pet-grid > p {
  grid-column: 1 / -1 !important; /* span the entire grid */
  display: flex !important;        /* center horizontally & vertically */
  justify-content: center !important;
  align-items: center !important;
  min-height: 60vh;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: #444;
  background: transparent;
}