*, *::before, *::after {
  box-sizing: border-box;
}

/* Import fonts - with additional fallback method */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Source+Sans+Pro:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700&family=Seaweed+Script&display=swap') ;
@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Seaweed+Script&display=swap');

/* Preload font as backup method for mobile browsers */
@font-face {
  font-family: 'Seaweed Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/seaweedscript/v13/bx6cNx6Tne2pxOATYE8C_Rsoe0WJ-KcGVbLW.woff2)  format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Reset and base styles */
html, body {
  background-color: #fcfaf5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
}

body {
  color: #000000;
  font-family: 'Source Sans Pro', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 156%;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-behavior: smooth;
}

.flex-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  max-width: 1024px;
  margin: 0 auto;
}

.text-box {
  flex: 1 1 auto;
  max-width: 600px;
}

.image-box {
  flex: 1 1 600px;
  max-width: 600px;
}

.responsive-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  margin: 0 auto;
}

/* Main container */
.content {
  width: 98%;
  max-width: 1024px;
  display: flex;
  flex-direction: column;
  background-color: #fcfaf5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'EB Garamond', Georgia, serif;
  color: #0D3D6B;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }

a {
  color: #C02F1D;
  font-family: 'Source Sans Pro', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a img {
  border: 0;
}

blockquote {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  border-left: 3px solid #0D3D6B;
  padding-left: 1rem;
  margin-left: 0;
}

/* Header */
header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important; /* Force left alignment */
  padding: 1rem 0;
  margin-bottom: 1rem;
  position: relative;
}

/* Banner and slogan styling */
.banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important; /* Force left alignment */
  width: 100%;
}

/* Slogan styling */
.site-slogan {
  font-family: 'Seaweed Script', cursive;
  font-size: 1.6rem;
  color: #7A9E7E; /* Sage green */
  line-height: 1.2;
  font-weight: normal;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
  animation: fadeIn 1.2s ease-in-out forwards;
  opacity: 0;
  align-self: flex-start; /* Explicitly align self to start */
}

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Main content area */
.main-wrapper {
  display: flex;
  width: 100%;
  gap: 2rem;
}

main {
  flex: 1;
  order: 1;
}

.text {
  background-color: #fcfaf5;
  color: #000000;
  padding: 1rem;
}

/* Navigation */
.navbox {
  flex: 0 0 30%;
  order: 2;
  padding: 1rem;
}

.navig {
  list-style-type: none;
  line-height: 180%;
  margin: 0;
  padding: 0;
}

.navig a {
  display: block;
  padding: 0.2rem 0.5rem;
}

.navig a.active {
  font-weight: 700;
  text-decoration: underline;
  color: #0D3D6B;
  background-color: rgba(13, 61, 107, 0.05);
  border-radius: 3px;
}

/* Utility classes */
.center {
  text-align: center;
}

.set {
  padding: 10px;
}

.note {
  font-size: 0.9em;
  color: #666;
  margin: 0.5em 0;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
  text-decoration: none;
  opacity: 0;
}

.skip-link:focus {
  top: 0;
  opacity: 1;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #0D3D6B;
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  display: none;
  text-decoration: none;
  z-index: 99;
}

.back-to-top:hover {
  background-color: #C02F1D;
  text-decoration: none;
}

/* Footer */
footer {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding: 1rem 0;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.icon-bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #0D3D6B;
  margin: 5px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive styles */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.3rem; }
  
  header {
    align-items: center; /* Center align on mobile */
    padding-bottom: 1rem;
    padding-top: 3rem; /* Make room for menu button */
  }
  
  .banner {
    align-items: center; /* Center align on mobile */
  }
  
  .site-slogan {
    text-align: center;
    margin: 0.5rem auto 1.5rem;
    font-size: 1.4rem; /* Slightly smaller on mobile */
    width: 100%; /* Full width for centering */
  }
  
  .main-wrapper {
    flex-direction: column;
  }
  
  .navbox {
    order: 1;
    width: 100%;
    margin-bottom: 1rem;
  }
  
  main {
    order: 2;
  }
  
  /* Hamburger menu implementation */
  .menu-toggle {
    display: block;
  }
  
  .navbox {
    display: none;
  }
  
  .navbox.active {
    display: block;
  }
}

@media (max-width: 600px) {
  .flex-container {
    flex-direction: column;
  }

  .text-box, .image-box {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
    margin: 0;
    padding: 0.5cm;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .navbox, .skip-link, .back-to-top, .menu-toggle {
    display: none;
  }
  
  .main-wrapper {
    display: block;
  }
  
  .text {
    max-width: 100%;
    border: none;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  img {
    max-width: 100% !important;
  }
  
  blockquote, table, pre {
    page-break-inside: avoid;
  }
  
  ul, ol, dl {
    page-break-before: avoid;
  }
}


/* --- Responsiveness Tweaks: April 30, 2025 --- */

/* Ensure nav toggle is robust */
@media (max-width: 768px) {
  .navbox {
    display: none;
  }

  .navbox.active {
    display: block;
  }
}

/* Text readability improvements on small screens */
@media (max-width: 600px) {
  .text {
    padding: 1rem 1.2rem;
  }

  body {
    font-size: 1.05rem;
  }

  .flex-container {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .text-box, .image-box {
    margin-bottom: 1rem;
  }
}
