/* --- 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/Image_20261128212248_344_12.png');
    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%;
    overflow: hidden;
    cursor: zoom-in;
}

.grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;      /* same as background-size: cover */
    object-position: center;
}

.grid-item.has-more {
    position: relative;
}

.more-link {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.more-link .arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.more-link:hover {
    background: rgba(0, 0, 0, 0.75);
}

.more-link:hover .arrow {
    transform: translateX(6px);
}

/* --- The Solid Overlapping Rectangle --- */
.solid-overlapping-card {
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 20%;                 /* your original width */
    min-width: 250px;

    box-sizing: border-box;
    height: auto;               /* grows taller to fit the text... */
    min-height: 60%;            /* ...but never shorter than before */
    max-height: 95vh;           /* ...up to this limit, then it scrolls */
    overflow-y: auto;           /* scroll inside the card if text is longer */

    background-image: url('../images/blue_yellow.jpg');
    color: #000000;
    padding: 70px 35px 40px;    /* extra top padding clears the curved corners */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    z-index: 10;

    border-top-left-radius: 150px;
    border-top-right-radius: 150px;

    display: grid;
    grid-template-rows: auto auto;  /* was 1fr 2fr, which forced fixed row sizes */
    align-content: start;
    gap: 20px;
}

/* --- Scrollbar Styling for the Card --- */
.solid-overlapping-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.4) transparent;
}

/* --- 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; 
}

/* --- 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;
  }
}

/* --- Lightbox --- */
.grid-item {
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;                      /* covers the whole screen */
    background: rgba(0, 0, 0, 0.85); /* the dimmed background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;                 /* above your nav bar and card (z-index: 10) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;           /* never stretches or crops */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.open .lightbox-img {
    transform: scale(1);           /* little zoom-in animation */
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
}