/* ==========================================================================
   DRUPAL 11 COMMENT SYSTEM (MODERN DEFAULT)
   ========================================================================== */

:root {
  --comment-bg: var(--light);
  --comment-border: #e9ecef;
  --comment-text: #212529;
  --comment-meta: #6c757d;
  --comment-reply-indent: 32px;
}
/* Blendet das Startseite/Website-Feld im Kommentarformular sicher aus */
.comment-form .form-item.form-item-homepage{
  display: none;
}
/* Container-Umschließung aller Kommentare */
.comment-wrapper {
  margin-top: 3rem;
  max-width: 800px;
}

/* Titel über der Sektion ("X Kommentare") */
.comment-wrapper__title {
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid var(--comment-border);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

/* Der einzelne Kommentar-Block */
article.comment {
  background: #ffffff;
  border: 1px solid var(--comment-border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Spezifisches Styling für neue/ungelesene Kommentare */
article.comment.comment--new {
  border-left: 4px solid #0066cc;
}

/* Header-Bereich (Autor, Datum, Status) */
.comment__meta {
  font-size: 0.875rem;
  color: var(--comment-meta);
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px dashed var(--comment-border);
  padding-bottom: 0.75rem;
}
.comment__meta p {
  margin: 0;
}
/* Name des Autors */
.comment__author {
  font-weight: 700;
  color: var(--comment-text);
}

/* Zeitstempel */
.comment__time {
  color: var(--comment-meta);
}

/* Der Textinhalt des Kommentars */
.comment__content {
  color: var(--comment-text);
  line-height: 1.6;
  font-size: 1rem;
}
.comment__content h3 {
  margin-top: 0;
}
.comment__content p:last-child {
  margin-bottom: 0;
}

/* Aktions-Links (Antworten, Bearbeiten, Löschen) */
.comment__links {
  margin-top: 1rem;
  padding-top: 0.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Die Links als unaufdringliche Buttons formatieren */
.comment__links a {
  font-size: 0.875rem;
  text-decoration: none;
  font-weight: 600;
  color: #0066cc;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: var(--comment-bg);
  transition: all 0.2s ease;
}
.comment__links a:hover {
  background: #0066cc;
  color: #ffffff;
}

/* Verschachtelte Antworten (Indentation) */
.indented {
  margin-left: var(--comment-reply-indent);
  position: relative;
}

/* Optional: Eine feine visuelle Verbindungslinie für Antworten bauen */
.indented::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--comment-reply-indent) / 2);
  top: -1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: var(--comment-border);
}
/* ==========================================================================
   DRUPAL 11 COMMENT FORM (MODERN DEFAULT)
   ========================================================================== */

/* Container für das gesamte Formular */
.comment-form {
  background: var(--comment-bg);
  border: 1px solid var(--comment-border);
  border-radius: 0;
  padding: 2rem;
  margin-top: 3rem;
  max-width: 800px;
}

/* Titel über dem Formular ("Kommentar schreiben") */
.comment-form__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--comment-text);
}

/* Formular-Element-Reihe (Abstand zwischen den Feldern) */
.comment-form .form-item {
  display: flex;
  flex-direction: column;
}

/* Beschriftungen (Labels) */
.comment-form .form-item label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--comment-text);
}

/* Pflichtfeld-Sternchen rot färben */
.comment-form .form-item label .form-required::after {
  color: #dc3545;
  content: " *";
}

/* Eingabefelder für Name, E-Mail, Website (Anonyme Nutzer) und Textarea */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  font-size: 1rem;
  color: var(--comment-text);
  background-color: #ffffff;
  border: 1px solid var(--comment-border);
  border-radius: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

/* Große Textarea für den eigentlichen Kommentar */
.comment-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* Fokus-Zustand für alle Felder (Barrierefreiheit & Optik) */
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Hinweise zu Textformaten (Filter-Guidelines) dezent im Hintergrund halten */
.comment-form .filter-wrapper {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}
.comment-form .filter-guidelines {
  font-size: 0.8rem;
  color: var(--comment-meta);
}
.comment-form .filter-help {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Aktions-Bereich für Buttons */
.comment-form .form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

/* Der primäre Speicher-Button ("Speichern" / "Vorschau") */
.comment-form input[type="submit"] {
  background-color: var(--hpd-dark);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.comment-form input[type="submit"]:hover {
  background-color: var(--bright-primary);
}

.comment-form input[type="submit"]:active {
  transform: scale(0.98);
}

/* Der sekundäre Vorschau-Button (falls aktiviert) */
.comment-form input[id^="edit-preview"] {
  background-color: transparent;
  color: #0066cc;
  border: 1px solid #0066cc;
}
.comment-form input[id^="edit-preview"]:hover {
  background-color: rgba(0, 102, 204, 0.05);
}

/* Fehlermeldungen direkt an Feldern stylen */
.comment-form .error {
  border-color: #dc3545 !important;
  background-color: rgba(220, 53, 69, 0.02);
}
.comment-form .form-item--error-message {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 0.35rem;
  font-weight: 600;
}
/* Styling für die Comment-Notify Checkbox-Gruppe */
.comment-form .form-item-notify,
.comment-form .form-item-notify-type {
  flex-direction: row !important;
  align-items: center;
  gap: 0.75rem;
}

.comment-form .form-item-notify input[type="checkbox"],
.comment-form .form-item-notify-type select {
  width: auto;
  cursor: pointer;
}

.comment-form .form-item-notify label {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0;
  cursor: pointer;
}
button.show-hide-btn{
  margin: -0.5em 0 1em;
}
button.global-comment-toggle-btn{
  margin: 1em 0;
}
/* Mobil-Optimierung für kleinere Displays */
@media screen and (max-width: 576px) {
  .comment-form {
    padding: 1.25rem;
  }
  .comment-form .form-actions {
    flex-direction: column;
  }
  .comment-form input[type="submit"] {
    width: 100%;
  }
}

/* Mobil-Optimierung: Auf kleinen Bildschirmen die Einrückung reduzieren */
@media screen and (max-width: 768px) {
  :root {
    --comment-reply-indent: 16px;
  }
  article.comment {
    padding: 1rem;
  }
}
