@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&family=Open+Sans:wght@400;600&display=swap');

/* General Body Styles */
:root {
  --primary-color: #0056b3; /* A modern blue */
  --secondary-color: #6c757d; /* Muted grey */
  --text-color: #343a40; /* Dark text */
  --light-text-color: #6c757d; /* Lighter text for secondary info */
  --background-color: #f8f9fa; /* Light background */
  --card-background: #ffffff; /* White for cards/sections */
  --border-color: #e9ecef; /* Light border */
  --accent-color: #28a745; /* Green for accents/success */
}

body {
  font-family: 'Open Sans', sans-serif;
  max-width: 1000px; /* Slightly increased max-width for a more spacious feel */
  margin: 40px auto;
  padding: 0 24px; /* Increased padding for better edge spacing */
  line-height: 1.7; /* Slightly increased line-height for readability */
  background: var(--background-color); /* Light grey background for a softer look */
  color: var(--text-color); /* Darker text for better contrast */
  -webkit-font-smoothing: antialiased; /* Smoother font rendering */
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-color); /* Even darker for headings */
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; } /* Larger main heading */
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* Links */
a {
  color: var(--primary-color); /* Apple blue for links */
  text-decoration: none;
  transition: color 0.2s ease-in-out; /* Smooth transition for hover */
}

a:hover {
  color: var(--primary-color); /* Darker blue on hover */
  text-decoration: underline;
}

/* Header */
header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color); /* Subtle separator */
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

header h1 {
  margin: 0;
  font-size: 2rem; /* Adjusted header title size */
}

header h1 a {
  color: var(--text-color); /* Keep header title dark */
  text-decoration: none;
}

/* Navigation */
nav {
  margin-top: 0; /* Reset margin */
  display: flex;
  gap: 24px; /* Space out navigation items */
  flex-wrap: wrap;
}

nav a {
  font-size: 1.1rem;
  font-weight: 500; /* Medium weight for navigation */
  padding: 8px 0;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.2s ease-in-out;
}

nav a:hover::after {
  width: 100%;
}

/* Main Content */
main {
  display: block; /* Ensure main behaves as a block-level element */
  width: 100%; /* Take full available width */
  overflow: hidden; /* Ensure main contains its children */
  padding-bottom: 60px; /* Space before footer */
}

p {
  margin-bottom: 1em;
}

ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 1em;
}

/* Section Styling */
section {
  background: var(--card-background);
  border-radius: 8px; /* Slightly rounded corners */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* More pronounced, modern shadow */
  padding: 30px;
  margin-bottom: 30px;
}

/* Gallery Styles */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Adjusted for more images per row */
  gap: 16px; /* Increased gap */
  margin-top: 30px;
}

.grid img {
  width: 100%;
  height: 100px; /* Adjusted for more images per row */
  object-fit: cover;
  border-radius: 6px; /* Consistent border-radius */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.grid img:hover {
  transform: translateY(-5px); /* Lift effect on hover */
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); /* More pronounced, modern shadow on hover */
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid var(--border-color); /* Subtle separator */
  color: var(--light-text-color); /* Lighter text for footer */
  font-size: 0.9rem;
  margin-top: 40px;
}

footer p {
  margin: 0.5em 0;
}

/* Back to Top Button */
#backToTopBtn {
  display: none; /* Hidden by default */
  position: fixed; /* Fixed position */
  bottom: 20px; /* Place the button at the bottom of the page */
  right: 30px; /* Place the button at the right side */
  z-index: 99; /* Make sure it does not overlap */
  border: none; /* Remove borders */
  outline: none; /* Remove outline */
  background-color: var(--primary-color); /* Set a background color */
  color: white; /* Text color */
  cursor: pointer; /* Add a mouse pointer on hover */
  padding: 15px; /* Some padding */
  border-radius: 10px; /* Rounded corners */
  font-size: 18px; /* Increase font size */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s, transform 0.3s;
}

#backToTopBtn:hover {
  background-color: #004080; /* Darker blue on hover */
  transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  body {
    padding: 0 16px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header h1 {
    font-size: 1.8rem;
    margin-bottom: 16px;
  }

  nav {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  nav a {
    padding: 4px 0;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.7rem; }
  h3 { font-size: 1.3rem; }

  section {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }
}