/* ==========================================================================
   XCT Single Post Template
   Clean version: desktop article layout, natural sidebar, expandable TOC,
   floating TOC handoff, tablet/mobile refinements.
   ========================================================================== */

/* 1. Page Shell */
body.single-post .xct-post-main {
  width: 100%;
  overflow-x: clip;
  color: var(--xct-text);
}

/* 2. Hero */
body.single-post .xct-post-hero {
  padding: 34px 22px 26px;
}

body.single-post .xct-post-hero-inner {
  max-width: var(--theme-container-width, 1200px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 28px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--xct-border);
  border-radius: 26px;
  background: radial-gradient(circle at 18% 18%, rgba(47, 125, 49, .16), transparent 32%), linear-gradient(135deg, #07120d, #122219);
  box-shadow: 0 18px 44px rgba(24, 45, 29, .12);
}

body.single-post .xct-post-hero-content {
  min-width: 0;
  padding: clamp(28px, 4vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.single-post .xct-post-kicker {
  width: fit-content;
  margin-bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(47, 125, 49, .28);
  color: #d8f0dc !important;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none !important;
}

body.single-post .xct-post-title {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

body.single-post .xct-post-excerpt {
  max-width: 760px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, .82);
  font-size: 17px;
  line-height: 1.75;
}

body.single-post .xct-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
}

body.single-post .xct-post-meta span {
  position: relative;
}

body.single-post .xct-post-meta span:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .35);
}

body.single-post .xct-post-hero-actions,
body.single-post .xct-product-card-actions,
body.single-post .xct-final-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

body.single-post .xct-post-hero-image {
  min-width: 0;
  min-height: 360px;
  background: rgba(255, 255, 255, .05);
}

body.single-post .xct-post-hero-image img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
}

/* 3. Main Layout */
body.single-post .xct-post-layout {
  max-width: var(--theme-container-width, 1200px);
  margin: 0 auto 70px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

body.single-post .xct-post-content-wrap,
body.single-post .xct-post-sidebar {
  min-width: 0;
}

body.single-post .xct-post-sidebar {
  position: relative;
  top: auto;
  display: grid;
  gap: 18px;
  align-self: start;
  max-height: none;
  overflow: visible;
}

/* 4. Shared Cards */
body.single-post .xct-takeaways,
body.single-post .xct-procurement-note,
body.single-post .xct-doc-cta,
body.single-post .xct-buyer-checklist,
body.single-post .xct-related-articles,
body.single-post .xct-sidebar-card {
  border: 1px solid var(--xct-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(24, 45, 29, .055);
}

body.single-post .xct-takeaways,
body.single-post .xct-procurement-note,
body.single-post .xct-doc-cta,
body.single-post .xct-buyer-checklist,
body.single-post .xct-related-articles {
  padding: 24px;
}

body.single-post .xct-takeaways {
  margin-bottom: 24px;
  padding: 22px;
  background: radial-gradient(circle at top left, rgba(47, 125, 49, .08), transparent 34%), #fff;
}

body.single-post .xct-procurement-note,
body.single-post .xct-doc-cta,
body.single-post .xct-buyer-checklist,
body.single-post .xct-related-articles {
  margin-top: 28px;
}

body.single-post .xct-sidebar-card {
  padding: 18px;
}

body.single-post .xct-takeaways h2,
body.single-post .xct-procurement-note h2,
body.single-post .xct-doc-cta h2,
body.single-post .xct-buyer-checklist h2,
body.single-post .xct-related-articles h2,
body.single-post .xct-sidebar-card h2 {
  margin: 0 0 12px;
  color: var(--xct-text);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
}

body.single-post .xct-takeaways ul,
body.single-post .xct-buyer-checklist ul,
body.single-post .xct-post-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.single-post .xct-takeaways li,
body.single-post .xct-buyer-checklist li {
  position: relative;
  margin-bottom: 9px;
  padding-left: 24px;
  color: #334139;
  font-size: 15px;
  line-height: 1.65;
}

body.single-post .xct-takeaways li::before,
body.single-post .xct-buyer-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .68em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--xct-green);
}

/* 5. Article Content */
body.single-post .xct-post-content > *:first-child {
  margin-top: 0;
}

body.single-post .xct-post-content h2 {
  margin-top: 42px;
  margin-bottom: 14px;
  color: var(--xct-text);
  font-size: clamp(25px, 2.3vw, 34px);
  line-height: 1.2;
  scroll-margin-top: 100px;
}

body.single-post .xct-post-content h3 {
  margin-top: 30px;
  margin-bottom: 12px;
  color: var(--xct-text);
  font-size: 22px;
  line-height: 1.28;
  font-weight: 600;
}

body.single-post .xct-post-content p,
body.single-post .xct-post-content li {
  color: #334139;
  font-size: 17px;
  line-height: 1.82;
}

body.single-post .xct-post-content p {
  margin-bottom: 18px;
}

body.single-post .xct-post-content a {
  color: var(--xct-green);
  font-weight: 760;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.single-post .xct-post-content figure {
  margin: 30px 0;
}

body.single-post .xct-post-content img {
  border-radius: 16px;
}

body.single-post .xct-post-content table {
  width: 100%;
  margin: 26px 0;
  border-collapse: collapse;
  font-size: 15px;
}

body.single-post .xct-post-content th,
body.single-post .xct-post-content td {
  padding: 13px 15px;
  border: 1px solid rgba(47, 125, 49, .15);
  vertical-align: top;
}

body.single-post .xct-post-content th {
  background: rgba(47, 125, 49, .06);
  color: var(--xct-text);
  font-weight: 850;
}

/* 6. Notes / Documentation CTA */
body.single-post .xct-procurement-note {
  border-left: 5px solid var(--xct-green);
  background: linear-gradient(135deg, rgba(47, 125, 49, .08), rgba(255, 255, 255, .98));
}

body.single-post .xct-procurement-note p,
body.single-post .xct-doc-cta p {
  margin: 0;
  color: #334139;
  font-size: 16px;
  line-height: 1.75;
}

body.single-post .xct-doc-cta {
  border-color: rgba(255, 74, 0, .16);
  background: linear-gradient(135deg, rgba(255, 74, 0, .08), #fff);
}

body.single-post .xct-doc-cta .xct-btn {
  margin-top: 16px;
}

/* 7. Product Card */
body.single-post .xct-inline-product {
  margin-top: 28px;
}

body.single-post .xct-product-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(47, 125, 49, .16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(47, 125, 49, .08), #fff);
  box-shadow: 0 10px 26px rgba(24, 45, 29, .055);
}

body.single-post .xct-product-card-media {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: #f7faf8;
}

body.single-post .xct-product-card-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

body.single-post .xct-product-card-body {
  min-width: 0;
}

body.single-post .xct-product-card-body span {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--xct-green);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.single-post .xct-product-card-body h3 {
  margin: 0 0 8px;
  color: var(--xct-text);
  font-size: 21px;
  line-height: 1.25;
  font-weight: 880;
}

body.single-post .xct-product-card-body p {
  margin: 0 0 14px;
  color: var(--xct-muted);
  font-size: 14px;
  line-height: 1.65;
}

body.single-post .xct-product-card-compact {
  padding: 0;
  display: block;
  border: 0;
  box-shadow: none;
  background: transparent;
}

body.single-post .xct-product-card-compact .xct-product-card-media {
  margin-bottom: 14px;
}

body.single-post .xct-product-card-compact .xct-product-card-actions {
  display: grid;
  gap: 10px;
}

/* 8. Sidebar TOC */
body.single-post .xct-post-toc a {
  display: block;
  padding: 8px 0;
  color: #415148;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 720;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(47, 125, 49, .09);
}

body.single-post .xct-post-toc li:last-child a {
  border-bottom: 0;
}

body.single-post .xct-post-toc a:hover {
  color: var(--xct-green);
}

body.single-post .xct-post-toc.has-extra-toc:not(.is-expanded) li:nth-child(n+9) {
  display: none;
}

body.single-post .xct-toc-toggle {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  padding: 0 13px;
  border: 1px solid rgba(47, 125, 49, .22);
  border-radius: 10px;
  background: rgba(47, 125, 49, .06);
  color: #2F7D31;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 850;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

body.single-post .xct-toc-toggle:hover {
  border-color: rgba(47, 125, 49, .42);
  background: rgba(47, 125, 49, .1);
}

/* 9. Floating TOC */
body.single-post .xct-floating-toc {
  display: none;
}

@media (min-width: 1200px) {
  body.single-post .xct-floating-toc {
    position: fixed;
    top: var(--xct-floating-toc-top, 112px);
    left: var(--xct-floating-toc-left, auto);
    width: var(--xct-floating-toc-width, 320px);
    z-index: 90;
    display: block;
    max-height: calc(100vh - var(--xct-floating-toc-top, 112px) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 18px;
    border: 1px solid rgba(47, 125, 49, .16);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(24, 45, 29, .12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  body.single-post .xct-floating-toc.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  body.single-post .xct-floating-toc h2 {
    margin: 0 0 12px;
    color: #1f2f27;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 880;
  }

  body.single-post .xct-floating-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body.single-post .xct-floating-toc li {
    display: list-item;
  }

  body.single-post .xct-floating-toc a {
    display: block;
    padding: 8px 0;
    color: #415148;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 720;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(47, 125, 49, .09);
  }

  body.single-post .xct-floating-toc li:last-child a {
    border-bottom: 0;
  }

  body.single-post .xct-floating-toc a:hover {
    color: #2F7D31;
  }

  body.single-post .xct-floating-toc::-webkit-scrollbar {
    width: 6px;
  }

  body.single-post .xct-floating-toc::-webkit-scrollbar-track {
    background: transparent;
  }

  body.single-post .xct-floating-toc::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(47, 125, 49, .24);
  }

  body.single-post .xct-floating-toc::-webkit-scrollbar-thumb:hover {
    background: rgba(47, 125, 49, .42);
  }
}

/* 10. Related Articles */
body.single-post .xct-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body.single-post .xct-related-card {
  min-width: 0;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(47, 125, 49, .13);
  border-radius: 15px;
  background: #fff;
  color: var(--xct-text);
  text-decoration: none !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

body.single-post .xct-related-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 125, 49, .32);
  box-shadow: 0 12px 28px rgba(24, 45, 29, .07);
}

body.single-post .xct-related-card-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

body.single-post .xct-related-card-body {
  padding: 14px;
}

body.single-post .xct-related-card h3 {
  margin: 0 0 8px;
  color: var(--xct-text);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 850;
}

body.single-post .xct-related-card span {
  color: #7a8880;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 720;
}

/* 11. Final CTA */
body.single-post .xct-final-cta {
  margin-top: 32px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(47, 125, 49, .18), transparent 32%), linear-gradient(135deg, #092014, #12331f);
  box-shadow: 0 16px 38px rgba(24, 45, 29, .1);
}

body.single-post .xct-final-cta h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 25px;
  line-height: 1.22;
  font-weight: 900;
}

body.single-post .xct-final-cta p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  line-height: 1.65;
}

/* 12. Sidebar Inquiry Form */
body.single-post .xct-sidebar-inquiry .tf-contact-sidebar {
  gap: 14px;
}

body.single-post .xct-sidebar-inquiry .tf-contact-sidebar-card,
body.single-post .xct-sidebar-inquiry .tf-contact-sidebar-note {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
/* 13. Tablet: 768px-1199px */
/* 13. Tablet: 768px閳ワ拷1199px */
@media (min-width: 768px) and (max-width: 1199px) {
  body.single-post .xct-post-hero-inner {
    grid-template-columns: 1fr;
  }

  body.single-post .xct-post-hero-image,
  body.single-post .xct-post-hero-image img {
    min-height: auto;
  }

  body.single-post .xct-post-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  body.single-post .xct-post-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  body.single-post .xct-post-toc,
  body.single-post .xct-sidebar-inquiry {
    grid-column: 1 / -1;
  }

  body.single-post .xct-product-card-compact {
    height: 100%;
  }

  body.single-post .xct-product-card-compact .xct-product-card-media img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
  }

  body.single-post .xct-product-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.single-post .xct-product-card-actions .xct-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  body.single-post .xct-sidebar-inquiry .tf-contact-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  body.single-post .xct-sidebar-inquiry .tf-contact-sidebar-form,
  body.single-post .xct-sidebar-inquiry .tf-contact-sidebar-note {
    grid-column: 1 / -1;
  }

  body.single-post .xct-sidebar-inquiry .ff-t-container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  body.single-post .xct-sidebar-inquiry .ff-t-cell {
    width: 100% !important;
    flex-basis: auto !important;
  }

  body.single-post .xct-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.single-post .xct-final-cta {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 34px 28px;
    text-align: left;
  }

  body.single-post .xct-final-cta h2 {
    max-width: 680px;
    margin-bottom: 12px;
    font-size: 28px;
    line-height: 1.22;
  }

  body.single-post .xct-final-cta p {
    max-width: 720px;
    font-size: 16px;
    line-height: 1.65;
  }

  body.single-post .xct-final-cta-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 560px;
    gap: 12px;
  }

  body.single-post .xct-final-cta-actions .xct-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }
}

/* 14. Narrow Tablet / Large Phone */
@media (max-width: 900px) {
  body.single-post .xct-post-sidebar,
  body.single-post .xct-sidebar-inquiry .tf-contact-sidebar,
  body.single-post .xct-sidebar-inquiry .ff-t-container {
    grid-template-columns: 1fr !important;
  }

  body.single-post .xct-product-card-actions {
    grid-template-columns: 1fr;
  }
}

/* 15. Mobile */
@media (max-width: 767px) {
  body.single-post .xct-post-hero {
    padding: 18px 10px 20px;
  }

  body.single-post .xct-post-hero-inner {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  body.single-post .xct-post-hero-content {
    padding: 24px 18px;
  }

  body.single-post .xct-post-title {
    font-size: clamp(29px, 9vw, 40px);
  }

  body.single-post .xct-post-excerpt {
    font-size: 15px;
    line-height: 1.68;
  }

  body.single-post .xct-post-meta span:not(:last-child)::after {
    display: none;
  }

  body.single-post .xct-post-hero-actions,
  body.single-post .xct-product-card-actions,
  body.single-post .xct-final-cta-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.single-post .xct-post-layout {
    grid-template-columns: 1fr;
    padding: 0 10px;
    margin-bottom: 46px;
  }

  body.single-post .xct-post-sidebar {
    position: static;
  }

  body.single-post .xct-post-toc {
    display: none;
  }

  body.single-post .xct-takeaways,
  body.single-post .xct-procurement-note,
  body.single-post .xct-doc-cta,
  body.single-post .xct-buyer-checklist,
  body.single-post .xct-related-articles,
  body.single-post .xct-sidebar-card {
    padding: 18px;
    border-radius: 16px;
  }

  body.single-post .xct-post-content h2 {
    margin-top: 34px;
    font-size: 25px;
  }

  body.single-post .xct-post-content h3 {
    font-size: 21px;
  }

  body.single-post .xct-post-content p,
  body.single-post .xct-post-content li {
    font-size: 16px;
    line-height: 1.75;
  }

  body.single-post .xct-product-card {
    grid-template-columns: 1fr;
  }

  body.single-post .xct-related-grid {
    grid-template-columns: 1fr;
  }

  body.single-post .xct-final-cta {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 20px;
    border-radius: 18px;
    text-align: left;
  }

  body.single-post .xct-final-cta h2 {
    font-size: 24px;
    line-height: 1.25;
  }

  body.single-post .xct-final-cta p {
    font-size: 15px;
    line-height: 1.65;
  }

  body.single-post .xct-final-cta-actions {
    width: 100%;
    gap: 10px;
  }

  body.single-post .xct-final-cta-actions .xct-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
