/* 1. The Global Foundation */
body {
    font-size: 100%; /* Default to 16px, but honors user settings  changd from */
    font-family: Nunito, arial, sans-serif;  
    color: black;
    background-color: #dcdcdc;
    line-height: 1.5; /* Added for better readability */
}

/* 2. Reset and Layout Rules */
* {
    box-sizing: border-box; 
    /* Removed font-size/family from here so they inherit from body */
}

/* 3. Typography Hierarchy */
h1 {
    font-size: 1.5rem; /* Using rem ensures it stays relative to the body 16px */
}

h2 {
    font-size: 1.3rem;
}

p {
    font-size: 1rem; /* This now matches the body 16px perfectly */
    margin-top: 0;
    margin-bottom: 1rem;
}

/* 4. Specialized Paragraphs & Links */
.copyright, .sp, .tiny, a.noter {
    font-size: 0.8rem;
}

p.topline {
    border-top: 1px solid #000000;
}

p.noter {
    text-align: right;
} 

p.textbox {
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
}

p.head {
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
}

/* 5. Navigation & Links */
a:link, a:visited {
    text-decoration: none;
    color: #660000;
    font-size: 1rem;
}

a.l1:hover, a.l1b:link, a.l1b:visited {
    color: #000000;
    font-weight: bold;
}

a.normal:link, a.normal:visited {
    font-size: 1rem;
    color: #000000;
}

/* 6. Grid & Flexbox Layouts */
.container2, .cont2c {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    column-gap: 10px;
}

.container3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0px;
    place-items: center;
}

.container2 div, .cont2c div, .container3 div {
    padding: 10px;
    text-align: left;
}

/*from google----*/

/* Match the class name in your PHP */
.newcontainer3 {
  display: grid;
  /* This forces 3 columns */
  grid-template-columns: repeat(3, 1fr); 
  gap: 15px;
  
  /* To make the images smaller, reduce this total width. 
     600px is a good starting point for 3-wide images. */
  max-width: 600px; 
  margin: 0 auto; 
  width: 100%;
}

.grid-item {
  min-width: 0; /* Prevents long text from blowing out the grid width */
}

.grid-item a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers the text and image */
  text-align: center;
}

.caption {
  color: #660000;
  margin: 5px 0;
  font-size: 0.9em;
  /* This ensures that even if one caption is 1 line and another is 2, 
     the images stay perfectly aligned in their rows. */
  min-height: 2.8em; 
  line-height: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1; 
  overflow: hidden;
  background-color: #eee; /* Light grey placeholder while images load */
}

.img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
}

/*------------------------*/




.flexcontainer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 50px;
}

.flexitem {
    display: flex;
    justify-content: left;
    align-items: left;
    flex-flow: column;
}

.fleximage {
    max-height: 300px;
    max-width: 300px; 
    height: auto%;
    width: auto;
}

/*new google suggested flexbox layout--------------------------*/

  .newcontainer {
    display: flex;
    flex-wrap: wrap; /* Allows the wrapping behavior */
    width: 100%;
  }

  
  .left-col, .right-col {  /*not sure about the right-col bit*/
    /* flex-grow: 1, flex-shrink: 1, flex-basis: 400px */
    flex: 1 1 400px; 
    box-sizing: border-box;
    padding: 15px;
  }

  .left-col img, .right-col img {
    width: 100%;       /* Fills the 50% container */
    height: auto;      /* Maintains aspect ratio */
    display: block;
    max-width: 100%;   /* Ensures it never overflows its cell */
  }





/*--------------------------------------------------------------*/

/* 7. Image & Container Widths */
.varsizepic, .imgdetail {
    width: 80%;
}

.fortypc { width: 40%; margin: auto; padding: 10px; }
.sixtypc { width: 60%; margin: auto; padding: 10px; }
.seventypc { width: 70%; margin: auto; padding: 10px; }
.eightypc { width: 80%; margin: auto; padding: 10px; }
.ninetypc { width: 90%; margin: auto; padding: 10px; }

.imgth { height: 200px; }
.imgthmax {
    max-height: 180px;
    max-width: 180px;
    height: auto;
    width: auto;
}
