/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Lato', sans-serif;
  line-height: 1.7;
  color: #333;
  background-color: #fffdfc;
}

.container {
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.site-header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100; /* Ensure header is above other content */
}

/* Ensure the container within the header is positioned for z-indexing */
.site-header .container {
  display: flex; /* Assuming it's a flex container for logo and nav */
  justify-content: space-between; /* Adjust as needed */
  align-items: center;
  position: relative; /* Needed for z-index to work on children */
  z-index: 101; /* Higher than main-nav ul.active */
}

.logo {
  position: relative; /* To allow z-index to work */
  z-index: 102; /* Ensure logo is always on top */
}

.logo img {
  height: 60px;
}

.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 15px;
}

.main-nav a {
  text-decoration: none;
  color: #3d5a52;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
  color: #d46f7a;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 140px 20px 100px;
  background: linear-gradient(135deg, #f8edeb 0%, #e8f5e9 100%);
  margin-bottom: 60px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  color: #3d5a52;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
  color: #555;
}

.btn {
  background: #d46f7a;
  color: white;
  padding: 14px 32px;
  text-decoration: none;
  border-radius: 30px;
  font-weight: bold;
  display: inline-block;
  transition: background 0.3s;
  font-size: 1.1rem;
}

.btn:hover {
  background: #c05a64;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap to next line */
  justify-content: center; /* Center items horizontally */
  align-items: center;
  gap: 20px; /* Space between the button and the form */
  margin-top: 30px;
}

.subscribe-form {
  display: flex;
  flex-direction: column; /* Stack input and button vertically */
  gap: 10px;
  width: 100%; /* Take full width on small screens */
  max-width: 350px; /* Limit form width */
  margin-top: 10px; /* Add margin to separate from buttons above */
}

.subscribe-form input[type="email"] {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  width: 100%;
  text-align: center; /* Center placeholder text */
}

.subscribe-form input[type="email"]::placeholder {
  color: #888;
}

.btn-secondary {
  background: #3d5a52; /* A complementary color */
  color: white;
  padding: 14px 32px;
  text-decoration: none;
  border-radius: 30px;
  font-weight: bold;
  display: inline-block;
  transition: background 0.3s;
  font-size: 1.1rem;
  border: none; /* Remove default button border */
  cursor: pointer;
  outline: none; /* Remove the outline on focus/click */
}

.btn-secondary:hover {
  background: #2a3e38; /* Darker shade on hover */
}

/* Adjustments for larger screens */
@media (min-width: 768px) {
  .hero-actions {
    flex-direction: row; /* Buttons and form side-by-side on larger screens */
    /* No need for justify-content: center here, as gap will handle spacing */
  }

  .hero-actions .btn,
  .hero-actions .subscribe-form {
    flex-shrink: 0; /* Prevent items from shrinking */
  }

  .subscribe-form {
    flex-direction: row; /* Input and button side-by-side on larger screens */
    margin-top: 0; /* Remove top margin on larger screens */
    gap: 0; /* Remove gap between input and button */
  }

  .subscribe-form input[type="email"] {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    width: auto; /* Allow input to size naturally */
    min-width: 200px; /* Ensure minimum width */
  }

  .subscribe-form button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px; /* Overlap border with input */
  }
}

/* Featured Posts */
.featured-posts h2 {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: #3d5a52;
  margin-bottom: 50px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.post-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.1);
}

.post-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.post-card h4 {
  font-family: 'Playfair Display', serif;
  margin: 18px 18px 8px;
  font-size: 1.3rem;
  color: #3d5a52;
}

.post-card p {
  margin: 0 18px 18px;
  color: #666;
  font-size: 0.95rem;
}

.post-card a {
  text-decoration: none;
  color: inherit;
}

/* Blog Post Page */
.post-page .blog-post {
  padding: 40px 0;
}

.post-page .blog-post h1,
.post-page .blog-post h2,
.post-page .blog-post h3 {
  font-family: 'Playfair Display', serif;
  color: #3d5a52;
  margin: 1.5em 0 0.5em;
}

.post-page .blog-post h1 {
  font-size: 2.2rem;
}

.post-page .blog-post h2 {
  font-size: 1.8rem;
}

.post-page .blog-post h3 {
  font-size: 1.5rem;
  }

.post-page .blog-post p {
  margin-bottom: 1.2em;
  font-size: 1.1rem;
  line-height: 1.8;
}

.post-page .blog-post ul,
.post-page .blog-post ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}

.post-page .blog-post li {
  margin-bottom: 0.5em;
}

.post-page .blog-post strong {
  font-weight: 700;
}

.post-page .blog-post em {
  font-style: italic;
}

/* ✅ Responsive Images */
.post-page .blog-post img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Optional: Limit maximum height for very tall images */
.post-page .blog-post img {
  max-height: 70vh;
  width: auto;
  object-fit: contain;
}

/* Footer */
footer {
  text-align: center;
  padding: 50px 20px 30px;
  background: #f8f8f8;
  margin-top: 80px;
}

.footer-logo {
  margin-bottom: 15px;
}

.social-links a {
  color: #d46f7a;
  text-decoration: none;
  margin: 0 10px;
}

.social-links a:hover {
  text-decoration: underline;
}

/* Login Page Styles */
.login-body {
  font-family: 'Lato', sans-serif;
  background-color: #f8f9fa !important; /* Explicitly set background color with !important */
  background-image: none !important; /* Force no background image */
  padding: 0; /* Remove padding here, handled by login-box */
  margin: 0;
  display: flex; /* Use flexbox for centering */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
  min-height: 100vh; /* Full viewport height */
}

.login-box {
  max-width: 400px;
  width: 90%; /* Make it responsive */
  background: white;
  padding: 40px; /* Increased padding for better look */
  border-radius: 16px; /* Slightly larger border-radius for softer look */
  box-shadow: 0 8px 20px rgba(0,0,0,0.15); /* Stronger shadow for depth */
  text-align: center; /* Center h2 and error message */
  display: flex; /* Use flexbox for internal layout */
  flex-direction: column; /* Stack children vertically */
  align-items: center; /* Center items within the box */
}

.login-logo {
  margin-bottom: 25px; /* Space below logo */
}

.login-logo img {
  width: 100px; /* Adjust logo size */
  height: auto;
}

.login-box h2 {
  color: #3d5a52;
  margin-bottom: 25px; /* Space below heading */
  font-family: 'Playfair Display', serif; /* Use blog's display font */
  font-size: 2rem;
}

.login-box input {
  width: calc(100% - 24px); /* Account for padding */
  padding: 14px; /* Increased padding for input fields */
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1.05rem; /* Slightly larger font for inputs */
}

.login-box button {
  background: #d46f7a;
  color: white;
  border: none;
  padding: 15px; /* Increased padding for button */
  width: 100%;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.3s;
  margin-top: 20px; /* Space above button */
}

.login-box button:hover {
  background: #c05a64;
}

.login-box .error {
  color: red;
  text-align: center;
  margin: 15px 0; /* Adjusted margin */
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero p {
    font-size: 1.1rem;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 12px;
  }
  .post-page .blog-post h1 {
    font-size: 1.8rem;
  }
  .post-page .blog-post h2 {
    font-size: 1.5rem;
  }
  .post-page .blog-post h3 {
    font-size: 1.3rem;
  }
  .post-page .blog-post p {
    font-size: 1rem;
  }
  
  /* Responsive Login Page */
  .login-body {
    padding: 20px; /* Reduce padding on small screens */
  }

  .login-box {
    padding: 25px; /* Adjust box padding */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Lighter shadow on mobile */
  }

  .login-box h2 {
    font-size: 1.8rem; /* Smaller heading on mobile */
  }

  .login-box input {
    font-size: 0.95rem; /* Slightly smaller font for inputs */
  }

  .login-box button {
    font-size: 1rem; /* Adjust button font size */
    padding: 12px;
  }

  .login-logo img {
    width: 80px; /* Smaller logo on mobile */
  }
}
