/* ===========================
   POST-SPECIFIC STYLES
   "Glass Newspaper" — frosted glass panels floating over a soft ambient
   color field, with editorial serif typography for headlines/kickers and
   sans-serif for reading body copy.
   =========================== */

:root {
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

#readingProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #ffffff, #888888);
    width: 0%;
    z-index: 10000;
    transition: width 0.1s ease;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* ===========================
   AMBIENT GLASS BACKDROP
   Fixed, blurred color blobs the frosted panels blur into — flat black
   behind backdrop-filter: blur() has nothing to refract, so glass needs
   something colorful and soft sitting behind it.
   =========================== */

.ambient-field {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    will-change: transform;
}

.blob-a {
    width: 640px;
    height: 640px;
    top: -220px;
    left: -160px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    animation: driftA 26s ease-in-out infinite alternate;
}

.blob-b {
    width: 520px;
    height: 520px;
    top: 18%;
    right: -180px;
    background: radial-gradient(circle, #f59e0b, transparent 70%);
    animation: driftB 32s ease-in-out infinite alternate;
}

.blob-c {
    width: 560px;
    height: 560px;
    bottom: -240px;
    left: 28%;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    animation: driftC 30s ease-in-out infinite alternate;
}

@keyframes driftA {
    to { transform: translate(60px, 40px) scale(1.08); }
}

@keyframes driftB {
    to { transform: translate(-50px, 60px) scale(1.05); }
}

@keyframes driftC {
    to { transform: translate(40px, -50px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .ambient-blob {
        animation: none;
    }
}

body.light-theme .ambient-blob {
    opacity: 0.13;
}

/* Glass nav, scoped to the post page only via body.post-page */
body.post-page .navbar {
    background: rgba(15, 15, 20, 0.55);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.post-page.light-theme .navbar {
    background: rgba(255, 255, 255, 0.6);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* ===========================
   MASTHEAD / HEADER
   =========================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    position: relative;
    padding: calc(var(--spacing-xl) + 1rem) 0 var(--spacing-md);
}

.post-container {
    max-width: 820px;
    position: relative;
}

/* Header column (kicker/title/subtitle/byline) matches the featured image's
   width (1100px, see .post-image-wrap) instead of the narrower body column. */
.post-header .post-container {
    max-width: 1100px;
}

.post-kicker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 0.7s ease;
}

.post-kicker .category {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
}

.kicker-divider {
    width: 1px;
    height: 14px;
    background: var(--border-color);
}

.post-kicker .read-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.post-title {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    animation: fadeInUp 0.8s ease 0.05s backwards;
}

.post-subtitle {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-style: normal;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    letter-spacing: 0.01em;
    margin-bottom: var(--spacing-md);
    max-width: 100%;
    animation: fadeInUp 0.8s ease 0.15s backwards;
}

/* Byline — glass card */
/* Classic newspaper byline — a hairline-bound row rather than a boxed glass
   card, so it reads as part of the masthead flow instead of a UI panel
   dropped under the dek. The action pills still carry their own glass
   treatment individually. */
.post-byline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    padding: 0.80rem 0 0.75rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    animation: fadeInUp 0.8s ease 0.25s backwards;
}

.author-details {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.author-avatar.large {
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.author-name {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.05rem;
    line-height: 1.2;
}

.author-name a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.author-name a:hover {
    border-color: currentColor;
}

.author-bio {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
    line-height: 1.3;
    max-width: 40ch;
}

.author-bio:empty {
    display: none;
}

.post-meta-bottom {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.separator {
    color: var(--border-color);
}

/* Actions — glass pills */
.post-actions {
    display: flex;
    gap: 0.6rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .icon {
    font-size: 0.95rem;
    display: inline-flex;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.action-btn .count {
    font-size: 0.85rem;
    font-weight: 600;
}

.action-btn.like-btn {
    position: relative;
    overflow: visible;
}

.action-btn.like-btn .icon {
    /* Desaturate the heart emoji to an outline until liked. brightness(2)
       pushes it toward white, which needs a dark-toward variant in light
       theme or the icon disappears into the pill background. */
    filter: grayscale(1) brightness(2);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body.light-theme .action-btn.like-btn .icon {
    filter: grayscale(1) brightness(0.6);
}

.action-btn.like-btn.active .icon {
    filter: grayscale(0) !important;
    animation: heartBeatPost 0.6s ease;
}

.action-btn.like-btn.clicked {
    animation: pulseRipplePost 0.6s ease;
}

@keyframes heartBeatPost {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.35) rotate(-5deg); }
    30% { transform: scale(1.1) rotate(5deg); }
    45% { transform: scale(1.3) rotate(-3deg); }
    60% { transform: scale(1.15) rotate(2deg); }
    75% { transform: scale(1.2) rotate(0deg); }
}

@keyframes pulseRipplePost {
    0% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7); }
    50% { box-shadow: 0 0 0 14px rgba(255, 82, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}

.action-btn.active {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.4);
    color: #00d9ff;
}

.action-btn.bookmark.active {
    background: rgba(251, 146, 60, 0.15);
    border-color: rgba(251, 146, 60, 0.4);
    color: #fb923c;
}

.action-btn.bookmark.active svg {
    fill: currentColor;
}

/* ===========================
   FEATURED IMAGE — glass frame
   =========================== */

.post-image-container {
    padding: 0 0 var(--spacing-xxl);
}

/* Deliberately wider than .post-container (820px) — the hero photo bleeds
   past the text column width, a classic editorial layout technique. */
.post-image-wrap {
    max-width: 1100px;
}

.post-image-frame {
    margin: 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.post-featured-image {
    display: block;
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 16px;
    animation: zoomIn 1s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(1.06);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .post-featured-image {
        height: 240px;
    }
}

/* ===========================
   CONTENT
   =========================== */

.post-content {
    padding: 0 0 var(--spacing-xl);
}

.content-wrapper {
    width: 100%;
}

.post-main {
    width: 100%;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.post-main section {
    margin-bottom: var(--spacing-xxl);
}

.lead-paragraph {
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    font-weight: 400;
}

.post-main h2 {
    font-family: var(--font-serif);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: var(--spacing-xl) 0 var(--spacing-md);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.post-main h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.post-main h3 {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.3;
    margin: var(--spacing-lg) 0 var(--spacing-sm);
    color: var(--text-primary);
}

.post-main p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.post-main > *:first-child {
    margin-top: 0;
}

/* Newspaper-style drop cap on the article's opening paragraph. The `>` direct-
   child combinator matters here — without it this would also match the first
   <p> nested inside a WYSIWYG <li>, dropping a giant letter on a list item. */
.post-main > p:first-of-type::first-letter {
    font-family: var(--font-serif);
    float: left;
    font-size: 4.4rem;
    line-height: 0.82;
    font-weight: 700;
    padding: 0.05em 0.08em 0 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* WYSIWYG output (h2/h3/p/ul/li/hr) has no custom classes to hook into, so it
   falls back to browser default UA spacing — that's what produced the
   inconsistent, oversized gaps. These rules normalize it to match the rest
   of the post typography. */
.post-main ul,
.post-main ol {
    margin: 0 0 var(--spacing-md);
    padding-left: 1.4rem;
}

.post-main ul {
    list-style: disc;
}

.post-main ol {
    list-style: decimal;
}

.post-main li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.post-main li:last-child {
    margin-bottom: 0;
}

/* The editor wraps each list item's text in its own <p>, which otherwise
   adds a second, browser-default top/bottom margin on top of the <li> gap. */
.post-main li > p {
    margin: 0;
}

.post-main hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-lg) 0;
}

.post-main strong {
    color: var(--text-primary);
    font-weight: 700;
    background: linear-gradient(transparent 70%, rgba(255, 255, 255, 0.18) 70%);
}

.post-main em {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-secondary);
}

.post-main a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.post-main a:hover {
    text-decoration-color: var(--text-primary);
}

/* Info Boxes */
.info-box,
.warning-box,
.timeline-box {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.info-box {
    border-left: 4px solid var(--accent-primary);
}

.warning-box {
    border-left: 4px solid #fb923c;
}

.info-box h4,
.warning-box h4,
.timeline-box h4 {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box p,
.warning-box p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Blockquote — pull-quote treatment */
blockquote {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid var(--text-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.6;
    border-radius: 0 16px 16px 0;
}

blockquote cite {
    display: block;
    margin-top: var(--spacing-sm);
    font-family: var(--font-body, inherit);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: normal;
}

/* Lists */
.feature-list {
    list-style: none;
    margin: var(--spacing-md) 0;
}

.feature-list li {
    padding: var(--spacing-sm) 0;
    padding-left: var(--spacing-md);
    position: relative;
}

.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    text-align: center;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Timeline */
.timeline-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-left: 2px solid var(--border-color);
    padding-left: var(--spacing-md);
    margin-left: var(--spacing-md);
}

.timeline-item .year {
    font-weight: 700;
    color: var(--accent-primary);
}

.timeline-item .event {
    color: var(--text-secondary);
}

/* Tags — glass chips */
.post-tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.tag {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    transition: var(--transition-fast);
}

.tag:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

/* ===========================
   RELATED ARTICLES — "Further Reading"
   =========================== */

.related-articles {
    padding: var(--spacing-xxl) 0;
}

.related-rule {
    height: 3px;
    background: var(--text-primary);
    margin-bottom: 6px;
}

.related-rule::after {
    content: '';
    display: block;
    height: 1px;
    background: var(--border-color);
    margin-top: 6px;
}

.related-header {
    margin: var(--spacing-lg) 0 var(--spacing-xl);
}

.related-kicker {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.related-header .section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.related-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    overflow: hidden;
    transition: var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.related-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.3);
}

.related-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.related-card:hover .related-image img {
    transform: scale(1.08);
}

.related-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(10, 10, 14, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}

.related-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.related-content h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-sm);
    line-height: 1.35;
    flex: 1;
}

.related-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.related-meta .read-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.related-arrow {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.25s ease;
}

.related-card:hover .related-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 968px) {
    .related-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 2.1rem;
    }

    .post-subtitle {
        font-size: 1.05rem;
    }

    .post-byline {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-actions {
        width: 100%;
    }

    .post-main h2 {
        font-size: 1.6rem;
    }

    .lead-paragraph {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .post-main {
        font-size: 1rem;
    }

    .post-title {
        font-size: 1.75rem;
    }

    .post-main > p:first-of-type::first-letter {
        font-size: 3rem;
    }
}

/* ===========================
   LIGHT THEME OVERRIDES FOR POST PAGE
   =========================== */

body.light-theme .post-byline {
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .author-avatar.large {
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .post-image-frame,
body.light-theme .related-card,
body.light-theme blockquote {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

body.light-theme .action-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

body.light-theme .action-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.25);
}

body.light-theme .table-of-contents {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .table-of-contents h4 {
    color: #6c757d;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .table-of-contents a {
    color: #6c757d;
}

body.light-theme .table-of-contents a:hover {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.05);
    border-left-color: rgba(0, 0, 0, 0.5);
}

body.light-theme .table-of-contents a.active {
    color: #000000;
    background: rgba(0, 0, 0, 0.1);
    border-left-color: #000000;
}

/* Light Theme Comments */
body.light-theme .comments-sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .comments-header h4 {
    color: #6c757d;
}

body.light-theme .comment-count {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

body.light-theme #commentInput,
body.light-theme .comment-reply-input textarea {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

body.light-theme #commentInput::placeholder,
body.light-theme .comment-reply-input textarea::placeholder {
    color: #6c757d;
}

body.light-theme .comment-author {
    color: #1a1a1a;
}

body.light-theme .comment-text {
    color: #495057;
}

body.light-theme .comment-time,
body.light-theme .comment-action {
    color: #6c757d;
}

body.light-theme .comment-action:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .comment-replies {
    border-left-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .cancel-btn {
    color: #6c757d;
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .cancel-btn:hover {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.3);
}

body.light-theme .empty-comments {
    color: #6c757d;
}

body.light-theme .info-box,
body.light-theme .warning-box,
body.light-theme .timeline-box,
body.light-theme .stat-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .tag {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #495057;
}

body.light-theme .tag:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: #1a1a1a;
    color: #1a1a1a;
}

body.light-theme .related-badge {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

body.light-theme .post-main strong {
    background: linear-gradient(transparent 70%, rgba(0, 0, 0, 0.1) 70%);
}

/* ===========================
   COMMENTS SIDEBAR (unused on the current post template — left in place
   for any view that still references these classes)
   =========================== */

.comments-sidebar {
    background: rgba(17, 23, 54, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.comments-sidebar::-webkit-scrollbar {
    width: 6px;
}

.comments-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.comments-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.comments-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-header h4 {
    font-size: 0.75rem;
    color: #7a7f8e;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin: 0;
}

.comment-count {
    background: rgba(0, 217, 255, 0.15);
    color: #00d9ff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.comment-input-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.comment-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#commentInput {
    width: 100%;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    color: #e8eaed;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    transition: all 0.3s ease;
}

#commentInput:focus {
    outline: none;
    border-color: rgba(0, 217, 255, 0.5);
    background: rgba(10, 14, 39, 0.95);
}

#commentInput::placeholder {
    color: #7a7f8e;
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.comment-btn {
    background: linear-gradient(135deg, #00d9ff 0%, #667eea 100%);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.comment-btn:active {
    transform: translateY(0);
}

.comment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    animation: fadeInUp 0.4s ease;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.comment-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e8eaed;
}

.comment-time {
    font-size: 0.75rem;
    color: #7a7f8e;
}

.comment-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #9aa0a6;
}

.comment-footer {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #7a7f8e;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.comment-action:hover {
    color: #00d9ff;
    background: rgba(0, 217, 255, 0.1);
}

.comment-action.liked {
    color: #ff4757;
}

.comment-action.liked .icon {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

.comment-replies {
    margin-top: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-reply-input {
    display: none;
    margin-top: 0.75rem;
    animation: fadeInUp 0.3s ease;
}

.comment-reply-input.active {
    display: flex;
    gap: 0.5rem;
}

.comment-reply-input textarea {
    flex: 1;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    color: #e8eaed;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    min-height: 60px;
}

.comment-reply-input textarea:focus {
    outline: none;
    border-color: rgba(0, 217, 255, 0.5);
}

.reply-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.reply-btn {
    background: linear-gradient(135deg, #00d9ff 0%, #667eea 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.cancel-btn {
    background: transparent;
    color: #7a7f8e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    color: #e8eaed;
    border-color: rgba(255, 255, 255, 0.3);
}

.empty-comments {
    text-align: center;
    padding: 2rem 1rem;
    color: #7a7f8e;
    font-size: 0.85rem;
}

.empty-comments .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}
