/* -------------------
   Single Post Page - Full CSS (Clean & Optimized)
------------------- */

/* Main container for single article */
.single-article {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem;
  font-family: 'Merriweather', Georgia, serif;
  color: #333;
  line-height: 1.85; /* more readable */
  letter-spacing: 0.5px;
  font-weight: 400;
}

.single-article ul {
  list-style: inherit !important;
}

/* Featured Image */
.single-article .post-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 30px;
  object-fit: cover;
}

/* Post Title */
.single-article .post-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #111;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

/* Category Chips */
.single-article .post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.single-article .post-categories .category-chip {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  border-radius: 50px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.single-article .post-categories .category-chip:hover {
  opacity: 0.8;
}

/* SDGs-inspired palette */
.single-article .post-categories .category-chip:nth-child(1n) { background: #E5243B; } 
.single-article .post-categories .category-chip:nth-child(2n) { background: #FF3A21; } 
.single-article .post-categories .category-chip:nth-child(3n) { background: #FCC30B; } 
.single-article .post-categories .category-chip:nth-child(4n) { background: #A21942; } 
.single-article .post-categories .category-chip:nth-child(5n) { background: #FD6925; } 
.single-article .post-categories .category-chip:nth-child(6n) { background: #DD1367; } 
.single-article .post-categories .category-chip:nth-child(7n) { background: #C5192D; } 
.single-article .post-categories .category-chip:nth-child(8n) { background: #FFA500; } 
.single-article .post-categories .category-chip:nth-child(9n) { background: #FF6F61; } 
.single-article .post-categories .category-chip:nth-child(10n) { background: #BF8B2E; } 

/* Post Content */
.single-article .post-content {
  font-size: 1.125rem;
  line-height: 1.85;
  margin-bottom: 40px;
  letter-spacing: 0.5px;
  word-break: break-word;
}

/* Paragraph spacing */
.single-article .post-content p {
  margin-bottom: 1.6em;
}

/* Headings inside content */
.single-article .post-content h2,
.single-article .post-content h3,
.single-article .post-content h4 {
  margin: 2em 0 1em 0;
  line-height: 1.4;
  font-weight: 600;
}

/* Lists inside content */
.single-article .post-content ul,
.single-article .post-content ol {
  margin: 1.5em 0 1.5em 2em;
  line-height: 1.8;
}

/* Images inside content */
.single-article .post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.25rem 0;
}

/* Blockquotes */
.single-article .post-content blockquote {
  border-left: 4px solid #ccc;
  padding-left: 15px;
  color: #555;
  font-style: italic;
  margin: 2em 0;
}

/* Links inside content */
.single-article .post-content a {
  color: #007acc;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.single-article .post-content a:hover {
  color: #005fa3;
}

/* Code blocks */
.single-article .post-content pre,
.single-article .post-content code {
  font-family: 'Courier New', Courier, monospace;
  background: #f5f5f5;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
}

/* -------------------
   Share Buttons as Buttons with SVG center
------------------- */
.single-article .post-share {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 5rem 0;
}

.single-article .post-share span {
  font-weight: 600;
  margin-right: 10px;
}

.single-article .post-share__menu {
  align-items: center;
  display: flex;
}

/* Generic style for all share buttons */
.single-article .post-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;         
  height: 40px;        
  border-radius: 100%;
  color: #fff;
  margin-right: 10px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Center SVG inside button */
.single-article .post-share a svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  fill: #fff;
}

/* Hover effect */
.single-article .post-share a:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

/* Brand colors */
.single-article .post-share a[href*="facebook.com"] {
  background-color: #1877F2; /* Facebook blue */
}

.single-article .post-share a[href*="twitter.com"] {
  background-color: #1DA1F2; /* Twitter / X blue */
}

/* Related Posts / You May Also Like */
.single-article .you-may-also-like > h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.single-article .related-posts {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.single-article .related-posts .related-item {
  flex: 1 1 calc(50% - 10px);
  box-sizing: border-box;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  overflow: hidden;
  background-color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.single-article .related-posts .related-item a {
  display: block;
  color: #111;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.single-article .related-posts .related-item a:hover {
  transform: translateY(-5px);
}

/* Images */
.single-article .related-posts .related-item a img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #eee;
}

/* Post Title / Link inside a */
.single-article .related-posts .related-item a h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 10px 15px;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.single-article .related-posts .related-item a:hover h4 {
  color: #005fa3; /* highlight on hover */
  text-decoration: underline;
}

/* ---------------------------
   Comment Form - Chat Bubble Style
---------------------------- */
.comments-area .comment-form {
  background-color: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.comments-area .comment-form .comment-form-author,
.comments-area .comment-form .comment-form-email,
.comments-area .comment-form .comment-form-url,
.comments-area .comment-form .comment-form-comment {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Modern textarea style for comment form */
.comments-area .comment-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background-color: #fff;
  transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Focus effect */
.comments-area .comment-form textarea:focus {
  outline: none;
  border-color: #ff6f61;
  box-shadow: 0 0 0 2px rgba(255,111,97,0.2);
  background-color: #fffefc;
}

/* Placeholder styling */
.comments-area .comment-form textarea::placeholder {
  color: #aaa;
  font-style: italic;
  opacity: 1;
}

.comments-area .comment-form input:focus,
.comments-area .comment-form textarea:focus {
  outline: none;
  border-color: #ff6f61;
  box-shadow: 0 0 0 2px rgba(255,111,97,0.2);
}

/* Submit button */
.comments-area .comment-form .form-submit {
  display: inline-block;
}

.comments-area .comment-form button,
.comments-area .comment-form input[type="submit"] {
  background-color: #ff6f61;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s;
}

.comments-area .comment-form button:hover,
.comments-area .comment-form input[type="submit"]:hover {
  background-color: #e65a50;
}

/* Form labels */
.comments-area .comment-form label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

.comments-area .comment-form-author input,
.comments-area .comment-form-email input,
.comments-area .comment-form-url input {
  width: 100%;
  padding: 6px 15px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background-color: #fff;
  transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Logged-in comment form links */
.comments-area .logged-in-as a {
  color: #007acc;
  text-decoration: none;
  transition: color 0.3s;
}

.comments-area .logged-in-as a:hover {
  color: #005a99; /* slightly darker on hover */
  text-decoration: underline;
}

/* ---------------------------
   Comments Title
---------------------------- */
.comments-area .comments-title {
  font-size: 1.5rem;          /* bigger and readable */
  font-weight: 700;           /* bold title */
  margin-bottom: 20px;        /* space below the title */
  padding-bottom: 5px;
  border-bottom: 2px solid #ff6f61; /* underline to match theme color */
  color: #333;
  text-transform: capitalize; /* optional, capitalize first letters */
}

/* ---------------------------
   Comments Area - Chat Bubble Style
---------------------------- */
.comments-area {
  font-size: 0.875rem;
  max-width: 700px;
  margin: 5rem auto 0;
  padding: 0 15px;
}

/* Comment list */
.comment-list,
.comment-list ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* Individual comment item */
.comment-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 10px;
}

/* Avatar */
.comment-avatar {
  flex-shrink: 0;
}

.comment-avatar img {
  border-radius: 50%;
  width: 48px;
  height: 48px;
  object-fit: cover;
}

/* Comment content */
.comment-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Bubble wrapper */
.comment-bubble {
  background-color: #f3f6f9;
  border-radius: 12px;
  padding: 10px 15px;
  position: relative;
  max-width: 100%;
  word-break: break-word;
}

/* Optional arrow for bubble */
.comment-bubble::before {
  content: '';
  position: absolute;
  top: 10px;
  left: -8px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent #f3f6f9 transparent transparent;
}

/* Comment meta (author + time) */
.comment-meta {
  font-size: 0.85em;
  color: #555;
  margin-bottom: 5px;
}

.comment-author {
  font-weight: bold;
  margin-right: 5px;
}

.comment-time {
  color: #999;
  font-size: 0.8em;
}

/* Comment text */
.comment-text {
  margin: 0;
  line-height: 1.5;
}

/* Reply link */
.comment-reply {
  margin-top: 5px;
  padding-left: 0.875rem;
}

.comment-reply a {
  font-size: 0.85em;
  color: #007acc;
  text-decoration: none;
}

.comment-reply a:hover {
  text-decoration: underline;
}

/* Nested replies */
.comment-list .children {
  margin-left: 60px;
  margin-top: 15px;
  padding-left: 0;
}

/* -------------------
   Responsive Adjustments
------------------- */

/* Tablet / small desktop */
@media (max-width: 1024px) {
  .single-article .related-posts .related-item {
    flex: 1 1 calc(50% - 10px);
  }
}

/* Mobile / small tablet */
@media (max-width: 768px) {
  .single-article {
    padding: 0;
  }

  .single-article .post-title {
    font-size: 1.8rem;
  }
  
  .single-article .post-content .wp-caption {
    width: 100% !important;
  }

  .single-article .post-featured-image img {
    max-height: 400px;
    object-fit: cover;
  }

  .single-article .post-share {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .single-article .related-posts .related-item {
    flex: 1 1 100%;
  }

  .single-article .you-may-also-like > h3 {
    font-size: 1.5rem;
  }

  .comments-area {
    padding: 0;
  }

  .comments-area .comment-form {
    padding: 12px 15px;
  }

  .comments-area .comment-form .comment-form-author,
  .comments-area .comment-form .comment-form-email,
  .comments-area .comment-form .comment-form-url,
  .comments-area .comment-form .comment-form-comment {
    padding: 8px 10px;
  }

  .comments-area .comment-form textarea {
    min-height: 100px;
    padding: 10px 12px;
  }

  .comments-area .comment-form button,
  .comments-area .comment-form input[type="submit"] {
    width: 100%;
    padding: 10px 0;
  }

  .comments-area .comment-form .form-submit {
    width: 100%;
  }

  .comments-area .comments-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

  .comment-item {
    align-items: flex-start;
  }

  .comment-avatar {
    margin-bottom: 8px;
  }

  .comment-list .children {
    margin-left: 30px;
  }

  .comment-bubble::before {
    left: -6px;
    top: 8px;
    border-width: 5px;
  }

  .comment-reply {
    padding-left: 0.875rem;
  }
}

/* Default styles for breadcrumbs */
.breadcrumbs {
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping */
  align-items: center; /* Vertically centers the breadcrumbs */
  justify-content: flex-start; /* Align breadcrumbs to the left */
  overflow: hidden;
}

/* Styling for breadcrumb links */
.breadcrumbs a {
  text-decoration: none;
  color: #0073e6;
  margin-left: 10px;
  margin-right: 10px; /* Space between each breadcrumb link */
  text-transform: capitalize; /* Capitalize the first letter of each word */
  white-space: nowrap; /* Prevent line breaks */
  overflow: hidden; /* Hide overflowing text */
  text-overflow: ellipsis; /* Display '...' if text is too long */
  max-width: 180px; /* Set max width to ensure text doesn't overflow on mobile */
  display: inline-block; /* Prevent wrapping of text */
}

.breadcrumbs a:first-child {
  margin-left: 0;
}

/* Hover effect on breadcrumb links */
.breadcrumbs a:hover {
  text-decoration: underline;
}

/* Styling for the active breadcrumb (last item) */
.breadcrumbs span {
  color: #555;
  text-transform: capitalize; /* Ensure active breadcrumb is capitalized as well */
  white-space: nowrap; /* Prevent wrapping for the current breadcrumb */
  margin-left: 10px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .breadcrumbs {
    margin-bottom: 15px;
  }

  .breadcrumbs a {
    margin-left: 8px;
    margin-right: 8px; /* Slightly smaller space between breadcrumbs on mobile */
    max-width: 120px; /* Set smaller max-width to prevent overflow on smaller screens */
  }

  .breadcrumbs span {
    color: #555;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis; /* Truncate the current breadcrumb text */
  }

  .breadcrumbs::after {
    content: " > "; /* Adds a separator between breadcrumbs */
  }

  /* Disable click on the last breadcrumb (current page) */
  .breadcrumbs a:last-child {
    color: #333; /* Change color of the last breadcrumb */
    pointer-events: none; /* Disable clicking on the current page breadcrumb */
  }
}

/* Very Small Screens (e.g. small mobile phones) */
@media (max-width: 480px) {
  .breadcrumbs {
    margin-bottom: 10px;
  }

  .breadcrumbs a {
    display: inline-block;
    max-width: 90px; /* Smaller max-width for very small screens */
  }

  .breadcrumbs span {
    display: inline-block;
    margin-left: 5px; /* Space between breadcrumb link and its separator */
  }

  /* Last breadcrumb adjustment for very small screens */
  .breadcrumbs a:last-child {
    color: #333;
  }
}

.table-of-contents {
  border: 1px solid #ddd;
  padding: 1rem;
  margin: 1.5rem 0;
  background: #f9f9f9;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.table-of-contents strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1.1em;
}

.table-of-contents ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.table-of-contents li {
  margin: 0.5rem 0;
}

.table-of-contents .toc-level-3 {
  margin-left: 1rem;
  font-size: 0.95em;
}

/* ========================
   Responsive Adjustments
   ======================== */
@media (max-width: 768px) { /* Tablet */
  .table-of-contents {
    font-size: 0.95rem;
    padding: 0.875rem;
  }
  .table-of-contents strong {
    font-size: 1em;
  }
}

@media (max-width: 480px) { /* Mobile */
  .table-of-contents {
    font-size: 0.9rem;
    padding: 0.75rem;
    margin: 1rem 0;
  }
  .table-of-contents ul {
    padding-left: 1rem;
  }
}


