/* ==========================================================================
   Single post — Insights article layout
   Class prefix: post-detail-* (not reference markup names)
   ========================================================================== */

body.single-post {
  --pd-black: #0a0a0f;
  --pd-white: #ffffff;
  --pd-glass: rgba(255, 255, 255, 0.1);
  --pd-text-body: clamp(0.9375rem, 0.15vw + 0.875rem, 1.0625rem);
  --pd-editorial: 17px;
  --pd-editorial-lh: 1.75;
  --pd-nav: var(--nav-offset, 72px);
  background: var(--pd-black);
}

body.single-post .main-wrapper.main-wrapper--post-detail {
  padding: 0;
  max-width: none;
  margin: 0;
  background: transparent;
  width: 100%;
}

body.single-post .post-detail-shell {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.post-detail {
  font-family: var(--font);
  width: 100%;
}

/* ----- Hero ----- */
.post-detail-hero {
  padding: calc(var(--pd-nav) + 80px) clamp(24px, 5vw, 80px) 80px;
  background: var(--pd-black);
  color: rgba(255, 255, 255, 0.7);
}

.post-detail-hero-inner {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.post-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--pd-text-body);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 32px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-detail-back:hover {
  color: var(--pd-white);
}

.post-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.post-detail-tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--pd-glass);
  border-radius: 6px;
  font-size: var(--pd-text-body);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.post-detail-tag:hover {
  color: var(--pd-white);
  border-color: rgba(255, 255, 255, 0.25);
}

.post-detail-title {
  font-weight: 400 !important;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--pd-white);
  margin: 0 0 28px;
}

.post-detail-excerpt {
  font-size: 20px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 32px;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.post-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #4169e1);
  color: var(--pd-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.post-detail-byline {
  flex: 1;
  min-width: 0;
}

.post-detail-author {
  display: block;
  font-weight: 600;
  font-size: 16px;
  color: var(--pd-white);
  margin-bottom: 4px;
  text-decoration: none;
}

.post-detail-author:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-detail-when {
  font-size: var(--pd-text-body);
  color: rgba(255, 255, 255, 0.5);
}

/* ----- Article body ----- */
.post-detail-body {
  padding: 40px clamp(24px, 4vw, 48px);
  background: var(--pd-white);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.post-detail-inner {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.post-detail-cover {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  margin-bottom: 32px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
}

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

.post-detail-content {
  font-size: var(--pd-editorial);
  line-height: var(--pd-editorial-lh);
  color: #444;
}

.post-detail-content > *:first-child {
  margin-top: 0;
}

.post-detail-content::after {
  content: '';
  display: table;
  clear: both;
}

.post-detail-content p {
  margin: 0 0 1.15em;
  font-size: var(--pd-editorial);
  line-height: var(--pd-editorial-lh);
  color: #444;
}

.post-detail-content h2,
.post-detail-content h3,
.post-detail-content h4,
.post-detail-content .wp-block-heading {
  margin: 1.75em 0 0.6em;
  color: var(--pd-black);
  line-height: 1.25;
  padding: 0;
}

.post-detail-content h2:first-child,
.post-detail-content h3:first-child {
  margin-top: 0;
}

.post-detail-content h2 {
  font-weight: 700;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.02em;
}

.post-detail-content h3 {
  font-weight: 600;
  font-size: clamp(22px, 3vw, 28px);
}

.post-detail-content h4 {
  font-weight: 600;
  font-size: clamp(18px, 2.5vw, 22px);
}

.post-detail-content ul,
.post-detail-content ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
  list-style: inherit;
}

.post-detail-content li {
  font-size: var(--pd-editorial);
  line-height: var(--pd-editorial-lh);
  color: #444;
}

.post-detail-content li + li {
  margin-top: 0.45em;
}

.post-detail-content a {
  color: #4169e1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-detail-content a:hover {
  text-decoration: underline;
}

.post-detail-content hr,
.post-detail-content .wp-block-separator {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 2em 0;
}

.post-detail-content figure,
.post-detail-content .wp-block-image {
  margin: 0 0 1.15em;
}

.post-detail-content figure img,
.post-detail-content .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.post-detail-content .alignleft {
  float: left;
  width: min(44%, 380px);
  margin: 0.15rem 2rem 1rem 0;
}

.post-detail-content .alignright {
  float: right;
  width: min(44%, 380px);
  margin: 0.15rem 0 1rem 2rem;
}

.post-detail-content .alignwide,
.post-detail-content .alignfull {
  clear: both;
  width: 100%;
  margin: 1.75rem 0;
}

.post-detail-content blockquote,
.post-detail-content .wp-block-quote {
  margin: 1.5em 0;
  padding: 0 0 0 1.25em;
  border-left: 3px solid rgba(10, 10, 15, 0.15);
  color: #555;
}

.post-detail-content blockquote p,
.post-detail-content .wp-block-quote p {
  font-style: italic;
}

.post-detail-content iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 240px;
  border: 0;
  border-radius: 12px;
  background: var(--pd-black);
}

.post-detail-pages {
  margin-top: 2rem;
  font-size: var(--pd-text-body);
}

/* ----- Share bar ----- */
.post-detail-share {
  padding: 32px clamp(24px, 4vw, 48px) 72px;
  margin: 0;
  background: var(--pd-white);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.post-detail-share-inner {
  max-width: 1120px;
  margin: 0 auto;
  text-align: center;
}

.post-detail-share-title {
  color: var(--pd-black);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 4px;
}

.post-detail-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.post-detail-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #f4f4f6;
  color: var(--pd-black);
  font-family: inherit;
  font-size: var(--pd-text-body);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease;
}

button.post-detail-share-btn {
  appearance: none;
  -webkit-appearance: none;
}

.post-detail-share-btn:hover {
  background: #ebebef;
  border-color: rgba(0, 0, 0, 0.18);
  color: var(--pd-black);
}

.post-detail-share-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.post-detail-copy-btn.is-copied {
  background: #e8f5ef;
  border-color: rgba(42, 216, 167, 0.45);
}

/* ----- Responsive (match reference blog article) ----- */
@media (max-width: 900px) {
  .post-detail-hero {
    padding-left: 24px;
    padding-right: 24px;
  }

  .post-detail-body {
    padding-left: 24px;
    padding-right: 24px;
  }

  .post-detail-share {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 768px) {
  .post-detail-hero {
    padding: calc(var(--pd-nav) + 48px) 24px 72px;
  }

  .post-detail-back {
    margin-bottom: 24px;
  }

  .post-detail-tags {
    margin-bottom: 20px;
  }

  .post-detail-title {
    font-size: clamp(34px, 9vw, 48px);
    line-height: 1.12;
    margin-bottom: 20px;
  }

  .post-detail-excerpt {
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 28px;
  }

  .post-detail-meta {
    gap: 14px;
  }

  .post-detail-avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .post-detail-author {
    font-size: 15px;
  }

  .post-detail-body {
    padding: 40px 24px;
  }

  .post-detail-cover {
    border-radius: 12px;
    margin-bottom: 28px;
  }

  .post-detail-content .alignleft,
  .post-detail-content .alignright,
  .post-detail-content .wp-block-image.alignleft,
  .post-detail-content .wp-block-image.alignright {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 1.25rem 0;
  }

  .post-detail-share {
    padding: 32px 24px 72px;
  }

  .post-detail-share-title {
    font-size: 18px;
  }

  .post-detail-share-actions {
    gap: 8px;
  }

  .post-detail-share-btn {
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .post-detail-hero {
    padding: calc(var(--pd-nav) + 40px) 20px 56px;
  }

  .post-detail-title {
    font-size: clamp(32px, 9vw, 42px);
  }

  .post-detail-body {
    padding: 32px 20px;
  }

  .post-detail-cover {
    border-radius: 10px;
    margin-bottom: 24px;
  }

  .post-detail-share {
    padding: 28px 20px 56px;
  }

  .post-detail-share-actions {
    gap: 8px;
  }

  .post-detail-share-btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-width: 0;
    padding: 10px 12px;
  }

  .post-detail-share-btn span {
    white-space: nowrap;
  }
}
