/* Level Up through Digital Discoveries - A WCAG 2.2 compliant theme
   Based on andreas07 layout */

:root {
  --primary-color: #2b5797;
  --text-color: #303030;
  --background-color: #fafafa;
  --sidebar-bg: #e0e0e0;
  --link-color: #2b5797;
  --link-hover: #1a365d;
}

/* Base styles with improved accessibility */
body {
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background: var(--background-color);
  font: 100%/1.5 'Arial', sans-serif;
  line-height: 1.6;
}

/* Improved focus styles for accessibility */
*:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Lists with proper spacing */
ul {
  list-style: disc;
  margin: 1rem 0;
  padding-left: 2rem;
}

li {
  margin: 0.5rem 0;
}

/* Links with sufficient color contrast */
a {
  color: var(--link-color);
  text-decoration: underline;
  font-weight: 600;
}

a:hover, a:focus {
  color: var(--link-hover);
  text-decoration: none;
}

/* Images with proper spacing and borders */
img {
  float: left;
  margin: 0 1rem 1rem 0;
  padding: 0.25rem;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  max-width: 100%;
  height: auto;
}

/* Sidebar styles */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100%;
  overflow: auto;
  background: var(--sidebar-bg);
  padding: 1rem;
  box-sizing: border-box;
}

#sidebar h1 {
  margin: 1.25rem 1rem 0 0.3rem;
  color: var(--primary-color);
  font-size: 1.6rem;
  letter-spacing: -0.5px;
}

#sidebar h2,
#sidebar h3 {
  margin: 1rem 1.25rem 1rem 0.3rem;
  color: #505050;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

#sidebar p {
  margin: 0 1.25rem 1rem 0.3rem;
  color: #505050;
  font-size: 0.9rem;
}

#menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#menu li {
  margin-bottom: 0.25rem;
}

#menu a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;                    
  color: #505050;
  background: #e0e0e0;
  border-radius: 4px;
}

#menu a.active {
  background: #fafafa;
  font-weight: bold;
  border-left: 4px solid #2b5797;
}

#menu a:focus,
#menu a:hover {
  background: #f0f0f0;
}

/* Main content area */
#content {
  width: calc(100% - 260px);
  margin-left: 240px;
  padding: 2rem;
  box-sizing: border-box;
}

#content p {
  margin: 0 0 1.25rem 0;
  line-height: 1.6;
}

#content h1 {
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  font-size: 2.5rem;
  letter-spacing: -1px;
  text-align: center;
}

#content h2 {
  margin: 0 0 1.5rem 0;
  color: #505050;
  font-size: 1.8rem;
  letter-spacing: -0.5px;
  text-align: center;
}

#content h3 {
  clear: both;
  margin: 2rem 0 1rem 0;
  color: var(--primary-color);
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

/* Responsive design */
@media (max-width: 768px) {
  #sidebar {
    position: static;
    width: 100%;
    height: auto;
    text-align: center;
  }
  
  #content {
    width: 100%;
    margin-left: 0;
    padding: 1rem;
  }
  
  img {
    float: none;
    display: block;
    margin: 1rem auto;
  }
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2B5797; /* Background */
  color: #FFFFFF; /* Adjusted text color for better contrast */
  padding: 8px;
  z-index: 100;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  background: #1A365D; /* Slightly darker background for focus */
  color: #FFFFFF; /* Maintain high contrast */
}


.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.photo-grid img {
  float: none;
  margin: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.photo-grid img:focus {
  outline: 3px solid var(--primary-color); /* Highlight the image when focused */
  outline-offset: 4px;
}

.section > p {
  clear: both;
  margin-top: 2rem;
}

footer {
  margin-top: 20px; /* Add spacing between main content and footer */
  text-align: center; /* Center-align footer text */
  font-size: 0.9rem; /* Ensure smaller font size */
  background-color: #f9f9f9; /* Optional: Light background for distinction */
  padding: 10px 20px;
  border-top: 1px solid #ccc; /* Optional: Add a top border for visual separation */
}