/* ============================================================
   Main Content — index, post, sidebar, pages, pagination
   Based on Shoka design
   ============================================================ */

/* ==========================================================
   Post Cards (.segments.posts > .item)
   ========================================================== */
.segments.posts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.segments.posts > .item {
  display: flex;
  background: var(--grey-1);
  border-radius: 0.625rem;
  box-shadow: 0 0.1rem 0.5rem var(--grey-9-a1);
  overflow: hidden;
  transition: background-color var(--transition-duration) var(--transition-ease),
              box-shadow var(--transition-duration) var(--transition-ease);
}
.segments.posts > .item:hover {
  box-shadow: 0 0.25rem 1rem var(--grey-9-a1);
}

.segments.posts > .item .cover {
  flex-shrink: 0;
  width: 13rem;
  min-height: 10rem;
  position: relative;
  overflow: hidden;
}
.segments.posts > .item .cover img {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.segments.posts > .item:hover .cover img {
  transform: scale(1.05);
}

.segments.posts > .item .info {
  flex: 1;
  padding: 1.25rem 1.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.segments.posts > .item .info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.5rem 0;
  line-height: 1.3;
}
.segments.posts > .item .info h3 a {
  color: var(--primary-color);
  text-decoration: none;
}
.segments.posts > .item .info h3 a:hover {
  color: var(--color-pink);
}

/* Meta */
.meta {
  font-size: 0.8125rem;
  color: var(--grey-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.meta .item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.meta .icon {
  display: inline-flex;
  align-items: center;
}
.meta a {
  color: var(--grey-5);
  text-decoration: none;
}
.meta a:hover {
  color: var(--color-pink);
}
.meta.footer {
  margin-top: auto;
  padding-top: 0.75rem;
}

.excerpt {
  font-size: 0.875rem;
  color: var(--grey-6);
  line-height: 1.6;
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-pink);
  text-decoration: none;
  font-weight: 500;
  align-self: flex-start;
}
.btn:hover {
  text-decoration: underline;
}

/* ==========================================================
   Single Post
   ========================================================== */
.post.wrap {
  padding: 0;
}

.post.wrap > .cover {
  width: 100%;
  max-height: 25rem;
  overflow: hidden;
  border-radius: 0.625rem 0.625rem 0 0;
}
.post.wrap > .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post.wrap > .meta {
  padding: 1.5rem 2rem 0;
}

.post.wrap > h1 {
  padding: 0.5rem 2rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary-color);
}

.post.wrap > .content {
  padding: 1.5rem 2rem;
}

.post.wrap > .tags {
  padding: 0 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.post.wrap > .tags a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  background: var(--color-pink-light);
  color: var(--grey-6);
  font-size: 0.8125rem;
  text-decoration: none;
}
.post.wrap > .tags a:hover {
  color: var(--grey-0);
  background: var(--color-pink);
}

/* Post nav */
.near {
  display: flex;
  justify-content: space-between;
  padding: 0 2rem 1.5rem;
  gap: 1rem;
}
.near a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  max-width: 48%;
}
.near .label {
  font-size: 0.75rem;
  color: var(--grey-5);
  margin-bottom: 0.25rem;
}
.near .title {
  font-size: 0.875rem;
  color: var(--primary-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.near .next {
  text-align: right;
  margin-left: auto;
}

/* ==========================================================
   Markdown (.md)
   ========================================================== */
.md {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--primary-color);
}
.md h1 { font-size: 1.75rem; margin: 2rem 0 1rem; }
.md h2 { font-size: 1.5rem; margin: 1.75rem 0 0.75rem; }
.md h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.md h4, .md h5, .md h6 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.md p { margin-bottom: 1rem; }
.md ul, .md ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.md li { margin-bottom: 0.25rem; }
.md blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--color-pink);
  background: var(--grey-2);
  border-radius: 0 0.25rem 0.25rem 0;
  color: var(--grey-6);
}
.md code {
  font-family: 'Inconsolata', monospace;
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  background: var(--grey-2);
  color: var(--color-pink);
}
.md pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-radius: 0.375rem;
  background: var(--grey-2);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}
.md pre code {
  padding: 0;
  background: none;
  color: inherit;
}
.md img { max-width: 100%; border-radius: 0.25rem; }
.md hr { margin: 2rem 0; border: none; height: 1px; background: var(--grey-3); }
.md table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.md th, .md td { padding: 0.5rem 0.75rem; border: 1px solid var(--grey-3); text-align: left; }
.md th { background: var(--grey-2); font-weight: 600; }

/* ==========================================================
   Sidebar
   ========================================================== */
#sidebar {
  width: 18rem;
  flex-shrink: 0;
  position: sticky;
  top: 4rem;
  align-self: flex-start;
}

#sidebar .panels {
  border-radius: 0.625rem;
  overflow: hidden;
  box-shadow: 0 0.1rem 0.5rem var(--grey-9-a1);
  background: var(--grey-1);
  transition: background-color var(--transition-duration) var(--transition-ease);
}

#sidebar .panels > .inner {
  display: flex;
  transition: transform 0.3s ease;
}

#sidebar .panel {
  flex: 0 0 100%;
  padding: 1.25rem;
  min-height: 10rem;
}

#sidebar .overview .author {
  text-align: center;
  margin-bottom: 1rem;
}
#sidebar .overview .author .image {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-pink);
  margin-bottom: 0.5rem;
}
#sidebar .overview .author .name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
}
#sidebar .overview .author .description {
  font-size: 0.8125rem;
  color: var(--grey-5);
  margin-top: 0.25rem;
}

/* State */
#sidebar .state {
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--grey-3);
  border-bottom: 1px solid var(--grey-3);
}
#sidebar .state .item { text-align: center; }
#sidebar .state .item a { text-decoration: none; color: var(--grey-5); font-size: 0.8125rem; }
#sidebar .state .item .count { display: block; font-size: 1.25rem; font-weight: 700; color: var(--primary-color); }
#sidebar .state .item:hover .count { color: var(--color-pink); }

/* Sidebar menu */
#sidebar .menu { list-style: none; padding: 0; }
#sidebar .menu .item { padding: 0.35rem 0; }
#sidebar .menu .item a {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--grey-6); font-size: 0.875rem;
  padding: 0.35rem 0.5rem; border-radius: 0.25rem;
  transition: all var(--transition-duration) var(--transition-ease);
}
#sidebar .menu .item a:hover,
#sidebar .menu .item.active a {
  color: var(--grey-0);
  background-image: linear-gradient(to right, var(--color-pink) 0, var(--color-orange) 100%);
}
#sidebar .menu .item .ic { font-size: 1rem; width: 1.25rem; text-align: center; }

#sidebar .menu .submenu { list-style: none; padding-left: 1.75rem; display: none; }
#sidebar .menu .item.dropdown.open > .submenu { display: block; }
#sidebar .menu .submenu .item a { font-size: 0.8125rem; }

/* Social */
#sidebar .social {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 0; border-top: 1px solid var(--grey-3); margin-top: 0.75rem;
}
#sidebar .social .item {
  color: var(--grey-5); font-size: 1.1rem; text-decoration: none;
  width: 2rem; height: 2rem; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 50%;
  transition: all var(--transition-duration) var(--transition-ease);
}
#sidebar .social .item:hover { color: var(--grey-0); background: var(--color-pink); }

/* Quick nav */
#quick {
  position: fixed; right: 1rem; top: 50%; transform: translateY(-50%);
  list-style: none; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
#quick li {
  width: 1.75rem; height: 1.75rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  color: var(--grey-5); background: var(--grey-1);
  border: 1px solid var(--grey-3); font-size: 0.75rem; opacity: 0.5;
  transition: all var(--transition-duration) var(--transition-ease);
}
#quick li:hover { opacity: 1; color: var(--color-pink); }
#quick .percent { font-size: 0.625rem; border: none; background: none; cursor: default; }

/* ==========================================================
   Archive, Categories, Tags pages
   ========================================================== */
.archive .segments .year,
.categories .segments .year,
.tag .segments .year {
  font-size: 1.25rem; font-weight: 600; color: var(--color-pink);
  margin: 1.25rem 0 0.5rem; padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--grey-3);
}

.archive .segments .item,
.tag .segments .item {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--grey-2);
}
.archive .segments .item time,
.tag .segments .item time {
  flex-shrink: 0; font-size: 0.8125rem; color: var(--grey-5);
  font-family: 'Inconsolata', monospace;
}
.archive .segments .item a,
.tag .segments .item a {
  color: var(--primary-color); text-decoration: none; font-size: 0.9375rem;
}
.archive .segments .item a:hover,
.tag .segments .item a:hover { color: var(--color-pink); }

.category-list { list-style: none; }
.category-list .category-list-item {
  padding: 0.5rem 0; border-bottom: 1px solid var(--grey-2);
}
.category-list .category-list-item a { color: var(--primary-color); text-decoration: none; }
.category-list .category-list-item a:hover { color: var(--color-pink); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.tag-cloud a { display: inline-block; padding: 0.25rem 0.75rem; color: var(--grey-5); text-decoration: none; }
.tag-cloud a:hover { color: var(--color-pink); }

.page.wrap .title {
  font-size: 1.75rem; font-weight: 700; color: var(--primary-color); margin-bottom: 1.5rem;
}

.empty { color: var(--grey-5); font-style: italic; padding: 2rem 0; }

/* ==========================================================
   Pagination
   ========================================================== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--grey-3);
}
.pagination a, .pagination span {
  display: inline-block; padding: 0.4rem 1rem; font-size: 0.8125rem;
  border-radius: 0.25rem; text-decoration: none; color: var(--primary-color);
  border: 1px solid var(--grey-3);
  transition: all var(--transition-duration) var(--transition-ease);
}
.pagination a:hover { border-color: var(--color-pink); color: var(--color-pink); }
.pagination .disabled { opacity: 0.4; cursor: default; }
.pagination .info { border: none; color: var(--grey-5); }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 900px) {
  #sidebar { width: 100%; position: static; }
  .segments.posts > .item { flex-direction: column; }
  .segments.posts > .item .cover { width: 100%; height: 12rem; }
}

@media (max-width: 768px) {
  .post.wrap > .meta, .post.wrap > h1,
  .post.wrap > .content, .post.wrap > .tags, .near {
    padding-left: 1.25rem; padding-right: 1.25rem;
  }
  #quick { display: none; }
}
