/* ============================================================
   YG Single Post
   Based on Shopify yg-main-article.liquid from questyle/sections
   ============================================================ */

   .yg-single-post-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 32px;
    padding-top: 40px;
    
}

.yg-single-post-container.yg-section {
  overflow: visible;
}

.yg-single-post__main {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-8);
    min-width: 0;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.yg-single-post__breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #000000;
}

.yg-single-post__breadcrumb-link {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    text-decoration: none;
    color: #242526;
    transition: color 0.3s ease;
}

.yg-single-post__breadcrumb-link:hover {
    color: #000000;
}

.yg-single-post__breadcrumb-separator {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #000000;
}

.yg-single-post__breadcrumb-current {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #000000;
    opacity: 0.1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Header ────────────────────────────────────────────── */
.yg-single-post__header {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-bottom: 40px;
    border-bottom: 1px solid #E2E2E2;
}

.yg-single-post__date {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    color: #707275;
}

.yg-single-post__date svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: currentColor;
}

.yg-single-post__title {
    color: #000000;
    margin: 0;
}

.yg-post-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.yg-author-avatar {
    flex-shrink: 0;
}

.yg-author-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.yg-author-name {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #000000;
}

/* ── Share ──────────────────────────────────────────────── */
.yg-single-post__share {
    display: flex;
    align-items: center;
    gap: 16px;
}

.yg-single-post__share-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #000000;
}

.yg-single-post__share-links {
    display: flex;
    align-items: center;
}

.yg-single-post__share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.yg-single-post__share-icon:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

/* ── Content ────────────────────────────────────────────── */
.yg-single-post__content {
    padding-bottom: 40px;
    border-bottom: 1px solid #E2E2E2;
}

.yg-single-post__content p,
.yg-single-post__content ul,
.yg-single-post__content ol {
    font-size: 16px;
    margin-block: 12px;
    color: #454748;
    line-height: 1.6;
}

.yg-single-post__content ul,
.yg-single-post__content ol {
    padding-inline-start: 24px;
    list-style: disc;
}

.yg-single-post__content li {
    margin-block-end: 8px;
}

.yg-single-post__content figure {
    margin-block: 40px;
}

.yg-single-post__content h2,
.yg-single-post__content h3,
.yg-single-post__content h4,
.yg-single-post__content h5,
.yg-single-post__content h6 {
    margin-block-start: 40px;
    margin-block-end: 12px;
    color: #000000;
    font-weight: 600;
    line-height: 1.4;
}

.yg-single-post__content h2 { font-size: 20px; }
.yg-single-post__content h3,
.yg-single-post__content h4,
.yg-single-post__content h5,
.yg-single-post__content h6 { font-size: 18px; }

.yg-single-post__content a {
    text-decoration: underline;
    color: #01633D;
}

/* ── Post Navigation ────────────────────────────────────── */
.yg-single-post__post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.yg-single-post__post-nav-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 12px;
    border-radius: 4px;
    background: #F4F4F4;
    text-decoration: none;
    transition: background 0.2s;
}

.yg-single-post__post-nav-item:hover {
    background: #e8e8e8;
}

.yg-single-post__post-nav-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

.yg-single-post__post-nav-item--prev .yg-single-post__post-nav-header {
    flex-direction: row;
}

.yg-single-post__post-nav-item--next .yg-single-post__post-nav-header {
    flex-direction: row-reverse;
}

.yg-single-post__post-nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.yg-single-post__post-nav-label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    color: #000000;
}

.yg-single-post__post-nav-title {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #000000;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.yg-single-post__post-nav-item--prev .yg-single-post__post-nav-title {
    margin-inline-start: 28px;
}

.yg-single-post__post-nav-item--next .yg-single-post__post-nav-title {
    margin-inline-end: 28px;
}

/* ── Sidebar ────────────────────────────────────────────── */
.yg-single-post__sidebar {
    position: sticky;
    z-index: 1;
    top: 140px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-8);
}

/* ── TOC ────────────────────────────────────────────────── */
.yg-single-post__toc {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    border-radius: 4px;
    background: #F4F4F4;
}

.yg-single-post__toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    cursor: pointer;
    border: none;
    background: transparent;
}

.yg-single-post__toc-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #242526;
    margin: 0;
}

.yg-single-post__toc-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.yg-single-post__toc .yg-single-post__toc-toggle {
    transform: rotate(180deg);
}

.yg-single-post__toc.is-collapsed .yg-single-post__toc-toggle {
    transform: rotate(0);
}

.yg-single-post__toc-divider {
    width: 100%;
    height: 0;
    border-top: 1px solid #E2E3E3;
}

.yg-single-post__toc-content {
    display: flex;
    gap: 24px;
}

.yg-single-post__toc.is-collapsed .yg-single-post__toc-content,
.yg-single-post__toc.is-collapsed .yg-single-post__toc-divider {
    display: none;
}

.yg-single-post__toc-inner {
    flex: 1 0 0;
    overflow-y: auto;
    max-height: 170px;
    padding-right: 20px;
}

.yg-single-post__toc-inner::-webkit-scrollbar {
    width: 2px;
}

.yg-single-post__toc-inner::-webkit-scrollbar-track {
    background: #B8D4C9;
}

.yg-single-post__toc-inner::-webkit-scrollbar-thumb {
    background: #3E886B;
}

.yg-single-post__toc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.yg-single-post__toc-item {
    line-height: 1.3;
    font-size: 16px;
    font-weight: 400;
    color: #000000;
    transition: color 0.2s;
    cursor: pointer;
}

.yg-single-post__toc-item--h3 {
    font-size: 14px;
    padding-inline-start: 10px;
}

.yg-single-post__toc-item.is-active {
    color: #000000;
}

.yg-single-post__toc-item.is-inactive {
    opacity: 0.2;
}

.yg-single-post__toc-link {
    display: flex;
    gap: 4px;
    text-decoration: none;
    color: inherit;
}

.yg-single-post__toc-number {
    flex-shrink: 0;
}

.yg-single-post__toc-empty {
    font-size: 14px;
    color: #9AA09F;
}

/* ── Recommended ────────────────────────────────────────── */
.yg-single-post__recommended {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.yg-single-post__recommended-title {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #454748;
    margin: 0;
}

.yg-single-post__recommended-list {
    display: flex;
    flex-direction: column;
    gap: var(--yg-article-card-gap, 20px);
    background: #ffffff;
}

.yg-blog-series__card-body {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yg-blog-series__date {
  display: flex;
  gap: 8px;
  align-items: center;
}

.yg-blog-series__date svg {
  width: 24px;
  height: 24px;
}

.yg-blog-series__excerpt {
  margin-top: 8px;
}

/* Mobile: recommended inside main, shown only on tablet (≤1149px) */
.yg-single-post__recommended--mobile {
    display: none;
}

/* ── Responsive: Tablet ≤1149px ─────────────────────────── */
@media (max-width: 1149px) {
    .yg-single-post-container {
        grid-template-columns: 1fr;
        padding-top: 0;
    }

    .yg-single-post__main {
        max-width: 100%;
    }

    .yg-single-post__sidebar {
        position: sticky;
        top: calc(var(--header-height, 0px) * var(--header-is-visible, 1) + 0px);
        z-index: 99;
        order: -1;
        margin-inline: 0;
        flex-direction: row;
        padding-block-start: 0;
        margin-inline: -20px;
    }

    .yg-single-post__sidebar > * {
        width: 50%;
        padding-block: 12px;
        gap: 12px;
    }

    .yg-single-post__toc {
        border-radius: 0;
        border-inline-end: 1px solid #F4F4F4;
    }

    .yg-single-post__toc-inner {
        max-height: 200px;
    }

    .yg-single-post__toc-list {
        gap: 8px;
    }

    /* Hide sidebar recommended; show mobile recommended in main */
    .yg-single-post__sidebar .yg-single-post__recommended {
        display: none !important;
    }

    .yg-single-post__recommended--mobile {
        display: flex;
    }

    .yg-single-post__recommended--mobile .yg-single-post__recommended-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .yg-single-post__header {
        padding-bottom: 24px;
        gap: 20px;
    }

    .yg-single-post__share {
        gap: 4px;
    }

    .yg-single-post__share-icon {
        width: 40px;
        height: 40px;
    }


    .yg-single-post__content figure {
        margin-block: 24px;
    }

    .yg-single-post__content h2 {
        font-size: 18px;
        margin-block-start: 24px;
    }

    .yg-single-post__content h3,
    .yg-single-post__content h4,
    .yg-single-post__content h5,
    .yg-single-post__content h6 {
        font-size: 16px;
        margin-block-start: 24px;
    }

    .yg-single-post__content p,
    .yg-single-post__content ul,
    .yg-single-post__content ol {
        font-size: 14px;
    }

    .yg-single-post__post-nav {
        gap: 12px;
    }
}

/* ── Responsive: Mobile ≤699px ──────────────────────────── */
@media (max-width: 699px) {
    .yg-single-post-container {
        gap: 24px;
    }

    .yg-single-post__main {
        gap: 20px;
    }

    .yg-single-post__sidebar {
        flex-direction: column;
        gap: 0;
    }

    .yg-single-post__sidebar > * {
        width: 100%;
    }

    .yg-single-post__recommended--mobile .yg-single-post__recommended-list {
        display: flex;
        flex-direction: column;
    }

    .yg-single-post__post-nav {
        gap: 12px;
    }

    .yg-single-post__content {
        padding-block: 24px;
    }
}
