/* Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 10000;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ── Article Hero Banner ──────────────────────── */
.article-hero-banner {
    position: relative;
    min-height: 340px;
    background: linear-gradient(160deg, #1E293B 0%, #0F172A 60%, #141f35 100%);
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    max-height: 340px;
}

/* Dot pattern fallback when no image */
.article-hero-banner:not(.has-image)::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(234,179,8,0.12) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 40%, transparent 100%);
}

/* Gradient overlay — stronger at bottom so text is always readable */
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10,15,28,0.80) 0%,
        rgba(10,15,28,0.35) 40%,
        rgba(10,15,28,0.85) 100%
    );
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.article-hero-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.article-hero-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(234,179,8,0.18);
    border: 1px solid rgba(234,179,8,0.35);
    padding: 0.28rem 0.85rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
}

.article-hero-title {
    font-size: 2.9rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 24px rgba(0,0,0,0.55);
    max-width: 860px;
}

.article-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.article-hero-meta .author-info {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
}

.article-hero-meta .author-name { color: #fff; }

.hero-sep {
    color: rgba(255,255,255,0.3);
}

.article-hero-meta .article-date,
.article-hero-meta .article-read-time {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
}

.article-hero-meta .article-read-time svg { color: var(--primary); }

.article-hero-meta .toc-button {
    background: rgba(234,179,8,0.15);
    border-color: rgba(234,179,8,0.35);
    backdrop-filter: blur(4px);
}

/* Article Layout */
.article-outer-wrap {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.article-container {
    display: flex;
    width: 100%;
}

.article-main {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 3rem max(1.5rem, calc(50vw - 460px));
    box-sizing: border-box;
}

/* TOC Sidebar */
.toc-sidebar {
    position: fixed;
    top: 100px;
    right: 2rem;
    width: 290px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    animation: slideInRight 0.3s ease-out;
    z-index: 100;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toc-sticky {
    background: var(--dark-gray);
    border: 1px solid rgba(234,179,8,0.25);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.toc-header h3 {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.toc-close {
    background: transparent;
    border: none;
    color: #475569;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.toc-close:hover { color: var(--primary); background: rgba(234,179,8,0.1); }

#toc-list ul { list-style: none; padding: 0; margin: 0; }
#toc-list li { margin-bottom: 0.2rem; }

#toc-list a {
    display: block;
    padding: 0.45rem 0.75rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.18s;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

#toc-list a:hover,
#toc-list a.active {
    color: white;
    background: rgba(255,255,255,0.05);
    border-left-color: var(--primary);
    padding-left: 1rem;
}

#toc-list .toc-h3 { margin-left: 0.75rem; }
#toc-list .toc-h3 a { font-size: 0.8rem; }

/* Article Meta */
.author-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.9rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
}

.author-info img { border-radius: 50%; width: 32px; height: 32px; }
.author-name { font-weight: 600; font-size: 0.875rem; color: white; }

.article-date {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.article-read-time {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.article-read-time svg { color: var(--primary); flex-shrink: 0; }

/* TOC Button */
.toc-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.1rem;
    background: rgba(234,179,8,0.08);
    color: var(--primary);
    border: 1px solid rgba(234,179,8,0.25);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    font-family: inherit;
}

.toc-button:hover {
    background: rgba(234,179,8,0.18);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Gear Specs */
.gear-specs-box {
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    background: rgba(234,179,8,0.04);
    border: 1px solid rgba(234,179,8,0.18);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    max-width: 580px;
    text-align: left;
}

.gear-specs-box h3 { color: var(--primary); margin-bottom: 1rem; font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.gear-specs-box p  { margin-bottom: 0.4rem; color: var(--text-gray); font-size: 0.95rem; }
.gear-specs-box strong { color: white; }

/* Share Buttons */
.article-share {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.share-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    margin-right: 0.25rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--dark-gray);
    color: var(--text-gray);
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
    line-height: 1;
}

.share-btn:hover { transform: translateY(-2px); }

.share-native { border-color: rgba(234,179,8,0.3); color: var(--primary); background: rgba(234,179,8,0.06); }
.share-native:hover { background: rgba(234,179,8,0.15); border-color: var(--primary); color: var(--primary); }

.share-facebook { color: #94a3b8; }
.share-facebook:hover { background: #1877F2; border-color: #1877F2; color: white; }

.share-x { color: #94a3b8; }
.share-x:hover { background: #000; border-color: #000; color: white; }

.share-copy { color: #94a3b8; }
.share-copy.copied { background: rgba(0,201,167,0.12); border-color: var(--accent); color: var(--accent); }
.share-copy:hover:not(.copied) { background: rgba(255,255,255,0.07); border-color: #64748b; color: white; }

/* Article Content */
.article-content {
    font-size: 1.125rem;
    line-height: 1.9;
    max-width: 100%;
}

.article-content h2,
.article-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 100px;
}

.article-content h2 {
    font-size: 1.8rem;
    color: white;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.article-content h3 {
    font-size: 1.35rem;
    color: var(--primary);
    font-weight: 700;
}

.article-content p { margin-bottom: 1.5rem; }

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2rem 0;
    border: 1px solid var(--border);
}

.article-content .wp-caption {
    max-width: 100% !important;
    margin: 2rem 0;
    background: white;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.article-content .wp-caption img {
    margin: 0 !important;
    border: none !important;
    border-radius: 10px 10px 0 0;
    display: block;
}

.article-content .wp-caption-text,
.article-content figcaption {
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: #555;
    background: white;
    margin: 0;
    font-style: italic;
}

.article-content figure.wp-block-image { margin: 2rem 0; }
.article-content figure.wp-block-image img { border-radius: 10px 10px 0 0; }
.article-content figure.wp-block-image figcaption {
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: #555;
    background: white;
    border-radius: 0 0 10px 10px;
    font-style: italic;
}

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

.article-content li { margin-bottom: 0.5rem; }

/* Article Footer */
.entry-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.entry-footer:empty { display: none; }

.post-meta-footer { display: flex; flex-direction: column; gap: 0.75rem; }
.post-categories, .post-tags { color: var(--text-gray); font-size: 0.9rem; }
.post-categories strong, .post-tags strong { color: white; }
.post-categories a, .post-tags a { color: var(--primary); text-decoration: none; }
.post-categories a:hover, .post-tags a:hover { color: var(--accent); }

/* Post Navigation */
.post-navigation {
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.post-navigation .nav-previous,
.post-navigation .nav-next { display: flex; }

.post-navigation a {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: var(--dark-gray);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.post-navigation a:hover {
    border-color: rgba(234,179,8,0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.post-navigation a span:first-child {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.post-navigation .post-title {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.related-posts-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.related-post-card {
    text-decoration: none;
    background: var(--dark-gray);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    display: block;
}

.related-post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(234,179,8,0.4);
    box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}

.related-post-image {
    height: 155px;
    overflow: hidden;
    background: var(--light-gray);
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    display: block;
}

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

.related-post-content { padding: 0.9rem 1rem; }

.related-post-meta {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.3rem;
}

.related-post-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Comments ─────────────────────────────────────────── */
.comments-section-wrap {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.comments-area { color: var(--text-gray); }

.comments-title,
.comment-reply-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.comment-list,
.comment-list .children {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list > li + li { margin-top: 1.5rem; }

.comment-list .children {
    margin-top: 1.5rem;
    margin-left: 3rem;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(234,179,8,0.2);
}

.comment-body {
    background: var(--dark-gray);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s;
}

.comment-body:hover { border-color: rgba(234,179,8,0.2); }

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-author-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(234,179,8,0.25);
    display: block;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.comment-author-name {
    font-weight: 700;
    color: white;
    font-size: 0.95rem;
}

.comment-time {
    font-size: 0.78rem;
    color: #475569;
}

.reply a {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(234,179,8,0.3);
    border-radius: 50px;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.reply a:hover {
    background: rgba(234,179,8,0.1);
    border-color: var(--primary);
}

.comment-content { font-size: 0.95rem; line-height: 1.7; }
.comment-content p { margin-bottom: 0.75rem; }
.comment-content p:last-child { margin-bottom: 0; }

.comment-awaiting-moderation {
    font-size: 0.82rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.comments-pagination {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
}

.comments-pagination a,
.comments-pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: border-color 0.2s, color 0.2s;
}

.comments-pagination a:hover,
.comments-pagination .current {
    border-color: var(--primary);
    color: var(--primary);
}

/* Comment Form */
#respond {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.comment-form-comment,
.form-submit,
.comment-form > p:not(.comment-form-author):not(.comment-form-email) {
    grid-column: 1 / -1;
}

.comment-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.comment-form .required { color: var(--primary); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    background: var(--dark-gray);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: rgba(234,179,8,0.5);
    box-shadow: 0 0 0 3px rgba(234,179,8,0.08);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder { color: #475569; }

.comment-form textarea { resize: vertical; min-height: 130px; }

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-submit:hover { opacity: 0.88; transform: translateY(-1px); }

#cancel-comment-reply-link {
    margin-left: 0.75rem;
    font-size: 0.82rem;
    color: #475569;
    text-decoration: none;
}

#cancel-comment-reply-link:hover { color: var(--primary); }

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

/* Responsive */
@media (max-width: 1200px) {
    .toc-sidebar { display: none !important; }
}

@media (max-width: 768px) {
    .article-hero-banner   { min-height: 280px; }
    .article-hero-title    { font-size: 1.9rem; }
    .article-hero-inner    { padding: 2rem 1.25rem; }
    .article-hero-meta     { gap: 0.6rem; }
    .toc-button            { width: 100%; justify-content: center; }
    .post-navigation .nav-links { grid-template-columns: 1fr; }
    .related-posts-grid    { grid-template-columns: 1fr; }
    .comment-form          { grid-template-columns: 1fr; }
    .comment-list .children { margin-left: 1rem; padding-left: 1rem; }
    #back-to-top           { bottom: 1.25rem; right: 1.25rem; }
}

@media (max-width: 480px) {
    .article-hero-banner   { min-height: 240px; }
    .article-hero-title    { font-size: 1.6rem; letter-spacing: -0.02em; }
    .hero-sep              { display: none; }
    .article-hero-meta .article-date { display: none; }
}
