/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Malayalam', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}


/* --- Navbar --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fff;
  padding: 0.75rem 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 999;
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2e7d32; /* deep green */
  cursor: pointer;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
}

.nav-links li {
  position: relative;
}

.nav-links > li {
  margin-left: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 0.5rem;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: #2e7d32;
}

/* --- Dropdown --- */
.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-radius: 6px;
  overflow: hidden;
  z-index: 999;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu li a {
  display: block;
  padding: 0.6rem 1rem;
  color: #333;
  font-weight: 400;
}

.dropdown-menu li a:hover {
  background-color: #e8f5e9; /* light green hover */
  color: #2e7d32;
}


.login-redirect {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 5rem;
}

.login-redirect h2 {
  color: #1e7f3e;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.login-redirect .buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.login-redirect button {
  background-color: #1e7f3e;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.login-redirect button:hover {
  background-color: #16632a;
}

/* --- Mobile responsive --- */
@media (max-width: 1024px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    background-color: #fff;
    width: 100%;
    box-shadow: 0 8px 16px #145a32;
  }

  .nav-links li {
    margin: 0;
  }

  .nav-links li a {
    padding: 1rem;
    border-bottom: 1px solid #eee;
  }

  .nav-links.show {
    display: flex;
  }
}

.profile-menu {
  position: relative;
  margin-left: 1.5rem;
}
/* --- Profile Icon (SVG) --- */
.profile-menu {
  position: relative;
  margin-left: 1.5rem;
}

.profile-btn {
  background: none;
  border: none;
  padding: 0.4rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-btn:hover {
  background-color: #e8f5e9;
}

.profile-icon {
  width: 22px;
  height: 22px;
  stroke: #2e7d32;
  fill: none;
  stroke-width: 1.8;
}

/* Dropdown */
.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 130%;
  background: #fff;
  min-width: 220px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border-radius: 10px;
  overflow: hidden;
  z-index: 1000;
}

.profile-dropdown li {
  list-style: none;
}

.profile-dropdown a {
  display: block;
  padding: 0.9rem 1.2rem;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.profile-dropdown a:hover {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.profile-menu:hover .profile-dropdown {
  display: block;
}

/* Button */
.profile-btn {
  background: none;
  border: none;
  padding: 0.4rem;
  border-radius: 50%;
  cursor: pointer;
}

/* Dropdown */
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px); /* tiny spacing */
  background: #fff;
  min-width: 220px;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s ease;
  z-index: 1000;
}

/* 🔥 INVISIBLE HOVER BRIDGE */
.profile-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 0;
  width: 100%;
  height: 10px;
}

/* Show dropdown when hovering anywhere */
.profile-menu:hover .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


/* ===== Main Container ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ===== Page Title ===== */
.article-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
    line-height: 1.4;
}

/* ===== Post Cards ===== */
#posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.article-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.article-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-category {
    font-size: 13px;
    font-weight: 500;
    color: #0066cc;
}

.article-title-card {
    font-weight: 600;
    font-size: 18px;
    line-height: 1.4;
}

.article-author,
.article-date {
    font-size: 13px;
    color: #666;
}

.article-text {
    font-size: 14px;
    color: #333;
}

/* ===== Featured Image (for single post page) ===== */
.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== Blockquotes ===== */
.article-content blockquote {
    border-left: 4px solid #ff6b6b;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 20px;
}

/* ===== Tags ===== */
.tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.tag {
    background: #e9ecef;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover {
    background: #ff6b6b;
    color: white;
}

/* ===== Share Buttons ===== */
.share-section {
    margin: 40px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.share-title {
    font-weight: 600;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    color: white;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.email { background: #ea4335; }

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===== Comments Section ===== */
.comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e9ecef;
}

.comments-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.comment-box {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Noto Sans Malayalam', sans-serif;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.comment-box:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255,107,107,0.1);
}

.sign-in-link {
    display: inline-block;
    margin-top: 10px;
    color: #0066cc;
    text-decoration: none;
}

.sign-in-link:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
footer {
    background: #1a1a1a;
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 14px;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff6b6b;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .article-title {
        font-size: 24px;
    }
    .featured-image { height: 250px; }
    .article-meta { flex-direction: column; gap: 10px; }
    nav { display: none; }
    .share-buttons { justify-content: center; }
    #posts-container { grid-template-columns: 1fr; }
}


/* ================= CATEGORY PAGE SPECIFIC STYLES ================= */

.category-header {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.category-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.category-header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.95;
}

.category-filter {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 0 2rem;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--primary-green);
  background: white;
  color: var(--primary-green);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-green);
  color: white;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.article-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--light-gray);
}

.article-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-category {
  display: inline-block;
  background: var(--light-green);
  color: var(--primary-green);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  width: fit-content;
}

.article-title {
  font-size: 1.3rem;
  color: var(--primary-green);
  margin-bottom: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.article-excerpt {
  color: var(--gray-text);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--gray-text);
  padding-top: 1rem;
  border-top: 1px solid var(--border-gray);
}

.article-author {
  font-weight: 600;
  color: var(--dark-text);
}

.article-date {
  color: var(--gray-text);
}

.read-more {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  margin-top: 1rem;
}

.read-more:hover {
  color: var(--primary-green);
}

.no-articles {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-text);
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--accent-green);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0.6rem 1rem;
  border: 1px solid var(--primary-green);
  background: white;
  color: var(--primary-green);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.pagination-btn:hover,
.pagination-btn.active {
  background: var(--primary-green);
  color: white;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================= DARK MODE SUPPORT ================= */

body.dark-mode .article-card {
  background: var(--dark-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .article-title {
  color: var(--dark-text-light);
}

body.dark-mode .article-excerpt {
  color: var(--dark-gray-text);
}

body.dark-mode .filter-btn {
  background: var(--dark-card);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
  background: var(--accent-green);
  color: var(--dark-card);
}

/* ================= RESPONSIVE DESIGN ================= */

@media (max-width: 768px) {
  .category-header h1 {
    font-size: 2rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }

  .category-filter {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .category-header {
    padding: 2rem 1rem;
  }

  .category-header h1 {
    font-size: 1.5rem;
  }

  .category-header p {
    font-size: 0.95rem;
  }

  .category-filter {
    gap: 0.5rem;
    padding: 0 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .articles-grid {
    gap: 1rem;
    padding: 1.5rem 0.5rem;
  }

  .article-title {
    font-size: 1.1rem;
  }

  .article-excerpt {
    font-size: 0.9rem;
  }
}


