/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size for scaling */
}

body {
  font-family: 'Open Sans', sans-serif;
  background-color: #1C2541;
  color: #FFFFFF;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Responsive Layouts */
header {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping for smaller screens */
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #1C2541;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #3A506B;
}

.logo img {
  height: 3rem;
  margin-right: 1rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap; /* Allow wrapping for smaller screens */
  gap: 1rem;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  text-decoration: none;
  color: #FFFFFF;
  font-weight: 400;
  transition: color 0.3s, border-bottom 0.3s;
  padding-bottom: 0.5rem;
}

nav ul li a:hover,
nav ul li a.active {
  color: #FF7F50;
}

.lang-toggle {
  display: flex;
  gap: 0.5rem;
}

.lang-toggle button {
  background: transparent;
  border: 1px solid #3A506B;
  padding: 0.5rem 1rem;
  color: #FFFFFF;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 5px;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.lang-toggle button:hover,
.lang-toggle button.active {
  background-color: #3A506B;
  color: #FF7F50;
}

/* Blog Section */
.blog-main {
  padding: 4rem 1rem;
  background: #22272e;
  color: #e0e0e0;
}

.blog-main .content {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.blog-main h1 {
  color: #fff;
  font-family: 'Oswald', sans-serif;
  border-bottom: 3px solid #ff6f61;
  padding-bottom: 15px;
  display: inline-block;
  font-size: 2rem;
  letter-spacing: 0.03em;
  text-align: center;
}

.blog-categories {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #444;
}

.blog-categories button {
  background: #333;
  color: #ccc;
  border: 1px solid #555;
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
  font-size: 0.9rem;
}

.blog-categories button.active,
.blog-categories button:hover {
  background: #ff6f61;
  color: #fff;
  border-color: #ff6f61;
}

.blog-post-list {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.blog-post-card {
  background: #2a2a2a;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-left: 5px solid #ff6f61;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.blog-post-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.blog-post-card h2 a {
  color: #fff;
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  transition: color 0.3s ease;
}

.blog-post-card h2 a:hover {
  color: #ff6f61;
}

.blog-post-excerpt {
  color: #bbb;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.read-more-link {
  color: #ff6f61;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.read-more-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Specific Fix for Portfolio Thumbnails */
.portfolio-thumbnail {
  width: 100%;
  max-width: 300px; /* Optional: Set a maximum width for better control */
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  margin: 0 auto;
}

/* Responsive Videos */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #1C2541;
  font-size: 0.9rem;
  color: #888;
  border-top: 1px solid #3A506B;
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo img {
    height: 2.5rem;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .lang-toggle {
    margin-top: 1rem;
  }

  .blog-main h1 {
    font-size: 1.8rem;
  }

  .blog-categories button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .portfolio-thumbnail {
    max-width: 90%; /* Reduce the maximum width for smaller screens */
  }

  .blog-post-card {
    padding: 1rem;
  }

  .blog-post-card h2 {
    font-size: 1rem;
  }

  .blog-post-excerpt {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .blog-main h1 {
    font-size: 1.5rem;
  }

  .blog-categories button {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .portfolio-thumbnail {
    max-width: 100%; /* Ensure the image fits within the screen on very small devices */
  }

  .blog-post-card {
    padding: 0.8rem;
  }

  .blog-post-card h2 {
    font-size: 0.9rem;
  }

  .blog-post-excerpt {
    font-size: 0.8rem;
  }

  footer {
    font-size: 0.8rem;
  }
}

.no-posts-message {
  text-align: center;
  color: #888;
  font-style: italic;
  margin-top: 50px;
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .blog-post-list {
    grid-template-columns: 1fr;
  }
}

header nav ul li.active a {
  color: #ff6f61;
}