/* ==========================================================================
   Single Blog Post — Redesigned Layout (single.php)
   Reuses the --tp-* design tokens defined in style.css
   ========================================================================== */

:root {
  --tp-single-container: 1100px;
  --tp-single-content-width: 1000px;
}

/*
 * This template replaces Astra's boxed "separate container" article
 * presentation entirely, but Astra still adds its `.ast-article-single`
 * class (and padding/border) to the <article> automatically. Zero it out
 * so our own spacing (set on .tp-article-layout etc. below) is the only
 * thing controlling layout, and so the hero can sit flush at the top.
 */
.tp-single-post.ast-article-single {
  padding: 0;
  margin: 0;
  border-bottom: 0;
}

/*
 * Astra's "separate container" layout also puts its own top spacing on
 * #primary itself (padding-top on mobile/tablet, margin-top from 993px
 * up) — on top of the .ast-article-single padding above. Zero just the
 * top side on both properties so the hero can sit flush at every
 * breakpoint, while leaving the bottom spacing before the footer intact.
 */
.ast-separate-container #primary {
  margin-top: 0;
  padding-top: 0;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.tp-hero {
  position: relative;
  z-index: 1;
  border-radius: var(--tp-radius-lg);
  overflow: hidden;
  margin: 0 auto 40px;
  max-width: var(--tp-single-container);
}

.tp-hero--has-image {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  /* Break out of Astra's .ast-container so the image hero runs full-bleed. */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
}

/*
 * The transparent header (enabled in inc/single-post-functions.php) is
 * position:absolute with no z-index of its own, so without this it can
 * end up stacked behind the hero instead of floating above it.
 */
.ast-theme-transparent-header #masthead {
  z-index: 30;
}

.tp-hero-media {
  position: absolute;
  inset: 0;
}

.tp-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(34, 50, 61, 0.15) 0%,
    rgba(34, 50, 61, 0.55) 65%,
    rgba(34, 50, 61, 0.85) 100%
  );
}

.tp-hero-content {
  position: relative;
  width: 100%;
  padding: 60px 40px 40px;
}

.tp-hero--no-image .tp-hero-content {
  background: var(--tp-bg-light);
  border-radius: var(--tp-radius-lg);
  padding: 48px 40px;
}

.tp-hero-inner {
  max-width: var(--tp-single-content-width);
  margin: 0 auto;
}

.tp-hero--has-image .tp-hero-inner {
  color: var(--tp-white);
}

.tp-hero-category {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--tp-primary);
  color: var(--tp-white);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-bottom: 16px;
}

.tp-hero-category:hover {
  background: var(--tp-primary-hover);
}

.tp-hero--no-image .tp-hero-category {
  background: var(--tp-primary-soft);
  color: var(--tp-primary);
}

.tp-hero-title {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: inherit;
}

.tp-hero--no-image .tp-hero-title {
  color: var(--tp-text-main);
}

.tp-hero-excerpt {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 20px;
  opacity: 0.92;
}

.tp-hero--no-image .tp-hero-excerpt {
  color: var(--tp-text-muted);
  opacity: 1;
}

.tp-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 14px;
}

.tp-hero--no-image .tp-hero-meta {
  color: var(--tp-text-muted);
}

.tp-hero-meta-avatar {
  /* border-radius: 50%; */
  width: 28px;
  height: 28px;
  margin-right: 4px;
}

.tp-hero-meta-author {
  color: inherit;
  font-weight: 700;
}

.tp-hero-meta-sep {
  opacity: 0.7;
}

/* ==========================================================================
   Two-column article layout: Table of Contents + article
   ========================================================================== */
.tp-article-layout {
  max-width: var(--tp-single-container);
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.tp-toc-column {
  position: sticky;
  top: 24px;
}

.tp-toc {
  background: var(--tp-white);
  border: 1px solid var(--tp-border-light);
  border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow-sm);
  padding: 18px 20px;
}

.tp-toc-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tp-text-main);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tp-toc-summary::-webkit-details-marker {
  display: none;
}

.tp-toc-summary::after {
  content: "\2212";
  color: var(--tp-text-light);
  font-weight: 400;
}

.tp-toc:not([open]) .tp-toc-summary::after {
  content: "+";
}

.tp-toc[open] .tp-toc-summary {
  margin-bottom: 10px;
}

.tp-toc-list,
.tp-toc-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tp-toc-item {
  margin: 0;
}

.tp-toc-link {
  display: block;
  padding: 6px 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--tp-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -1px;
}

.tp-toc-link--sub {
  font-size: 13px;
}

.tp-toc-link:hover {
  color: var(--tp-primary);
}

.tp-toc-link.is-active {
  color: var(--tp-primary);
  font-weight: 700;
  border-left-color: var(--tp-primary);
}

/* ==========================================================================
   Article content
   ========================================================================== */
.tp-single-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--tp-text-main);
}

.tp-single-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 40px 0 16px;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}

.tp-single-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 14px;
  scroll-margin-top: 24px;
}

.tp-single-content p {
  margin: 0 0 20px;
}

.tp-single-content ul,
.tp-single-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.tp-single-content li {
  margin-bottom: 8px;
}

.tp-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--tp-radius);
  margin: 8px 0;
}

.tp-single-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--tp-primary);
  background: var(--tp-primary-light);
  border-radius: 0 var(--tp-radius) var(--tp-radius) 0;
  font-style: italic;
  color: var(--tp-text-main);
}

/* Tables: never widen the page — scroll the table itself if it's too wide. */
.tp-single-content table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
}

.tp-single-content table th,
.tp-single-content table td {
  padding: 10px 14px;
  border: 1px solid var(--tp-border);
  text-align: left;
}

.tp-single-content table th {
  background: var(--tp-bg-light);
}

.tp-single-content a {
  color: var(--tp-primary);
  text-decoration: underline;
}

/* Contextual paths from educational articles into core product features. */
.tp-feature-paths {
  margin: 40px 0;
  padding: 28px;
  background: var(--tp-bg-light);
  border: 1px solid var(--tp-border-light);
  border-radius: var(--tp-radius-lg);
}

.tp-feature-paths-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.tp-feature-paths-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--tp-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tp-feature-paths h2 {
  margin: 0;
  color: var(--tp-text-main);
  font-size: 24px;
  line-height: 1.3;
}

.tp-feature-paths-all {
  flex-shrink: 0;
  color: var(--tp-primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.tp-feature-paths-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tp-feature-path {
  display: flex;
  min-width: 0;
  padding: 20px;
  flex-direction: column;
  gap: 8px;
  background: var(--tp-white);
  border: 1px solid var(--tp-border-light);
  border-radius: var(--tp-radius);
  color: var(--tp-text-main);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tp-feature-path:hover,
.tp-feature-path:focus-visible {
  border-color: var(--tp-primary);
  box-shadow: var(--tp-shadow-sm);
  color: var(--tp-text-main);
  transform: translateY(-2px);
}

.tp-feature-path:focus-visible,
.tp-feature-paths-all:focus-visible {
  outline: 3px solid var(--tp-primary-soft);
  outline-offset: 3px;
}

.tp-feature-path strong {
  font-size: 16px;
}

.tp-feature-path > span:not(.tp-feature-path-action) {
  color: var(--tp-text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.tp-feature-path-action {
  margin-top: auto;
  padding-top: 6px;
  color: var(--tp-primary);
  font-size: 13px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .tp-feature-path {
    transition: none;
  }

  .tp-feature-path:hover,
  .tp-feature-path:focus-visible {
    transform: none;
  }
}

/* Author box */
.tp-author-box {
  /* Hidden for now — remove this line to bring it back. */
  display: none;
  margin: 40px 0;
  gap: 18px;
  padding: 24px;
  background: var(--tp-bg-main);
  border: 1px solid var(--tp-border-light);
  border-radius: var(--tp-radius-lg);
}

.tp-author-box-avatar {
  border-radius: 50%;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.tp-author-box-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tp-text-light);
  margin-bottom: 4px;
}

.tp-author-box-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--tp-text-main);
  text-decoration: none;
  margin-bottom: 8px;
}

.tp-author-box-name:hover {
  color: var(--tp-primary);
}

.tp-author-box-bio {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tp-text-muted);
}

/* Tags */
.tp-single-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.tp-single-tags-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tp-text-light);
}

.tp-single-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--tp-bg-light);
  color: var(--tp-text-main);
  font-size: 13px;
  text-decoration: none;
}

.tp-single-tag:hover {
  background: var(--tp-primary);
  color: var(--tp-white);
}

/* Social share */
.tp-single-share {
  /* Hidden for now — remove this line to bring it back. */
  display: none;
  margin:  32px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--tp-border-light);
  border-bottom: 1px solid var(--tp-border-light);
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-single-share-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--tp-text-main);
}

.tp-single-share-links {
  display: flex;
  gap: 10px;
}

.tp-single-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tp-bg-light);
  color: var(--tp-text-main);
  text-decoration: none;
  transition: all 0.2s ease;
}

.tp-single-share-link:hover {
  background: var(--tp-primary);
  color: var(--tp-white);
}

.tp-single-share-link svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Related posts
   ========================================================================== */
.tp-related-posts {
  max-width: var(--tp-single-container);
  margin: 56px auto 0;
  padding: 40px 24px 0;
  /* border-top: 1px solid var(--tp-border-light); */
}

.tp-related-posts-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--tp-text-main);
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  text-align: center;
}

/* Card grid + card component itself live in blog-cards.css, shared with
   the archive.php post grid. */

/* ==========================================================================
   Tablet (769px – 1024px)
   ========================================================================== */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  .tp-hero-title {
    font-size: 32px;
  }

  .tp-article-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
  }
}

/* ==========================================================================
   Mobile (up to 768px)
   ========================================================================== */
@media only screen and (max-width: 768px) {
  .tp-hero {
    border-radius: var(--tp-radius);
  }

  .tp-hero--has-image {
    min-height: 320px;
    border-radius: 0;
  }

  .tp-hero-content,
  .tp-hero--no-image .tp-hero-content {
    padding: 32px 20px;
  }

  .tp-hero-title {
    font-size: 26px;
  }

  .tp-hero-excerpt {
    font-size: 16px;
  }

  .tp-article-layout {
    grid-template-columns: minmax(0, 1fr); /* plain 1fr grows to the widest table and pushes the page past the viewport */
    gap: 24px;
    padding: 0 20px;
  }

  .tp-toc-column {
    position: static;
  }

  /* 44px tap targets on touch screens */
  .tp-toc-summary,
  .tp-toc-link {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .tp-toc-link {
    padding-top: 0;
    padding-bottom: 0;
  }

  .tp-single-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .tp-single-content {
    font-size: 16px;
  }

  .tp-single-content h2 {
    font-size: 22px;
  }

  .tp-single-content h3 {
    font-size: 19px;
  }

  .tp-feature-paths {
    padding: 22px;
  }

  .tp-feature-paths-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .tp-feature-paths-grid {
    grid-template-columns: 1fr;
  }

  .tp-single-share {
    flex-direction: column;
    align-items: flex-start;
  }

  .tp-author-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .tp-related-posts {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ==========================================================================
   Help Center articles (single-help_center.php)

   These are built in Elementor, which lays out its own full-width sections.
   So unlike blog posts, we deliberately do NOT constrain the article body —
   no grid, no max-width, no typography overrides — or Elementor's hero gets
   squeezed into a narrow column. We only contain the theme-rendered footer
   (topics / share / comments) so it stays readable.
   ========================================================================== */
.tp-help-article,
.tp-help-article-column {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
}

.tp-help-article-footer {
  max-width: var(--tp-single-container);
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* The footer blocks carry their own top margins in the blog layout; here the
   flex gap above already spaces them, so drop the doubled-up margin. */
.tp-help-article-footer > .tp-single-tags,
.tp-help-article-footer > .tp-single-share {
  margin-top: 0;
  margin-bottom: 0;
}
