/**
 * NB NOW — Single post layout (article pages only)
 *
 * ONE WRAPPER:  .article-main (flex, centers children)
 * ONE WIDTH:    .article-container + .related-container = 900px max-width, margin auto
 * READING COL:  .article-meta through .article-footer = 680px max-width, margin auto
 * Do not add other width/centering rules for single; this file is the single source of truth.
 */

/* Reading progress bar */
.single-post .reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 3px;
  background-color: transparent;
}

.single-post .reading-progress__bar {
  height: 100%;
  background-color: #12163d;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Main article shell — ensure content area is never black/blank */
.single-post #content {
  padding-left: 0;
  padding-right: 0;
  background-color: #ffffff;
}

.single-post .site-main {
  margin: 0;
}

.single-post .article-main {
  min-height: 100vh;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.single-post .article-container {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 20px 64px;
}

/* Fallback when single post loop is empty (wrong URL or post not found) */
.single-post .article-not-found {
  padding: 48px 20px 64px;
}
.single-post .article-not-found p {
  margin: 0 0 1em;
}
.single-post .article-not-found a {
  color: #12163d;
  text-decoration: underline;
}

@media (max-width: 639.98px) {
  .single-post .article-container {
    padding-top: 32px;
  }
}

/* Metadata row */
.single-post .article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* Constrain core article content to a 680px reading column centered
   within the wider 900px container for better visual centering
   relative to the \"What to read next\" section. */
.single-post .article-meta,
.single-post .article-headline,
.single-post .article-deck,
.single-post .article-byline,
.single-post .article-hero,
.single-post .article-body,
.single-post .article-footer {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.single-post .category-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 2px;
  font-family: var(--nb-font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background-color: #12163d;
  color: #ffffff;
}

.single-post .meta-separator {
  color: rgba(0, 0, 0, 0.25);
  font-size: 12px;
}

.single-post .publish-time,
.single-post .read-time {
  font-family: var(--nb-font-sans);
  font-size: 13px;
  color: #6b7280;
}

.single-post .read-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

.single-post .icon-clock {
  width: 12px;
  height: 12px;
}

/* Headline & deck */
.single-post .article-headline {
  font-family: var(--nb-font-sans);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #12163d;
  margin-bottom: 20px;
}

.single-post .article-deck {
  font-family: var(--nb-font-sans);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.65;
  color: #374151;
  margin-bottom: 32px;
}

/* Byline / author */
.single-post .article-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  gap: 20px;
  flex-wrap: wrap;
}

.single-post .byline-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.single-post .author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

.single-post .author-info {
  display: flex;
  flex-direction: column;
}

.single-post .author-name {
  font-family: var(--nb-font-sans);
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  transition: color 0.2s ease;
  text-decoration: none;
}

.single-post .author-name:hover {
  color: #12163d;
}

.single-post .author-role {
  font-family: var(--nb-font-sans);
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

@media (max-width: 639.98px) {
  .single-post .article-byline {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Share row */
.single-post .share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.single-post .share-label {
  font-family: var(--nb-font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  margin-right: 8px;
}

.single-post .share-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background-color: #ffffff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.single-post .share-btn svg {
  color: rgba(17, 24, 39, 0.7);
}

.single-post .share-btn:hover {
  background-color: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.2);
}

/* Hero image */
.single-post .article-hero {
  margin-bottom: 40px;
}
.single-post .hero-image-wrapper {
  overflow: hidden;
}

.single-post .hero-image {
  width: 100%;
  height: auto;
  display: block;
}

.single-post .hero-caption {
  font-family: var(--nb-font-sans);
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  margin-top: 12px;
}

/* Article body */
.single-post .article-body {
  margin-top: 8px;
}

/* Article footer */
.single-post .article-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.single-post .article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-post .tag-link {
  padding: 6px 12px;
  font-family: var(--nb-font-sans);
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  text-decoration: none;
  color: #111827;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.single-post .tag-link:hover {
  background-color: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.2);
}

.single-post .footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.single-post .save-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--nb-font-sans);
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;
}

.single-post .save-btn:hover {
  color: #111827;
}

/* Related articles */
.single-post .related-articles {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 56px 0;
}

.single-post .related-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.single-post .related-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.single-post .related-title {
  font-family: var(--nb-font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #111827;
  white-space: nowrap;
}

.single-post .related-divider {
  flex: 1;
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
}

.single-post .related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 640px) {
  .single-post .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.single-post .related-card {
  display: flex;
  flex-direction: column;
}

.single-post .card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

.single-post .card-image {
  aspect-ratio: 16 / 10;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.single-post .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease-out;
}

.single-post .related-card:hover .card-image img {
  transform: scale(1.03);
}

.single-post .card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.single-post .card-category {
  font-family: var(--nb-font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #111827;
  margin-bottom: 10px;
}

.single-post .card-headline {
  font-family: var(--nb-font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  color: #111827;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.single-post .related-card:hover .card-headline {
  color: #12163d;
}

.single-post .card-summary {
  font-family: var(--nb-font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: #6b7280;
  margin-bottom: 12px;
  flex: 1;
}

.single-post .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.single-post .card-time {
  font-family: var(--nb-font-sans);
  font-size: 12px;
  color: #6b7280;
}

.single-post .card-read-more {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--nb-font-sans);
  font-size: 12px;
  font-weight: 600;
  color: #12163d;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.single-post .related-card:hover .card-read-more {
  opacity: 1;
}

