/* --- Section 1: Full-Screen Hero Image --- */
/* --- Main Hero Section Container --- */
.hero-section {
    width: 100%;
    height: 180vh; /* Made it longer (130% of screen height) so it feels spacious */
    display: flex;
    flex-direction: column; /* Stacks upper and lower halves vertically */
    position: relative; /* Essential so the overlapping rectangle can anchor to this section */
}

/* --- Upper Half (Your Image) --- */
.upper-half {
    height: 60%; /* Takes up exactly half of the 130vh */
    width: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('../images/student/img01.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Position your School text beautifully on the top-left */
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;

    position: sticky; 
    overflow: hidden;
    top: 0;
    z-index:1;/* lower than the section that follows */
}

/* Your specific School heading styles */
.hero-content {
    padding-top: 100px; /* Leaves space for your fixed top nav bar */
    padding-left: 60px;
    color: #ffffff;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Lower Half (Your Solid White Block) --- */
.lower-half {
    height: 40%; /* Takes up the other half of the 180vh */
    width: 100%;
    background-color: #fdffe6; 
    display: flex;
    justify-content: flex-end; 
    align-items: center; /* This will now perfectly center the grid vertically */
    padding: 0; 
    overflow: hidden;
    position: relative;
    z-index: 3;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    
    width: 60%;
    height: 85%;  /* ← was 90vh, now relative to .lower-half's actual height */
    
    margin-right: 10%;
    margin-top: auto;    /* ← pushes it away from the top */
    margin-bottom: auto
}

.grid-item {
    display: block;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- The Solid Overlapping Rectangle --- */
.solid-overlapping-card {
    position: absolute;
    
    /* Pin it completely to the bottom edge */
    bottom: -0px;  
    
    /* Offset it from the left edge to align with your text */
    left: 5%; 
    width: 20%; 
    min-width: 250px;
    
    /* 75% height means it fills the bottom 50% and perfectly takes up half of the top 50% */
    height: calc(60% + 0px);
    
    background-image: url('../images/blue_yellow.jpg'); /* Dark solid block */
    color: #000000;
    padding: 40px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15); /* Shadow shifted upward slightly */
    z-index: 10;

    /* make the top edges font-smooth*/
    border-top-left-radius: 150px;  /* Smooths the top-left corner */
    border-top-right-radius: 150px;
    
    /* --- Inner Layout Grid --- */
    display: grid;
    /* Since 1/3 of this card is over the image and 2/3 is over the white block, 
       we can adjust the row ratios to match! */
    grid-template-rows: 1fr 2fr; 
    gap: 20px;
}

/* --- Top Section of the Card (Overlapping the Image) --- */
.intro-text {
    font-size: 12px;
    line-height: 1.6;
    color: #000000; 
    font-weight: 600;
    align-self: center; 
    margin-top: 30px;
}

/* --- Bottom Section of the Card (Fully covering the white block area) --- */
.main-body-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligns text cleanly from the top of this zone */
    padding-top: 10px;
}

.main-body-text h2 {
    font-size: 17px;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.main-body-text p {
    font-size: 12px;
    line-height: 1.5;
    color: #000000;
    margin-bottom: 12px;
}

.main-body-text p:last-child {
    margin-bottom: 0;
}

@media (max-width: 1000px) {
  .hero-section {
    height: auto;
  }

  .upper-half {
    height: 108vh; 
  }
  .lower-half {
    height: auto;
    order: 3; /* now appears AFTER the card */
    padding: 20px 0; /* a little breathing room since it's no longer squeezed between things */
  }

  .hero-content {
    padding-top: 60px;
    padding-left: 24px;
  }

  .hero-content h1 {
    font-size: 3.5rem;
  }

  .photo-grid {
    width: 90%;
    margin: 0 auto;
    grid-template-columns: repeat(2, 1fr); /* 2 columns reads better than 3 on mobile */
    height: auto;
    aspect-ratio: 3 / 2; /* keeps the grid items from going flat/squished without a fixed height */
  }

  .solid-overlapping-card {
    position: static;
    order: 2; /* appears BEFORE the grid now */
    width: 90%;
    min-width: 0;
    height: auto;
    margin: 20px auto;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  }

  .intro-text,
  .main-body-text p {
    font-size: 0.85rem;
  }
}