/*
 * Mobile-Responsive Stylesheet for My Teacher Finder Non-Profit
 * Converted from original styles.css to use modern, flexible layout techniques.
 */

/* Global Reset and Box Sizing */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  padding: 5px; /* From original inline style */
  /* FIX 1: Prevent horizontal scroll by setting overflow-x to hidden */
  overflow-x: hidden;
}

/* FIX 2: Correctly size the donations-start image */
.donations-start {
    /* Removed fixed width: 400px; */
    max-width: 100%; /* Ensure it never exceeds its container */
    height: auto;
}

/* --- Header Section (Logo and Donations Start) --- */

/* Use Flexbox for the header content to allow for easy stacking on mobile */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 90%;
    margin: 0 auto;
    padding: 7px; /* From original table cell padding */
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo-col img {
    max-width: 240px;
    height: auto;
    display: block;
}

.donations-col {
    text-align: right;
}

/* FIX 3: Remove conflicting max-width on the parent container image selector */
.donations-col img {
    /* max-width: 400px; - Removed, using .donations-start now */
    height: auto;
    display: block;
}

/* --- Top Images Section --- */

/* Replace the table with a Flexbox/Grid layout for the 6 images */
.nonprofit-top-images-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 20px;
}

.nonprofit-top-images-flex > div {
    flex: 1 1 150px; /* Allow items to grow/shrink, with a minimum width of 150px */
    max-width: 16.66%; /* 6 items per row */
    padding: 10px;
    text-align: center;
}

.nonprofit-top-images-flex img {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.3);
}

/* --- Main Content and Staff Sidebar --- */

/* Use Flexbox for the main content area (text/video and staff) */
.main-content-wrapper {
    display: flex;
    max-width: 90%;
    margin: 10px auto;
    padding: 10px;
    gap: 20px; /* Space between main content and staff */
    flex-wrap: wrap; /* Allow stacking on mobile */
}

.main-info-col {
    flex: 3; /* Takes up more space on desktop */
    /* FIX 4: Removed min-width: 60%; to prevent overflow on very small screens */
    min-width: 0; /* Allow it to shrink */
}

.staff-col {
    flex: 1; /* Takes up less space, but stays visible */
    /* FIX 5: Reduced min-width to 150px (staff image size) or removed entirely */
    min-width: 150px;
    text-align: center;
    line-height: 25px;
    font-weight: bold;
}

.staff-col img {
    width: 150px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 5px;
}

/* What Goes Back to Teachers Section (Text and Video) */
.what-goes-back-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 70px;
    flex-wrap: wrap; /* Allow stacking on mobile */
}

.what-goes-back-text {
    flex: 1;
    line-height: 30px;
    font-size: 22px;
    /* FIX 6: Reduced min-width from 300px to 0 */
    min-width: 0;
}

.what-goes-back-text span {
    font-weight: bold;
    font-size: 26px;
}

.what-goes-back-video {
    flex: 1;
    text-align: center;
    /* FIX 7: Reduced min-width from 350px to 0 */
    min-width: 0;
}

/* FIX 8: Ensure iframe is responsive by setting max-width on the iframe itself */
.what-goes-back-video iframe {
    max-width: 100%;
}

.donate-button {
    text-align: center;
    margin: 20px 0;
}

/* Three Red Boxes Section */
.three-red-boxes {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 150px;
    flex-wrap: wrap;
}

.three-red-boxes > div {
    flex: 1 1 300px; /* Each box should have a minimum width of 300px */
    max-width: 350px;
    text-align: center;
    margin: 10px; /* Add margin for spacing on all sides */
}

.three-red-boxes img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Media Queries for Mobile Screens (Max-width: 768px) --- */

@media (max-width: 768px) {
    /* Header: Stack logo and donations */
    .header-container {
        flex-direction: column;
        text-align: center;
        max-width: 100%; /* Use full width on mobile */
    }

    .donations-col {
        text-align: center;
        margin-top: 10px;
    }

    /* Top Images: Show 3 per row (or 2 if images are wide) */
    .nonprofit-top-images-flex > div {
        max-width: 50%; /* Changed to 2 per row for better spacing */
        flex: 1 1 50%;
    }

    /* Main Content: Stack main info and staff */
    .main-content-wrapper {
        flex-direction: column;
        max-width: 100%; /* Use full width on mobile */
        padding: 5px; /* Reduced padding */
    }

    .main-info-col,
    .staff-col {
        min-width: 100%;
    }

    /* Staff: Display staff members in a horizontal row or grid for better use of space */
    .staff-col {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        margin-top: 20px;
    }
    
    .staff-member {
        width: 150px; /* Fixed width for each staff member container */
    }

    /* What Goes Back to Teachers: Stack text and video */
    .what-goes-back-section {
        flex-direction: column;
        padding-top: 20px;
    }

    .what-goes-back-text,
    .what-goes-back-video {
        min-width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .what-goes-back-text {
        font-size: 18px;
        line-height: 24px;
    }
    
    .what-goes-back-text span {
        font-size: 22px;
    }

    /* Three Red Boxes: Stack vertically */
    .three-red-boxes {
        flex-direction: column;
        align-items: center;
        padding-top: 50px; /* Adjusted padding for mobile */
    }

    .three-red-boxes > div {
        max-width: 90%;
        margin-bottom: 20px;
        flex: 1 1 90%; /* Allow boxes to take up more width */
    }
    
    /* Ensure iframe is responsive */
    iframe {
        max-width: 100%;
        height: auto;
    }
}

/* Original styles that are still useful or need to be preserved */

.cloudbox {
    background-image: url("../images/cloud-background.jpg");
    background-size: 100% 100%;
    width: 100%;
    min-height: 500px;
    font-size: 18px;
    padding: 80px 80px 95px 90px;
    max-width: 90%;
    margin: 0 auto;
    border: 0px #000 solid;
    position: relative;
    z-index: 1;
}

.staff {line-height: 25px;font-weight: bold;}
.staff img {width:150px;height:auto;border-radius: 10px;}

.three-red-boxes img {
    width: 100%;
    height: auto;
}

/* Other unused/preserved styles from original styles.css */
input[type="checkbox"] {
  transform: scale(1.5);
  margin-right: 8px;
}
.banner2 {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ccc;
  height: 200px;
  background-image: url('../images/banner.jpg');
  background-size: cover;
  background-position: center;
  margin: 1rem;
}
.banner {width:100%;padding:0px;}
.container {
  max-width: 100%;
  margin: 0 auto;
}
.header {
  text-align: center;
  padding: 1rem;
}
.header img.logo {
  width: 200px;
  float: left;
  margin-left: 1rem;
  margin-top:30px;
}
.header img.teacher-photo {
  width: 200px;
  border-radius: 5%;
  float: right;
  margin-right: 1rem;
}
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}
.logocell {padding:10px 0px 0px 20px;}
.section-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  flex-wrap: wrap;
}
.box {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 20px;
  padding: 1rem;
  position: relative;
}
.contact-box {
  width: 619px;
  height: 633px;
}
.note-box {
  width: 402px;
  height: 633px;
}
.other-box {text-align: center;padding:150px 30px 0px 30px;font-size:20px;font-weight: bold;box-sizing: border-box;}
.box img {
  display: none;
}
.socialbutton {width:50px; height:50px;}
.socialicons {padding:10px 20px 0px 0px;}
.socialicons img {width:50px;height:50px;display:inline-block;margin:10px;}
.starbursts {position: relative;z-index: 10;margin-top:-100px;}
.sticky-box-1 {
  width: 360px;
  height: 400px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 10px;
}
.sticky-box-2 {
  width: 360px;
  height: 300px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 10px;
}
.sticky-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  margin-top: -14px;
}
.theworld {font-weight: bold;font-size:22px;font-style: italic;}
.topbutton {width:100%;height:auto;}
.topnav {
    text-align: center;
}
.topnav img {width:150px;display:inline-block;padding:10px 20px 10px 20px;}
