body,
html {
  /* fit the whole landing page on one page */
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-size: 16px; /* Base font size for rem calculations */
  /* Fallback for older browsers */
  font-size: 14px;
}

.container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
  max-width: 1200px;
  /* Fallback for older screens */
  max-width: 1024px;
  margin: 0 auto;
  padding: 1rem;
  /* Fallback padding */
  padding: 16px;
  box-sizing: border-box;
  /* Fallback for older browsers */
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

#container-services-SAlogo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 2rem;
  padding: 0 1rem;
}

#centered-container-txt-sa {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  font-size: clamp(1.2rem, 4vw, 1.875rem);
  text-align: center;
  padding: 0 1rem;
}

#volunteer-services-txt-sa {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  font-size: clamp(1.2rem, 4vw, 1.875rem);
  text-align: center;
  padding: 0 1rem;
}

h1 {
  /*I want a gold color*/
  color: #e1a250;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(2rem, 8vw, 3.75rem);
  /* Fallback for older browsers */
  font-size: 48px;
  font-weight: bold;
  text-align: center;
  margin: 1rem 0;
  /* Fallback margin */
  margin: 16px 0;
  padding: 0 1rem;
  /* Fallback padding */
  padding: 0 16px;
  animation: slide-in 1s ease-out forwards;
  line-height: 1.2;
}

.logoStellaAurorae {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
  width: auto;
}

h2 {
  color: #0b0b01;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  /* Fallback for older browsers */
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin: 1rem 0;
  /* Fallback margin */
  margin: 16px 0;
  padding: 0 1rem;
  /* Fallback padding */
  padding: 0 16px;
  animation: slide-in 1s ease-out forwards; /* Add slide-in animation horizontally */
  line-height: 1.3;
} 

.menu ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  color: blue;
}

.menu li {
  margin: 0 0.5rem;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.menu a {
  text-decoration: none;
  color: #0066cc;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.menu a:hover {
  background-color: #f0f0f0;
  color: #004499;
}

/* Back navigation styles */
.back-nav {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background-color: #e1a250;
  color: white;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-nav:hover {
  background-color: #d4942a;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Page navigation menu for sub-pages */
.page-nav {
  background-color: #f8f9fa;
  padding: 1rem 0;
  border-bottom: 2px solid #e1a250;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-nav .menu {
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.page-nav .menu ul {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.page-nav .menu a {
  background-color: white;
  border: 1px solid #ddd;
  padding: 0.75rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  text-align: center;
  transition: all 0.3s ease;
}

.page-nav .menu a:hover {
  background-color: #e1a250;
  color: white;
  border-color: #e1a250;
  transform: translateY(-2px);
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #f1f1f1;
  padding: 0.5rem 0;
  z-index: 1000;
}

.menu {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  padding: 0 1rem;
  margin: 0;
}

.small-rounded-photo {
  width: clamp(150px, 25vw, 200px);
  height: clamp(150px, 25vw, 200px);
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1rem;
  max-width: 100%;
}


/*this controls the positioning of the text in the container*/

.swinburne {
  display: flex;
  padding-left: clamp(1rem, 10vw, 6rem);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: clamp(2rem, 20vw, 12rem) 0;
}


/*fit webpages to all devices width*/
@keyframes slide-in {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

* {
  box-sizing: border-box;
  /* Fallback for older browsers */
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

/* Ensure images work well on older displays */
img {
  max-width: 100%;
  height: auto;
  /* Fallback for older browsers */
  width: auto\9; /* IE8 and below */
}

/* Better font rendering for older screens */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Ensure flexbox works on older browsers */
.menu ul,
.page-nav .menu ul {
  /* Flexbox fallbacks */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
}

.container {
  /* Flexbox fallbacks */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Legacy/Older Screen Support */
/* Very old monitors and devices (800x600, 1024x768) */
@media (max-width: 1024px) and (max-height: 768px) {
  body {
    font-size: 14px;
  }
  
  .container {
    max-width: 100%;
    padding: 12px;
  }
  
  h1 {
    font-size: 36px;
    margin: 12px 0;
  }
  
  h2 {
    font-size: 20px;
    margin: 10px 0;
  }
  
  .page-nav {
    padding: 0.5rem 0;
  }
  
  .page-nav .menu a {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
  }
  
  .back-nav {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
  }
}

/* Old CRT monitors (800x600) */
@media (max-width: 800px) and (max-height: 600px) {
  body {
    font-size: 12px;
  }
  
  .container {
    padding: 8px;
  }
  
  h1 {
    font-size: 28px;
    margin: 8px 0;
  }
  
  h2 {
    font-size: 16px;
    margin: 6px 0;
  }
  
  .page-nav .menu ul {
    gap: 0.25rem;
  }
  
  .page-nav .menu a {
    padding: 0.375rem 0.5rem;
    font-size: 11px;
  }
  
  .back-nav {
    padding: 0.375rem 0.5rem;
    font-size: 11px;
    top: 0.5rem;
    left: 0.5rem;
  }
}

/* Very old devices with limited screen real estate */
@media (max-width: 640px) {
  .container {
    padding: 8px;
  }
  
  #container-services-SAlogo {
    margin: 0.5rem;
    flex-direction: column;
  }
  
  .page-nav .menu ul {
    flex-direction: column;
    align-items: center;
  }
  
  .page-nav .menu a {
    width: 90%;
    text-align: center;
    margin: 0.125rem 0;
  }
}

/* Support for very old Palm Pilot and early PDA screens */
@media (max-width: 240px) {
  body {
    font-size: 10px;
  }
  
  .container {
    padding: 4px;
  }
  
  h1 {
    font-size: 18px;
    margin: 4px 0;
  }
  
  h2 {
    font-size: 12px;
    margin: 3px 0;
  }
  
  .back-nav {
    padding: 0.25rem 0.375rem;
    font-size: 9px;
    top: 0.25rem;
    left: 0.25rem;
  }
  
  .page-nav .menu a {
    padding: 0.25rem 0.375rem;
    font-size: 9px;
    width: 95%;
  }
}

/* Support for old Nokia and early mobile phones */
@media (max-width: 176px) and (max-height: 220px) {
  body {
    font-size: 8px;
  }
  
  .container {
    padding: 2px;
  }
  
  h1 {
    font-size: 14px;
    margin: 2px 0;
  }
  
  h2 {
    font-size: 10px;
    margin: 2px 0;
  }
  
  .back-nav {
    padding: 0.125rem 0.25rem;
    font-size: 8px;
  }
  
  .page-nav {
    padding: 0.25rem 0;
  }
  
  .page-nav .menu a {
    padding: 0.125rem 0.25rem;
    font-size: 8px;
    width: 98%;
  }
}

/* Tablet styles */
@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
    /* Fallback for older tablets */
    padding: 12px;
  }
  
  #container-services-SAlogo {
    margin: 1rem;
    /* Fallback margin */
    margin: 16px;
    flex-direction: column;
  }
  
  .menu ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    /* Fallback gap using margins for older browsers */
  }
  
  .menu li {
    margin: 0.25rem;
    /* Fallback margin */
    margin: 4px;
  }
  
  .page-nav .menu ul {
    gap: 0.25rem;
  }
  
  .page-nav .menu a {
    padding: 0.5rem 0.75rem;
    /* Fallback padding */
    padding: 8px 12px;
    font-size: 0.875rem;
    /* Fallback font size */
    font-size: 14px;
  }
  
  .back-nav {
    padding: 0.5rem 1rem;
    /* Fallback padding */
    padding: 8px 16px;
    font-size: 0.875rem;
    /* Fallback font size */
    font-size: 14px;
  }
  
  .small-rounded-photo {
    margin-right: 0;
    margin-bottom: 1rem;
    /* Fallback margin */
    margin-bottom: 16px;
  }
}

/* Mobile styles */
@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
    /* Fallback padding */
    padding: 8px;
    margin-top: 1rem;
    /* Fallback margin */
    margin-top: 16px;
  }
  
  #container-services-SAlogo {
    margin: 0.5rem;
    /* Fallback margin */
    margin: 8px;
  }
  
  #centered-container-txt-sa,
  #volunteer-services-txt-sa {
    margin: 0.5rem 0;
    /* Fallback margin */
    margin: 8px 0;
    padding: 0 0.5rem;
    /* Fallback padding */
    padding: 0 8px;
    /* Fallback font size for older devices */
    font-size: 18px;
  }
  
  .menu {
    padding: 0 0.5rem;
    /* Fallback padding */
    padding: 0 8px;
  }
  
  .menu ul {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
  }
  
  .menu li {
    margin: 0;
    width: auto;
  }
  
  .page-nav {
    padding: 0.75rem 0;
    /* Fallback padding */
    padding: 12px 0;
  }
  
  .page-nav .menu {
    padding: 0 0.5rem;
    /* Fallback padding */
    padding: 0 8px;
  }
  
  .page-nav .menu ul {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .page-nav .menu a {
    padding: 0.75rem 1rem;
    /* Fallback padding */
    padding: 12px 16px;
    width: 100%;
    max-width: 200px;
    text-align: center;
    /* Fallback font size */
    font-size: 14px;
  }
  
  .back-nav {
    top: 0.5rem;
    left: 0.5rem;
    /* Fallback positioning */
    top: 8px;
    left: 8px;
    padding: 0.5rem 0.75rem;
    /* Fallback padding */
    padding: 8px 12px;
    font-size: 0.75rem;
    /* Fallback font size */
    font-size: 12px;
  }
  
  .footer {
    position: relative;
    margin-top: auto;
  }
}

/* Extra small devices */
@media (max-width: 320px) {
  .container {
    padding: 0.25rem;
    margin-top: 1.5rem;
  }
  
  h1, h2 {
    padding: 0 0.5rem;
  }
  
  .page-nav .menu a {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    max-width: 180px;
  }
  
  .back-nav {
    top: 0.25rem;
    left: 0.25rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.7rem;
    min-height: 36px;
    min-width: 36px;
  }
  
  .page-nav {
    padding: 0.5rem 0;
  }
}
