/* ============================================
   Global Styles & Boxed Layout
============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f4f4f4;
}

/* Boxed layout container to center content with padding from the sides */
.boxed-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Ensure main sections are positioned below the fixed header */
.boxed-layout > section,
.boxed-layout > main,
.boxed-layout > footer {
  padding-top: 80px; /* Adjust if header height changes */
}

/* ============================================
   Header
============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.site-name a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  text-decoration: none;
}

/* Navigation styling */
.navigation ul {
  list-style: none;
  display: flex;
}

.navigation ul li {
  margin-left: 20px;
}

.navigation ul li a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navigation ul li a:hover {
  color: #007BFF;
}

/* Hamburger icon styling for mobile (requires JS functionality to toggle .active) */
.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

/* ============================================
   Top Section (Site Information)
============================================ */
#top-section {
  padding: 40px 0;
}

#top-section .content-container {
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#top-section h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

#top-section p {
  margin-bottom: 20px;
  line-height: 1.8;
}

/* ============================================
   Latest News / Recent Blog Posts Section
============================================ */
#recent-news {
  padding: 40px 0;
}

.section-header h2,
#recent-news h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

/* Grid layout for dynamically loaded posts */
.news-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.news-container .post {
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex: 1 1 calc(33.333% - 20px);
  max-width: calc(33.333% - 20px);
  text-align: center;
}

.news-container .post img {
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
}

.news-container .post a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  display: block;
  margin-bottom: 10px;
}

.news-container .post p {
  font-size: 0.9rem;
  color: #666;
}

/* ============================================
   Footer
============================================ */
footer {
  background: #333;
  color: #f4f4f4;
  padding: 20px 0;
  margin-top: 40px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-links ul,
.footer-social ul {
  list-style: none;
  display: flex;
  gap: 15px;
  padding: 0;
}

.footer-links ul li a,
.footer-social ul li a {
  text-decoration: none;
  color: #f4f4f4;
  transition: color 0.3s ease;
}

.footer-links ul li a:hover,
.footer-social ul li a:hover {
  color: #007BFF;
}

.footer-social p {
  margin-right: 10px;
}

/* ============================================
   Blog Page Styles
============================================ */
main .content-container article {
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
}

main .content-container article h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

main .content-container article .meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 20px;
}

main .content-container article figure {
  text-align: center;
  margin-bottom: 20px;
}

main .content-container article figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

main .content-container article .article-content p {
  margin-bottom: 20px;
  line-height: 1.8;
}

/* ============================================
   Responsive Design
============================================ */
/* Medium devices (tablets) */
@media (max-width: 992px) {
  .news-container .post {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }

  .header-container {
    padding: 10px 20px;
  }

  /* Adjust top spacing when header height changes */
  .boxed-layout > section,
  .boxed-layout > main,
  .boxed-layout > footer {
    padding-top: 70px;
  }
}

/* Small devices (landscape phones, small tablets) */
@media (max-width: 768px) {
  /* Reduce horizontal padding */
  .boxed-layout {
    padding: 0 10px;
  }

  /* Stack header elements vertically */
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Navigation menu: Hide list by default, show hamburger */
  .navigation {
    width: 100%;
  }
  .navigation ul {
    flex-direction: column;
    width: 100%;
    display: none; /* Collapsed by default */
  }
  .navigation ul li {
    margin: 10px 0;
  }
  
  /* Display hamburger icon */
  .hamburger {
    display: block;
  }

  /* When active, display the navigation */
  .navigation.active ul {
    display: flex;
  }

  /* Adjust top-section headings */
  #top-section h1 {
    font-size: 2rem;
  }

  /* News posts take full width */
  .news-container .post {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Extra small devices (portrait phones) */
@media (max-width: 480px) {
  main .content-container article h1 {
    font-size: 2rem;
  }

  main .content-container article .article-content p {
    font-size: 1rem;
  }
}