/* Single post / content detail */

.single-post {
  display: block;
}

.single-post-header {
  margin-bottom: 1.25rem;
}

.single-post-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 1rem;
  line-height: 0;
}

.single-post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.single-post-thumbnail .news-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 245, 163, 0.12);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.single-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.single-post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.single-post-meta-item svg {
  width: 13px;
  height: 13px;
}

.single-post-header .breadcrumb {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.single-post-header .breadcrumb a {
  color: var(--text-secondary);
}

.single-post-header .breadcrumb a:hover {
  color: var(--primary);
}

.single-post-header .breadcrumb .current {
  color: var(--text-primary);
}

.single-post-header .breadcrumb-separator {
  margin: 0 0.35rem;
  opacity: 0.7;
}

.single-post-title {
  font-family: var(--font-display, "Outfit", sans-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0;
}

.single-post .post-content {
  background: linear-gradient(135deg, rgba(42, 54, 66, 0.75), rgba(35, 45, 56, 0.9));
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 2rem;
  overflow-x: clip;
}

.single-post .post-content h2 {
  font-family: var(--font-display, "Outfit", sans-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  color: var(--text-primary);
}

.single-post .post-content p,
.single-post .post-content li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

.single-post .post-content ul {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
}

.single-post .post-content ul li {
  margin-bottom: 0.4rem;
}

.single-post .post-content .table-wrap,
.static-page-content .table-wrap,
.static-page .entry-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(28, 37, 46, 0.35);
}

.single-post .post-content table,
.static-page-content .entry-content table,
.static-page .entry-content table,
.single-post .post-content .table-wrap table,
.static-page-content .table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0;
}

.single-post .post-content th,
.single-post .post-content td,
.static-page-content .entry-content th,
.static-page-content .entry-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

.single-post .post-content th,
.static-page-content .entry-content th {
  background: #2a3642;
  color: var(--text-primary);
  font-weight: 600;
}

.single-post .post-content td,
.static-page-content .entry-content td {
  color: var(--text-secondary);
}

.single-post .post-content td strong,
.static-page-content .entry-content td strong,
.single-post .post-content th strong,
.static-page-content .entry-content th strong {
  color: var(--text-primary);
  font-weight: 600;
}

.single-post .post-content tbody tr:nth-child(even) td,
.static-page-content .entry-content tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

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

.single-post .post-content .cai-inline-ad {
  margin-left: 0;
  margin-right: 0;
}

/* Social share */
.social-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.social-share a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.social-share a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.social-share svg {
  width: 18px;
  height: 18px;
}

/* Author box */
.author-box {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  margin: 2.5rem 0;
}

.author-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 999px;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.author-posts-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Related posts */
.related-posts {
  margin: 2.5rem 0;
}

.related-posts-title {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.related-post-card {
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
}

.related-post-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.related-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.related-post-card:hover .related-post-thumb img {
  transform: scale(1.05);
}

.related-post-content {
  padding: 1rem;
}

.related-post-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-title a:hover {
  color: var(--primary);
}

.related-post-excerpt {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.related-post-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.related-post-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

/* Comments */
.comments-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-color);
}

.comments-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.comment-form {
  margin-bottom: 2.5rem;
}

.comment-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.comment-form-group.full-width {
  margin-bottom: 1rem;
}

.comment-form-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.comment-form-group .required {
  color: var(--primary);
}

.comment-form-group input,
.comment-form-group textarea {
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition-fast);
}

.comment-form-group input::placeholder,
.comment-form-group textarea::placeholder {
  color: #fff;
  opacity: 1;
}

.comment-form-group input::-moz-placeholder,
.comment-form-group textarea::-moz-placeholder {
  color: #fff;
  opacity: 1;
}

.comment-form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form-group input:focus,
.comment-form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon > span {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}

.input-with-icon svg {
  width: 18px;
  height: 18px;
}

.input-with-icon input {
  padding-left: 2.75rem;
}

.form-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.comment-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.comment-form-checkbox input {
  width: 16px;
  height: 16px;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.info-box {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.info-box-icon {
  flex-shrink: 0;
  color: var(--primary);
}

.info-box-icon svg {
  width: 24px;
  height: 24px;
}

.info-box-warning {
  border-left: 4px solid var(--primary);
}

.info-box-warning .info-box-icon {
  color: var(--primary);
}

.comment-submit {
  width: 100%;
  padding: 1rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.comment-form-honeypot {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

.logged-in-as {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.logged-in-as a {
  color: var(--primary);
}

.comments-closed {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.comment-list .comment {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
}

.comment-list .comment-author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.comment-list .comment-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.comment-list .comment-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.comment-list .children {
  list-style: none;
  margin: 1rem 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

@media (max-width: 1024px) {
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .single-post .post-content {
    padding: 1.2rem;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  .comment-form-row {
    grid-template-columns: 1fr;
  }
}
