:root {
  --base-blue: #0969da;
  --base-black: #1f2328;
  --base-black: #242424;
  --base-black: #000000e6;
  --base-gray: #59636e;
  --base-gray: #6b6b6b;
  --base-gray: #828282;

  --color-primary: var(--base-blue);
  --color-text: var(--base-black);
  --color-text-muted: var(--base-gray);
  --color-error: #e74c3c;
  --color-bg: #fff;
  --color-input-border: #d1d9e0;
  --color-input-border-focus: var(--color-primary);
  --color-button-bg: #f6f8fa;
  --color-button-bg-hover: #eff2f5;

  --font-main: Verdana, Geneva, sans-serif;
  --font-sans-serif: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --size-xxs: 0.625rem;
  --size-xs: 0.6875rem;
  --size-sm: 0.825rem;
  --size-md: 1rem;
  --size-lg: 1.5rem;
  --spacing-unit: 0.5rem;
}

@media (max-width: 700px) {
  :root {
    font-size: 14px;
  }
}

/* normalize */

*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
}

a {
  outline: none;
  color: inherit;
}

button {
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

/* base */

body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-weight: 400;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

label {
  color: var(--color-text);
  opacity: 0.95;
  font-weight: 500;
  font-family: var(--font-sans-serif);
  font-size: 14px;
}

input,
textarea {
  display: block;
  width: 100%;
  border-radius: 0.25rem;
  border: 1px solid var(--color-input-border);
  padding: 5px 12px;
  resize: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

input {
  height: 2rem;
}

input:focus,
textarea:focus {
  border-color: var(--color-input-border-focus);
  box-shadow: inset 0 0 0 1px var(--color-input-border-focus);
  outline: none;
}

.note {
  color: var(--color-text-muted);
  font-size: var(--size-xs);
}

.container {
  margin: 0 auto;
  max-width: 800px;
  background-color: white;
}

.err-msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  font-weight: 500;
}

.bi {
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentcolor;
  height: 1rem;
  width: 1rem;
}

/* utils */

.icon-lg {
  height: 1.2rem;
  width: 1.2rem;
}

.icon-xl {
  height: 1.6rem;
  width: 1.6rem;
}

.btn {
  height: 30px;
  padding: 0 12px 1px;
  border: 1px solid var(--color-input-border);
  border-radius: 0.375rem;
  background-color: var(--color-button-bg);
  font-size: var(--size-sm);
  font-family: var(--font-sans-serif);
  font-weight: 500;
  transition: opacity 0.3s;
}

.btn:hover {
  border: 1px solid var(--color-primary);
  background-color: var(--color-primary);
  color: #fff;
}

/* flash */

.val-err {
  display: block;
  font-size: 0.75rem;
  color: var(--color-error);
}

.flash-wrapper {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flash-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  background-color: #262626;
  color: #ffffff;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInOut 5s ease-in-out forwards;
}
.flash-text {
  flex-grow: 1;
  line-height: 1.4;
  margin-right: 10px;
}

@keyframes slideInOut {
  0% {
    transform: translateY(100px);
    opacity: 0;
  }
  10% {
    transform: translateY(0);
    opacity: 1;
  }
  90% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100px);
    opacity: 0;
    display: none;
  }
}

/* navbar */

.nav-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: white;
  border-bottom: solid 1px #f2f2f2;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  max-width: 50rem;
  height: 3.5rem;
  padding: 0 1rem;
  background-color: white;
  font-family: var(--font-sans-serif);
}

.logo {
  text-decoration: none;
  color: inherit;
  font-size: 1.3rem;
  font-weight: 800;
}

.nav-links-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

/* post form */

#toolbar-container {
  position: -webkit-sticky;
  position: sticky;
  top: calc(4.5rem + 1px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 30rem;
  height: 3rem;
  margin: 0 auto;
  border: none;
  border-radius: 1.5rem;
  background-color: #f2f4f7;
}

#toolbar-container svg {
  height: 1.2rem;
  width: 1.2rem;
}

#post-form {
  padding: 1rem 1rem 1.5rem;
}

@media (max-width: 700px) {
  #post-form {
    padding: 0 0 1rem;
  }
}

#post-form .title-input {
  margin: 0.5rem 0 0;
  width: 100%;
  padding: 1rem;
  overflow-y: hidden;
  border: none;
  box-shadow: none;
  outline: none;
  resize: none;
  line-height: 1.2;
  background: transparent;
  color: inherit;
  font-size: 2.5rem;
  font-weight: 400;
  font-family: var(--font-serif);
  font-variant-numeric: lining-nums;
  -moz-font-feature-settings: 'lnum';
  -webkit-font-feature-settings: 'lnum';
  font-feature-settings: 'lnum';
}

#post-form .title-input::placeholder {
  color: #b3b3b1;
  font-weight: 400;
}

#editor {
  border: none;
}

#post-form .ql-editor {
  overflow-y: visible;
  height: auto;
  min-height: 150px;
  padding: 0 1rem;
  line-height: 1.6;
  font-size: 1.25rem;
  font-family: var(--font-serif);
  font-variant-numeric: lining-nums;
  -moz-font-feature-settings: 'lnum';
  -webkit-font-feature-settings: 'lnum';
  font-feature-settings: 'lnum';
}

#post-form .ql-editor.ql-blank::before {
  color: #b3b3b1;
  font-style: normal;
}

#post-form .ql-snow .ql-editor h1 {
  margin-top: 2rem;
  font-size: 2rem;
  font-weight: 500;
  font-family: var(--font-sans-serif);
}

#post-form .ql-snow .ql-editor h2 {
  margin-top: 1.5rem;
  font-size: 1.5rem;
  font-weight: 500;
  font-family: var(--font-sans-serif);
}

#post-form .ql-snow .ql-editor h1:first-child,
#post-form .ql-snow .ql-editor h2:first-child {
  margin-top: 0;
}

#post-form .ql-snow .ql-editor > * + * {
  margin-top: 1rem;
}

#post-form .ql-snow .ql-editor blockquote {
  margin-top: 1rem;
}

#post-form .ql-snow .ql-editor ol,
#post-form .ql-snow .ql-editor ul {
  padding-left: 0.5rem;
}

#post-form .ql-snow .ql-editor a {
  color: inherit;
}

#post-form .ql-snow .ql-editor p img {
  display: block;
  margin: 0 auto;
}

/* post */

.post-wrapper {
  padding: 1rem 2rem 1.5rem;
  line-height: 1.6;
  font-family: var(--font-serif);
}

@media (max-width: 700px) {
  .post-wrapper {
    padding: 1rem;
  }
}

.post-title {
  display: block;
  width: 100%;
  line-height: 1.2;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 400;
  font-weight: 800;
  font-family: var(--font-sans-serif);
}

.post-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem 0;
  font-family: var(--font-sans-serif);
}

.post-info a {
  text-decoration: none;
  opacity: 0.9;
  font-weight: 500;
}

.post-info a:hover {
  text-decoration: underline;
}

.post-info span {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.post-content {
  font-size: 1.25rem;
  font-variant-numeric: lining-nums;
  -webkit-font-feature-settings: 'lnum';
  font-feature-settings: 'lnum';
}

.post-content h1 {
  margin-top: 2.5rem;
  font-size: 2rem;
  font-weight: 500;
  font-family: var(--font-sans-serif);
}

.post-content h2 {
  margin-top: 2rem;
  font-size: 1.5rem;
  font-weight: 500;
  font-family: var(--font-sans-serif);
}

.post-content > * + * {
  margin-top: 1.5rem;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
}

.post-content ol {
  padding-left: 2.5rem;
}

.post-content ol li[data-list='ordered'] {
  list-style-type: decimal;
}

.post-content ol li[data-list='bullet'] {
  list-style-type: disc;
}

.post-content blockquote {
  border-left: 3px solid #333;
  padding-left: 1rem;
  font-style: italic;
  color: rgba(0, 0, 0, 0.6);
}

.post-content a {
  color: inherit;
}

/* profile */

.profile-wrapper {
  padding: 1rem 1.5rem 1.5rem;
  font-family: var(--font-sans-serif);
}

.profile-name {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
}

.profile-username {
  text-align: center;
  font-weight: 500;
  margin-bottom: 1rem;
}

.profile-bio {
  margin: 0 auto;
  max-width: 500px;
  text-align: center;
}

.profile-contact-wrapper {
  margin: 1rem 0;
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  font-weight: 500;
}

@media (max-width: 700px) {
  .profile-contact-wrapper {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
}

.profile-contact-wrapper > * {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}

.profile-contact-wrapper > *:hover {
  opacity: 0.9;
}

.profile-contact-wrapper buttom {
  cursor: pointer;
}

.profile-contact-wrapper svg {
  margin-top: 0.125rem;
  height: 1.125rem;
  width: 1.125rem;
}

.profile-posts-wrapper {
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.profile-posts-wrapper a {
  text-decoration: none;
}

.profile-posts-wrapper a:hover {
  text-decoration: underline;
}

.profile-action-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 500px) {
  .profile-action-wrapper {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
}

.profile-action {
  border-radius: 12px;
  padding: 0.7rem 3rem;
  text-decoration: none;
  background-color: #f0f2f5;
  color: #0c1014;
  font-size: 0.85rem;
  font-weight: 500;
}

.profile-action:hover {
  background-color: #e7eaee;
}

.profile-section-title {
  margin-top: 1.5rem;
  font-size: 1.7rem;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-serif);
}

.profile-post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.profile-post-list .profile-post-title {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-weight: 700;
  font-size: 1.2rem;
}

.profile-post-title:hover {
  text-decoration: underline;
}

.profile-post-item {
  font-weight: 500;
  font-size: 0.9rem;
}

.profile-post-item div {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.profile-post-item a {
  text-decoration: none;
}

.profile-post-item a:hover {
  text-decoration: underline;
}

.profile-post-item span {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.btn-publish-post {
  padding: 5px 1.5rem 6px;
  border-radius: 1rem;
  background-color: #1a8917;
  color: #fff;
  font-weight: 500;
  font-size: var(--size-sm);
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.btn-publish-post:hover {
  opacity: 0.95;
}

.btn-delete-post:hover {
  text-decoration: underline;
}

.profile-comments-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.5rem 1rem;
  font-size: var(--size-sm);
}

/* edit profile */

.edit-profile-wrapper {
  padding: 1rem;
  padding-bottom: 1.5rem;
  margin: 0 auto;
  max-width: 30rem;
  font-size: var(--size-sm);
}

.edit-profile-section-title {
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 1.3rem;
}

.edit-profile-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.edit-profile-wrapper form div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* stories */

.stories-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem;
}

.story-item {
  display: flex;
  gap: 0.1rem;
  min-height: 2rem;
}

.story-rank {
  margin-top: 2px;
  min-width: 1.5rem;
  text-align: right;
  font-size: var(--size-sm);
  color: var(--color-text-muted);
}

.story-caret-wrapper {
  color: #999999;
  font-size: 0.75rem;
}

.story-caret-wrapper button.active {
  color: var(--color-text);
}

.story-caret-wrapper button.up {
  margin-top: 3px;
}

.story-caret-wrapper span {
  display: inline-block;
  margin-top: 3px;
  color: white;
}

.li .story-content {
  display: flex;
  flex-direction: column;
}

.story-title {
  display: inline;
  margin: 0;
  font-size: var(--size-sm);
  font-weight: 400;
}

.story-title a {
  text-decoration: none;
}

.story-title .story-link:visited {
  color: var(--color-text-muted);
}

.story-title .story-source {
  font-size: 11px;
  margin-left: 0.3rem;
  color: var(--color-text-muted);
}

.story-title .story-source:hover {
  text-decoration: underline;
}

.story-subtext {
  font-size: var(--size-xxs);
  color: var(--color-text-muted);
}

.story-subtext a {
  text-decoration: none;
}

.story-subtext a:hover {
  text-decoration: underline;
}

/* story form */

.story-wrapper {
  padding: 1rem;
  padding-bottom: 1.5rem;
  margin: 0 auto;
  font-size: var(--size-sm);
}

.story-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 38rem;
  margin: 0 auto;
}

.story-wrapper form > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* comment story */

.comment-story-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
}

.comment-story-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 0.8rem;
  margin-bottom: 0.2rem;
  opacity: 0.9;
  font-size: var(--size-sm);
}

.comment-story-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 38rem;
  padding-left: 0.8rem;
  font-size: var(--size-sm);
}

/* comment list */

.comment-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.5rem;
  font-size: var(--size-sm);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-left: 2rem;
}

.comment-item {
  display: flex;
  gap: 0.2rem;
}

.comment-caret-wrapper {
  color: #999999;
  font-size: 12px;
}

.comment-caret-wrapper button.active {
  color: var(--color-text);
}

.comment-caret-wrapper span {
  display: inline-block;
  margin-top: 3px;
  color: white;
}

.comment-author-info {
  margin-bottom: 0.2rem;
  color: var(--color-text-muted);
  font-size: var(--size-xs);
}

.comment-author-info a {
  text-decoration: none;
}

.comment-author-info a:hover {
  text-decoration: underline;
}

.comment-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-reply {
  font-size: 10px;
}

/* reply comment */

.comment-reply-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: var(--size-sm);
}

.comment-reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 38rem;
  padding-left: 0.8rem;
}

/* edit comment */

.comment-edit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: var(--size-sm);
}

.comment-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 38rem;
}

/* footer */

.footer {
  text-align: center;
  font-size: var(--size-xs);
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.footer-line {
  border: none;
  border-top: 1px solid var(--color-text-muted);
  margin: 1rem 0;
}

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--color-text);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links span {
  margin: 0 0.25rem;
}
