/* Category and Post Styles */
:root {
  --card-bg: #1a1a1a;
  --card-hover-bg: #232323;
  --post-meta-bg: rgba(0, 0, 0, 0.2);
  --comment-date-color: var(--dark-primary); /* Green color for comment dates */
  --button-green: #2e7d32; /* Green color for buttons */
  --button-hover-green: #388e3c; /* Lighter green for hover states */
}

/* === CATEGORY PAGE STYLES === */
.category-page-wrapper {
  min-height: 100vh;
}

.category-hero {
  padding: 60px 0;
}

.category-hero h1 {
  margin-bottom: 15px;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* Post Card */
.post-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  background-color: var(--card-hover-bg);
}

.post-card-image-link {
  display: block;
  width: 100%;
  overflow: hidden;
}

.post-card-image-container {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  background-color: var(--dark-surface);
}

.post-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.05);
}

.post-card-no-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--dark-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-no-image::after {
  content: "No Image";
  color: var(--dark-text-secondary);
  font-size: 0.9rem;
}

.post-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--dark-text-secondary);
}

/* Meta Icons */
.meta-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  vertical-align: middle;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.date-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' fill='none' stroke='rgba(176, 176, 176, 0.9)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.category-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' fill='none' stroke='rgba(46, 125, 50, 0.9)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.post-date,
.post-category {
  padding: 4px 8px;
  border-radius: 4px;
  background-color: var(--post-meta-bg);
  display: inline-flex;
  align-items: center;
}

.post-category {
  color: var(--dark-primary);
}

.post-card-title {
  font-size: 1.25rem;
  margin-bottom: 15px;
  line-height: 1.4;
}

.post-card-title a {
  color: var(--dark-text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-card-title a:hover {
  color: var(--dark-primary);
}

.post-card-excerpt {
  color: var(--dark-text-secondary);
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  flex-grow: 1;
}

.read-more-link {
  color: var(--dark-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
  margin-top: auto;
  display: inline-block;
}

.read-more-link:hover {
  color: #388e3c;
}

/* Blog archive styles for index.php */
.blog-archive {
  padding: 60px 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.blog-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  background-color: var(--card-hover-bg);
}

.blog-card-image {
  width: 100%;
  overflow: hidden;
}

.blog-card-image a {
  display: block;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.blog-card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-thumbnail {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: var(--dark-text-secondary);
}

.blog-card-meta .meta-icon {
  width: 14px;
  height: 14px;
}

.blog-card-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
  line-height: 1.4;
}

.blog-card-title a {
  color: var(--dark-text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-card-title a:hover {
  color: var(--dark-primary);
}

.blog-card-excerpt {
  color: var(--dark-text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
  flex-grow: 1;
}

.read-more-btn {
  color: var(--dark-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
  margin-top: auto;
}

.read-more-btn:hover {
  color: #388e3c;
}

.read-more-btn .chevron-right {
  transition: transform 0.3s ease;
}

.read-more-btn:hover .chevron-right {
  transform: translateX(3px);
}

/* Blog pagination */
.blog-pagination {
  margin-top: 40px;
  text-align: center;
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  margin: 0 5px;
  color: var(--dark-text-secondary);
  text-decoration: none;
  border-radius: 4px;
  background-color: var(--dark-surface);
  transition: all 0.3s ease;
}

.blog-pagination .page-numbers.current {
  background-color: var(--dark-primary);
  color: var(--dark-text-primary);
}

.blog-pagination .page-numbers:hover:not(.current) {
  background-color: var(--card-hover-bg);
  color: var(--dark-text-primary);
}

/* No Posts Found */
.no-posts-found {
  text-align: center;
  padding: 50px 20px;
  background-color: var(--dark-surface);
  border-radius: 8px;
  width: 100%;
  grid-column: 1 / -1;
}

.no-posts-found h2 {
  margin-bottom: 15px;
  color: var(--dark-text-primary);
}

.no-posts-found p {
  margin-bottom: 20px;
  color: var(--dark-text-secondary);
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  background-color: var(--dark-surface);
  border-radius: 8px;
  grid-column: 1 / -1;
}

.no-results h2 {
  margin-bottom: 15px;
  color: var(--dark-text-primary);
}

.no-results p {
  margin-bottom: 20px;
  color: var(--dark-text-secondary);
}

.btn-default {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--dark-primary);
  color: var(--dark-text-primary);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.btn-default:hover {
  background-color: #388e3c;
}

/* Pagination */
.pagination-container {
  margin: 30px 0;
  text-align: center;
}

.pagination-container .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 5px;
  border-radius: 4px;
  background-color: var(--dark-surface);
  color: var(--dark-text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination-container .page-numbers.current {
  background-color: var(--dark-primary);
  color: var(--dark-text-primary);
}

.pagination-container .page-numbers:hover:not(.current) {
  background-color: var(--card-hover-bg);
  color: var(--dark-text-primary);
}

.pagination-prev,
.pagination-next {
  font-weight: 600;
}

/* === SINGLE POST STYLES === */
.single-post {
  margin-bottom: 50px;
}

.post-hero {
  padding: 80px 0 40px;
}

.post-hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
}

.post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.post-categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-categories a {
  padding: 4px 8px;
  border-radius: 4px;
  background-color: var(--post-meta-bg);
  color: var(--dark-primary);
  text-decoration: none;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.post-categories a:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

.post-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  line-height: 1.2;
}

.post-excerpt {
  font-size: 1.2rem;
  color: var(--dark-text-secondary);
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Reduced size of featured image */
.post-featured-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 650px; /* Further reduced from 800px */
  margin: 0 auto;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Content layout */
.content-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* Post Tags */
.post-tags {
  margin: 40px 0;
  padding: 20px;
  background-color: var(--dark-surface);
  border-radius: 8px;
}

.post-tags h4 {
  margin-bottom: 15px;
  color: var(--dark-text-primary);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tags-list a {
  display: inline-block;
  padding: 6px 12px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  color: var(--dark-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.tags-list a:hover {
  background-color: var(--dark-primary);
  color: var(--dark-text-primary);
}

/* Post Navigation */
.post-navigation {
  margin: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
}

.post-nav-links {
  display: flex;
  justify-content: space-between;
}

.post-nav-prev,
.post-nav-next {
  display: flex;
  flex-direction: column;
  max-width: 45%;
  text-decoration: none;
  transition: all 0.3s ease;
}

.post-nav-prev {
  text-align: left;
}

.post-nav-next {
  text-align: right;
  align-items: flex-end;
}

.nav-label {
  color: var(--dark-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.nav-title {
  color: var(--dark-primary);
  font-weight: 600;
}

.post-nav-prev:hover .nav-title,
.post-nav-next:hover .nav-title {
  color: #388e3c;
}

.empty {
  flex: 1;
}

/* Related Posts */
.related-posts {
  margin: 10px 0;
}

.related-posts h3 {
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-post-card {
  margin-bottom: 0;
}

.related-post-card .post-card-title {
  font-size: 1rem;
}

/* Comments Section - More Compact & Professional */
.comments-area {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-title {
  margin-bottom: 25px;
  font-size: 1.5rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin-bottom: 30px;
}

/* More compact comment styling */
.comment {
  margin-bottom: 20px;
  padding: 15px;
  background-color: var(--dark-surface);
  border-radius: 8px;
}

.comment-author {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.comment-author img {
  border-radius: 50%;
  margin-right: 10px;
  width: 40px; /* Smaller avatar */
  height: 40px;
}

.comment-metadata {
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* Fix spacing between commenter name and "says" */
.comment-author .fn {
  margin-right: 5px;
}

.comment-author .says {
  margin-left: 5px;
}

/* Fixed comment date color */
.comment-metadata a,
.comment-metadata a:link,
.comment-metadata a:visited,
.comment-metadata a:hover,
.comment-metadata a:active,
a.comment-date,
a.comment-date:link,
a.comment-date:visited,
a.comment-date:hover,
a.comment-date:active,
time.comment-date,
.comment-metadata time {
  color: var(--dark-primary) !important;
  font-weight: 500;
  text-decoration: none;
}

.comment-content {
  margin-bottom: 10px;
}

.comment-content p {
  margin: 0 0 10px;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.reply {
  text-align: right;
}

.reply a {
  color: var(--dark-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.reply a:hover {
  color: #388e3c;
  text-decoration: underline;
}

/* Nested comments - more compact */
.comment .children {
  margin-left: 15px;
  margin-top: 15px;
  list-style: none;
  padding-left: 15px;
  border-left: 2px solid var(--dark-primary);
}

/* Comment Form */
.comment-respond {
  margin-top: 25px;
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* IMPORTANT: These styles remove all headings from the comment form */
.comment-reply-title,
#reply-title,
.comment-respond h3 {
  display: none !important;
}

/* Custom heading that replaces h3 */
.custom-comment-title {
  margin-bottom: 15px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark-text-primary);
  display: inline-block;
}

/* Custom reply title class - specific for reply mode */
.comment-respond.comment-reply .custom-comment-title {
  content: "Add a reply" !important;
}

/* Style for cancel reply link */
.custom-cancel-reply {
  margin-left: 10px;
  font-size: 14px;
  font-weight: normal;
}

.custom-cancel-reply a {
  color: var(--dark-primary);
  text-decoration: none;
}

.custom-cancel-reply a:hover {
  text-decoration: underline;
}

/* Comment form layout - matching screenshot */
.compact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.compact-form .comment-notes {
  grid-column: 1 / -1;
  margin-bottom: 10px;
}

.compact-form .comment-form-comment {
  grid-column: 1 / 2;
  grid-row: 2 / 4;
  margin: 0;
}

.compact-form .comment-form-author {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  margin: 0;
}

.compact-form .comment-form-email {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
  margin: 0;
}

.compact-form .comment-form-cookies-consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  margin: 0;
}

.compact-form .comment-form-cookies-consent input[type="checkbox"] {
  margin-right: 8px;
  margin-top: 4px;
}

.compact-form .form-submit {
  grid-column: 1 / -1;
  margin-top: 10px;
}

/* Form fields styling */
.compact-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.compact-form textarea,
.compact-form input[type="text"],
.compact-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  background-color: #262626;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--dark-text-primary);
  border-radius: 6px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.compact-form textarea:focus,
.compact-form input[type="text"]:focus,
.compact-form input[type="email"]:focus {
  border-color: var(--dark-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

/* Submit button styling - GREEN and LARGER */
.compact-form input[type="submit"] {
  background-color: var(--button-green);
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: normal;
}

.compact-form input[type="submit"]:hover {
  background-color: var(--button-hover-green);
}

/* Hiding any comments headings with Cancel link */
h1 a#cancel-comment-reply-link,
h2 a#cancel-comment-reply-link,
h3 a#cancel-comment-reply-link,
h4 a#cancel-comment-reply-link,
h5 a#cancel-comment-reply-link,
h6 a#cancel-comment-reply-link {
  display: none !important;
}

/* Force fix for any h3 container that might get added */
h3#reply-title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Logged in message styling */
.logged-in-as {
  grid-column: 1 / -1;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.logged-in-as a {
  color: var(--dark-primary);
  text-decoration: none;
}

.logged-in-as a:hover {
  text-decoration: underline;
}

/* Responsiveness for comment form */
@media (max-width: 768px) {
  .compact-form {
    display: block;
  }

  .compact-form .comment-form-comment,
  .compact-form .comment-form-author,
  .compact-form .comment-form-email {
    margin-bottom: 15px;
  }

  .compact-form .comment-form-cookies-consent {
    margin: 15px 0;
  }

  .post-title {
    font-size: 1.8rem;
  }

  .posts-grid,
  .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-nav-links {
    flex-direction: column;
    gap: 20px;
  }

  .post-nav-prev,
  .post-nav-next {
    max-width: 100%;
  }

  .post-nav-next {
    align-items: flex-start;
    text-align: left;
  }

  .post-featured-image {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .post-meta {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .post-card:hover,
  .post-card:hover .post-card-image,
  .blog-card:hover,
  .blog-card:hover .blog-card-thumbnail {
    transition: none;
    transform: none;
  }
}

/* Pagination styles */
.pagination-container {
  margin: 40px 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.pagination-container ul {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination-container li {
  margin: 0;
  padding: 0;
}

/* Pagination styling */
.pagination-container .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 16px;
  text-decoration: none;
  border-radius: 4px;
  background-color: rgba(50, 50, 50, 0.6);
  transition: background-color 0.2s ease;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Active page */
.pagination-container .page-numbers.current {
  color: #ffffff;
  background-color: #2e7d32;
  font-weight: 500;
}

/* Hover */
.pagination-container .page-numbers:hover:not(.current) {
  background-color: rgba(70, 70, 70, 0.8);
}

/* Next/Previous buttons */
.pagination-prev,
.pagination-next {
  min-width: 80px !important;
}

/* Dots between pages */
.pagination-container .page-numbers.dots {
  background: none;
  box-shadow: none;
}

/* Screen reader text */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Mobile pagination visibility */
@media (max-width: 768px) {
  .pagination-container,
  .pagination-container ul {
    display: flex !important;
    visibility: visible !important;
  }

  .pagination-container .page-numbers {
    min-width: 35px;
    height: 35px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .pagination-container .page-numbers {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    font-size: 13px;
  }

  /* Always show these elements on small screens */
  .pagination-container .page-numbers.current,
  .pagination-container .page-numbers.prev,
  .pagination-container .page-numbers.next {
    display: inline-flex !important;
  }
}