/* ========= Reset & brand variables ========= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --q-bg1: #fff;
  --q-bg2: #f7f7fb;
  --q-border: rgba(13, 16, 40, 0.08);
  --q-shadow: 0 4px 12px rgba(6, 12, 38, 0.06);
  --q-accent: #133670;
  --q-accent-2: #4d8bf0;
}

/* ========= Layout ========= */
.containerp {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: nowrap;
}
.questions-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 300px;
  max-width: 800px;
  width: 100%;
}
.questions-container ul {
  list-style: none;
}

/* Заголовки в фирменном градиенте */
.page-title,
.questions-title,
.questions-container h2,
h1,
h2 {
  display: flex;
  justify-content: center;
  text-align: center;
  font-weight: 800;
  font-size: 1.8rem;
  margin: 0 0 18px;
  background: linear-gradient(145deg, #4d8bf0, #133670);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========= Вопрос — карточка ========= */
.question-card {
  position: relative; /* контейнер для меню */
  background: linear-gradient(180deg, var(--q-bg1), var(--q-bg2));
  border: 1px solid var(--q-border);
  border-radius: 20px;
  box-shadow: var(--q-shadow);
  padding: 16px 18px;
  color: #0f1220;
  max-width: 100%;
  overflow: visible; /* важно для меню «…» */
  word-wrap: break-word;
  margin-bottom: 18px; /* расстояние между карточками */
}
/* без ховер-эффекта */
.question-card:hover {
  transform: none;
  box-shadow: var(--q-shadow);
}

/* Шапка */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.question-header .question-author {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.question-header .author-info {
  font-weight: 800;
  color: #0f1220;
}
.question-header .question-date {
  margin-left: auto;
  font-size: 0.86rem;
  color: #6b7280;
  white-space: nowrap;
}

/* Аватар */
.question-header .avatar,
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.comment-avatar {
  width: 32px;
  height: 32px;
}

/* Текст вопроса и медиа */
.question-text {
  color: #0f1220;
  white-space: normal;
  word-break: break-word;
}
.question-card img {
  max-width: 100%;
  height: auto;
}
.question-text img,
.question-body img,
.question-content img,
.comment-text img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  margin: 8px 0;
  box-shadow: 0 2px 8px rgba(6, 12, 38, 0.08);
}

/* Теги — без обводки */
.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 6px;
}
.question-tags .tag,
.question-tag,
.tag-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef5ff, #f5f7ff);
  color: var(--q-accent);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  box-shadow: none;
  cursor: default;
}

/* Ответ */
.question-answer {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--q-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(6, 12, 38, 0.05);
}

/* Футер */
.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(13, 16, 40, 0.06);
}

/* Кнопки */
.show-answer-btn {
  border: none;
  color: #fff;
  background: linear-gradient(145deg, var(--q-accent-2), var(--q-accent));
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(77, 139, 240, 0.28);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.show-answer-btn.unanswered {
  background: linear-gradient(145deg, #133670, #4d8bf0);
}
.show-answer-btn:hover {
  filter: none;
  transform: none;
  box-shadow: 0 6px 14px rgba(77, 139, 240, 0.28);
}

/* «Комментарии» — без синего ховера */
.show-comments-btn,
a.show-comments-btn {
  background: transparent !important;
  border: none !important;
  color: var(--q-accent) !important;
  font-weight: 700 !important;
  padding: 8px 0 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.show-comments-btn:hover,
a.show-comments-btn:hover,
.show-comments-btn:focus,
a.show-comments-btn:focus {
  background: transparent !important;
  color: var(--q-accent) !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

/* Комментарии */
.question-comments {
  display: none;
  border-radius: 6px;
  margin-top: 10px;
  max-width: 100%;
}
.comment-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--q-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(6, 12, 38, 0.06);
  margin-bottom: 12px;
  padding: 6px 10px;
}
.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.comment-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-user {
  font-weight: 700;
  font-size: 14px;
  color: #333;
}
.comment-date {
  font-size: 10px;
  color: #888;
  white-space: nowrap;
  margin-left: auto;
  text-align: right;
}
.comment-text {
  margin: 10px 5px;
}

/* Ввод комментария */
.comment-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  flex-wrap: wrap;
}
.comment-input {
  flex: 1;
  border: none;
  padding: 5px 8px;
  height: 28px;
  border-radius: 6px;
  background: #f9f9f9;
  font-size: 14px;
}
.comment-input:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 3px rgba(19, 54, 112, 0.3);
}
.comment-submit {
  background: #133670;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
}
.comment-submit:hover {
  background: #133670;
}

/* Меню опций (три точки) */
.question-options {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 5;
  color: #5b6b95;
  background: transparent;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}
.question-options i {
  font-size: 20px;
  line-height: 1;
  transform: rotate(90deg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.options-menu {
  position: absolute;
  top: 34px;
  right: 8px;
  z-index: 10;
  min-width: 150px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 5px 0;
  display: none;
}
.options-menu ul {
  list-style: none;
}
.options-menu li {
  padding: 8px 15px;
  cursor: pointer;
  white-space: nowrap;
}
.options-menu li:hover {
  background: #f0f0f0;
}

/* Пагинация */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.page-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4d8bf0, #133670);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s;
  min-width: 42px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.page-btn:hover {
  transform: scale(1.06);
}
.page-btn.active {
  background: #133670;
  font-weight: 700;
  transform: scale(1.1);
  pointer-events: none;
}
.page-btn.disabled {
  background: #ccc;
  color: #777;
  cursor: not-allowed;
  box-shadow: none;
}
.page-btn.prev::before {
  content: "←";
  font-weight: 700;
  margin-right: 4px;
}
.page-btn.next::after {
  content: "→";
  font-weight: 700;
  margin-left: 4px;
}

/* ========= Responsive ========= */
@media (max-width: 1024px) {
  .side-filters {
    width: 100%;
    max-width: 500px;
    position: relative;
    top: auto;
    margin-bottom: 20px;
  }
}
@media (max-width: 768px) {
  .questions-container {
    max-width: 100%;
    padding: 0 10px;
  }
  .question-card {
    padding: 14px;
  }
  .question-header {
    gap: 8px;
  }
  .question-header .question-author {
    gap: 8px;
  }
  /* дата уходит под имя */
  .question-header .question-date {
    margin-left: 0;
  }
  .question-footer {
    flex-wrap: nowrap;
    gap: 10px;
  }
  .question-footer > * {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
  }
  .show-answer-btn,
  .show-comments-btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
  }
}
@media (max-width: 600px) {
  .page-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}
/* Теги в списке вопросов: чистый текст, без фона */
.question-tags .tag,
.question-tags a.tag {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;

  color: var(--q-accent);
  cursor: pointer;
  text-decoration: none; /* ← нет линии по умолчанию */
  border-bottom: 1px dashed transparent; /* аккуратный ховер-акцент */
  line-height: 1.2; /* на всякий случай для ровной базы */
  transition: color 0.15s ease, border-color 0.15s ease;
}

/* Ховер/фокус: только цвет + пунктирная линия, без синего фона */
.question-tags .tag:hover,
.question-tags .tag:focus-visible,
.question-tags a.tag:hover,
.question-tags a.tag:focus-visible {
  color: #0f2a5a;
  border-bottom-color: currentColor; /* тонкая пунктирная линия под хештегом */
  outline: none;
}
