/* ==========================================================================
   Post Page
   ========================================================================== */

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--tb-teal);
  z-index: var(--z-progress);
  transition: width 100ms linear;
}

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--color-meta);
}

.breadcrumb a {
  color: var(--color-meta);
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--tb-red);
}

.breadcrumb .sep {
  margin: 0 8px;
}

.sep {
  margin: 0 6px;
}

/* Post Hero */
.post-hero {
  /* Section wrapper — no grid here; grid lives on __grid child */
}

.post-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.post-hero__image {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

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

.post-hero__content {
  padding: 40px 0;
}

.post-hero__label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tb-red);
  margin-bottom: 16px;
}

.post-hero__title {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.15;
  margin-bottom: 16px;
}

.post-hero__excerpt {
  font-size: 18px;
  color: var(--color-body-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.post-hero__meta {
  font-size: 14px;
  color: var(--color-meta);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.post-hero__meta .meta-sep {
  color: var(--color-border);
  font-size: 10px;
}

.post-hero__author {
  font-weight: 600;
  color: var(--color-heading);
}

.post-hero__date {
  color: var(--color-meta);
}

.post-hero__reading-time {
  color: var(--color-meta);
}

/* Contained Hero Variant */
.post-hero--contained {
  padding: 32px 0 0;
}

.post-hero__title--contained {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 800px;
}

.post-hero--contained .post-hero__excerpt {
  max-width: 700px;
}

.post-hero__image--contained {
  margin-top: 32px;
  max-height: 500px;
  overflow: hidden;
}

.post-hero__image--contained img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

/* Vergetic Hero Variant — title top, image 16:9 + meta side by side */
.post-hero--vergetic {
  padding: 32px 0 0;
}

.post-hero__title--vergetic {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.15;
  margin-bottom: 24px;
}

.post-hero__vergetic-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: start;
}

.post-hero__image--vergetic {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

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

.post-hero__vergetic-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 0;
}

.post-hero__vergetic-side .post-hero__excerpt {
  font-size: 17px;
  color: var(--color-body-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.post-hero__vergetic-side .post-hero__meta {
  margin-top: auto;
}

@media (max-width: 767px) {
  .post-hero__title--vergetic {
    font-size: 1.75rem;
  }

  .post-hero__vergetic-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (min-width: 1280px) {
  .post-hero__title--vergetic {
    font-size: 3rem;
  }
}

@media (max-width: 767px) {
  .post-hero__title--contained {
    font-size: 1.75rem;
  }
}

@media (min-width: 1280px) {
  .post-hero__title--contained {
    font-size: 3rem;
  }
}

/* Post Layout */
.post-layout {
  display: grid;
  grid-template-columns: 48px 1fr 280px;
  gap: 32px;
  padding: 48px 0;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Share Sidebar */
.post-share {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-share__btn,
.post-share .share-buttons__btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-meta);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.post-share__btn:hover,
.post-share .share-buttons__btn:hover {
  color: var(--tb-red);
  background: rgba(0, 0, 0, 0.04);
}

.post-share__btn svg,
.post-share .share-buttons__btn svg {
  width: 18px;
  height: 18px;
}

/* Post Content */
.post-content {
  max-width: 720px;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.post-content p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--color-body);
  margin-bottom: 1.5em;
}

.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.post-content a {
  color: var(--tb-red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

.post-content a:hover {
  color: var(--tb-red-dark);
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.75em;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  font-size: 18px;
  line-height: 1.8;
  color: var(--color-body);
  margin-bottom: 0.5em;
}

.post-content blockquote {
  border-top: 2px solid var(--color-heading);
  border-bottom: 1px solid var(--color-border);
  border-left: none;
  padding: 24px 0;
  margin: 2.5em 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-heading);
  line-height: 1.6;
}

.post-content blockquote p {
  font-size: inherit;
  font-family: inherit;
  color: inherit;
  margin-bottom: 0;
}

.post-content figure,
.post-content .wp-caption {
  margin: 2em 0;
  max-width: 100%;
}

.post-content figcaption,
.post-content .wp-caption-text {
  font-size: 13px;
  color: var(--color-meta);
  margin-top: 8px;
  text-align: center;
}

.post-content .wp-caption {
  width: auto !important;
}

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

.post-content .wp-block-image {
  margin: 2em 0;
}

.post-content .wp-block-image figcaption {
  font-size: 13px;
  color: var(--color-meta);
  margin-top: 8px;
  text-align: center;
}

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

.post-content hr,
.post-content .wp-block-separator {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5em 0;
}

.post-content pre {
  background: #f5f5f5;
  padding: 24px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  font-size: 14px;
  line-height: 1.6;
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9em;
}

.post-content p code {
  background: #f5f5f5;
  padding: 2px 6px;
}

/* Post Sidebar */
.post-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
}

.post-sidebar__widget {
  margin-bottom: 40px;
}

.post-sidebar__widget-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-heading);
}

/* Author Box */
.author-box {
  display: flex;
  gap: 24px;
  margin-top: 56px;
  padding: 32px 0 0;
  border-top: 1px solid var(--color-border);
  align-items: flex-start;
  overflow: hidden;
}
.author-box__avatar {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  min-width: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-box__info {
  flex: 1;
}
.author-box__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-meta);
  margin-bottom: 6px;
}
.author-box__name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 8px;
}
.author-box__name a {
  color: inherit;
  text-decoration: none;
}
.author-box__name a:hover {
  color: var(--tb-red);
}
.author-box__bio {
  font-size: 15px;
  color: var(--color-body-light);
  line-height: 1.6;
  margin-bottom: 14px;
}
.author-box__social {
  display: flex;
  gap: 14px;
}
.author-box__social a,
.author-box__social-link {
  color: var(--color-meta);
  transition: color 200ms;
}
.author-box__social a:hover,
.author-box__social-link:hover {
  color: var(--tb-red);
}
.author-box__social svg {
  width: 18px;
  height: 18px;
}
.author-box__posts-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tb-red);
  text-decoration: none;
  transition: color 200ms;
}
.author-box__posts-link:hover {
  color: var(--tb-red-dark);
}

/* Horizontal Share Buttons (after content) */
.share-buttons--horizontal {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.share-buttons__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-meta);
  white-space: nowrap;
}

.share-buttons--horizontal .share-buttons__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-meta);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.share-buttons--horizontal .share-buttons__btn:hover {
  color: var(--tb-red);
  background: rgba(0, 0, 0, 0.04);
}

.share-buttons--horizontal .share-buttons__btn svg {
  width: 16px;
  height: 16px;
}

/* Post Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.post-tags__tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-meta);
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  transition: color var(--transition), border-color var(--transition);
}

.post-tags__tag:hover {
  color: var(--tb-red);
  border-color: var(--tb-red);
}

/* Related Posts */
.related-posts {
  padding: var(--section-padding) 0;
  border-top: 1px solid var(--color-border);
}

.related-posts__title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 40px;
}

/* Breadcrumb — Category Page Hero */
.category-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--color-border);
}

.category-hero__title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 8px;
}

.category-hero__desc {
  font-size: 18px;
  color: var(--color-body-light);
  max-width: 600px;
}

.category-hero__count {
  font-size: 14px;
  color: var(--color-meta);
  margin-top: 8px;
}

/* Post Hero Avatar */
.post-hero__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Inline Related ("You Might Also Like") */
.inline-related {
  margin: 3em 0;
  padding: 28px 0;
  border-top: 2px solid var(--color-heading);
  border-bottom: 1px solid var(--color-border);
}

.inline-related__title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 20px;
}

.inline-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.inline-related__item {
  display: flex;
  gap: 12px;
  text-decoration: none;
  align-items: flex-start;
}

.inline-related__thumb {
  flex-shrink: 0;
}

.inline-related__thumb img {
  width: 100px;
  height: 66px;
  object-fit: cover;
}

.inline-related__item-title {
  font-family: var(--font-heading-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.35;
}

.inline-related__date {
  font-size: 11px;
  color: var(--color-meta);
  margin-top: 4px;
  display: block;
}

.inline-related a,
.inline-related a *,
.post-content .inline-related a,
.post-content .inline-related__item {
  text-decoration: none !important;
  color: inherit;
}

.post-content .inline-related__item-title {
  color: var(--color-heading);
}

.post-content .inline-related__date {
  color: var(--color-meta);
}

.inline-related__item:hover .inline-related__item-title {
  color: var(--tb-red);
}

/* Mobile Share Bar */
.mobile-share {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 8px 16px;
  z-index: var(--z-header);
  justify-content: space-around;
}

.mobile-share__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-meta);
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-share__btn svg {
  width: 20px;
  height: 20px;
}

/* ---- Responsive ---- */

@media (max-width: 767px) {
  .mobile-share {
    display: flex;
  }

  .inline-related__grid {
    grid-template-columns: 1fr;
  }
  .post-hero__grid {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
  }

  .post-hero__content {
    padding: 24px 0;
  }

  .post-hero__title {
    font-size: 1.75rem;
  }

  .post-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .post-share {
    display: none;
  }

  .post-sidebar {
    position: static;
  }

  .post-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .post-hero__content {
    padding: 24px 16px;
  }

  .category-hero__title {
    font-size: 2rem;
  }

  .author-box {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .author-box__social {
    justify-content: flex-start;
  }
}

@media (min-width: 768px) {
  .post-layout {
    grid-template-columns: 48px 1fr;
    gap: 24px;
  }

  .post-sidebar {
    display: none;
  }
}

@media (min-width: 1024px) {
  .post-layout {
    grid-template-columns: 48px 1fr 280px;
    gap: 32px;
  }

  .post-sidebar {
    display: block;
  }
}

@media (min-width: 1280px) {
  .post-hero__title {
    font-size: 3rem;
  }
}
