/* --------------------------------------------------------------------------
   Page hero — unified layout for all archives, pages, singles, search
   -------------------------------------------------------------------------- */

.page-hero {
    --page-hero-padding-y: 2.5rem;
    --page-hero-padding-x: 0;
    --page-hero-cover-min-height: 240px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: var(--page-hero-padding-y) var(--page-hero-padding-x);
    margin-bottom: 0;
}

body:not(.page-hero-layout-content) .page-hero {
    border-radius: 0;
}

.page-hero--has-cover {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: var(--page-hero-cover-min-height);
    padding: 3rem 0 2.5rem;
    overflow: hidden;
}

.page-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.page-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.72) 100%);
}

.page-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
}

.page-hero__content {
    max-width: 960px;
}

.page-hero__content > :last-child {
    margin-bottom: 0;
}

.page-hero__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    margin: 0.5rem 0 0;
}

.page-hero__title-sep {
    opacity: 0.72;
    font-weight: 500;
}

.page-hero__title-count {
    font-weight: 600;
    opacity: 0.92;
}

.page-hero__pet-icon {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 1.15em;
    vertical-align: -0.05em;
}

.page-hero__desc {
    margin: 0.75rem 0 0;
    opacity: 0.92;
    font-size: 1rem;
    max-width: 640px;
    color: rgba(255, 255, 255, 0.95);
}

.page-hero__desc a {
    color: inherit;
    text-decoration: none;
}

.page-hero__desc a:hover {
    color: #fff;
    text-decoration: underline;
}

.page-hero__meta {
    margin: 0.75rem 0 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.88);
}

.page-hero__body {
    margin-top: 1rem;
}

.page-hero__body > :first-child {
    margin-top: 0;
}

.page-hero .breadcrumb {
    margin-bottom: 0;
}

.page-hero .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.85);
}

.page-hero .breadcrumb-item a:hover {
    color: #fff;
}

.page-hero .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.95);
}

.page-hero .breadcrumb-item + .breadcrumb-item::before {
    color: currentColor;
    opacity: 0.65;
}

.page-hero .search-page-form {
    max-width: 560px;
    margin-top: 0;
}

.page-hero .search-page-form .form-control {
    border: none;
    box-shadow: var(--box-shadow-md);
}

.page-hero .search-page-form .btn-primary {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.page-hero .search-category-filter {
    margin-top: 1rem;
    text-align: left;
}

.page-hero .search-category-filter__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.page-hero .search-category-filter__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-hero .search-category-filter__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.page-hero .search-category-filter__tag:hover,
.page-hero .search-category-filter__tag.is-active {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.page-hero .article-meta {
    margin-top: 0.75rem;
}

.search-page-form {
    max-width: 560px;
    margin-top: 1.25rem;
}

.search-page-form .form-control {
    border: none;
    box-shadow: var(--box-shadow-md);
}

.search-page-form .btn-primary {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* --------------------------------------------------------------------------
   Section headers
   -------------------------------------------------------------------------- */

.section-header__title {
    color: var(--gray-900);
    font-weight: 700;
    font-size: clamp(1.125rem, 3vw, 1.5rem);
}

.section-header__desc {
    font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Post cards (grid & list)
   -------------------------------------------------------------------------- */

.post-card {
    border: none;
    background: transparent;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.post-card:hover {
    transform: translateY(-4px);
}

.post-card--list {
    flex-direction: row;
    align-items: stretch;
}

.post-card--list .post-card__cover-link {
    flex: 0 0 38%;
    width: 38%;
    max-width: 240px;
    min-width: 120px;
    align-self: stretch;
    display: flex;
}

.post-card--list .post-card__cover-frame {
    flex: 1;
    width: 100%;
    min-height: 100%;
}

.post-card--list .post-card__cover-frame::before {
    display: none;
}

.post-card--list .post-card__cover {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.post-card__cover-link {
    display: block;
    width: 100%;
    flex-shrink: 0;
    text-decoration: none;
}

.post-card__cover-frame {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    background: var(--gray-100, #f3f4f6);
}

.post-card__cover-frame::before {
    content: '';
    display: block;
    width: 100%;
    padding-top: 75%;
}

.post-card__badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    pointer-events: none;
}

.post-card__badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.post-card__badge--top {
    background: var(--danger-color, #ef4444);
}

.post-card__badge--recommend {
    background: var(--primary-color);
}

.post-card__cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card__cover {
    transform: scale(1.03);
}

.post-card__category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
}

.post-card__category:hover {
    color: var(--secondary-color);
}

.post-card__title {
    color: var(--gray-900);
    font-weight: 600;
    transition: color var(--transition-speed) ease;
}

.post-card__title:hover {
    color: var(--primary-color);
}

.post-card__meta {
    margin-bottom: 0.5rem;
}

.post-card__excerpt {
    color: var(--gray-600);
    font-size: 0.9375rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-list .post-card--list .card-body {
    padding: 1.25rem 1.5rem;
}

/* --------------------------------------------------------------------------
   Article single
   -------------------------------------------------------------------------- */

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.article-meta__item + .article-meta__item::before {
    content: '·';
    margin-inline: 0.5rem;
    opacity: 0.75;
}

.article-meta__item {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
}

.article-meta__item:hover {
    color: #fff;
}

.article-excerpt {
    margin: 0 0 1.75rem;
    padding: 1.25rem 1.5rem;
    background-color: var(--gray-50, #f3f4f6);
    border-radius: var(--border-radius);
}

.article-excerpt__text {
    margin: 0;
    color: var(--text-color, #374151);
    font-size: 1.0625rem;
    line-height: 1.8;
    margin-bottom: 0 !important;
}

.article-body .article-content {
    margin-top: 0;
}

.related-posts .post-card {
    height: 100%;
}

.article-cover {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow-md);
}

.article-cover__img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.article-body {
    border: none;
}

.article-body .article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.article-copyright {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--gray-400);
    text-align: left;
}

.article-tags__label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-right: 0.15rem;
}

.article-tags__link {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--bs-secondary-color);
    background: color-mix(in srgb, var(--bs-secondary-color) 5%, transparent);
    border-radius: 2rem;
    text-decoration: none;
    transition: color var(--transition-speed) ease, background var(--transition-speed) ease;
}

.article-tags__link:hover {
    color: #fff;
    background: var(--primary-color);
}

.article-actions-separator {
    font-size: 0.825rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-color, #374151);
    margin: 1.25rem 0 0;
    padding: 1rem 0 0;
    opacity: .45;
    text-align: center;
}

.article-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.article-actions .nova-social-share--action-inline {
    margin: 0;
}

.article-action {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 3.5rem;
    padding: 0;
    color: var(--text-color, #374151);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.article-action:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.article-action__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.125rem;
    line-height: 1;
    background: var(--gray-50, #f8fafc);
    transition: background 0.2s ease, color 0.2s ease;
}

.article-action__text {
    font-size: 0.8125rem;
    line-height: 1.3;
    font-weight: 500;
}

.article-action--like.is-active,
.article-action--like.is-active:hover {
    color: var(--primary-color);
}

.article-action--like.is-active .article-action__icon {
    color: #fff;
    background: var(--primary-color);
}

.article-action--favorite.is-active,
.article-action--favorite.is-active:hover {
    color: #f59e0b;
}

.article-action--favorite.is-active .article-action__icon {
    color: #fff;
    background: #f59e0b;
}

.article-action--share .article-action__icon {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 10%, #fff);
}

.article-action--reward .article-action__icon {
    color: #f97316;
    background: color-mix(in srgb, #f97316 12%, #fff);
}

.article-reward-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.article-reward-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.article-reward-modal[hidden]:not(.is-open) {
    display: none !important;
}

.article-reward-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.article-reward-modal__dialog {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: calc(100vw - 2rem);
    padding: 1.5rem 1.25rem 1.25rem;
    background: var(--surface-color, #fff);
    border-radius: var(--border-radius);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    transform: translateY(1rem) scale(0.98);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-reward-modal.is-open .article-reward-modal__dialog {
    transform: translateY(0) scale(1);
}

.article-reward-modal__dialog--single {
    width: min(100%, 17.5rem);
}

.article-reward-modal__dialog--multiple {
    width: min(100%, 28rem);
}

.article-reward-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--gray-600, #6b7280);
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.article-reward-modal__close:hover {
    color: var(--gray-900, #111827);
    background: var(--gray-100, #f3f4f6);
}

.article-reward-modal__title {
    margin: 0 0 1rem;
    padding-right: 2rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    color: var(--text-color, #374151);
}

.article-reward-modal__items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: 1rem;
}

.article-reward-modal__items--single {
    grid-template-columns: 1fr;
}

.article-reward-modal__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.article-reward-modal__qr {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: var(--surface-color, #fff);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.article-reward-modal__qr img {
    display: block;
    width: 100%;
    max-width: 9rem;
    height: auto;
}

.article-reward-modal__label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    color: var(--text-color, #374151);
}

html.article-reward-modal-open,
body.article-reward-modal-open {
    overflow: hidden;
}

body.article-reward-modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Page content & typography
   -------------------------------------------------------------------------- */

.page-content {
    border: none;
}

.page-content--fullwidth .card-body,
.page-content--landing {
    max-width: 100%;
}

.page-content--landing {
    max-width: 900px;
}

.page-content--blank {
    border: none;
    background: transparent;
    box-shadow: none;
}

.page-landing-hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    padding: 3rem 0 2.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    overflow: hidden;
}

.page-landing-hero--has-cover {
    min-height: 360px;
}

.page-landing-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.page-landing-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.72) 100%);
}

.page-landing-hero__inner {
    position: relative;
    z-index: 1;
}

.page-landing-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0.5rem 0 0;
    color: #fff;
}

.page-landing-hero__desc {
    margin: 1rem 0 0;
    max-width: 640px;
    font-size: 1.125rem;
    opacity: 0.92;
}

.page-landing-hero .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.85);
}

.page-landing-hero .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.95);
}

.content {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--gray-800);
}

.content img {
    border-radius: var(--border-radius);
    margin: 0;
    box-shadow: var(--box-shadow);
}

.content p {
    margin-bottom: 1.25rem;
}

.content h1, .content h2, .content h3, .content h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.content h2 {
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-100);
}

.content ul, .content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.content li {
    margin-bottom: 0.35rem;
}

.content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.25rem;
    background-color: var(--gray-50);
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    color: var(--gray-700);
}

.content pre,
.content code {
    font-size: 0.9em;
}

.content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    /* display: block; */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

.content table th,
.content table td {
    border: 1px solid var(--gray-200);
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.content table th {
    background: var(--gray-50);
}

@media (max-width: 575.98px) {
    .content table th,
    .content table td {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }
}

.content .ql-grid-embed,
.entry-content .ql-grid-embed,
.article-content .ql-grid-embed {
    margin: 1.5rem 0;
}

.content .ql-grid-layout,
.entry-content .ql-grid-layout,
.article-content .ql-grid-layout {
    display: grid;
    gap: 1rem;
    width: 100%;
}

.content .ql-grid-layout[data-cols="1"],
.entry-content .ql-grid-layout[data-cols="1"],
.article-content .ql-grid-layout[data-cols="1"] { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.content .ql-grid-layout[data-cols="2"],
.entry-content .ql-grid-layout[data-cols="2"],
.article-content .ql-grid-layout[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content .ql-grid-layout[data-cols="3"],
.entry-content .ql-grid-layout[data-cols="3"],
.article-content .ql-grid-layout[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.content .ql-grid-layout[data-cols="4"],
.entry-content .ql-grid-layout[data-cols="4"],
.article-content .ql-grid-layout[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.content .ql-grid-layout[data-cols="5"],
.entry-content .ql-grid-layout[data-cols="5"],
.article-content .ql-grid-layout[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.content .ql-grid-layout[data-cols="6"],
.entry-content .ql-grid-layout[data-cols="6"],
.article-content .ql-grid-layout[data-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.content .ql-grid-cell,
.entry-content .ql-grid-cell,
.article-content .ql-grid-cell {
    min-width: 0;
    outline: none;
}

.content .ql-grid-cell:focus,
.entry-content .ql-grid-cell:focus,
.article-content .ql-grid-cell:focus,
.content .ql-grid-cell:focus-visible,
.entry-content .ql-grid-cell:focus-visible,
.article-content .ql-grid-cell:focus-visible {
    outline: none;
    box-shadow: none;
}

.content .ql-grid-cell img,
.entry-content .ql-grid-cell img,
.article-content .ql-grid-cell img,
.content .ql-grid-cell video,
.entry-content .ql-grid-cell video,
.article-content .ql-grid-cell video {
    display: block;
    max-width: 100%;
    height: auto;
    outline: none;
    border: 0;
}

.content .ql-grid-cell img:focus,
.entry-content .ql-grid-cell img:focus,
.article-content .ql-grid-cell img:focus,
.content .ql-grid-cell img:focus-visible,
.entry-content .ql-grid-cell img:focus-visible,
.article-content .ql-grid-cell img:focus-visible,
.content .ql-grid-cell video:focus,
.entry-content .ql-grid-cell video:focus,
.article-content .ql-grid-cell video:focus {
    outline: none;
    box-shadow: none;
}

.content .ql-grid-cell > :first-child,
.entry-content .ql-grid-cell > :first-child,
.article-content .ql-grid-cell > :first-child {
    margin-top: 0;
}

.content .ql-grid-cell > :last-child,
.entry-content .ql-grid-cell > :last-child,
.article-content .ql-grid-cell > :last-child {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .content .ql-grid-layout,
    .entry-content .ql-grid-layout,
    .article-content .ql-grid-layout {
        grid-template-columns: 1fr !important;
    }
}

/* --------------------------------------------------------------------------
   Article reading UI — progress, TOC, prev/next, hero tweaks
   -------------------------------------------------------------------------- */

.reading-progress {
    position: fixed;
    top: 0;
    top: env(safe-area-inset-top, 0);
    left: 0;
    left: env(safe-area-inset-left, 0);
    right: 0;
    right: env(safe-area-inset-right, 0);
    z-index: 1090;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

body.has-reading-progress .reading-progress {
    pointer-events: auto;
    cursor: pointer;
}

.reading-progress__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.12s ease-out;
}

body.has-reading-progress .back-to-top.is-visible {
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary-color) 25%, transparent);
}

.article-toc {
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 249, 240, 0.6);
}

.article-toc__label {
    font-size: 0.9375rem;
    color: var(--text-color, #2d3436);
}

.article-toc__list {
    padding: 0 1rem 0.85rem;
}

.article-toc__item {
    margin-bottom: 0.35rem;
}

.article-toc__item--h3 {
    padding-left: 1rem;
}

.article-toc__item a {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600, #6b7280);
    text-decoration: none;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.article-toc__item a:hover {
    color: var(--primary-color);
}

/* Active heading in TOC (scroll spy) */
.article-toc__item--active a {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* ---- Floating TOC (right side, desktop only) ---- */
.article-toc-floating {
    display: none;
}

@media (min-width: 1400px) {
    .article-toc-floating {
        display: block;
        position: fixed;
        top: 120px;
        right: max(1rem, calc((100vw - 1320px) / 2 - 240px));
        width: 220px;
        max-height: calc(100vh - 160px);
        overflow-y: auto;
        z-index: 100;
        background: var(--card-bg, #fff);
        border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow, 0 2px 12px rgba(0, 0, 0, 0.06));
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .article-toc-floating.is-collapsed .article-toc--floating {
        display: none;
    }

    .article-toc-floating.is-collapsed {
        width: auto;
        min-width: 0;
        padding: 0.5rem;
    }
}

.article-toc-floating__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.5rem;
}

.article-toc-floating__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color, #2d3436);
    margin: 0;
}

.article-toc-floating__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500, #9ca3af);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.article-toc-floating__toggle:hover {
    background: var(--gray-100, #f3f4f6);
    color: var(--text-color, #2d3436);
}

.article-toc--floating {
    border: none !important;
    background: transparent !important;
    padding: 0 0.5rem;
}

.article-toc--floating .article-toc__list {
    padding: 0 0.5rem 0.5rem;
}

.article-toc--floating .article-toc__item a {
    font-size: 0.8125rem;
    line-height: 1.45;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.article-toc--floating .article-toc__item--active a {
    border-left-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 6%, transparent);
}

/* ---- Inline TOC (inside article body) ---- */
.article-toc-inline {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    background: var(--card-bg-secondary, rgba(255, 249, 240, 0.6));
}

.article-toc-inline__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color, #2d3436);
    margin: 0 0 0.5rem 0;
}

.article-toc--inline {
    border: none !important;
    background: transparent !important;
}

.article-toc--inline .article-toc__list {
    padding: 0;
}

/* ---- Gesture Nav Indicator ---- */
.gesture-nav-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.gesture-nav-indicator.is-active {
    opacity: 0.85;
}

.gesture-nav-indicator.is-ready {
    opacity: 0.95;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.gesture-nav-indicator__icon {
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.gesture-nav-indicator--prev .gesture-nav-indicator__icon {
    border-right: 12px solid #fff;
    margin-right: 2px;
}

.gesture-nav-indicator--next .gesture-nav-indicator__icon {
    border-left: 12px solid #fff;
    margin-left: 2px;
}

/* Edge hints (fade in briefly on page load) */
.gesture-nav-hint {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 50px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.gesture-nav-hint.is-visible {
    opacity: 1;
    transition: opacity 0.3s ease 0.3s;
}

.gesture-nav-hint--left {
    left: 4px;
}

.gesture-nav-hint--right {
    right: 4px;
}

@media (min-width: 992px) {
    .gesture-nav-indicator,
    .gesture-nav-hint {
        display: none !important;
    }
}

.page-hero__pet-icon {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 1.15em;
    vertical-align: -0.05em;
}

/* ---- Author Info Card ---- */
.author-card__inner {
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    border-radius: var(--border-radius);
    background: var(--card-bg, #fff);
    box-shadow: var(--box-shadow, 0 1px 4px rgba(0, 0, 0, 0.04));
}

.author-card__inner .card-body {
    align-items: center;
}

.author-card__avatar {
    width: 64px;
    height: 64px;
}

.author-card__avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, rgba(0, 0, 0, 0.06));
}

.author-card__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.author-card__name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color, #2d3436);
}

.author-card__count {
    font-size: 0.8125rem;
    color: var(--gray-500, #9ca3af);
}

.author-card__bio {
    font-size: 0.875rem;
    color: var(--gray-600, #6b7280);
    line-height: 1.65;
}

@media (max-width: 576px) {
    .author-card__inner .card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-card__header {
        justify-content: center;
    }
}

.article-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.article-nav__item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 100%;
    padding: 1rem 1.1rem;
    border-radius: var(--card-border-radius);
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    box-shadow: var(--box-shadow, 0 1px 4px rgba(0, 0, 0, 0.04));
    text-decoration: none;
    color: var(--text-color, #2d3436);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.article-nav__item:hover {
    border-color: color-mix(in srgb, var(--primary-color) 28%, transparent);
    box-shadow: var(--box-shadow-hover, 0 8px 24px rgba(0, 0, 0, 0.08));
    transform: translateY(-1px);
    color: var(--text-color, #2d3436);
    text-decoration: none;
}

.article-nav__item--next {
    text-align: right;
    align-items: flex-end;
}

.article-nav__item--empty {
    visibility: hidden;
    pointer-events: none;
}

.article-nav__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color);
}

.article-nav__title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-color, #2d3436);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .article-nav {
        grid-template-columns: 1fr;
    }

    .article-nav__item--next {
        text-align: left;
        align-items: flex-start;
    }

    .article-nav__item--empty {
        display: none;
    }
}
