/**
 * GreenLight Board Forum Styles
 * Shared styles for PHP-generated content, template overrides, and layout
 * Block-specific styles live in each block's style.css
 */

/* ==========================================================================
   CSS Custom Properties (for dynamic/interactive elements)
   ========================================================================== */

:root {
    --gltb-btn: var(--wp--custom--button--background, var(--wp--preset--color--brand, #33EFAB));
    --gltb-btn-text: var(--wp--custom--button--text, var(--wp--preset--color--text-on-brand, #000002));
    --gltb-btn-hover: var(--wp--custom--button--background-hover, var(--wp--preset--color--brand-hover, #7AFFCE));
    --gltb-btn-text-hover: var(--wp--custom--button--text-hover, var(--wp--preset--color--text-on-brand-hover, #000003));
    --gltb-btn-border: var(--wp--custom--button--border-radius, var(--wp--preset--border-radius--medium, 15px));
    --gltb-accent: var(--wp--preset--color--secondary, #340fa0);
    --gltb-bg: #f1f3f9;
    --gltb-surface: #ffffff;
    --gltb-border: #e2e8f0;
    --gltb-text: #0f172a;
    --gltb-text-secondary: #475569;
    --gltb-text-muted: #94a3b8;
    --gltb-radius-sm: 6px;
    --gltb-radius-md: 10px;
    --gltb-radius-lg: 16px;
    --gltb-radius-full: 9999px;
    --gltb-transition-fast: 150ms ease;
    --gltb-accent-shadow: rgba(14, 63, 126, 0.06) 0px 0px 0px 1px, rgba(42, 51, 70, 0.03) 0px 1px 1px -0.5px, rgba(42, 51, 70, 0.04) 0px 2px 2px -1px, rgba(42, 51, 70, 0.04) 0px 3px 3px -1.5px, rgba(42, 51, 70, 0.03) 0px 5px 5px -2.5px, rgba(42, 51, 70, 0.03) 0px 10px 10px -5px, rgba(42, 51, 70, 0.03) 0px 24px 24px -8px;
    --gltb-accent-shadow-secondary: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
}

/* ==========================================================================
   Main Wrapper Background
   ========================================================================== */

.gltb-main-wrapper {
    background-color: var(--gltb-bg);
    color: var(--gltb-text);
}

/* ==========================================================================
   Avatar Styling (overrides for post-author block)
   ========================================================================== */


.gltb-topic-avatar .wp-block-post-author__name,
.gltb-post-avatar .wp-block-post-author__name {
    display: none !important;
}

.gltb-topic-avatar .wp-block-post-author__avatar,
.gltb-topic-avatar.wp-block-post-author {
    margin-right: 0 !important;
}

.gltb-topic-avatar img,
.gltb-post-avatar img {
    border-radius: var(--gltb-radius-md) !important;
    object-fit: cover;
}

/* ==========================================================================
   Interactive States (hover/focus)
   ========================================================================== */


/* Link hover colors - handled via elements.link in blocks where possible */
a:hover {
    transition: color var(--gltb-transition-fast);
}

/* CTA buttons – override inline block colours with CSS variables */
.gltb-cta-btn .wp-block-button__link {
    background-color: var(--gltb-btn) !important;
    color: var(--gltb-btn-text) !important;
    border-radius: var(--gltb-btn-border) !important;
}

.gltb-cta-btn .wp-block-button__link:hover {
    background-color: var(--gltb-btn-hover) !important;
    color: var(--gltb-btn-text-hover) !important;
}

/* Button hover enhancement */
.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(51, 239, 171, 0.3) !important;
    transition: all var(--gltb-transition-fast);
}


/* ==========================================================================
   Comment/Reply Styles (PHP-generated content)
   ========================================================================== */

/* Comment template container styling */
.gltb-board-comments:not(.gltb-forum-comments) .wp-block-comment-template {
    background: var(--gltb-surface);
    border-radius: var(--gltb-radius-lg);
    box-shadow: var(--gltb-accent-shadow-secondary);
    overflow: hidden;
    color: var(--gltb-text);
}

.gltb-board-comments:not(.gltb-forum-comments) .wp-block-comment-template a{
    color: var(--gltb-text);
}

.gltb-board-comments .wp-block-comment-template{
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gltb-forum-comments .wp-block-comment-template > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Avatar in comments */
.gltb-board-comments .wp-block-avatar img {
    border-radius: var(--gltb-radius-md) !important;
}

/* Comment date link */
.gltb-board-comments .wp-block-comment-date a {
    color: var(--gltb-text-muted) !important;
    text-decoration: none !important;
}
.gltb-board-comments .wp-block-comment-template li{position: relative;}
.gltb-board-comments .wp-block-comment-template ol{padding-left: 2rem;}
.gltb-board-comments .wp-block-comment-template li > ol > li:before {
    position: absolute;
    content: "↑";
    left: -15px;
    opacity: .3;
    top:20px;
}
.gltb-board-comments.gltb-forum-comments .wp-block-comment-template li > ol > li:before{
    left:-28px
}
.gltb-board-comments .wp-block-comment-template ol:before{display: none;}
.gltb-board-comments .wp-block-comment-reply-link{margin-bottom: 0 !important;}

.gltb-board-comments:has(.wp-block-comment-template){margin-bottom: 24px;}
.gltb-reply-notes{font-size:14px; opacity: 0.8;}

/* ==========================================================================
   Reply Form (PHP-generated)
   ========================================================================== */

.gltb-new-reply-form {
    background: var(--gltb-surface);
    border-radius: var(--gltb-radius-lg);
    padding: 32px;
    box-shadow: var(--gltb-accent-shadow-secondary);
    color: var(--gltb-text);
}
.gltb-new-reply-form label{font-size: 0.875rem;}
.gltb-new-reply-form a{
    color: var(--gltb-text);
}

ol .gltb-new-reply-form{box-shadow: none !important;}

.gltb-new-reply-form .comment-reply-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--gltb-text) !important;
    margin: 0 0 24px 0 !important;
}

.gltb-new-reply-form .logged-in-as {
    font-size: 0.875rem;
    color: var(--gltb-text-secondary);
    margin-bottom: 16px;
}

.gltb-new-reply-form textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    background: var(--gltb-surface);
    color: var(--gltb-text);
    border: 2px solid var(--gltb-border);
    border-radius: var(--gltb-radius-md);
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--gltb-transition-fast), box-shadow var(--gltb-transition-fast);
}

.gltb-new-reply-form textarea:focus {
    outline: none;
    border-color: var(--gltb-btn);
    box-shadow: 0 0 0 4px rgba(108, 43, 217, 0.15);
}

.gltb-new-reply-form .form-submit {
    margin-top: 24px;
}

.gltb-new-reply-form input[type="submit"],
.gltb-new-reply-form button[type="submit"] {
    background: linear-gradient(135deg, var(--gltb-btn) 0%, var(--gltb-btn-hover) 100%) !important;
    color: var(--gltb-btn-text) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    padding: 14px 32px !important;
    border: none !important;
    border-radius: var(--gltb-btn-border) !important;
    cursor: pointer;
    transition: all var(--gltb-transition-fast);
    box-shadow: 0 2px 8px rgb(215 215 215 / 30%);
}

.gltb-new-reply-form input[type="submit"]:hover,
.gltb-new-reply-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgb(215 215 215 / 40%);
}

.gltb-new-reply-form #cancel-comment-reply-link {
    font-size: 0.875rem;
    color: var(--gltb-text-muted);
    margin-left: 16px;
    text-decoration: none;
}

.gltb-new-reply-form #cancel-comment-reply-link:hover {
    color: #ef4444;
}

/* Guest form fields */
.gltb-new-reply-form .comment-form-author,
.gltb-new-reply-form .comment-form-email,
.gltb-new-reply-form .comment-form-url {
    margin-bottom: 16px;
}

.gltb-new-reply-form .comment-form-author label,
.gltb-new-reply-form .comment-form-email label,
.gltb-new-reply-form .comment-form-url label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 4px;
    color: var(--gltb-text);
}

.gltb-new-reply-form .comment-form-author input,
.gltb-new-reply-form .comment-form-email input,
.gltb-new-reply-form .comment-form-url input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gltb-border);
    border-radius: var(--gltb-radius-md);
    font-size: 0.9375rem;
    transition: border-color var(--gltb-transition-fast), box-shadow var(--gltb-transition-fast);
}

.gltb-new-reply-form .comment-form-author input:focus,
.gltb-new-reply-form .comment-form-email input:focus,
.gltb-new-reply-form .comment-form-url input:focus {
    outline: none;
    border-color: var(--gltb-btn);
    box-shadow: 0 0 0 4px rgba(108, 43, 217, 0.15);
}

/* ==========================================================================
   Topic List Template Overrides
   ========================================================================== */

/* Topic list items padding */
.wp-block-post-template > .wp-block-group[style*="border-bottom"] {
    padding: 20px 24px;
}

/* Sticky topic indicator */
.wp-block-post-template > li.gltb-sticky > .wp-block-group {
    border-left: 3px solid var(--gltb-accent);
}

/* ==========================================================================
   Pagination Enhancements
   ========================================================================== */

.wp-block-query-pagination a,
.wp-block-query-pagination span,
.gltb-board-comments .wp-block-comments-pagination a,
.gltb-board-comments .wp-block-comments-pagination span {
    padding: 8px 16px !important;
    font-size: 0.875rem !important;
    font-weight: 500;
    border-radius: var(--gltb-radius-md);
    transition: all var(--gltb-transition-fast);
}

.wp-block-query-pagination a,
.gltb-board-comments .wp-block-comments-pagination a {
    background: var(--gltb-surface);
    color: var(--gltb-text-secondary) !important;
    text-decoration: none !important;
    border: 1px solid var(--gltb-border);
}

.wp-block-query-pagination a:hover,
.gltb-board-comments .wp-block-comments-pagination a:hover {
    background: var(--gltb-btn);
    color: var(--gltb-btn-text) !important;
    border-color: var(--gltb-btn);
}

.wp-block-query-pagination .current,
.gltb-board-comments .wp-block-comments-pagination .current {
    background: var(--gltb-btn) !important;
    color: var(--gltb-btn-text) !important;
    border: 1px solid var(--gltb-btn);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    /* Stack topic rows on mobile */
    .wp-block-query .wp-block-post-template .wp-block-group[style*="flex-wrap:nowrap"] {
        flex-wrap: wrap !important;
    }

    /* Reply body padding adjustment */
    .gltb-forum-comments .wp-block-group[style*="padding-left:64px"] {
        padding-left: 0 !important;
    }

    /* Reply form on mobile */
    .gltb-new-reply-form {
        padding: 16px !important;
    }
}

@media (max-width: 480px) {
    /* Smaller avatars on mobile */
    .gltb-topic-avatar img {
        width: 40px !important;
        height: 40px !important;
    }

    .gltb-forum-comments .wp-block-avatar img {
        width: 40px !important;
        height: 40px !important;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.gltb-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   Notices (PHP-generated)
   ========================================================================== */

/* Moderation notice */
.gltb-reply-awaiting-moderation {
    display: block;
    background: #fef3c7;
    color: #92400e;
    padding: 8px 16px;
    border-radius: var(--gltb-radius-sm);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

/* Topic closed notice */
.gltb-replies-closed {
    text-align: center;
    padding: 32px;
    background: #f8fafc;
    border-radius: var(--gltb-radius-lg);
    color: var(--gltb-text-secondary);
    font-size: 0.9375rem;
}

/* ==========================================================================
   Topic Card Design (template-level)
   ========================================================================== */

.gltb-topic-card {
    position: relative;
    overflow: hidden;
    background-color: var(--gltb-surface);
    color: var(--gltb-text);
    box-shadow: var(--gltb-accent-shadow);
}
.gltb-topic-card a{color: var(--gltb-text);}

/* Meta separator (author/date row inside topic cards) */
.gltb-meta-separator {
    border-top: 1px solid var(--gltb-border);
}

/* Comment item bottom border */
.gltb-comment-item {
    border-bottom: 1px solid var(--gltb-border);
}

/* Query listing meta (author · date · terms) */
.gltb-query-meta {
    color: var(--gltb-text-muted);
}

.gltb-query-meta a {
    color: var(--gltb-text-secondary);
}

/* Query listing excerpt */
.gltb-query-excerpt {
    color: var(--gltb-text-muted);
}

/* Gradient top border */
.gltb-topic-card-gradient-border {
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
    margin-left: -32px;
    margin-right: -32px;
    border-radius: 16px 16px 0 0;
}

/* Forum category badge */
.gltb-forum-badge a {
    display: inline-block;
    background: rgb(92 147 246 / 15%) !important;
    color: #4b8aec !important;
    padding: 3px 14px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--gltb-transition-fast);
}

/* Topic content quote style */

/* Topic divider */
.gltb-topic-divider {
    border: none !important;
    height: 1px !important;
}

/* Author avatar with online indicator */
.gltb-author-avatar {
    position: relative;
    display: inline-block;
}

.gltb-author-avatar img {
    border-radius: 50% !important;
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.gltb-author-avatar .gltb-online-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
}

/* OP badge styling */
.gltb-op-badge {
    text-transform: uppercase;
    line-height: 1;
}

/* ==========================================================================
   Filter Button
   ========================================================================== */

.gltb-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--gltb-radius-md);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--gltb-transition-fast);
}

.gltb-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Upvote Button (legacy archive styles)
   ========================================================================== */

.gltb-upvote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--gltb-radius-md);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--gltb-transition-fast);
}

.gltb-upvote-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.gltb-upvote-btn.is-voted {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.gltb-topic-votes {
    text-align: center;
    flex-shrink: 0;
    min-width: 50px;
}

/* ==========================================================================
   Leaderboard
   ========================================================================== */

.gltb-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gltb-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--gltb-radius-md);
    transition: background var(--gltb-transition-fast);
}

.gltb-leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.gltb-rank {
    width: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.gltb-leaderboard-item:nth-child(1) .gltb-rank { color: #fbbf24; }
.gltb-leaderboard-item:nth-child(2) .gltb-rank { color: #94a3b8; }
.gltb-leaderboard-item:nth-child(3) .gltb-rank { color: #d97706; }

.gltb-leaderboard-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.gltb-leaderboard-name {
    flex: 1;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gltb-leaderboard-score {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
    flex-shrink: 0;
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */

.gltb-sidebar {
    position: relative;
}

/* Sidebar widget background */
.gltb-sidebar-widget {
    background-color: var(--gltb-surface);
    box-shadow: var(--gltb-accent-shadow-secondary);
}

.gltb-sidebar-title {
    color: var(--gltb-text);
}

/* Sidebar card styling */
.gltb-sidebar-card {
    overflow: hidden;
}


/* ==========================================================================
   Archive/Taxonomy Responsive
   ========================================================================== */

@media (max-width: 960px) {

    .wp-block-columns .wp-block-column[style*="flex-basis:70%"] {
        flex-basis: 100% !important;
    }
}

@media (max-width: 640px) {
    .gltb-filters-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch !important;
    }
}

/* ==========================================================================
   Changelog Timeline
   ========================================================================== */

/* Timeline container — the vertical line */
.gltb-changelog-timeline {
    position: relative;
}

.gltb-changelog-timeline img{max-width: 100%;}

.gltb-changelog-timeline::before {
    content: '';
    position: absolute;
    left: 198px; /* 170px date col + center of 60px marker col */
    top: 20px;
    bottom: 0;
    width: 2px;
    background-color: var(--gltb-border, #e5e7eb);
    z-index: 0;
}

/* Entry list reset */
.gltb-changelog-entries {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gltb-changelog-entries > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Date column */
.gltb-cl-date-col {
    text-align: right;
    padding-right: 20px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    box-sizing: border-box;
}

.gltb-cl-date-col .wp-block-post-date {
    position: sticky;
    top: 40px;
    letter-spacing: 0.025em;
}

/* Marker column (dot) */
.gltb-cl-marker-col {
    position: relative;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

.gltb-cl-dot {
    width: 12px;
    height: 12px;
    background-color: #6C2BD9;
    border-radius: 50%;
    border: 3px solid #f1f5f9;
    box-shadow: 0 0 0 1px #6C2BD9;
    z-index: 1;
    position: relative;
    margin-top: 6px;
    display: inline-block;
    line-height: 0;
    font-size: 0;
}

/* Content column */
.gltb-cl-content-col {
    flex-grow: 1 !important;
    padding-left: 10px !important;
    padding-bottom: 40px !important;
    border-bottom: 1px solid #f3f4f6;
}

.gltb-cl-entry:last-child .gltb-cl-content-col {
    border-bottom: none;
}

/* Category tag in timeline */
.gltb-cl-tag a {
    text-decoration: none !important;
}

/* Version badge */
.gltb-cl-version-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 500;
    line-height: 1.4;
}

/* Responsive: Timeline on mobile */
@media (max-width: 768px) {
    .gltb-changelog-timeline::before {
        left: 20px;
    }

    .gltb-cl-entry .wp-block-columns {
        flex-direction: column !important;
        padding-left: 50px;
        position: relative;
    }

    .gltb-cl-date-col {
        text-align: left !important;
        padding-right: 0 !important;
        margin-bottom: 8px;
        flex-basis: auto !important;
    }

    .gltb-cl-marker-col {
        position: absolute !important;
        left: -50px;
        top: 0;
        flex-basis: 40px !important;
        height: 100%;
    }

    .gltb-cl-content-col {
        padding-left: 0 !important;
        flex-basis: auto !important;
    }

    .gltb-cl-content-col .wp-block-post-title {
        font-size: 1.5rem !important;
    }
}

/* ==========================================================================
   Roadmap Card Grid
   ========================================================================== */

/* Card grid — 4 columns */
.gltb-roadmap-grid {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gltb-roadmap-grid > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Card styling */
.gltb-roadmap-card {
    position: relative;
    overflow: hidden;
    transition: transform var(--gltb-transition-fast), box-shadow var(--gltb-transition-fast);
    height: 100%;
}

.gltb-roadmap-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
}

/* Ensure card content stretches */
.gltb-roadmap-card > .wp-block-group:last-child {
    margin-top: auto;
    padding-top: 12px;
}

/* Excerpt clamp */
.gltb-roadmap-card .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive: Roadmap grid */
@media (max-width: 1100px) {
    .gltb-roadmap-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .gltb-roadmap-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .gltb-roadmap-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Page Title
   ========================================================================== */

.gltb-page-title {
    color: var(--gltb-text);
}

/* ==========================================================================
   Listing Title (post title links in archive/taxonomy cards)
   ========================================================================== */

.gltb-listing-title a {
    color: var(--gltb-text);
}

/* ==========================================================================
   Board Listing Item (shared card background)
   ========================================================================== */

.gltb-board-listing-item {
    background-color: var(--gltb-surface);
}

/* ==========================================================================
   Documentation Card Grid
   ========================================================================== */

/* Card grid */
.gltb-doc-grid {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gltb-doc-grid > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Card styling */
.gltb-doc-card {
    position: relative;
    overflow: hidden;
    transition: transform var(--gltb-transition-fast), box-shadow var(--gltb-transition-fast);
    height: 100%;
}

.gltb-doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
}

/* Excerpt clamp */
.gltb-doc-card .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Documentation Sidebar
   ========================================================================== */

.gltb-doc-sidebar {
    position: relative;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

.gltb-doc-sidebar .gltb-sidebar-sticky {
    position: sticky;
    top: 32px;
}

/* ==========================================================================
   Documentation TOC Sidebar
   ========================================================================== */

.gltb-doc-toc-sidebar {
    position: relative;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

.gltb-doc-toc-sidebar .gltb-toc-sticky {
    position: sticky;
    top: 32px;
}

/* ==========================================================================
   Documentation Mobile Sidebar Panel
   ========================================================================== */

/* Hamburger button - hidden by default on desktop */
.gltb-doc-mobile-menu-btn {
    display: none;
}

/* Breadcrumb row wrapper (injected by JS) */
.gltb-doc-breadcrumb-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Overlay backdrop - always in DOM but hidden */
.gltb-doc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.gltb-doc-nav-open .gltb-doc-overlay {
    display: block;
    opacity: 1;
}

body.gltb-doc-nav-open {
    overflow: hidden;
}

/* Close button inside the panel */
.gltb-doc-panel-close {
    display: none;
}

/* ==========================================================================
   Documentation Responsive
   ========================================================================== */

@media (max-width: 1100px) {
    .gltb-doc-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Hide TOC sidebar on tablets and smaller */
    .gltb-doc-toc-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .gltb-doc-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Hamburger button visible on mobile */
    .gltb-doc-mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 1px solid var(--gltb-border);
        border-radius: var(--gltb-radius-sm);
        background: var(--gltb-surface);
        color: var(--gltb-text);
        cursor: pointer;
        flex-shrink: 0;
        transition: all var(--gltb-transition-fast);
    }

    .gltb-doc-mobile-menu-btn:hover,
    .gltb-doc-mobile-menu-btn:focus-visible {
        background: #eef2f7;
        border-color: #cbd5e1;
    }

    .gltb-doc-mobile-menu-btn svg {
        width: 20px;
        height: 20px;
        display: block;
    }

    /* Sidebar becomes a sliding panel on mobile */
    .gltb-doc-three-col > .gltb-doc-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        z-index: 10000;
        background: var(--gltb-surface);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px 24px;
        box-shadow: none;
        flex-basis: auto !important;
    }

    body.gltb-doc-nav-open .gltb-doc-three-col > .gltb-doc-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    }

    /* Override sticky positioning inside the panel */
    .gltb-doc-three-col > .gltb-doc-sidebar .gltb-sidebar-sticky {
        position: static;
    }

    /* Close button visible inside panel on mobile */
    .gltb-doc-panel-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        position: absolute;
        top: 16px;
        right: 16px;
        background: none;
        border: none;
        color: var(--gltb-text-muted);
        cursor: pointer;
        border-radius: var(--gltb-radius-sm);
        padding: 0;
        transition: all var(--gltb-transition-fast);
        z-index: 1;
    }

    .gltb-doc-panel-close:hover,
    .gltb-doc-panel-close:focus-visible {
        background: #f1f5f9;
        color: var(--gltb-text);
    }

    .gltb-doc-panel-close svg {
        width: 20px;
        height: 20px;
        display: block;
    }
}

@media (max-width: 480px) {
    .gltb-doc-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Rendered Comment Blocks (Display)
   ========================================================================== */

/* Style blocks in rendered comments */
.gltb-reply-content .wp-block-paragraph,
.gltb-board-comments .wp-block-comment-content .wp-block-paragraph {
    margin-bottom: 0.75rem;
}

.gltb-reply-content .wp-block-paragraph:last-child,
.gltb-board-comments .wp-block-comment-content .wp-block-paragraph:last-child {
    margin-bottom: 0;
}

.gltb-reply-content .wp-block-heading,
.gltb-board-comments .wp-block-comment-content .wp-block-heading {
    font-family: var(--gltb-font-display, serif);
    margin: 1rem 0 0.5rem;
}

.gltb-reply-content .wp-block-heading:first-child,
.gltb-board-comments .wp-block-comment-content .wp-block-heading:first-child {
    margin-top: 0;
}

.gltb-reply-content .wp-block-code,
.gltb-board-comments .wp-block-comment-content .wp-block-code {
    background: var(--gltb-text, #1a1f2e);
    color: var(--gltb-surface, #ffffff);
    padding: 1rem;
    border-radius: var(--gltb-radius-md, 10px);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.gltb-reply-content .wp-block-preformatted,
.gltb-board-comments .wp-block-comment-content .wp-block-preformatted {
    background: var(--gltb-bg, #f1f5f9);
    padding: 1rem;
    border-radius: var(--gltb-radius-md, 10px);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.gltb-reply-content .wp-block-quote,
.gltb-board-comments .wp-block-comment-content .wp-block-quote {
    border-left: 4px solid var(--gltb-accent, #340fa0);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    background: var(--gltb-bg, #f1f5f9);
    border-radius: 0 var(--gltb-radius-sm, 6px) var(--gltb-radius-sm, 6px) 0;
    font-size: 0.9375rem;
}

.gltb-reply-content .wp-block-quote p,
.gltb-board-comments .wp-block-comment-content .wp-block-quote p {
    font-size: 0.9375rem;
}

.gltb-reply-content .wp-block-quote p,
.gltb-board-comments .wp-block-comment-content .wp-block-quote p {
    font-style: italic;
    color: var(--gltb-text-secondary, #475569);
    margin: 0;
}

.gltb-reply-content .wp-block-quote cite,
.gltb-board-comments .wp-block-comment-content .wp-block-quote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-style: normal;
    font-weight: 600;
    color: var(--gltb-text-muted, #94a3b8);
}

.gltb-reply-content .wp-block-list,
.gltb-board-comments .wp-block-comment-content .wp-block-list {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.gltb-reply-content .wp-block-image,
.gltb-board-comments .wp-block-comment-content .wp-block-image {
    margin: 0.75rem 0;
}

.gltb-reply-content .wp-block-image img,
.gltb-board-comments .wp-block-comment-content .wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--gltb-radius-md, 10px);
}

.gltb-reply-content .wp-block-separator,
.gltb-board-comments .wp-block-comment-content .wp-block-separator {
    border: none;
    border-top: 1px solid var(--gltb-border, #e2e8f0);
    margin: 1rem 0;
}