.container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.page-content {
  flex: 1 1 0%;
  margin-right: 240px;
}

.page-content:has(+ .rightbar:empty) {
  margin-right: 0;
}

.rightbar {
  width: 300px;
  max-width: 30vw;
  margin-left: 2rem;
  background: #f8f9fa;
  border-left: 1px solid #e0e0e0;
  padding: 1rem;
  overflow-y: auto;
  height: auto;
  position: sticky;
  top: 50px;
  box-sizing: border-box;
}

.rightbar:empty {
  display: none !important;
}

body.scrolled .rightbar {
  height: calc(100vh - 50px);
  position: fixed;
  right: 0;
  top: 50px;
}

h1, h2, h3, h4, h5, h6 {
  color: #333;
}

ul.cardlist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.carditem {
  background-color: #fff;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

li.carditem:hover {
  color: #0070f3;
  border-color: #0070f3;
}

/* タイトル */
li.carditem a {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

li.carditem a:hover {
  color: #0070f3;
}

.card-date {
  font-size: 0.9rem;
  color: #888;
  margin-top: auto;
  text-align: right;
}

.card-excerpt {
  font-size: 1rem;
  color: #666;
  margin: 10px 0;
  line-height: 1.6;
  text-overflow: ellipsis;
  height: 60px;
  display: -webkit-box;
  line-clamp: 5;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

div.status-bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 54px;
}

ul.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin-left: 12px;
}

ul.breadcrumb li:not(:last-of-type)::after {
  content: ">";
  margin: 0 4px;
}

div.post-meta {
  margin-bottom: 1rem;
  color: #666;
  font-size: 0.9rem;
}

@media screen and (max-width: 767px) {
  .rightbar {
    display: none;
  }

  .page-content {
    margin-right: 0;
  }
}