/* Import Open Sans and Source Code Pro fonts to match fsPDA's use of Open Sans */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Source+Code+Pro&display=swap');

/* General page styling */
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
  margin: 0;
  padding: 0;
}

/* Header styling to match Cayman's page-header, full-width */
header, .navbar {
  background: linear-gradient(-45deg, #155799, #159957);
  color: #ffffff; /* Ensure header text is white */
  padding: 3rem 4rem;
  text-align: center;
  border-bottom: none;
  width: 100vw; /* Full viewport width */
  margin: 0; /* Remove any margins */
  position: relative; /* Ensure it escapes container constraints */
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  z-index: 1; /* Ensure header is below title */
}

/* Ensure navbar inner elements respect padding */
.navbar > .container, .navbar > .container-fluid {
  padding: 0;
  max-width: none; /* Override Bootstrap's container max-width */
}

/* Title styling with high specificity to ensure visibility */
.navbar-brand, .navbar-title, .quarto-title, h1.title, .quarto-title-block .quarto-title, header h1, .navbar h1 {
  font-family: 'Open Sans', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff !important; /* Force white color for visibility */
  text-decoration: none;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Add contrast */
  position: relative; /* Ensure title is positioned above header */
  z-index: 2; /* Place title above header */
}

.navbar-text, .navbar-subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  color: #ffffff !important; /* Ensure subtitle is white */
  opacity: 0.8;
  position: relative;
  z-index: 2;
}

.navbar-nav .nav-link {
  color: #ffffff !important; /* Ensure nav links are white */
  font-weight: 400;
  margin: 0 1rem;
  transition: opacity 0.2s;
  position: relative;
  z-index: 2;
}

.navbar-nav .nav-link:hover {
  opacity: 0.7;
}

/* Main content styling to match Cayman's main-content */
main, .container {
  max-width: 48rem;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Headings with fsPDA's light green color */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  color: #157878; /* Match fsPDA's heading color */
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1em; }
h5 { font-size: 0.875em; }
h6 { font-size: 0.75em; }

/* Links */
a {
  color: #159957;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #1ab188;
  text-decoration: underline;
}

/* Buttons */
.btn {
  background-color: #159957;
  color: #fff;
  border: 1px solid #159957;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  font-weight: 400;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn:hover {
  background-color: #1ab188;
  border-color: #1ab188;
  color: #fff;
}

/* Code blocks */
pre, code {
  font-family: 'Source Code Pro', 'Consolas', monospace;
  background-color: #f8f8f8;
  border: 1px solid #eee;
  border-radius: 3px;
}

pre {
  padding: 1rem;
  overflow-x: auto;
}

code {
  padding: 0.2em 0.4em;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  color: #666;
  font-size: 0.875rem;
  border-top: 1px solid #eee;
  margin-top: 2rem;
}

/* Responsive adjustments to match Cayman's media queries */
@media (max-width: 42em) {
  header, .navbar {
    padding: 2rem 3rem;
  }

  main, .container {
    margin: 1rem;
    padding: 1.5rem;
  }
}

@media (max-width: 24em) {
  header, .navbar {
    padding: 1rem 2rem;
  }

  .navbar-brand, .navbar-title, .quarto-title, h1.title, .quarto-title-block .quarto-title, header h1, .navbar h1 {
    font-size: 1.75rem;
  }

  .navbar-text, .navbar-subtitle {
    font-size: 1rem;
  }
}
