/* css styles */

/* css styles */

h3.box {
  display: inline-block;
  background-color: #ffffff;
  border: 2px solid #37678aff;   /* your blue border */
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  color: black
}

.grid .g-col-4 p,
.grid .g-col-6 p {
  height: 300px;            /* uniform box height */
  border-radius: 12px;      /* visible rounded corners */
  overflow: hidden;         /* clip the image to the rounded box */
  background: #fff;         /* clean letterbox background */
  display: flex;            /* center the image */
  align-items: center;
  justify-content: center;
  margin: 4px;              /* small outer gap */
}

/* Let the image shrink to fit without cropping */
.grid .g-col-4 p img,
.grid .g-col-6 p img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;       /* keep the whole image */
  display: block;
  border-radius: 0;          /* rounding is on the wrapper now */
}

.grid.grid-3 { 
  margin-bottom: 2rem;       /* 3-up sections: more breathing room */
}

.grid.grid-2 { 
  margin-bottom: 2rem;       /* 2-up sections: more breathing room */
}

/* General card styling */
.hover-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  aspect-ratio: 1 / 1;   /* keeps cards square */
  width: 100%;
  max-width: 400px;
  margin: auto;

  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 1rem;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* subtle text glow to improve contrast */
  text-shadow: 0 2px 6px rgba(0,0,0,.6);

  transition: transform 0.2s ease, filter 0.2s ease;
}

/* Example background-image cards with gradient overlay */
.card-lab1 {
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
                    url("uPs/images/lab1_1.jpg");
}
.card-lab2 {
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
                    url("uPs/images/lab2_1.jpeg");
}
.card-lab3 {
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
                    url("uPs/images/lab3_4.jpeg");
}
.card-lab4 {
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
                    url("uPs/images/lab4_speaker.jpeg");
}
.card-lab5 {
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
                    url("uPs/images/lab5_1.jpeg");
}

/* Hover effect: darken + slight lift */
.hover-card:hover {
  filter: brightness(85%);
  transform: translateY(-2px);
}

.img-left {
  float: left;
  margin: 0 15px 15px 0;   
  clear: left;            /* keeps multiple images from stacking wrong */
}