/*
|--------------------------------------------------------------------------
| Forum Auth Navigation
|--------------------------------------------------------------------------
*/

.forum-nav-user {
  display: inline-flex;
  align-items: center;

  min-height: 40px;

  padding:
    8px 12px;

  font-weight:
    800;

  white-space:
    nowrap;
}

.forum-nav-logout {
  min-height:
    40px;

  padding:
    8px 14px;

  border:
    1px solid currentColor;

  border-radius:
    999px;

  background:
    transparent;

  color:
    inherit;

  font:
    inherit;

  font-weight:
    700;

  cursor:
    pointer;
}

/*
|--------------------------------------------------------------------------
| Shared Forum Navigation
|--------------------------------------------------------------------------
*/

.forum-nav {
  width: 100%;
  background: #ffffff;
  border-bottom:
    1px solid
    rgba(127, 127, 127, 0.25);
}

.forum-nav-inner {
  width: min(
    100% - 32px,
    1100px
  );

  min-height: 70px;

  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
}

.forum-nav-brand {
  color: inherit;

  font-size: 1.2rem;
  font-weight: 900;

  text-decoration: none;

  white-space: nowrap;
}

.forum-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forum-nav-links a {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-height: 40px;

  padding: 8px 14px;

  border-radius: 999px;

  color: inherit;

  font-weight: 700;
  text-decoration: none;
}

.forum-nav-links a:hover {
  background:
    rgba(127, 127, 127, 0.1);
}

.forum-nav-login {
  border:
    1px solid
    currentColor;
}


/*
|--------------------------------------------------------------------------
| Forum Navigation Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 700px) {

  .forum-nav-inner {
    align-items: flex-start;
    flex-direction: column;

    padding:
      16px 0;
  }

  .forum-nav-links {
    width: 100%;

    overflow-x: auto;

    padding-bottom: 4px;
  }

  .forum-nav-links a {
    white-space: nowrap;
  }
}

/*
|--------------------------------------------------------------------------
| Shared Forum
|--------------------------------------------------------------------------
*/

.forum-page,
.forum-thread-page,
.forum-create-page {
  width: min(100% - 32px, 1000px);
  margin: 0 auto;
  padding: 32px 0 64px;
}

.forum-page-header,
.forum-create-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.forum-page-title,
.forum-create-header h1,
.forum-thread-header h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.forum-page-description,
.forum-create-header p {
  margin: 0;
  opacity: 0.75;
}

.forum-create-button,
.forum-submit-button,
.forum-cancel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid currentColor;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.forum-create-button,
.forum-submit-button {
  background: #111;
  color: #fff;
  border-color: #111;
}

.forum-cancel-button {
  background: transparent;
  color: inherit;
}

.forum-submit-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

/*
|--------------------------------------------------------------------------
| Thread list
|--------------------------------------------------------------------------
*/

.forum-thread-list {
  display: grid;
  gap: 16px;
}

.forum-thread-card {
  padding: 20px;
  border: 1px solid rgba(127, 127, 127, 0.3);
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.05);
}

.forum-thread-link {
  color: inherit;
  text-decoration: none;
}

.forum-thread-link:hover {
  text-decoration: underline;
}

.forum-thread-title {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.forum-thread-preview {
  margin: 0 0 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.forum-thread-meta,
.forum-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.85rem;
  opacity: 0.65;
}

/*
|--------------------------------------------------------------------------
| Individual thread
|--------------------------------------------------------------------------
*/

.forum-thread {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.3);
}

.forum-thread-header {
  margin-bottom: 24px;
}

.forum-thread-body {
  font-size: 1.05rem;
  line-height: 1.7;
}

.forum-thread-body p,
.forum-post-body p {
  margin: 0;
  white-space: pre-wrap;
}

/*
|--------------------------------------------------------------------------
| Replies
|--------------------------------------------------------------------------
*/

.forum-replies-section,
.forum-reply-section {
  margin-top: 36px;
}

.forum-replies-section > h2,
.forum-reply-section > h2 {
  margin: 0 0 20px;
}

.forum-post {
  padding: 18px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.2);
}

.forum-post-body {
  margin-top: 12px;
  line-height: 1.6;
}

/*
|--------------------------------------------------------------------------
| Forms
|--------------------------------------------------------------------------
*/

.forum-create-form,
.forum-reply-form {
  display: grid;
  gap: 20px;
}

.forum-create-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.forum-create-form input,
.forum-create-form textarea,
.forum-reply-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid rgba(127, 127, 127, 0.4);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.forum-create-form textarea {
  min-height: 220px;
  resize: vertical;
}

.forum-reply-form textarea {
  min-height: 140px;
  resize: vertical;
}

.forum-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.forum-form-status {
  min-height: 24px;
  margin: 0;
}

/*
|--------------------------------------------------------------------------
| States
|--------------------------------------------------------------------------
*/

.forum-empty-state,
.forum-error-state {
  padding: 28px;
  border: 1px dashed rgba(127, 127, 127, 0.4);
  border-radius: 12px;
  text-align: center;
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 640px) {
  .forum-page,
  .forum-thread-page,
  .forum-create-page {
    width: min(100% - 24px, 1000px);
    padding-top: 24px;
  }

  .forum-page-header,
  .forum-create-header {
    flex-direction: column;
  }

  .forum-create-button {
    width: 100%;
    box-sizing: border-box;
  }

  .forum-thread-card {
    padding: 16px;
  }
}
