/**
 * Medium Pro - Main Stylesheet
 * Vanilla CSS implementation using CSS Variables
 */

:root {
    /* Colors - Light Mode (Minimalist Palette) */
    --bg-color: linear-gradient(180deg, #fffbff 0%, #F6F3FC 100%);
    --text-color: #1C1920;
    --text-muted: #707070;
    --text-light: #707070;
    --border-color: #e6e6e6;
    --border-hover: #666666;
    --primary-color: #A163E9;
    --primary-hover: #8b4dd3;
    --btn-secondary: #2A3C4D;
    --card-bg: #ffffff;
    --shadow-soft: none;
    --shadow-hover: none;
    --error-color: #e63946;

    /* Layout Constants */
    --max-width: 1100px;
    --single-max-width: 680px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-color);
    background-attachment: fixed;
    /* Ensures gradient doesn't clip on scroll */
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Buttons */
.btn,
button,
input[type="submit"] {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 99px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.light-mode .btn-outline {
    background-color: #e8eeff;
    color: #121115;
    border: 1px solid #d1d1d1 !important;
}



.light-mode .btn-outline:hover {
    background-color: #8b4dd3;
    color: #fff;
    border: 1px solid #8b4dd3 !important;
}

.dark-mode .btn-outline {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.dark-mode .btn-outline:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

/* Layout Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Header & Nav */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    z-index: 100;
}

.light-mode .site-header {
    background: #fff;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    margin: 0;
}

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

.theme-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.theme-toggle-btn:hover {
    color: var(--text-color);
}

/* Search Modal Component */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    /* Light translucent background for Medium feel */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

[data-theme="dark"] .search-modal-overlay {
    background-color: rgba(18, 18, 18, 0.85);
}

.search-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-modal-container {
    background: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 650px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.search-modal-overlay.active .search-modal-container {
    transform: translateY(0);
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.search-modal-icon {
    color: var(--text-muted);
    margin-right: 16px;
    flex-shrink: 0;
}

.search-modal-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    font-family: var(--font-sans);
    color: var(--text-color);
    outline: none;
    padding: 0;
}

.search-filter-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(26, 137, 23, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    cursor: pointer;
}

[data-theme="dark"] .search-filter-icon {
    background-color: rgba(50, 168, 82, 0.2);
}

.search-filter-icon svg {
    stroke: var(--primary-color);
    fill: var(--primary-color);
}

.search-modal-body {
    padding: 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.search-results-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-family: var(--font-sans);
}

.modal-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-color);
    transition: background 0.2s ease;
    margin: 0 -16px;
}

.modal-search-result-item:hover {
    background: var(--border-color);
}

.skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background-color: var(--border-color);
    margin-right: 16px;
    flex-shrink: 0;
}

.skeleton-text-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skeleton-title {
    height: 14px;
    background-color: var(--border-color);
    border-radius: 4px;
    width: 60%;
    margin-bottom: 8px;
}

.skeleton-meta {
    height: 12px;
    background-color: var(--border-color);
    border-radius: 4px;
    width: 30%;
    opacity: 0.6;
}

/* Ensure real results fit the skeleton layout visually */
.real-result-title {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 4px;
}

.real-result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Post Grid / Cards */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 900px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
    height: 100%;
}

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

.card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.card-content {
    padding: 15px !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 8px;
    font-family: var(--font-sans);
    font-weight: 700;
}

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: auto;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Reading Progress Bar */
.progress-container {
    width: 100%;
    height: 3px;
    background: transparent;
    position: absolute;
    bottom: -3px;
    left: 0;
}

.progress-bar {
    height: 3px;
    background: var(--primary-color);
    width: 0%;
}

/* Loader Array */
.page-loader {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xl) 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* AJAX Save Button State */
.btn-save-post.saved {
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

/* Single Post Readability Enhancements */
.entry-content {
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 1.8;
    color: var(--text-color);
}

.entry-content p {
    margin-bottom: 2em;
}

/* Drop Cap on first paragraph (Only on Single Posts) */
.single .entry-content>p:first-of-type::first-letter {
    float: left;
    font-size: 5rem;
    line-height: 0.8;
    padding-top: 8px;
    padding-right: 12px;
    font-weight: 700;
    color: var(--text-color);
    font-family: var(--font-serif);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: var(--font-sans);
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 700;
}

.entry-content h2 {
    font-size: 2rem;
}

.entry-content h3 {
    font-size: 1.5rem;
}

.entry-content blockquote {
    border-left: 4px solid var(--text-color);
    padding-left: 24px;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1.6;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2em 0;
}

.entry-content a {
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}

.entry-content a:hover {
    color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Meta Data Block */
.post-meta-block {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-sans);
}

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

.meta-details {
    display: flex;
    flex-direction: column;
}

.meta-details .byline a {
    font-weight: 600;
    color: var(--text-color);
}

.meta-time-read {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

/* Author Bio Box */
.author-bio-box {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: var(--spacing-xl) 0;
}

.author-bio-box .bio-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.bio-title {
    margin: 0 0 8px 0;
    font-family: var(--font-sans);
    font-size: 1.2rem;
}

.bio-description {
    color: var(--text-muted);
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.bio-link {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}


/*
.gated-content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), #23b21c);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}
*/
.global-reviews-wrapper {
    padding: 20px !important;
}
.post-card .card-excerpt, .post-card .card-meta {
    display: none !important;
}
.dark-mode .gated-content-card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px !important;
    padding: 30px !important;
    border-radius: 12px;
    border: 1px solid #444;
    background: #23222b;
}

.light-mode .gated-content-card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px !important;
    padding: 30px !important;
    border-radius: 12px;
    border: 1px solid #444;
    background: #fff;
}

.gated-icon-wrapper {
    background: rgba(26, 137, 23, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

}

[data-theme="dark"] .gated-icon-wrapper {
    background: rgba(50, 168, 82, 0.2);
}


.gated-lock-icon {
    stroke: #d7bbf8;
}

.gated-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text-color);
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    padding: 0px !important;
}

.gated-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    line-height: 1.6;
    margin-bottom: var(--spacing-xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    padding: 0px !important;
    text-align: center !important;
}

.gated-login-btn {
    font-size: 1.1rem;
    padding: 14px 32px;
    border-radius: 99px;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(26, 137, 23, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    margin-top: 0px;
    margin-bottom: 0px;
    color: #fff !important;
}

.gated-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 137, 23, 0.4);
}

/* Premium Badge for Archive Loops */
.premium-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #a163e9;
    color: white;
    /* padding: 6px 10px; */
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-badge svg {
    width: 20px;
    height: 20px;
}

.card-image-placeholder {
    display: block;
    width: 100%;
    height: 180px;
    background: var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Nested Comments Styling - Minimal Accordion */
.comment-list .children {
    list-style: none;
    margin-left: 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
    margin-top: 1rem;
    display: none;
    /* Hidden by default for accordion effect */
}

.comment-list .children.expanded {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .comment-list .children {
        padding-left: 1rem;
    }
}

.view-replies-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    padding: 8px 0;
    transition: color 0.2s;
    margin-top: -8px;
    margin-bottom: 12px;
}

.view-replies-btn:hover {
    color: var(--primary-hover);
}

.view-replies-btn svg {
    transition: transform 0.2s ease;
}

.view-replies-btn.expanded svg {
    transform: rotate(180deg);
}

.reply a {
    display: inline-block;
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    color: var(--text-color);
    transition: all 0.2s;
}

.reply a:hover {
    border-color: var(--text-color);
    background: var(--border-color);
}

/* Specific styling for the comment form when replying inline */
#respond.comment-respond {
    margin-top: 24px;
    padding: 0;
    background: transparent;
    border: none;
}

#reply-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    font-family: var(--font-sans);
}

#cancel-comment-reply-link {
    font-size: 14px;
    color: var(--error-color);
    margin-left: 12px;
    font-weight: normal;
}


.mobile-only {
    display: none !important;
}

.desktop-nav-list {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.desktop-nav-list a {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-muted);
}

.desktop-nav-list a:hover {
    color: var(--text-color);
}

.desktop-nav-list .current-menu-item>a {
    color: var(--text-color);
    font-weight: 600;
}

/* Off-Canvas Drawer */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: var(--bg-color);
    z-index: 1001;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-drawer.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
}

.mobile-menu-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.mobile-navigation-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-navigation-list li {
    margin-bottom: 16px;
}

.mobile-navigation-list a {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
    display: block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }
}


.footer-widget-column .widget {
    margin-bottom: 32px;
}

.footer-widget-column .widget-title {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-color);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.footer-widget-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget-column ul li {
    margin-bottom: 12px;
}

.footer-widget-column ul li a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-widget-column ul li a:hover {
    color: var(--text-color);
}

@media (max-width: 768px) {
    .footer-widgets-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ==============================================
   ACCORDION COMMENTS SYSTEM
   ============================================== */

/* ── Comments area ── */
.comments-area {
    margin-top: var(--spacing-xl);
    font-family: var(--font-sans);
}

.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

/* ── List resets ── */
.comment-list,
.comment-list .children {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ── Individual comment item ── */
.comment-item {
    margin-bottom: 6px;
}

/* ── Article layout: avatar | content ── */
.comment-article {
    display: flex;
    gap: 14px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child>.comment-article {
    border-bottom: none;
}

/* ── Avatar column ── */
.comment-avatar-col {
    flex: 0 0 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.comment-initials-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0;
    flex-shrink: 0;
    user-select: none;
}

.comment-thread-line {
    flex: 1;
    width: 2px;
    background: var(--border-color);
    margin-top: 8px;
    border-radius: 2px;
    min-height: 20px;
}

/* ── Main content column ── */
.comment-main-col {
    flex: 1;
    min-width: 0;
}

/* ── Comment "bubble" ── */
.comment-bubble {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 12px 12px 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
}

.dark-mode .comment-bubble {
    background: #1e1d24;
}

/* ── Meta row ── */
.comment-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.comment-author-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: capitalize;
}

.comment-author-name a {
    color: inherit;
    text-decoration: none;
}

.comment-dot {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.comment-time-link {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.2s;
}

.comment-time-link:hover {
    color: var(--primary-color);
}

/* ── Author badge ── */
.author-badge {
    background: var(--primary-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 99px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ── Comment text ── */
.comment-moderation {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}

.comment-text p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-color);
    margin: 0;
}

.dark-mode .comment-text p {
    color: #e0dfe6;
}

/* ── Action row: Reply + Accordion toggle ── */
.comment-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Reply link */
.reply-link-wrap .comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 600;

    text-decoration: none;
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

a#cancel-comment-reply-link {
    background: #8b4dd3;
    padding: 2px 10px 4px 10px;
    /* display: inline-block !important; */
    color: #fff !important;
    border-radius: 500px;
}

.reply-link-wrap .comment-reply-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(161, 99, 233, 0.06);
}

/* ── Replies accordion toggle button ── */
.comment-replies-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 99px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.comment-replies-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(161, 99, 233, 0.06);
}

.comment-replies-toggle[aria-expanded="true"] {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(161, 99, 233, 0.08);
}

.comment-replies-toggle .toggle-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.77, 0, 0.175, 1);
}

.comment-replies-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* ── Children <ul> accordion panel ── */
.comment-list .children {
    display: block !important;
    /* override any WP inline display:none */
    overflow: hidden;
    max-height: 0;
    visibility: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s ease,
        visibility 0s linear 0.45s;
    opacity: 0;
    padding-left: 58px;
    margin-top: 0;
}

.comment-list .children.is-open {
    max-height: 9999px;
    opacity: 1;
    margin-top: 8px;
    visibility: visible;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s ease,
        visibility 0s linear 0s;
}

/* Child comments are slightly more compact */
.comment-child-item .comment-article {
    padding: 14px 0;
}

.comment-child-item .comment-bubble {
    padding: 12px 16px;
}

/* ── Comment form ── */
#respond {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.dark-mode #respond {
    background: #1e1d24;
}

#respond .comment-reply-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
}

#respond .comment-reply-title a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 12px;
    text-decoration: none;
}

#respond .comment-reply-title a:hover {
    color: var(--primary-color);
}

#comment {
    transition: border-color 0.2s, box-shadow 0.2s;
}

#comment:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(161, 99, 233, 0.15);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .comment-avatar-col {
        flex: 0 0 36px;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
    }

    .comment-bubble {
        padding: 12px 14px;
    }

    .comment-list .children {
        padding-left: 50px;
    }
}

.search-modal-overlay.active .search-modal-container {
    transform: translateY(0);
    margin: 10px;
}

span.byline>a {
    text-transform: capitalize !important;
}

/* ================================================
   COMPREHENSIVE RESPONSIVE SYSTEM
   Tablet  ≤ 768px
   Mobile  ≤ 480px
   ================================================ */

/* ── Tablet (768px) ── */
@media (max-width: 768px) {

    /* ─ Container ─ */
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* ─ Header ─ */
    .site-title {
        font-size: 20px;
    }

    .header-actions {
        gap: var(--spacing-sm);
    }

    /* ─ Hero / Single title ─ */
    .single-title {
        font-size: 1.6rem !important;
        letter-spacing: -0.5px !important;
    }

    .single-subtitle {
        font-size: 1rem !important;
    }

    /* ─ Post Grid ─ */
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* ─ Single Article ─ */
    .single-content-area {
        padding: var(--spacing-md) 0;
    }

    .single-article .entry-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* ─ Author bio ─ */
    .author-bio-box {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    /* ─ Search modal ─ */
    .search-modal-container {
        max-width: 100%;
        margin: 0 var(--spacing-sm);
        border-radius: 8px;
    }

    .search-modal-body {
        max-height: 60vh;
    }

    /* ─ Comments ─ */
    .comment-avatar-col {
        flex: 0 0 38px;
    }

    .comment-initials-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .comment-bubble {
        padding: 12px 14px;
    }

    .comment-list .children {
        padding-left: 46px;
    }

    /* ─ Footer ─ */
    .footer-widgets-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
}

/* ── Mobile (480px) ── */
@media (max-width: 480px) {

    /* ─ Container ─ */
    .container {
        padding: 0 12px;
    }

    /* ─ Header ─ */
    .site-title {
        font-size: 18px;
    }

    /* ─ Hero / Single title ─ */
    .single-title {
        font-size: 1.35rem !important;
    }

    .single-subtitle {
        font-size: 0.95rem !important;
    }

    /* ─ Post Grid → single column ─ */
    .post-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    /* ─ Buttons ─ */
    .btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    /* ─ Comments ─ */
    .comment-avatar-col {
        flex: 0 0 32px;
    }

    .comment-initials-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .comment-bubble {
        padding: 10px 12px;
        border-radius: 0 8px 8px 8px;
    }

    .comment-action-row {
        gap: 10px;
        flex-wrap: wrap;
    }

    .reply-link-wrap .comment-reply-link,
    .comment-replies-toggle {
        font-size: 0.77rem;
        padding: 4px 10px;
    }

    .comment-list .children {
        padding-left: 40px;
    }

    /* ─ Footer → full single column ─ */
    .footer-widgets-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    /* ─ Search modal ─ */
    .search-modal-container {
        border-radius: 0 0 12px 12px;
        margin: 0;
    }

    .search-modal-overlay {
        padding-top: 0;
        align-items: flex-start;
    }
}