/* =============================================================
   Single Post — Design System
   Prefix: pcp- (Pro Caphe Post)
   Dịch từ design/code(2).html sang CSS thuần cho WordPress
   ============================================================= */

/* --- Design Tokens -------------------------------------------*/
.pcp-single-wrap {
  --pc-primary:              #a63b00;
  --pc-primary-container:    #f26522;
  --pc-deep-espresso:        #1A0F0E;
  --pc-surface:              #fbf9f4;
  --pc-surface-container:    #f0eee9;
  --pc-surface-container-low:#f5f3ee;
  --pc-on-surface:           #1b1c19;
  --pc-on-surface-variant:   #594138;
  --pc-secondary:            #745853;
  --pc-outline:              #8d7166;
  --pc-warm-sand:            #D7CCC8;
  --pc-shadow-warm:          0 4px 20px rgba(62, 39, 35, 0.08);
  --pc-shadow-warm-lg:       0 8px 32px rgba(62, 39, 35, 0.14);
  --pc-font-display:         'DM Sans', sans-serif;
  --pc-font-body:            'Manrope', sans-serif;
  --pc-radius:               1rem;
  --pc-radius-xl:            1.5rem;
  --pcp-page-gutter:         18px;
  --pcp-article-top:         28px;
}

@media (min-width: 640px) {
  .pcp-single-wrap {
    --pcp-page-gutter: 32px;
    --pcp-article-top: 36px;
  }
}

@media (min-width: 1024px) {
  .pcp-single-wrap {
    --pcp-page-gutter: 40px;
    --pcp-article-top: 42px;
  }
}

/* --- Wrap + Reset ---------------------------------------------*/
.pcp-single-wrap {
  background: var(--pc-surface);
  padding-bottom: 80px;
  /* Break out of Flatsome container constraints */
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Flatsome inner .container override for single post */
.single .page-wrapper,
.single #content {
  padding: 0;
  margin: 0;
  max-width: 100%;
}

/* --- Article Layout -------------------------------------------*/
.pcp-article {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pcp-page-gutter);
  margin-top: var(--pcp-article-top);
  box-sizing: border-box;
}

/* --- Article Header -------------------------------------------*/
.pcp-breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: min(100%, 920px);
  margin: 0 auto 20px;
  font-family: var(--pc-font-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--pc-on-surface-variant);
  text-align: center;
}

.pcp-breadcrumbs .rank-math-breadcrumb,
.pcp-breadcrumbs .rank-math-breadcrumb p {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.pcp-breadcrumbs a {
  color: rgba(89, 65, 56, 0.78);
  text-decoration: none;
  border-bottom: none;
}

.pcp-breadcrumbs a:hover {
  color: var(--pc-primary);
}

.pcp-breadcrumbs .separator,
.pcp-breadcrumbs .last,
.pcp-breadcrumbs .pcp-breadcrumb-sep {
  color: rgba(89, 65, 56, 0.55);
}

.pcp-breadcrumbs .last,
.pcp-breadcrumbs [aria-current="page"] {
  color: rgba(89, 65, 56, 0.78);
  display: inline-block;
  max-width: min(100%, 560px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pcp-article-header {
  text-align: center;
  max-width: 1080px;
  margin: 0 auto 48px;
}

.pcp-cat-pill-wrap {
  margin: 0 0 18px;
}

.pcp-cat-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--pc-font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pc-primary);
  border: 1px solid rgba(166, 59, 0, 0.2);
  background: rgba(255, 255, 255, 0.45);
  padding: 7px 18px;
  border-radius: 9999px;
  text-decoration: none;
  transition: background 0.2s;
}
.pcp-cat-pill:hover {
  background: rgba(166, 59, 0, 0.05);
}

.pcp-post-title {
  font-family: var(--pc-font-display);
  font-size: 28px;
  line-height: 1.29;
  font-weight: 700;
  color: var(--pc-deep-espresso);
  letter-spacing: -0.02em;
  max-width: 1040px;
  margin: 0 auto 26px;
  text-transform: none;
}
@media (min-width: 768px) {
  .pcp-post-title {
    font-size: 48px;
    line-height: 1.17;
  }
}

.pcp-meta-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--pc-font-body);
  font-size: 15px;
  color: var(--pc-on-surface-variant);
  padding: 10px 18px;
  border: 1px solid rgba(141, 113, 102, 0.14);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.36);
}

.pcp-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.pcp-meta-item .material-symbols-outlined {
  color: var(--pc-secondary);
}

.pcp-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(141, 113, 102, 0.36);
  flex-shrink: 0;
}

/* --- Hero Figure ----------------------------------------------*/
.pcp-hero-figure {
  margin: 0 0 80px !important;
  width: 100%;
  border-radius: var(--pc-radius);
  overflow: hidden;
  box-shadow: var(--pc-shadow-warm);
  background: #fff;
}

.pcp-hero-figure .pcp-hero-img,
.pcp-hero-figure img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  aspect-ratio: 16 / 9;
  object-fit: cover !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.pcp-hero-caption {
  text-align: center;
  font-size: 14px;
  font-style: italic;
  color: var(--pc-on-surface-variant);
  padding: 16px 16px 24px;
  font-family: var(--pc-font-body);
}

/* --- Content Wrapper — full width of article ------------------*/
.pcp-content-wrap {
  max-width: 100%;
  margin: 0 auto;
}

/* --- Table of Contents ----------------------------------------*/
.pcp-toc {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 44px;
  padding: 0;
  border: 1px solid rgba(141, 113, 102, 0.16);
  border-radius: var(--pc-radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--pc-shadow-warm);
  font-family: var(--pc-font-body);
  overflow: hidden;
}

.pcp-toc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 20px 24px;
  color: var(--pc-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pcp-toc-head::-webkit-details-marker {
  display: none;
}

.pcp-toc-title {
  flex: 1;
  margin: 0;
  font-family: var(--pc-font-display);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--pc-deep-espresso);
  text-transform: none;
  letter-spacing: normal;
}

.pcp-toc-toggle {
  color: var(--pc-outline);
  font-size: 24px;
  transition: transform 0.2s, color 0.2s;
}

.pcp-toc[open] .pcp-toc-toggle {
  transform: rotate(180deg);
}

.pcp-toc-head:hover .pcp-toc-toggle {
  color: var(--pc-primary);
}

.pcp-toc-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0 24px 24px;
  list-style: none;
  counter-reset: pcp-toc-main;
}

.pcp-toc-item {
  margin: 0;
  line-height: 1.45;
}

.pcp-toc-list > .pcp-toc-item {
  counter-increment: pcp-toc-main;
}

.pcp-toc-list > .pcp-toc-item > a,
.pcp-toc-sublist > .pcp-toc-item > a {
  position: relative;
  display: block;
  padding-left: 34px;
}

.pcp-toc-list > .pcp-toc-item > a::before {
  content: counter(pcp-toc-main) ".";
  position: absolute;
  left: 0;
  top: 0;
  min-width: 24px;
  font-weight: 700;
  color: var(--pc-primary);
}

.pcp-toc-sublist {
  display: grid;
  gap: 8px;
  margin: 9px 0 0;
  padding: 0 0 0 24px;
  list-style: none;
  counter-reset: pcp-toc-sub;
}

.pcp-toc-sublist > .pcp-toc-item {
  counter-increment: pcp-toc-sub;
}

.pcp-toc-sublist > .pcp-toc-item > a::before {
  content: counter(pcp-toc-main) "." counter(pcp-toc-sub);
  position: absolute;
  left: 0;
  top: 0;
  min-width: 28px;
  font-weight: 700;
  color: rgba(166, 59, 0, 0.72);
}

.pcp-toc-item a {
  color: var(--pc-on-surface-variant);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s;
}

.pcp-toc-item a:hover {
  color: var(--pc-primary);
}

.pcp-toc-level-3 {
  font-size: 15px;
}

.pcp-prose h2[id],
.pcp-prose h3[id] {
  scroll-margin-top: 96px;
}

@media (max-width: 767px) {
  .pcp-toc {
    margin-bottom: 32px;
    border-radius: 16px;
  }

  .pcp-toc-head {
    padding: 18px 18px;
  }

  .pcp-toc-title {
    font-size: 20px;
  }

  .pcp-toc-list {
    gap: 10px;
    padding: 0 18px 20px;
  }

  .pcp-toc-sublist {
    padding-left: 16px;
  }
}

/* --- Prose Content --------------------------------------------*/
.pcp-prose {
  font-family: var(--pc-font-body);
  font-size: 18px;
  line-height: 1.78;
  color: var(--pc-on-surface);
  overflow-wrap: break-word;
}

.pcp-prose *,
.pcp-prose *::before,
.pcp-prose *::after {
  box-sizing: border-box;
}

.pcp-prose p {
  margin-bottom: 25px !important;
  line-height: 1.78 !important;
}

.pcp-prose h2,
.pcp-prose h3 {
  font-family: var(--pc-font-display) !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: var(--pc-deep-espresso) !important;
  margin: 30px 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.pcp-prose ul,
.pcp-prose ol {
  margin-bottom: 2rem !important;
  padding-left: 1.5rem !important;
}

.pcp-prose ul { list-style-type: disc !important; }
.pcp-prose ol { list-style-type: decimal !important; }

.pcp-prose li {
  margin-bottom: 1rem !important;
  line-height: 1.78 !important;
}

.pcp-prose ul li::marker { color: var(--pc-primary); }

.pcp-prose blockquote {
  margin: 48px 0 !important;
  padding: 40px 32px !important;
  border-left: 8px solid var(--pc-primary) !important;
  background: rgba(245, 243, 238, 0.3) !important;
  border-radius: 0 var(--pc-radius) var(--pc-radius) 0 !important;
  font-style: italic !important;
  color: var(--pc-secondary) !important;
  font-size: 20px !important;
  line-height: 1.6 !important;
}

.pcp-prose blockquote p {
  margin: 0 !important;
}

.pcp-prose a {
  color: var(--pc-primary);
  text-decoration: none;
  text-underline-offset: 4px;
  border-bottom: 1px solid rgba(166, 59, 0, 0.4);
  transition: border-color 0.2s;
}
.pcp-prose a:hover {
  border-bottom-color: var(--pc-primary);
}

.pcp-prose img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 12px !important;
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.pcp-prose img.aiagcs-inserted-image {
  display: none !important;
}

.pcp-prose p:has(> img.aiagcs-inserted-image:only-child) {
  display: none !important;
}

.pcp-prose iframe,
.pcp-prose video,
.pcp-prose embed,
.pcp-prose object,
.pcp-prose table {
  max-width: 100% !important;
}

.pcp-prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
}

/* ── WordPress images: reset float, căn giữa, caption bên dưới ── */

/* Gutenberg: wp-block-image */
.pcp-prose .wp-block-image {
  display: block;
  float: none;
  margin: 40px auto;
  width: 100%;
  max-width: 100%;
  text-align: center;
}
.pcp-prose .wp-block-image img {
  display: block !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 12px !important;
  margin: 0 auto !important;
}
.pcp-prose .wp-block-image figcaption,
.pcp-prose .wp-block-image .wp-element-caption {
  display: block;
  text-align: center;
  font-size: 14px;
  font-style: italic;
  color: var(--pc-on-surface-variant);
  margin: 10px 0 0;
  padding: 0 8px;
  background: none;
  border-radius: 0;
  float: none;
  clear: both;
  width: 100%;
}

/* Classic editor: .wp-caption */
.pcp-prose .wp-caption,
.pcp-prose div.wp-caption {
  display: block;
  float: none;
  max-width: 100%;
  width: auto;
  margin: 40px auto;
  padding: 0;
}
.pcp-prose .wp-caption img {
  display: block !important;
  max-width: 100% !important;
  width: auto !important;
  border-radius: 12px 12px 0 0 !important;
  margin: 0 auto !important;
}
.pcp-prose .wp-caption-text,
.pcp-prose p.wp-caption-text {
  display: block !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  text-align: center !important;
  font-size: 14px !important;
  font-style: italic !important;
  color: var(--pc-on-surface-variant) !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  background: none !important;
  border-radius: 0 0 12px 12px !important;
}

/* Figure chung (không phân biệt block/classic) */
.pcp-prose figure {
  display: block !important;
  float: none !important;
  margin: 40px auto !important;
  width: 100% !important;      /* ← full width, không thu nhỏ theo ảnh */
  max-width: 100% !important;
  text-align: center;
}
.pcp-prose figcaption,
.pcp-prose .wp-element-caption,
.pcp-prose .wp-block-image figcaption {
  display: block !important;
  float: none !important;
  clear: both;
  text-align: center;
  font-size: 14px;
  font-style: italic;
  color: var(--pc-on-surface-variant);
  margin-top: 10px;
  padding: 0 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  background: none;
}

/* Reset alignleft / alignright → center trong prose */
.pcp-prose .alignleft,
.pcp-prose .alignright {
  float: none;
  display: block;
  margin: 40px auto;
  clear: both;
}
.pcp-prose .aligncenter {
  display: block;
  margin: 40px auto;
  text-align: center;
}

/* Clear sau mỗi figure để text không chạy quanh ảnh */
.pcp-prose figure::after,
.pcp-prose .wp-caption::after {
  content: '';
  display: table;
  clear: both;
}

/* --- Ẩn plugin output bên trong prose (tránh trùng lặp) ------*/
.pcp-prose .kk-star-ratings,
.pcp-prose .post-views.entry-meta {
  display: none;
}

/* --- Stats Bar: Rating · Views · Share — 1 hàng ngang --------*/
.pcp-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding: 20px 24px;
}

/* Rating: reset centering của plugin, để nó nằm trong flex */
.pcp-stats-bar .pcp-stats-rating .kk-star-ratings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  /* override plugin's center alignment */
  margin: 0;
  padding: 0;
}
.pcp-stats-bar .pcp-stats-rating .kk-star-ratings.kksr-align-center {
  justify-content: flex-start;
}

/* View count */
.pcp-stats-views {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--pc-font-body);
  font-size: 14px;
  color: var(--pc-on-surface-variant);
  white-space: nowrap;
}

/* Share trong stats bar: compact hơn */
.pcp-stats-bar .pcp-share {
  gap: 8px;
}
.pcp-stats-bar .pcp-share-label {
  font-size: 12px;
}
.pcp-stats-bar .pcp-share-btn {
  width: 36px;
  height: 36px;
}

@media (max-width: 640px) {
  .pcp-stats-bar {
    padding: 16px;
    gap: 12px;
  }
  /* Mobile: rating + views trên 1 hàng, share hàng dưới */
  .pcp-stats-bar .pcp-stats-rating { order: 1; }
  .pcp-stats-views                 { order: 2; }
  .pcp-stats-bar .pcp-share        { order: 3; width: 100%; justify-content: flex-end; }
}

/* --- Post Footer: Tags + Share --------------------------------*/
.pcp-post-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(141, 113, 102, 0.2);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: flex-end; /* default: share button trên cùng bên phải */
}

/* Khi có tags: tags bên trái, share bên phải */
.pcp-post-footer:has(.pcp-tags a) {
  justify-content: space-between;
}

.pcp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Ẩn tags container khi rỗng */
.pcp-tags:empty {
  display: none;
}

.pcp-tags a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px !important;
  border-radius: 9999px;
  background: var(--pc-surface-container-low);
  color: var(--pc-on-surface-variant);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: none;
  transition: background 0.2s;
}
.pcp-tags a:hover {
  background: #e4e2dd;
}
.pcp-tags a::before {
  content: '#';
  font-size: 13px;
}

.pcp-share {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pcp-share-label {
  font-family: var(--pc-font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pc-on-surface-variant);
}

.pcp-share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(141, 113, 102, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-on-surface-variant);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.pcp-share-btn:hover {
  border-color: var(--pc-primary);
  color: var(--pc-primary);
}
.pcp-share-btn svg { display: block; }

/* Reset button-specific browser defaults */
button.pcp-share-btn {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  vertical-align: middle;
  box-sizing: border-box;
  line-height: 1;
}

/* --- Author Box -----------------------------------------------*/
.pcp-author-box {
  margin-top: 40px;
  background: rgba(245, 243, 238, 0.4);
  border: 1px solid rgba(141, 113, 102, 0.1);
  border-radius: 24px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  text-align: center;
}
@media (min-width: 640px) {
  .pcp-author-box {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }
}

.pcp-author-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e4e2dd;
}
.pcp-author-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  margin: 0 !important;
}

.pcp-author-body { flex: 1; }

.pcp-author-name {
  font-family: var(--pc-font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--pc-deep-espresso);
  margin: 0 0 12px;
  text-transform: none;
}

.pcp-author-bio {
  font-family: var(--pc-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--pc-on-surface-variant);
  margin: 0 0 24px;
}

.pcp-author-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  background: var(--pc-primary);
  color: #fff;
  font-family: var(--pc-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: none;
  transition: opacity 0.2s;
}
.pcp-author-btn:hover { opacity: 0.9; }

/* --- Comments Wrapper -----------------------------------------
.pcp-comments-wrap {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid rgba(141, 113, 102, 0.15);
} */

/* --- Section: Related Posts -----------------------------------*/
.pcp-related-section {
  max-width: 1280px;
  margin: 10px auto 0;
  padding: 60px 20px 0;
}
@media (min-width: 640px) {
  .pcp-related-section { padding: 30px 32px 0; }
}
@media (min-width: 1024px) {
  .pcp-related-section { }
}

.pcp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.pcp-section-title {
  font-family: var(--pc-font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--pc-deep-espresso);
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}

.pcp-section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pc-primary);
  font-family: var(--pc-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: none;
  white-space: nowrap;          /* ← ngăn break xuống dòng */
  flex-shrink: 0;               /* ← không bị ép thu nhỏ */
  transition: color 0.2s;
}
.pcp-section-link:hover { color: var(--pc-primary-container); }

.pcp-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .pcp-related-grid { grid-template-columns: repeat(3, 1fr); }
}

.pcp-rel-card {
  display: block;
  background: #fff;
  border-radius: var(--pc-radius);
  overflow: hidden;
  box-shadow: var(--pc-shadow-warm);
  border: 1px solid rgba(141, 113, 102, 0.1);
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.3s;
}
.pcp-rel-card:hover {
  box-shadow: var(--pc-shadow-warm-lg);
  transform: translateY(-4px);
}

.pcp-rel-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--pc-surface-container);
}
.pcp-rel-img img,
.pcp-rel-img .pcp-rel-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  transition: transform 0.3s;
}
.pcp-rel-card:hover .pcp-rel-img img { transform: scale(1.03); }

.pcp-rel-img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--pc-surface-container);
}

.pcp-rel-body { padding: 32px; }

.pcp-rel-cat {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pc-primary);
  margin-bottom: 12px;
}

.pcp-rel-title {
  font-family: var(--pc-font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pc-deep-espresso);
  margin: 0 0 16px;
  text-transform: none;
  letter-spacing: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.pcp-rel-card:hover .pcp-rel-title { color: var(--pc-primary); }

.pcp-rel-date {
  font-size: 14px;
  color: var(--pc-on-surface-variant);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Section: Recommended Products ----------------------------*/
.pcp-products-section {
  max-width: 1280px;
  margin: 80px auto 80px;
  padding: 0 20px;
}
@media (min-width: 640px) {
  .pcp-products-section { padding: 0 32px; }
}
@media (min-width: 1024px) {
  .pcp-products-section { padding: 0 40px; }
}

.pcp-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (min-width: 768px) {
  .pcp-products-grid { grid-template-columns: repeat(4, 1fr); }
}

.pcp-prod-card {
  background: #fff;
  border-radius: var(--pc-radius);
  overflow: hidden;
  border: 1px solid rgba(141, 113, 102, 0.1);
  transition: box-shadow 0.3s, transform 0.3s;
}
.pcp-prod-card:hover {
  box-shadow: var(--pc-shadow-warm-lg);
  transform: translateY(-4px);
}

.pcp-prod-img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--pc-surface-container);
}
.pcp-prod-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
}

.pcp-prod-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.pcp-prod-title {
  font-family: var(--pc-font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--pc-deep-espresso);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  transition: color 0.2s;
}
.pcp-prod-card:hover .pcp-prod-title { color: var(--pc-primary); }

.pcp-prod-price {
  font-family: var(--pc-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--pc-primary);
  margin: 0 0 16px;
}
/* WooCommerce price HTML */
.pcp-prod-price .woocommerce-Price-amount { color: var(--pc-primary); }
.pcp-prod-price .woocommerce-Price-currencySymbol,
.pcp-prod-price abbr,
.pcp-prod-price abbr[title] {
  font-family: var(--pc-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--pc-primary);
  text-decoration: none;
  text-decoration-line: none;
  border-bottom: none;
  cursor: default;
  vertical-align: baseline;
}

.pcp-prod-btn {
  width: 100%;
  padding: 10px;
  border-radius: 9999px;
  border: 1px solid var(--pc-primary);
  color: var(--pc-primary);
  background: transparent;
  font-family: var(--pc-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.pcp-prod-btn:hover {
  background: var(--pc-primary);
  color: #fff;
}

/* --- Mobile: "Xem tất cả" button dưới related grid ---------- */
.pcp-related-mobile-cta {
  display: block;
  margin-top: 40px;
  text-align: center;
}
@media (min-width: 768px) {
  .pcp-related-mobile-cta { display: none; }
}

.pcp-related-mobile-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 32px !important;
  border: 1px solid rgba(141, 113, 102, 0.3);
  border-radius: 12px;
  color: var(--pc-deep-espresso);
  font-family: var(--pc-font-body) !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.pcp-related-mobile-cta a:hover {
  border-color: var(--pc-primary);
  color: var(--pc-primary);
}

/* =============================================================
   FIX: Ẩn fixed-toc plugin — dùng TOC tự build thay thế
   ============================================================= */
.single #ftwp-container {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* =============================================================
   FIX: Layout centering + Flatsome override
   ============================================================= */

/* Force #main to be full-width on single post pages */
.single #main {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  float: none;
  display: block;
  background: #fbf9f4;
}

/* Force article centering regardless of Flatsome grid system */
article.pcp-article {
  float: none;
  clear: both;
  display: block;
  width: 100%;
  margin-top: var(--pcp-article-top) !important;
  padding-left: var(--pcp-page-gutter) !important;
  padding-right: var(--pcp-page-gutter) !important;
  box-sizing: border-box;
}

/* Ensure pcp-single-wrap fills full width */
.pcp-single-wrap {
  display: block;
  overflow-x: hidden;
}

/* Remove any Flatsome shortcode padding that may bleed in */
.single .section-content,
.single .page-wrapper {
  padding: 0;
}

/* =============================================================
   FIX: Related Posts — Horizontal Swipe Carousel on mobile
   ============================================================= */

@media (max-width: 767px) {
  /* Reset section padding so cards bleed to edges */
  .pcp-related-section {
    padding-left: 0;
    padding-right: 0;
    overflow: visible;
  }

  .pcp-section-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Convert grid → horizontal scroll snap */
  .pcp-related-grid {
    display: flex;
    flex-wrap: nowrap;
    grid-template-columns: unset;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding: 4px 16px 24px;
    /* Hide scrollbar visually, keep scroll functional */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .pcp-related-grid::-webkit-scrollbar { display: none; }

  /* Each card: fixed width showing peek of next card */
  .pcp-rel-card {
    flex: 0 0 78%;
    min-width: 0;
    scroll-snap-align: start;
    transform: none; /* disable hover lift on touch */
  }
  /* Disable hover scale on touch */
  .pcp-rel-card:hover { transform: none; }
  .pcp-rel-card:hover .pcp-rel-img img { transform: none !important; }

  /* Scroll indicator dots (added via JS) */
  .pcp-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 0 16px;
  }

  /* Related mobile CTA hidden — using scroll instead */
  .pcp-related-mobile-cta { display: none; }
}

/* Products: remove hover lift on touch devices */
@media (hover: none) {
  .pcp-prod-card:hover,
  .pcp-rel-card:hover {
    transform: none;
    box-shadow: var(--pc-shadow-warm);
  }
}

/* =============================================================
   FIX: General alignment — consistent spacing on all viewports
   ============================================================= */

/* Article header spacing on mobile */
@media (max-width: 767px) {
  .pcp-breadcrumbs {
    margin-bottom: 24px;
    font-size: 12px;
    overflow: hidden;
  }
  .pcp-breadcrumbs .rank-math-breadcrumb,
  .pcp-breadcrumbs .rank-math-breadcrumb p {
    width: 100%;
  }
  .pcp-breadcrumbs .last,
  .pcp-breadcrumbs [aria-current="page"] {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .pcp-article-header { margin-top: 0; margin-bottom: 32px; }
  .pcp-cat-pill-wrap  { margin-bottom: 16px; }
  .pcp-post-title     { margin-bottom: 20px; }
  .pcp-meta-row       {
    display: flex;
    width: 100%;
    border-radius: 16px;
    padding: 12px 14px;
  }
  .pcp-hero-figure    { margin-bottom: 40px; }
  .pcp-author-box     { padding: 24px; }
  .pcp-rel-body       { padding: 20px; }
  .pcp-post-footer    { margin-top: 40px; }

  /* Meta row: reduce gap on small screens */
  .pcp-meta-row       { gap: 12px; font-size: 14px; }
  .pcp-meta-dot       { display: none; }
}

/* Section spacing consistency */
.pcp-related-section,
.pcp-products-section {
  margin-top: 50px;
  margin-bottom: 0;
}

/* Products grid: consistent gap */
.pcp-products-grid {
  gap: 16px;
}
@media (min-width: 768px) {
  .pcp-products-grid { gap: 24px; }
}

/* Section header: align baseline */
.pcp-section-header {
  align-items: baseline;
}

/* Content wrap: consistent bottom spacing */
.pcp-content-wrap {
  padding-bottom: 0;
}

/* Prose: first p intro style */
.pcp-prose > p:first-child {
  font-size: 20px !important;
  line-height: 1.7 !important;
  color: var(--pc-secondary) !important;
  font-weight: 500 !important;
}

/* Fix post_class adding unexpected styles via hentry */
.pcp-article.hentry {
  margin: var(--pcp-article-top) auto 0;
  padding-left: var(--pcp-page-gutter) !important;
  padding-right: var(--pcp-page-gutter) !important;
  border: none;
  background: transparent;
}
