/* ============================
   General Reset / Normalize
   ============================ */

html {
    scroll-behavior: smooth;
}

/* Progressive Enhancement */
.no-js .js-only {
    display: none !important;
}

.js .no-js-only {
    display: none !important;
}

/* ============================
   Search Functionality
   ============================ */
.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-top: 0.5rem;
}

#searchInput {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    background: white;
}

#searchInput:focus {
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover,
.search-result-item.highlighted {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: bold;
    color: #007cba;
    margin-bottom: 2px;
}

.search-result-description {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

.search-result-type {
    display: inline-block;
    background: #e0e0e0;
    color: #333;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.search-result-type.article {
    background: #e3f2fd;
    color: #1976d2;
}

.search-result-type.glossary {
    background: #f3e5f5;
    color: #7b1fa2;
}

.search-result-type.topic {
    background: #fff3e0;
    color: #f57c00;
}

/* Autocomplete specific styling */
.autocomplete-item .search-result-description {
    font-style: italic;
    color: #999;
}

.autocomplete-item .search-result-title {
    font-size: 14px;
}

.search-no-results {
    padding: 15px 12px;
    color: #666;
    text-align: center;
    font-style: italic;
}

.search-result-item mark {
    background-color: #ffeb3b;
    color: #333;
    padding: 1px 2px;
    border-radius: 2px;
}

/* ============================
   Enhanced Mobile Responsiveness
   ============================ */

/* Header responsive improvements */
.header-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
}

.header-center {
    justify-self: center;
}

@media (max-width: 768px) {
    .header-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: center;
        gap: 0.5rem;
    }
    
    .header-center {
        order: 2;
        justify-self: stretch;
    }
    
    .header-content a:first-child {
        order: 1;
        justify-self: center;
    }
    
    .header-content a:last-child {
        order: 3;
        justify-self: center;
    }
    
    .search-container {
        max-width: none;
        margin-top: 0.25rem;
    }
    
    .header-center h1 {
        font-size: 1.5rem;
        margin: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.5rem;
    }
    
    .header-center h1 {
        font-size: 1.2rem;
    }
    
    #searchInput {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 12px;
    }
}

/* Advanced Grid Layout Improvements */
.nav-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* Smaller gap for desktop/tablet */
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Touch targets only on mobile */
@media (max-width: 600px) {
    .nav-box {
        gap: 0.5rem; /* Larger gap for mobile touch */
    }
    
    .nav-btn {
        min-height: 44px; /* Touch target minimum for mobile */
    }
}

.glossary-box {
    display: flex;
    flex-direction: column;
}

.glossary-title-box {
    flex-shrink: 0;
}

.glossary-terms {
    flex: 1;
    overflow-y: auto;
}

.glossaryterms li {
    display: flex;
    align-items: center;
}

/* Touch targets only on mobile */
@media (max-width: 600px) {
    .glossaryterms li {
        min-height: 44px; /* Touch target minimum for mobile */
    }
}

/* Enhanced Grid Layout for Main Content */
@media (min-width: 1025px) {
    .main-box {
        display: grid;
        grid-template-areas: 
            "nav center glossary"
            "nav center donation";
        grid-template-columns: minmax(200px, 1fr) minmax(400px, 3fr) minmax(200px, 1fr);
        grid-template-rows: 1fr auto;
        gap: 1rem;
        align-items: start;
    }

    .left-box {
        grid-area: nav;
        display: flex;
        flex-direction: column;
    }

    .center-box {
        grid-area: center;
    }

    .right-box {
        grid-area: glossary;
    }

    .donation-box {
        grid-area: donation;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-box {
        display: grid;
        grid-template-areas: 
            "nav center"
            "glossary center"
            "donation center";
        grid-template-columns: minmax(250px, 1fr) minmax(350px, 2fr);
        grid-template-rows: auto auto auto;
        gap: 1rem;
    }
}

* {
    box-sizing: border-box;
}

/* ============================
   Body Styles
   ============================ */
   
   .phone-only {
    display: none;
  }
  
    .desktop-only {
    display: block;
  }
  


body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevents horizontal scrolling */
    background-color: #FFFFCC; /* Header background color */
}

/* ============================
   Typography Styles
   ============================ */

h2 {
    text-align: center;
	color: #333;
}

h3 {
    font-size: 14pt;
	margin-left: 0; /* No indent for top-level sections */
    font-weight: bold;
    text-transform: uppercase;
}

h4 {
    font-size: 14pt;
	margin-left: 3rem; /* Indent one level */
	font-weight: normal; /* Remove bold */
}

h5 {
    font-size: 14pt;
	margin-left: 6.5rem; /* Indent further */
	font-weight: normal; /* Remove bold */
    font-style: italic;
}

h6 {
    font-size: 12pt;
	margin-left: 10rem; /* Indent more */
	font-weight: bold; /* Remove bold */
}

/* Custom heading styles */
.h7 {
    font-size: 12pt; /* Adjust the size */
    font-weight: bold;
    margin-left: 13rem;
}

.h8 {
    font-size: 12pt; /* Adjust the size */
	font-weight: bold; /* Remove bold */
    font-style: italic;
    margin-left: 16rem;
}

article h4 {
    font-size: 14pt;
	margin-left: 0in; /* Indent one level */
	font-weight: normal; /* Remove bold */
}

article h5 {
    font-size: 14pt;
	margin-left: 0.25in; /* Indent further */
	font-weight: normal; /* Remove bold */
    font-style: italic;
}

article h6 {
    font-size: 12pt;
	margin-left: 0.5in; /* Indent more */
	font-weight: bold; /* Remove bold */
}

/* Custom heading styles */
article .h7 {
    font-size: 12pt;
    font-weight: bold;
    margin-left: 1in;
    margin-top: 0.8em;
    margin-bottom: 0.4em;
}


.h8 {
    font-size: 12pt; /* Adjust the size */
	font-weight: bold; /* Remove bold */
    font-style: italic;
    margin-left: 16rem;
}


h2, h3, h4, h5, h6, .h7, .h8 {
    margin-top: 0.0rem;  /* Reduce the space above each heading */
    margin-bottom: 0.2rem;  /* Reduce the space below each heading */
}
/* ============================
   Custom heading styles in Content-Articles
   ============================ */
.content-articles h3 a img,
.content-articles h4 a img,
.content-articles h5 a img,
.content-articles h6 a img {
    width: 1cm; 
    height: auto;
    vertical-align: middle; /* Aligns image with text */
    margin-left: 10em; /* Space between text and icon */
}

.content-articles h3 a,
.content-articles h4 a,
.content-articles h5 a,
.content-articles h6 a {
    position: relative; /* This is necessary for the tooltip to position correctly */
    display: inline-block; /* Keeps the image and text inline */
}

.content-articles h3,
.content-articles h4,
.content-articles h5,
.content-articles h6 {
    display: inline-flex;
    align-items: center; /* Aligns the image with the text */
	margin-right: 4em; /* Apply margin to h3 for better control */
    display: inline-flex;
    align-items: center;
    gap: 4rem; /* Adjust gap directly on h3 */
}

/* Custom Tooltip on hover */
.content-articles h3 a img:hover::after,
.content-articles h4 a img:hover::after,
.content-articles h5 a img:hover::after,
.content-articles h6 a img:hover::after {
    content: attr(title); /* Displays the title attribute as tooltip text */
    position: absolute;
    top: -1.5em; /* Positions the tooltip above the image */
    left: 0;
    background-color: rgba(0, 0, 0, 0.7); /* Dark background */
    color: white; /* White text */
    padding: 5px;
    border-radius: 5px;
    font-size: 0.8em;
    white-space: nowrap; /* Prevents text from wrapping */
    z-index: 999;
    display: block;
	opacity: 1; /* Make the tooltip visible instantly */
}




ul {
	font-size: 12pt;
    padding-left: 20px;
}

/* ============================
   Header Styles
   ============================ */

.header-box {
    background-color: #FFFFCC; /* Light cream yellow */
    color: #333;
}

.header-content {
    max-width: 816px; /* Match body width */
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Align logos on left and right */
    padding: 1rem 0; /* Reduced padding for proper height */
}

.header-content a img {
    cursor: pointer;
    transition: filter 0.3s ease;
}

.header-content a img:hover {
    filter: brightness(1.2);
}


header img {
    width: 2in; /* Maintain aspect ratio */
	height: auto;
    max-width: 100%;
}

header h1 {
    margin: 0;
    font-size: 2.5rem; /* Larger text for the title */
    text-align: center; /* Center title text between logos */
    flex: 1; /* Ensure title stretches between the logos */
}

/* ============================
   Main Box Styles
   ============================ */

.main-box {
    display: flex; /* Flex box */
    justify-content: space-between; /* Align the children (left-box and box) */
	align-items: flex-start;  /* Align from top, let each box be its natural height */
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    gap: 1rem;
	
}


.center-box {
    width: min(816px, 100%);  /* Never wider than container - prevents horizontal scroll */
    max-width: 100%;
    flex-shrink: 0;
    flex-grow: 0;	
	margin: 0 auto;
    background: #FFF9E5;
    padding-top: 0.5in;
	padding-right: 1in;
	padding-bottom: 1rem;
	padding-left: 1in;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-height: 70vh;
    overflow-y: auto;
	scroll-padding-top: 40px;
}






/* ============================
   Side Box Styles
   ============================ */
.left-box {
     flex: 1 1 20%;
	min-width: 150px;
	max-width: 300px;
    background-color: #FFFFCC;
    box-sizing: border-box;

    padding: 0.5rem;
    padding-bottom: 1rem;

    display: flex;
    flex-direction: column;
	max-height: 70vh; /* Limit the height of the left box */
	overflow-y: auto;
    flex-shrink: 0;
    align-self: stretch;
}


/* Style for nav-box */
.nav-box {
  box-sizing: border-box;
  margin-bottom: 1rem; /* Space between the boxes */
/*    border: 1px solid #cccccc;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); */
/*  border-top: .5px solid #ccc; */
/*  border-bottom: 2px solid #ccc; */
  padding: 0.05rem; /* Optional: add some inner spacing */
  padding-bottom: 0in;
  margin-bottom: 0.25in; /* Spacing from the next element */
/* height: 4in;                /* Set fixed height */
  overflow-y: auto;           /* Allow scrolling if buttons exceed 4in */
flex: 1 1 100%;
min-width: 150px;
max-width: 300px;
width: auto;
  min-height: 200px;          /* Restore original nav-box constraints */

}

/* Navigation buttons */
.nav-btn {
  display: block;
  width: 90%;                   /* Good size for mobile */
  max-width: 200px;             /* Good max width for mobile */
  padding: 0.2rem 0.5rem;       /* Good padding for mobile touch */
  margin: 0.3rem auto;          /* Good spacing for mobile */
  font-size: 1rem;              /* Slightly bigger for mobile */
  font-weight: bold;             /* Bold text for mobile */
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  
  /* Add daylight lemony color cues */
  background: #f8f8f0;          /* Very light warm background */
  border: 2px solid #e8e8cc;    /* Subtle lemony border */
  color: #333;                  /* Dark text for contrast */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle depth */
  
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: #f0f0e6;          /* Slightly more lemony on hover */
  border-color: #d4d4aa;        /* Stronger lemony border on hover */
  transform: translateY(-1px);  /* Subtle lift effect */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Desktop and Tablet: Make nav buttons fill the nav-box efficiently */
@media (min-width: 601px) {
  .nav-btn {
    width: 95% !important;                   /* Fill nav-box horizontally */
    max-width: 200px !important;             /* Allow wider buttons */
    padding: 0.15rem 0.3rem !important;     /* More vertical padding to fill box */
    margin: 0.32rem auto !important;        /* Match production spacing between buttons */
    font-size: 0.8rem !important;           /* Slightly larger readable font */
    font-weight: bold !important;           /* Bold text */
  }
}


.right-box {
    flex: 1 1 20%;
	min-width: 150px;
	max-width: 300px;
    background: #FFF9E5;
  padding: 0.5rem 1rem 1rem 1rem; /* top, right, bottom, left */
   /* border: 1px solid #cccccc; 
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); */
    flex-shrink: 0; /* Prevent shrinking */
    max-height: none; /* Limit the height of the box */
    overflow-y: auto; /* Enable vertical scrolling if content overflows */
}
	/* Style for donation-box */
	
.donate-button img {
  display: block;
  margin: 0 auto;
  width: 95%; /* Expand to fill more of the button area */
  max-width: 180px; /* Set a reasonable maximum size */
  height: auto;
}

 
 .donation-box {
  display: flex;
  align-items: center;   /* vertical centering */
  justify-content: center;  /* horizontal centering */
  height: auto;              /* Let content determine height */
    padding: 0.5rem 1rem 0.5rem 1rem; /* Reduced bottom padding */

}

.donate-button {
  display: block;
  margin: 0 auto 0.5rem auto;
  padding: 0;
  border: none;
  background: none;
  max-width: 100%;
  height: auto;
}


.donate-button img {
  display: block;
  margin: 0 auto;
  width: 95%; /* Expand to fill more of the button area */
  max-width: 180px; /* Set a reasonable maximum size */
  height: auto;
}

.donate-wrapper {
  margin: 0;
  padding: 0;
  text-align: center;
}




/* Glossary Terms Styles */


.glossary-definitions h3 {
	margin-top: 1em; /* Or even 0 if you want them very tight */
    margin-bottom: 0em; /* Adjust this as needed */
} 

.glossary-definitions p {
    margin-top: 0em; /* Or even 0 if you want them very tight */
	margin-bottom: 1.5em; /* Adjust this as needed */

}


.glossary-box {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem; /* Space between the boxes */
    border: 1px solid #cccccc;
/*    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); */
/*  border-bottom: 2px solid #ccc; */
  padding: 0; /* Optional: add some inner spacing */
    padding-left: 0;  /* Prevent unintentional indent */
  padding-bottom: 0.25in;
 /* margin-bottom: 0.1rem; /* Spacing from the next element */
  overflow-y: auto;           /* Allow scrolling if buttons exceed 4in */
     position: relative;
    margin-left: 0;
	 background: #fff;
	 flex-grow: 1;              /* Grow to fill remaining space in left-box */
}

/* Optional styling for glossary-box */
.glossary-box ul {
  list-style-type: none;
  padding-left: 0.5rem;
}


.glossary-title-box {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
  padding: 0.5em;
  margin-bottom: 0;
      padding-left: 10px;
    padding-right: 10px;

  border-bottom: 1px solid #ccc;
  width: 100%;
  text-align: center;
}

.glossary-title-box h2 {
  margin: 0;
  padding: 0;
}

/* Ensure no gap between title box and glossary terms list */
.glossary-terms {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
}
/* Glossary list styles */

.glossaryterms {
    padding: 10px 10px 5px 10px;
    margin: 10px 10px 2px 0px;
    list-style: none;
    background: #fff;
    position: relative;
    cursor: pointer;
    margin-left: 0em;
    margin-right: 0;
    padding-right: 1rem;
    font-family: Arial, sans-serif;
    font-size: 11pt;
}

.glossaryterms ul {
    padding: 0 0 5px 0;
    /* margin: 10px 10px 2px 0px; */
    list-style: none;
    font: 12px mono;
    border: 1px solid #000;
    border-color: #157925 #074e12 #074e12 #157925;
    border-width: 1px 2px 2px 1px;
    background: #fff;
    position: relative;
    cursor: pointer;
    margin-left: 0em;
    margin-right: 0;
}

.glossaryterms li,
.glossary-box li {
    width: auto;
    max-width: 100%;
    background: #fff;
    text-indent: 0;
    padding-left: 1.1em;
    text-indent: 0em;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    line-height: 2em;
    position: relative;
}


.glossaryterms li a {
    display: inline-block;
    width: 100%;
    color: blue;
    padding-left: 0em;
    text-decoration: none;
}

.glossaryterms li a:hover {
    text-decoration: underline;
    color: #0000cc;
}


/* ============================
   Footer Styles
   ============================ */
   
 .footer-box {
    background-color: #ffffff;
    padding: 20px;
    text-align: center;
    min-height: 100px;
    position: relative;
}

footer {
    position: relative;
    bottom: 0;
    width: 100%;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer Links */
.footer-links ul {
    list-style: none; /* Remove bullets */
    padding: 0;
    text-align: center; 
    display: inline-block; /* Keep it centered as a block */
}

.footer-links > ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links ul ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links a {
    text-decoration: none;
    color: blue;
}

.footer-links a:hover {
    text-decoration: underline;
	color: blue;

}

.footer-links a:visited {
    text-decoration: underline;
	color: purple; /* For visited links */

}

.footer-links a.clicked {
  color: purple;
  text-decoration: underline;
}

.footer-links li {
    margin-bottom: 0.5rem;
}




/* ============================
   Responsive Design
   ============================ */
   
   
   
/* Default (Desktop greater than 1366px) */
.content-articles a img {
    width: 1cm;  /* For desktop, the image in the link is 1cm */
    height: auto;
}

html {
	font-size: 100%;
}



/* Mid-size desktops and large tablets: 1025–1366px */
@media (min-width: 1025px) and (max-width: 1366px) {
  .main-box {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;  /* Let each box be its natural height */
  }

  .left-box,
  .right-box {
    flex-shrink: 1;
    flex-grow: 0;
    max-width: 20%;         /* Try 15% if still too wide */
    min-width: 150px;       /* Prevent disappearing */
    box-sizing: border-box;
    padding: 1rem;
  }

  .center-box {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 60%;         /* Allows it to expand */
    padding: 1rem;
  }

  .nav-box,
  .glossary-box {
    font-size: 1rem;
  }
}


/* < 1024 */


/* Tablet (screen width up to 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
	
	html {
		font-size: 95%;
	}
	
    /* Adjust header image for tablets */
    header img {
        height: auto; /* Adjust header image height for tablet screens */
        width: 100%;
		max-width: 120px;
    }
	
	.header-content {
		flex-wrap: wrap;
		justify-content: center;
		text-align: center;
	}
	
		header h1 {
		font-size: 2rem;
		width: 100%;
		margin-top: 1rem;
	}

 .main-box {
	flex-direction: row;
	gap: 1rem;
}


   .left-box {
	width: 20%;
}
.right-box {
	width: 25%;
}

	
	.left-box, .nav-box, .glossary-box {
		font-size: 0.9rem; /* or try 85% */
	}


	.center-box {
		width: 50%;
		padding: 1rem;
		font-size: 85%;
	}
	
	
    /* Adjust image size in Content-Articles for tablets */
    .content-articles a img {
        width: 0.8cm; /* Adjust image size for tablets */
        height: auto;
    }

    footer {
        padding: 1rem; /* Adjust footer padding for tablet screens */
    }
}




/* ====================================================================== */

/* Enhanced Mobile Layout */
@media (max-width: 600px) {
   .phone-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
  
  html {
    font-size: 85%;
  }

  body {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .header {
    order: 1;
    flex-shrink: 0;
  }

  /* Override grid layout for mobile */
  .main-box {
    display: flex !important;
    flex-direction: column;
    order: 2;
    flex: 1;
    padding: 0.5rem;
    gap: 1rem;
  }

  .left-box,
  .right-box {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-width: auto;
  }

  .center-box {
    order: 1;
    width: 100%;
    padding: 1rem;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
  }

  .left-box {
    order: 2;
  }

  .nav-box {
    width: 100%;
    padding: 0.5rem 1rem;
    max-height: none;
    margin-bottom: 1rem;
  }
  
  .nav-btn {
    display: block !important;
    width: 95% !important;
    max-width: 200px !important;
    margin: 0.3rem auto !important;
    padding: 0.2rem 0.5rem !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    text-align: center;
  }

  .right-box {
    order: 3;
  }

  .donation-box {
    order: 4;
    margin: 1rem 0;
    padding: 1rem;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
  }

  .glossary-box {
    width: 100%;
    max-height: 40vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
  }
  
  .glossary-title-box {
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 0.75rem;
  }
  
  .glossaryterms li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
  }
  
  .glossaryterms li:last-child {
    border-bottom: none;
  }
  
  .glossaryterms li a {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  /* Prevent any layout-wide flex container (like body or main-box) from forcing height */
  body, .main-box {
    display: block !important;
  }



  .advertisement-box {
    display: none !important;
  }

  .footer-box {
    order: 5;
    flex-shrink: 0;
    padding: 1rem;
  }
  
  /* Enhanced touch interactions */
  .nav-btn,
  .glossaryterms li a {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
  }
  
  /* Improved scrolling on iOS */
  .center-box,
  .glossary-box {
    -webkit-overflow-scrolling: touch;
  }

}





#contactModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
  background-color: #fff;
  color: #333;
  margin: 10% auto;
  padding: 1.5em;
  border-radius: 8px;
  width: 90%; max-width: 500px;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}
.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 0.5em;
  margin-bottom: 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
}
.modal-content button {
  background-color: #005f7f;
  color: white;
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.close-btn {
  position: absolute;
  right: 1em;
  top: 0.5em;
  font-size: 1.5em;
  cursor: pointer;
  user-select: none;
  z-index: 1000; /* Add this line */

}
.close-btn:hover,
.close-btn:focus {
  color: red;
}

/* ====================================================================== */
/* LANDSCAPE ORIENTATION FIXES */
/* ====================================================================== */

/* Landscape Phones: Wide but short screens (480px-900px wide, max 500px tall) */
@media (min-width: 480px) and (max-width: 900px) and (max-height: 500px) {
  body {
    padding: 0 0.5rem;  /* Less horizontal padding */
  }
  
  .main-box {
    padding: 0.5rem;   /* Reduce padding to save vertical space */
    gap: 0.5rem;
  }
  
  .nav-box {
    min-height: auto;  /* Remove height constraints */
    max-height: 120px; /* Limit height in landscape */
    overflow-y: auto;
  }
  
  .nav-btn {
    padding: 0.1rem 0.3rem !important;  /* Smaller buttons */
    margin: 0.1rem auto !important;     /* Tighter spacing */
    font-size: 0.7rem !important;       /* Smaller text */
  }
  
  .glossary-box {
    max-height: 150px; /* Limit glossary height in landscape */
  }
  
  .center-box {
    padding: 0.5rem 1rem; /* Reduce vertical padding */
  }
}

/* Tablet Landscape: Wide tablets in landscape mode */
@media (min-width: 1024px) and (max-height: 800px) {
  .nav-box {
    min-height: 150px;  /* Shorter nav-box for landscape */
  }
  
  .glossary-box {
    max-height: 200px;  /* Limit glossary height */
  }
  
  .main-box {
    padding: 0.5rem 1rem; /* Optimize padding for wide-but-short */
  }
}

/* Short screens in general - optimize vertical space usage */
@media (max-height: 600px) {
  .header-box {
    padding: 0.5rem 0; /* Reduce header height */
  }
  
  .main-box {
    padding: 0.5rem;   /* Less vertical padding */
  }
  
  .nav-box {
    min-height: auto;  /* Remove min-height constraints */
    padding: 0.25rem;
  }
  
  .center-box {
    max-height: 60vh;  /* More screen space for content */
    padding-top: 0.25in;
    padding-bottom: 0.25in;
  }
  
  .footer-box {
    padding: 0.5rem 0; /* Reduce footer height */
  }
}

/* Very wide screens - prevent excessive stretching */
@media (min-width: 1600px) {
  .main-box {
    max-width: 1400px;  /* Prevent excessive width */
    margin: 0 auto;
  }
}

/* ============================
   Print Styles for Articles
   ============================ */
@media print {
  /* Hide non-essential elements */
  .nav-box,
  .glossary-box,
  .donation-box,
  .header-content a,
  .search-container,
  .footer-links,
  .advertisement-box {
    display: none !important;
  }
  
  /* Simplify header for printing */
  .header-box {
    background: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .header-center h1 {
    color: black !important;
    font-size: 18pt !important;
    text-align: center;
    margin: 0.5in 0;
  }
  
  /* Optimize main content for print */
  body {
    background: white !important;
    font-size: 12pt;
    line-height: 1.4;
    color: black;
    margin: 0;
    padding: 0;
  }
  
  .main-box {
    display: block !important;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  
  .center-box {
    width: 100% !important;
    max-width: none !important;
    padding: 0.5in !important;
    margin: 0 !important;
    background: white !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  /* Article typography for print */
  .center-box h2 {
    font-size: 16pt;
    margin-top: 0.3in;
    margin-bottom: 0.2in;
    page-break-after: avoid;
  }
  
  .center-box h3 {
    font-size: 14pt;
    margin-top: 0.25in;
    margin-bottom: 0.15in;
    page-break-after: avoid;
  }
  
  .center-box h4,
  .center-box h5,
  .center-box h6 {
    font-size: 12pt;
    margin-top: 0.2in;
    margin-bottom: 0.1in;
    page-break-after: avoid;
  }
  
  .center-box p {
    margin-bottom: 0.15in;
    orphans: 3;
    widows: 3;
  }
  
  .center-box ul,
  .center-box ol {
    margin-bottom: 0.15in;
  }
  
  .center-box li {
    margin-bottom: 0.05in;
  }
  
  /* Handle page breaks */
  .center-box h2,
  .center-box h3,
  .center-box h4,
  .center-box h5,
  .center-box h6 {
    page-break-inside: avoid;
  }
  
  /* Hide interactive elements in articles */
  .content-articles a img {
    display: none !important;
  }
  
  /* Ensure links are visible in print */
  a {
    color: black !important;
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #666;
  }
  
  /* Hide URL for internal links */
  a[href^="/"]:after,
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }
  
  /* Print footer */
  .footer-box {
    margin-top: 0.5in;
    padding: 0.2in 0;
    border-top: 1pt solid black;
    text-align: center;
    font-size: 10pt;
  }
  
  /* Add print timestamp */
  .footer-box:after {
    content: "Printed from TenantIdeas.com on " date();
    display: block;
    margin-top: 0.1in;
    font-size: 9pt;
    color: #666;
  }
  
  /* Force background colors for important elements */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ============================
   Dark Mode Styles
   ============================ */

/* Dark mode CSS variables */
:root {
  --bg-color: #FFFFCC;
  --text-color: #333;
  --center-bg: #FFF9E5;
  --nav-bg: #FFFFCC;
  --glossary-bg: #fff;
  --glossary-title-bg: #f8f9fa;
  --border-color: #ddd;
  --link-color: blue;
  --link-hover: #0000cc;
  --button-bg: #f0f0f0;
  --button-hover: #e0e0e0;
}

[data-theme="dark"] {
  /* Background colors with warm undertones (hinting at lemony daytime theme) */
  --bg-color: #1a1816;          /* Very dark warm gray (hints at lemony) */
  --text-color: #f0f0e8;        /* Warm white (hints at cream) */
  --center-bg: #2a2926;         /* Dark warm gray for content areas */
  --nav-bg: #242220;            /* Darker warm gray for navigation */
  --glossary-bg: #2f2f2a;       /* Slightly different warm gray for contrast */
  --glossary-title-bg: #3a3a32; /* Medium warm gray for headers */
  
  /* Border and accent colors with subtle brand hints */
  --border-color: #4a4a42;      /* Warm gray borders (visible contrast) */
  --accent-color: #4a4840;      /* Slightly more yellow-tinted for brand hint */
  
  /* Link colors that hint at the brand while being accessible */
  --link-color: #8eb3ff;        /* Lighter blue (better contrast) */
  --link-hover: #a3c4ff;        /* Even lighter blue on hover */
  
  /* Button colors with much better contrast */
  --button-bg: #3d3d35;         /* Medium warm gray (good contrast) */
  --button-hover: #4a4a42;      /* Lighter warm gray on hover */
}

/* Apply dark mode variables */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.header-box {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.center-box {
  background: var(--center-bg);
  color: var(--text-color);
}

.left-box {
  background-color: var(--nav-bg);
}

[data-theme="dark"] .nav-box {
  background: var(--nav-bg) !important;
}

/* Nav buttons use original styling, dark mode only changes colors */
[data-theme="dark"] .nav-btn {
  background: var(--button-bg) !important;
  border: 2px solid var(--border-color) !important;
  color: var(--text-color) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important; /* Stronger shadow for dark mode */
}

[data-theme="dark"] .nav-btn:hover,
[data-theme="dark"] .nav-btn:focus {
  background: var(--button-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) !important;
}

/* Dark mode: Light up borders with daylight colors on hover (like search box focus) */
[data-theme="dark"] .nav-btn[style*="hsl(44, 93%, 60%)"]:hover,
[data-theme="dark"] .nav-btn[style*="hsl(44, 93%, 60%)"]:focus {
  border-color: hsl(44, 93%, 75%) !important; /* Home - Bright yellow */
  box-shadow: 0 0 8px hsla(44, 93%, 75%, 0.4) !important;
}

[data-theme="dark"] .nav-btn[style*="hsl(180, 84%, 70%)"]:hover,
[data-theme="dark"] .nav-btn[style*="hsl(180, 84%, 70%)"]:focus {
  border-color: hsl(180, 84%, 80%) !important; /* Disclaimer - Light cyan */
  box-shadow: 0 0 8px hsla(180, 84%, 80%, 0.4) !important;
}

[data-theme="dark"] .nav-btn[style*="hsl(189, 78%, 60%)"]:hover,
[data-theme="dark"] .nav-btn[style*="hsl(189, 78%, 60%)"]:focus {
  border-color: hsl(189, 78%, 75%) !important; /* Terms of Use - Light blue */
  box-shadow: 0 0 8px hsla(189, 78%, 75%, 0.4) !important;
}

[data-theme="dark"] .nav-btn[style*="hsl(6, 100%, 65%)"]:hover,
[data-theme="dark"] .nav-btn[style*="hsl(6, 100%, 65%)"]:focus {
  border-color: hsl(6, 100%, 80%) !important; /* Privacy - Light coral/pink */
  box-shadow: 0 0 8px hsla(6, 100%, 80%, 0.4) !important;
}

[data-theme="dark"] .nav-btn[style*="hsl(48, 89%, 60%)"]:hover,
[data-theme="dark"] .nav-btn[style*="hsl(48, 89%, 60%)"]:focus {
  border-color: hsl(48, 89%, 75%) !important; /* Contact Us - Bright golden */
  box-shadow: 0 0 8px hsla(48, 89%, 75%, 0.4) !important;
}

[data-theme="dark"] .nav-btn[style*="hsl(168, 89%, 60%)"]:hover,
[data-theme="dark"] .nav-btn[style*="hsl(168, 89%, 60%)"]:focus {
  border-color: hsl(168, 89%, 75%) !important; /* Other Policies - Light teal */
  box-shadow: 0 0 8px hsla(168, 89%, 75%, 0.4) !important;
}

/* Glossary title box border light-up on hover */
.glossary-box:hover .glossary-title-box {
  border: 2px solid #007cba !important; /* Full border, not just bottom */
  box-shadow: 0 0 8px rgba(0, 124, 186, 0.3) !important; /* Soft blue glow */
  transition: all 0.3s ease;
}

/* Dark mode glossary title box glow */
[data-theme="dark"] .glossary-box:hover .glossary-title-box {
  border: 2px solid #66b3ff !important; /* Full border, not just bottom */
  box-shadow: 0 0 8px rgba(102, 179, 255, 0.4) !important; /* Brighter glow for dark mode */
  transition: all 0.3s ease;
}

/* Ensure glossary title box has consistent border behavior */
.glossary-title-box {
  border: 1px solid transparent !important; /* Default transparent border for consistent sizing */
  transition: all 0.3s ease;
}

/* Donation box border light-up on hover (same as glossary title box) */
.donation-box {
  border: 1px solid transparent !important; /* Default transparent border for consistent sizing */
  transition: all 0.3s ease;
  border-radius: 8px; /* Add some rounding for modern look */
}

.donation-box:hover {
  border: 2px solid #007cba !important; /* Brand blue border */
  box-shadow: 0 0 8px rgba(0, 124, 186, 0.3) !important; /* Soft blue glow */
  transform: translateY(-1px); /* Subtle lift effect */
}

/* Dark mode donation box glow */
[data-theme="dark"] .donation-box:hover {
  border: 2px solid #66b3ff !important; /* Light blue for dark mode */
  box-shadow: 0 0 8px rgba(102, 179, 255, 0.4) !important; /* Brighter glow for dark mode */
  transform: translateY(-1px); /* Subtle lift effect */
}

/* Clean link styling (status bar handled by JavaScript) */
a {
  text-decoration: none; /* Remove underlines by default for cleaner look */
}

a:hover {
  text-decoration: underline; /* Add underline on hover for visual feedback */
}

.glossary-box {
  background: var(--glossary-bg) !important;
  border: 1px solid var(--border-color) !important;
}

.glossary-title-box {
  background: var(--glossary-title-bg) !important;
  color: var(--text-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.glossaryterms li {
  background: var(--glossary-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.glossaryterms li a {
  color: var(--link-color) !important;
}

.glossaryterms li a:hover {
  color: var(--link-hover) !important;
}

.footer-links a {
  color: var(--link-color) !important;
}

.footer-links a:hover {
  color: var(--link-hover) !important;
}

/* Additional dark mode improvements for better contrast */
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--text-color) !important;
}

[data-theme="dark"] .footer-box {
  background-color: var(--nav-bg) !important;
  color: var(--text-color) !important;
}

[data-theme="dark"] .donation-box {
  background: var(--glossary-title-bg) !important;
  color: var(--text-color) !important;
}

/* Improve nav button text contrast in dark mode */
[data-theme="dark"] .nav-btn {
  color: var(--text-color) !important;
  font-weight: bold !important;
}

/* Better search input styling in dark mode */
[data-theme="dark"] #searchInput::placeholder {
  color: #999 !important;
}

/* Fix TOC/article link colors in dark mode */
[data-theme="dark"] .center-box a {
  color: #b0e0e6 !important; /* Powder blue for unvisited links (matches footer) */
}

[data-theme="dark"] .center-box a:visited {
  color: #dda0dd !important; /* Lavender for visited links */
}

[data-theme="dark"] .center-box a:hover {
  color: #87ceeb !important; /* Sky blue on hover */
}

/* Ensure all article content links use the improved colors */
[data-theme="dark"] article a,
[data-theme="dark"] .content-articles a {
  color: #b0e0e6 !important; /* Powder blue for article links (matches footer) */
}

[data-theme="dark"] article a:visited,
[data-theme="dark"] .content-articles a:visited {
  color: #dda0dd !important; /* Lavender for visited article links */
}

[data-theme="dark"] article a:hover,
[data-theme="dark"] .content-articles a:hover {
  color: #87ceeb !important; /* Sky blue on hover */
}

/* Dark mode toggle button */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--button-bg);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  background: var(--button-hover);
  transform: scale(1.05);
}

.theme-toggle:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

/* Search results dark mode */
[data-theme="dark"] .search-results {
  background: var(--center-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .search-result-item:hover,
[data-theme="dark"] .search-result-item.highlighted {
  background-color: var(--button-hover);
}

[data-theme="dark"] .search-result-title {
  color: var(--link-color);
}

[data-theme="dark"] .search-result-description {
  color: #ccc;
}

[data-theme="dark"] #searchInput {
  background: var(--center-bg);
  border: 2px solid var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] #searchInput:focus {
  border-color: var(--link-color);
}

/* Mobile adjustments for dark mode */
@media (max-width: 600px) {
  .theme-toggle {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  [data-theme="dark"] .donation-box {
    background: var(--nav-bg) !important;
  }
}



