/* Global Reset for Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base Styles */
body {
  font-family: sans-serif;
  margin: 0;
  line-height: 1.6;
  background-color: #f4f4f4;
  color: #333;
  position: relative;
  display: flex; /* Make body a flex container */
  flex-direction: column; /* Stack children vertically */
  min-height: 100vh; /* Ensure body takes full viewport height */
}

@media screen and (max-width: 768px) {
  .site-name {
      font-size: 16px;
      content: "ODASCO";
      display: inline-block;
  }
}

/* Header Styles */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 30px;
  background-color: #006400;
  color: #fff;
  position: relative;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  flex: 0 0 auto;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.site-name {
  font-size: 29px;
  font-weight: bold;
  align-items: center;
}

@media screen and (max-width:900px) {
  .site-name {
      display: none;
  }

  .logo-container::after {
      content: "ODASCO";
      font-size: 29px;
      font-weight: bold;
      color: white;
      align-items: center;
  }
}

@media screen and (min-width: 1366px) {
  .site-name {
      display: inline;
  }

  .logo-container::after {
      content: "";
  }
}

@media screen and (min-width: 750px) {
  .site-name {
      display: inline;
  }

  .logo-container::after {
      content: "";
  }
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #ffcc00;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
}

.bar {
  width: 100%;
  height: 3px;
  background-color: #fff;
  transition: all 0.3s ease;
  position: relative;
}

.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(7.3px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-7.3px) rotate(-45deg);
}

.mobile-menu {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  background-color: #006400;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 3;
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu ul {
  list-style: none;
  padding: 20px 0;
  text-align: center;
}

.mobile-menu ul li {
  margin: 10px 0;
  /* overflow-y: scroll; */
}

.mobile-menu ul li a {
  text-decoration: none;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  transition: color 0.3s ease;
}

.mobile-menu ul li a:hover {
  color: #ffcc00;
}

@media (max-width: 1000px) {
  .nav {
      display: none;
  }

  .menu-toggle {
      display: flex;
  }
}

/* Scroll Bar Container */
.progress-container {
  width: 100%;
  height: 5px;
  background: #006400;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.progress-bar {
  height: 5px;
  width: 0%;
  background: #4caf50; /* Green */
  transition: width 0.1s ease-out;
}

/* Hero Section Styles */
.hero-section {
  background-image: url('sch3.jpg'); /* Replace with your image path */
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  min-height: 400px;
  padding-top: 120px;
  padding-bottom: 120px;
  margin-bottom: 0;
  overflow: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Hero section now remains visible in full post view as requested */
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content h1 {
  font-size: 3em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  text-align: center;
}

/* Styling for search input in Hero Section */
.hero-content input#search-input {
  width: 80%; /* Default width */
  max-width: 500px; /* Default maximum width */
  padding: 0.7em;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: width 0.3s ease;
  margin: 10px auto; /* Center the search bar */
  background-color: rgba(255, 255, 255, 0.9); /* Slightly transparent white */
  color: #333;
  outline: none; /* Remove outline on focus */
}

.hero-content input#search-input::placeholder {
  color: #666;
}

/* Admin Login Button */
.admin-login-button {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background-color: #006400;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: background-color 0.3s ease;
  font-size: 0.8em;
}

.admin-login-button:hover {
  background-color: #fedd00;
  box-shadow: 0 5px 15px rgba(254,221,0);
}

.admin-login-button svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* --- BLOG POST CARD STYLES (for initial grid view on main blog page) --- */
#blog-container {
  padding: 40px 20px; /* Padding around the entire grid */
  width: 100%;
  max-width: 1200px; /* Maximum width for the grid container */
  margin: 20px auto; /* Center the blog container on the page */
  display: grid; /* Enable CSS Grid for the layout */
  /* Adjusts grid columns: cards will be at least 300px, but stretch to fill available 1fr space.
     The max-width on .blog-post will then constrain individual card width. */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px; /* Space between cards */
  flex-grow: 1; /* Allows the container to grow and push the footer down */
  justify-items: center; /* Centers cards within their individual grid cells */
}

/* This targets ONLY the blog post cards displayed in the main #blog-container */
#blog-container .blog-post {
  background-color: white;
  border-radius: 10px; /* Rounded corners for the cards */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow effect */
  overflow: hidden; /* Ensures content (like images) respects border-radius and fixed height */
  
  display: flex;
  flex-direction: column; /* Changed: Image on top, content below */
  align-items: center; /* Center items horizontally within the card */
  height: auto; /* Changed: Allow height to adjust based on content */
  
  opacity: 0; /* Initial state for animation */
  transform: translateY(20px); /* Initial state for animation */
  /* Transitions for smooth loading, hover effects, and shadow changes */
  transition: opacity 0.5s ease-out, transform 0.5s ease-out, box-shadow 0.3s ease, transform 0.3s ease;
  
  max-width: 400px; /* Adjusted max width to match the image better */
  width: 100%; /* Ensures the card takes up the full width of its grid cell (up to max-width) */
  justify-self: center; /* Centered in its grid cell */
}

#blog-container .blog-post.loaded {
  opacity: 1; /* Fades in */
  transform: translateY(0); /* Moves into position */
}

/* Lift Hover Animation for cards */
#blog-container .blog-post:hover {
  transform: translateY(-8px); /* Lifts the card slightly on hover */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Deeper shadow on hover */
}

.blog-post-image-wrapper {
  width: 100%; /* Changed: Image wrapper takes 100% of the card's width */
  height: 180px; /* Fixed height for the image area */
  overflow: hidden;
  background-color: #eee; /* Placeholder background color */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0; /* Prevents the image section from shrinking when content grows */
}

.blog-post-image-wrapper img {
  width: 100%; /* Image fills the width of its wrapper */
  height: 100%; /* Image fills the height of its wrapper */
  object-fit: cover; /* Ensures the image covers the area without distortion, cropping as needed */
  transition: transform 0.3s ease; /* Smooth zoom transition on hover */
}

.blog-post:hover .blog-post-image-wrapper img {
  transform: scale(1.05); /* Slight zoom effect on the image when hovering over the card */
}

.blog-post-content {
  padding: 15px; /* Uniform padding inside the content area of the card */
  display: flex;
  flex-direction: column; /* Stack title, meta, excerpt, and button vertically */
  flex-grow: 1; /* Allows the content area to take up the remaining horizontal space */
  justify-content: space-between; /* Distributes vertical space, pushing the "Read More" button to the bottom */
  width: 100%; /* Ensure content takes full width within the card */
  text-align: left; /* Align text to the left within the content area */
}

.blog-post-content h2 {
  font-size: 1.4em; /* Adjusted title font size */
  margin-top: 0;
  margin-bottom: 8px; /* Reduced margin below the title */
  color: #1e293b;
  line-height: 1.3;
}

.blog-post-content .post-meta {
  color: #777;
  font-size: 0.85em; /* Smaller font size for meta information (date, author) */
  margin-bottom: 10px; /* Reduced margin */
}

.blog-post-content .excerpt {
  font-size: 0.95em; /* Slightly smaller font size for the excerpt text */
  color: #555;
  margin-bottom: 15px; /* Reduced margin below the excerpt */
  flex-grow: 1; /* Allows the excerpt to take up available vertical space */
  
  /* Text truncation for fixed height cards */
  display: -webkit-box; /* Required for line clamping */
  -webkit-line-clamp: 4; /* Increased to 4 lines as seen in the image */
  -webkit-box-orient: vertical; /* Required for line clamping */
  overflow: hidden; /* Hides content that exceeds the line limit */
  text-overflow: ellipsis; /* Adds an ellipsis (...) if text is truncated */
}

.read-more-btn {
  font-size: 0.85em; /* Smaller font size for the "Read More" button */
  padding-top: 5px; /* Adds a small space above the button */
  align-self: flex-start; /* Aligns the button to the start (left) of the content area */
  display: inline-block; /* Ensures padding and margin work correctly */
  color: #006400; /* Blue for the link */
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, transform 0.2s ease;
}

.read-more-btn:hover {
  color: #fedd00;
  transform: translateX(5px);
}


/* --- FULL POST LAYOUT STYLES --- */
#blog-container.full-post-layout {
  display: grid;
  /* Main content (flexible 'fr' unit) | Sidebar (fractional unit) */
  grid-template-columns: 3fr 1fr; /* Adjusted: Main content wider, sidebar narrower for image match */
  gap: 30px;
  padding: 40px 20px;
  max-width: 1400px; /* Adjusted: Overall container max-width for better balance */
  margin: 20px auto;
}

.full-post-main-content {
  grid-column: 1 / 2; /* Main content in the first column */
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 20px; /* This padding provides internal spacing for content */
  display: flex;
  flex-direction: column;
}

.full-post-sidebar {
  grid-column: 2 / 3; /* Sidebar in the second column */
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  padding: 80px; /* Reduced top padding */
  padding-top: 20px;
  padding-left: 30px;
  padding-right: 110px;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Allow scrolling within sidebars if content is long */
  max-height: 68vh; /* Adjusted: Sidebar height to 68vh */
}

.full-post-sidebar h3 {
  margin-top: 0; /* Ensures no extra space above the heading */
  margin-bottom: 20px;
  color: #1e293b;
  font-size: 1.3em;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  text-align: left; /* Align heading text to the left */
}

/* Sidebar News Item */
.sidebar-news-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.2s ease;
  padding: 5px;
  border-radius: 5px;
}

.sidebar-news-item:hover {
  background-color: #f0f0f0;
}

.sidebar-news-item img {
  width: 60px; /* Small image size */
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}

.sidebar-news-item-content {
  flex-grow: 1;
  text-align: left; /* Ensure content within news item aligns left */
}

.sidebar-news-item-content h4 {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.3;
  color: #1e293b;
}

.sidebar-news-item-content .meta {
  font-size: 0.75em;
  color: #777;
  margin-top: 5px;
}

/* Main Post Content within full-post-main-content */
.main-post-header h1 {
  font-size: 2.5em;
  margin-bottom: 15px;
  color: #333;
  line-height: 1.2;
  overflow-wrap: break-word; /* Ensure long titles wrap */
}

.main-post-meta {
  font-size: 1em;
  color: #555;
  margin-bottom: 20px;
}

.full-post-image-container { /* New container for main image in full post */
  width: 100%;
  max-height: 450px; /* Increased max height for main image */
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #eee; /* Placeholder for main image */
}

.full-post-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Image will cover the container */
}

/* Other images below main article */
.full-post-other-images { /* New container for additional images */
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.full-post-other-images img {
  width: 100%; /* Default for smaller screens, adjust below */
  height: auto;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

/* Layout for multiple images side-by-side */
@media (min-width: 769px) {
  .full-post-other-images[data-image-count="2"] img {
      width: calc(50% - 5px); /* Two images side-by-side */
      margin-bottom: 0;
  }
  .full-post-other-images[data-image-count="3"] img,
  .full-post-other-images[data-image-count="4"] img,
  .full-post-other-images[data-image-count="5"] img,
  .full-post-other-images[data-image-count="6"] img {
      width: calc(33.33% - 7px); /* Three images per row for subsequent ones */
      margin-bottom: 10px;
  }
}


/* Style for the headline (within main content) */
.post-headline {
  font-size: 1.8em;
  color: #444;
  margin-bottom: 15px;
  font-weight: bold;
  overflow-wrap: break-word; /* Ensure long headlines wrap */
}

.full-post-text {
  text-align: justify;
  margin-bottom: 30px; /* Space before videos or "You Might Also Like" */
  overflow-wrap: break-word; /* Ensure long words in text wrap */
}

/* Video Layout (at the end of article) */
.full-post-videos {
  margin-top: 30px;
  margin-bottom: 30px; /* Space before "You Might Also Like" */
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.full-post-videos[data-video-count="2"] {
  flex-direction: row;
  justify-content: space-between;
}

.full-post-videos[data-video-count="2"] iframe {
  width: calc(50% - 10px);
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%;
}

.full-post-videos iframe {
  width: 80%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 560px;
}

/* Removed share buttons as per request */
.share-buttons {
  display: none; /* Explicitly hide share buttons as requested */
}


/* "You Might Also Like" Section */
.you-might-also-like {
  margin-top: 40px; /* Space above this section */
  padding-top: 20px;
  border-top: 1px solid #eee; /* Separator line */
}

.you-might-also-like h3 {
  text-align: center;
  font-size: 1.8em;
  color: #1e293b;
  margin-bottom: 25px;
}

.you-might-also-like-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

/* Override for .blog-post when it's inside the "You Might Also Like" grid */
/* These cards revert to a vertical layout (image top, content bottom) and auto height */
.you-might-also-like-grid .blog-post {
  max-width: 100%; /* Allows cards to expand within their grid cell */
  justify-self: stretch; /* Ensure it stretches to fill the grid cell */
  height: auto; /* Allow height to adjust for these cards based on content */
  flex-direction: column; /* Revert to column layout for these cards */
  padding: 0; /* No padding on the blog-post itself, content-wrapper handles it */
}

.you-might-also-like-grid .blog-post .blog-post-image-wrapper {
  width: 100%; /* Image takes full width of the card */
  height: 180px; /* Fixed height for image in this context */
  min-height: unset; /* Remove min-height override from horizontal layout */
}

.you-might-also-like-grid .blog-post .blog-post-content {
  padding: 15px; /* Reset padding for this context */
}

.you-might-also-like-grid .blog-post .blog-post-content h2 {
  font-size: 1.4em; /* Revert title size for these cards */
  margin-bottom: 8px;
}
.you-might-also-like-grid .blog-post .post-meta {
  font-size: 0.85em; /* Revert meta size for these cards */
  margin-bottom: 10px;
}
.you-might-also-like-grid .blog-post .excerpt {
  font-size: 0.95em; /* Revert excerpt size for these cards */
  -webkit-line-clamp: unset; /* Remove line clamp for these excerpts (allow full if desired) */
  margin-bottom: 15px;
}
.you-might-also-like-grid .blog-post .read-more-btn {
  font-size: 1em; /* Revert read more button size */
  padding-top: 0; /* Remove extra padding */
}


/* Style for the "Back to All Posts" button */
.full-post-back-button { /* New class for the button */
  background-color: #006400; /* Green color */
  color: white;
  border: none;
  padding: 10px 20px; /* Comfortable padding */
  border-radius: 8px; /* Slightly more rounded */
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-top: 30px; /* More space above the button */
  align-self: flex-start; /* Align to the left within flex column */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
}

.full-post-back-button:hover {
  background-color: #004d00; /* Darker green on hover */
  transform: translateY(-2px); /* Slight lift on hover */
}


/* Footer General Styles */
.footer {
  background-color: #006400;
  color: #ffffff;
  font-family: Arial, sans-serif;
  padding: 20px 0;
  flex-shrink: 0; /* Prevent footer from shrinking */
  margin-top: auto; /* Push footer to the bottom if content is short */
}

.footer h3 {
  margin-bottom: 10px;
  color: #ffffff;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0 5%;
  gap: 20px;
}

.footer-section.about {
  flex: 1 1 300px;
  text-align: center;
}

.footer-logo {
  width: 80px;
  margin: 10px 0;
}

.footer p {
  font-size: 14px;
  line-height: 1.6;
}

.footer-section.quick-links {
  flex: 1 1 200px;
}

.footer-section.quick-links ul {
  list-style: none;
  padding: 0;
}

.footer-section.quick-links ul li {
  margin: 5px 0;
}

.footer-section.quick-links ul li a {
  text-decoration: none;
  color: #ffffff;
  transition: color 0.3s ease;
}

.footer-section.quick-links ul li a:hover {
  color: #ffcc00;
}

.footer-section.map {
  flex: 1 1 300px;
  text-align: center;
}

.map-placeholder {
  width: 100%;
  height: 200px;
  border: none;
  overflow: hidden;
}

.map-placeholder iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

.footer-socials a {
  display: inline-block;
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease;
}

.footer-socials a img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-socials a:hover {
  transform: scale(1.2);
}

.footer-bottom {
  text-align: center;
  font-size: 13px;
  padding-top: 10px;
  border-top: 1px solid #013220
}

.footer-bottom span {
  color: #00bfff;
}

/* Responsive Layout for Smaller Screens (max-width: 768px) */
@media (max-width: 768px) {
  .footer-container {
      flex-direction: column;
      text-align: center;
  }

  .footer-section {
      margin-bottom: 15px;
  }

  /* Full Post Layout Changes for Smaller Screens */
  #blog-container.full-post-layout {
      grid-template-columns: 1fr; /* Stack columns */
      padding: 20px 0;
      gap: 20px;
      max-width: 100%; /* Ensure it takes full width on smaller screens */
  }

  .full-post-main-content {
      grid-column: auto / auto; /* Reset grid column span */
      width: 100%; /* Take full width of parent (which is now full viewport width) */
      order: 0; /* Main content comes first */
  }

  .full-post-sidebar {
      display: none; /* Hide sidebar on smaller devices as requested */
  }

  .main-post-header h1 {
      font-size: 2em;
      overflow-wrap: break-word; /* Ensure long titles wrap on small screens */
  }

  .full-post-image-container {
      max-height: 250px;
  }

  /* Ensure videos never overflow on mobile */
  .full-post-videos iframe {
      width: 100%; /* Force videos to fill their parent's width */
      max-width: 100%; /* Explicitly cap at 100% of parent */
      height: auto;
      aspect-ratio: 16 / 9;
  }

  .you-might-also-like h3 {
      font-size: 1.5em;
  }

  .you-might-also-like-grid {
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 480px) {
  .main-post-header h1 {
      font-size: 1.8em;
  }

  .post-headline {
      font-size: 1.4em;
      overflow-wrap: break-word; /* Ensure long headlines wrap on extra small screens */
  }

  .full-post-text {
      font-size: 0.95em;
      line-height: 1.6;
  }

  .full-post-back-button {
      font-size: 0.8em;
      padding: 0.5em 1em;
  }
}
