/* ==============================================
   COMMENTS SECTION — VISUAL STYLING
   ============================================== */

/* Base container */
section.comments {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-top: 2px solid #ccc;
  border-radius: 6px;
  background: #fafafa;
  color: #222;
}

/* Header with toggle control */
section.comments h2.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 600;
  color: #003366;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.25rem;
}

/* The + / – toggle icon */
.comments-toggle {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: #003366;
  border: 1px solid #003366;
  border-radius: 50%;
  width: 1.6rem;
  height: 1.6rem;
  text-align: center;
  background-color: #fff;
  transition: all 0.25s ease;
}

.comments-toggle:hover {
  background-color: #003366;
  color: #fff;
}

/* Individual comment cards */
section.comments article {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.75rem 0;
  margin-bottom: 0.5rem;
}

section.comments article:last-of-type {
  border-bottom: none;
}

/* Comment title (linked heading) */
section.comments h3.title a {
  text-decoration: none;
  color: #002b4f;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

section.comments h3.title a:hover {
  color: #0055a5;
}

/* Comment body text */
section.comments .field--name-comment-body {
  font-size: 0.96rem;
  line-height: 1.6;
  letter-spacing: 0.015em;
  color: #333;
  margin-top: 0.4rem;
}

/* Submitted info */
section.comments footer p.submitted {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.25rem;
}

/* Action links (Edit / Delete / Permalink) */
section.comments ul.links.inline {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
}

section.comments ul.links.inline a {
  color: #0056a6;
  text-decoration: none;
}

section.comments ul.links.inline a:hover {
  text-decoration: underline;
}

/* The "Add new comment" form area */
section.comments form.comment-form {
  margin-top: 1.5rem;
  border-top: 1px solid #ddd;
  padding-top: 1rem;
  background: #fff;
  border-radius: 6px;
}

/* Hide comment list when collapsed */
.comments-collapsed .comments-list {
  display: none;
}

/* When expanded */
.comments-expanded .comments-list {
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  section.comments {
    padding: 1rem;
  }
  section.comments h2.title {
    font-size: 1.15rem;
  }
}

/************************************************************
 * Elgar Theme — Unified CSS for Collapsible Comments & Forms
 * Author: Chittaranjan (Sarvatra / Elgar)
 * Purpose: Keeps both comment bodies and comment forms clean,
 * collapsible, and visually consistent with Marathi typography.
 ************************************************************/

/* ========== 1️⃣  Collapsible Comment Bodies ========== */

.comment-toggle {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.4rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: #5b3b1f;
  background: transparent;
  border: 1px solid #c7b49a;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.1;
  transition: all 0.2s ease-in-out;
}

.comment-toggle:hover,
.comment-toggle:focus {
  background: #f3ebe2;
  border-color: #b59b7b;
  color: #3b2413;
}

.comment__title-inline {
  display: inline;
  font-size: 1rem;
  color: #3b2413;
}

.comment__author-inline {
  font-size: 0.9rem;
  color: #7c6444;
}

.comment__content {
  /* margin: 0.5rem 0 1rem 1.8rem;
  padding: 0.35rem 0.75rem; */
  border-left: 2px solid #d8c3a8;
  background: #faf8f6;
  border-radius: 4px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.comment__content.expanded {
  opacity: 1;
  max-height: 2000px;
  margin: 0.5rem 0 1rem 1.8rem;
  padding: 0.35rem 0.75rem;
}

/* ========== 2️⃣  Collapsible Comment Form ========== */

.comment-form-toggle {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid #d1bfa7;
  border-radius: 4px;
  background: #f8f4ef;
  color: #7a4f26;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.comment-form-toggle:hover {
  background: #ede3d7;
  color: #4a301a;
  border-color: #b79c77;
}

.comment-form-toggle[aria-expanded="true"] {
  background: #e9ddcf;
  color: #3b2413;
  border-color: #b79c77;
}

/* --- Collapsible Form Wrapper --- */
.comment-form-wrapper {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  margin-top: 0.25rem;
}

.comment-form-wrapper.expanded {
  opacity: 1;
  max-height: 1200px;
  margin-top: 0.5rem;
}

.comment-form-wrapper[hidden] {
  display: none !important;
}

/* Hide the default “Add new comment” link from node links */
.node__links a[href*="#comment-form"] {
  display: none !important;
}

/* ========== 3️⃣  Responsive & Accessibility ========== */

@media (prefers-reduced-motion: reduce) {
  .comment__content,
  .comment-form-wrapper {
    transition: none !important;
  }
}

.comment-toggle:focus,
.comment-form-toggle:focus {
  outline: 2px solid #b79c77;
  outline-offset: 2px;
}

/************************************************************
 * End of Unified Collapsible Styles
 ************************************************************/

 /* ========== 4️⃣  Collapse comment links together with content ========== */

/* Hide links when comment body is collapsed */
.comment__content:not(.expanded) + .comment__links {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  margin-top: 0;
  padding-top: 0;
}

/* Show links when comment body is expanded */
.comment__content.expanded + .comment__links {
  opacity: 1;
  max-height: 50px; /* enough for two inline links */
  margin-top: 0.25rem;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

/* Smooth spacing control for inline links */
.comment__links ul.links.inline {
  display: inline-flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #6b5033;
}

.comment__links a {
  color: #6b5033;
  text-decoration: none;
}

.comment__links a:hover {
  text-decoration: underline;
  color: #3b2413;
}