:root {
  --color-white: #fff;
  --color-blue: #0073aa;
  --color-dark-blue: #005a87;
  --color-gray: #666;
  --size-height-post-viewers-btn: 40px;
  --size-width-main-container: 900px;
  --size-width-post-viewers-btn: 102px;
  --material-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

a {
  text-decoration: none;
}

p, a {
  word-wrap: break-word;
}

li,
ol {
  list-style: none;
}

/* style.css */
body {
  font-family: "Arial", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
}

.site-title {
  margin-left: 20px;
}

.site-title a {
  color: #333;
  text-decoration: none;
}

.site-main {
  padding: 20px;
  max-width: var(--size-width-main-container);
  margin: 20px auto;
}

#scroll-top-btn {
  position: fixed;
  width: 64px;
  height: 48px;
  bottom: 20px;
  left: calc((100% - 64px) / 2);
  background-color: var(--color-blue);
  color: var(--color-white);
  border: none;
  border-radius: 5px;
  font-size: 26px;
  cursor: pointer;
  display: none;
  box-shadow: var(--material-box-shadow);
}

/* Post List Styles for Index Page */
.post-list article {
  background: var(--color-white);
  border: 1px solid #ddd;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--material-box-shadow);
}

.post-list .entry-header h2 {
  color: var(--color-blue);
  font-size: 1.5em;
}

.post-list .entry-footer {
  margin-top: 15px;
  font-size: 0.875em;
  color: var(--color-gray);
}

/* Post Page Styles */
.entry-header h1 {
  font-size: 2em;
  color: #333;
  margin-bottom: 10px;
}

.entry-meta {
  font-size: 0.875em;
  color: var(--color-gray);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
}

.meta-author {
  margin: 0;
}

.meta-date {
  margin: 0;
}

.entry-content p {
  font-size: 1.125em;
  line-height: 1.6;
  margin-bottom: 15px;
}

.entry-footer {
  margin-top: 50px;
  font-size: 0.875em;
  color: #777;
  border-top: 1px solid #ddd;
  padding-top: 10px;
}

.entry-category a {
  background-color: var(--color-blue);
  color: var(--color-white);
  padding: 6px 10px;
  border-radius: 3px;
  box-shadow: var(--material-box-shadow);
}

.entry-footer .text-area {
  display: flex;
  flex-direction: row;
}

.entry-author,
.posted-on {
  width: 50%;
}

.posted-on {
  text-align: right;
}

#viewers-container {
  height: var(--size-height-post-viewers-btn);
  width: var(--size-width-post-viewers-btn);
  margin-right: 1rem;
}

#post-viewers-list {
  background-color: var(--color-blue);
  color: #ecf0f1;
  padding: 0 8px;
  border-radius: 5px;
  cursor: pointer;
  height: var(--size-height-post-viewers-btn);
  width: var(--size-width-post-viewers-btn);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  box-shadow: var(--material-box-shadow);
}

#post-viewers-list:hover {
  background: var(--color-dark-blue);
}

#post-viewers-list.expanded {
  position: fixed;
  top: 20%;
  left: calc((100vw - 12rem) / 2);
  width: 12rem;
  height: auto;
  background-color: var(--color-white);
  box-shadow: var(--material-box-shadow);
  border-radius: 10px;
  padding: 20px;
  color: #333;
  z-index: 1000;
  flex-direction: column;
}

.viewers-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

#post-viewers-list.expanded .viewers-title {
  justify-content: center;
}

#post-viewers-list.expanded .viewers-title h3 {
  margin-right: 8px;
}

.viewers-title h3,
#viewers-loding {
  margin: 0;
  font-size: 16px;
}

.viewers-number {
  background-color: #2c3e50;
  color: var(--color-white);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 14px;
}

#viewers-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

#post-viewers-list.expanded #viewers-list {
  display: flex !important;
  flex-direction: column;
  align-items: center;
}

#viewers-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

#viewers-list li:last-child {
  border-bottom: none;
}

.close {
  display: none;
}

.open {
  display: block;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
}

/* Navigation Links */
.nav-links,
.post-navigation {
  text-align: center;
  margin: 30px 0;
}

#top .nav-links {
  display: flex;
  justify-content: center;
}

#post .nav-links {
  display: flex;
  justify-content: space-around;
}

.nav-previous a,
.nav-next a,
.nav-links a {
  box-shadow: var(--material-box-shadow);
}

.nav-previous a,
.nav-next a {
  font-size: 12px;
}

.nav-previous a,
.nav-next a,
.nav-links a,
.nav-links span {
  background: var(--color-blue);
  color: var(--color-white);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  display: inline-block;
}

.nav-links .page-numbers {
  margin: 0 0.2rem;
}

.nav-previous a:hover,
.nav-next a:hover,
.nav-links a:hover {
  background: var(--color-dark-blue);
}

.nav-links span.page-numbers.current {
  background-color: var(--color-gray);
}

/* Sidebar Styles */
#nav-menu {
  padding: 20px 20px 88px 20px;
  background: #333;
  color: var(--color-white);
  box-shadow: var(--material-box-shadow);
}

#nav-menu h3 {
  border-bottom: 1px solid #555;
  padding-bottom: 5px;
  cursor: auto !important;
}

#nav-menu a {
  color: var(--color-white);
  text-decoration: none;
}

#nav-menu ul {
  list-style-type: none;
  padding: 0;
}

#nav-menu li {
  margin: 10px 0;
}

#nav-menu a:hover {
  text-decoration: underline;
}

.logout {
  padding-top: 12px;
}

.logout a {
  display: block;
}

/* Comment Section Styles */
.commentlist {
  list-style-type: none;
  padding: 0;
}

.comment {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fafafa;
}

.comment-author img {
  float: left;
  margin-right: 10px;
  border-radius: 50%;
}

.comment-author .fn {
  font-weight: bold;
}

.comment-meta {
  font-size: 0.875em;
  color: var(--color-gray);
}

.comment-body p {
  margin: 10px 0;
}

.comment-reply-link {
  background: var(--color-blue);
  color: var(--color-white);
  padding: 5px 10px;
  border-radius: 5px;
  text-decoration: none;
}

.comment-reply-link:hover {
  background: var(--color-dark-blue);
}

.children {
  margin-top: 15px;
}

#respond {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #f4f4f4;
}

.comment-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
}

.comment-form input[type="submit"] {
  background: var(--color-blue);
  color: var(--color-white);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: var(--material-box-shadow);
}

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

@media screen and (min-width: 768px) {
  body {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-around;
  }

  .site-title {
    width: 100%;
  }

  .site-main {
    width: 65vw;
    margin: 0 0 88px 0;
    padding: 0;
  }

  #nav-menu {
    min-width: 200px;
    max-width: 35vw;
    border-radius: 5px;
    padding: 20px;
  }
}
