/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
.navbar {
  background-color: #2c3e50;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
}

.logo:hover {
  color: #3498db;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: #ecf0f1;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #3498db;
}

/* Main content */
#content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Post cards */
.post-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.post-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.post-title a {
  color: #2c3e50;
  text-decoration: none;
}

.post-title a:hover {
  color: #3498db;
}

.post-excerpt {
  color: #666;
  margin: 0 0 1rem;
}

.post-meta {
  color: #999;
  font-size: 0.875rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.page-info {
  color: #666;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.btn:hover:not(:disabled) {
  background-color: #2980b9;
}

.btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

.btn-prev::before {
  content: "\2190 ";
}

.btn-next::after {
  content: " \2192";
}

/* Post detail */
.post-detail {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-detail .post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.post-detail h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  color: #2c3e50;
}

.post-detail .post-content {
  margin-bottom: 2rem;
}

.post-detail .post-content p {
  margin: 0 0 1rem;
}

.post-detail .post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem auto;
  border-radius: 8px;
}

.post-detail .post-footer {
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* Error pages */
.error-page {
  text-align: center;
  padding: 3rem 0;
}

.error-page h1 {
  font-size: 3rem;
  color: #e74c3c;
  margin-bottom: 1rem;
}

.error-page p {
  color: #666;
  margin-bottom: 2rem;
}

.error-panel {
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 4px;
  padding: 1rem;
  color: #c00;
  text-align: center;
}

/* Empty list */
.empty-list {
  text-align: center;
  padding: 3rem 0;
  color: #666;
}

/* Footer */
.footer {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 1.5rem 0;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.875rem;
}

/* Loading indicator for MHX */
.mx-request .btn {
  opacity: 0.7;
  pointer-events: none;
}

/* Link Card styles */
.link-card {
  display: flex;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  margin: 1rem 0;
  transition: box-shadow 0.2s, transform 0.2s;
}

.link-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.link-card-image {
  width: 120px;
  min-width: 120px;
  height: 120px;
  object-fit: cover;
  background: #f0f0f0;
}

.link-card-image-placeholder {
  background: linear-gradient(135deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 200%;
}

.link-card-loading .link-card-image-placeholder {
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.link-card-content {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.link-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: #2c3e50;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-description {
  font-size: 0.875rem;
  color: #666;
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-card-site {
  font-size: 0.75rem;
  color: #999;
}

/* Embed Card styles */
.embed-card {
  margin: 1rem 0;
}

.embed-card iframe {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
}

.embed-slide iframe {
  max-width: 100%;
  min-height: 360px;
  background: #111;
}

.embed-twitter {
  max-width: 550px;
}

.embed-twitter .twitter-tweet {
  margin: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
  }

  .post-detail {
    padding: 1rem;
  }

  .pagination {
    flex-direction: column;
  }

  .link-card {
    flex-direction: column;
  }

  .link-card-image {
    width: 100%;
    height: 160px;
  }
}
