/* CSS Variables */
:root {
    --primary:       #9fcd22;
    --primary-dark:  #2d6a1e;
    --primary-light: #b6e537;
    --primary-glow:  rgba(159, 205, 34, 0.18);
    --white:         #ffffff;
    --black:         #0c0c0c;
    --gray-100:      #f7f7f7;
    --gray-200:      #ebebeb;
    --gray-400:      #aaaaaa;
    --gray-600:      #666666;
    --gray-800:      #333333;
    --text-body:     #3a3a3a;
    --sidebar-width: 320px;
    --transition:    0.42s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Overlay */
.br-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1200;
    pointer-events: none;
    transition: background var(--transition);
}

.br-overlay.br-open {
    background: rgba(0, 0, 0, 0.55);
    pointer-events: all;
}

/* Full-Page Panel */
.br-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    background: var(--white);
    z-index: 1201;
    display: flex;
    flex-direction: column;
    /* transform: translateX(100%); */
    transition: transform var(--transition);
    box-shadow: -8px 0 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;

    opacity: 0;
    filter: blur(12px);
    pointer-events: none;
    transform: scale(0.97);
    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.br-panel.br-open {
    /* transform: translateX(0); */
    opacity: 1;
    filter: blur(0px);
    pointer-events: all;
    transform: scale(1);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.2);
}

/* Panel Header */
.br-header {
    flex: 0 0 auto;
    height: 60px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid var(--gray-200);
    background: var(--white);
    position: relative;
    z-index: 5;
}

.br-header-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Roboto", serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

/* .br-header-category::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
} */

.br-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.br-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    color: var(--gray-600);
}

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

.br-share-btn svg {
    flex-shrink: 0;
}

.br-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary-dark);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.br-share-toast.br-share-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.br-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    color: var(--gray-600);
}

.br-close-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: rotate(90deg);
}

.br-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Panel Body */
.br-body {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* Main Article Area */
.br-main {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 40px 48px 60px;
    background: var(--white);
    scroll-behavior: smooth;
    min-height: 0;
}

.br-main::-webkit-scrollbar       { width: 6px; }
.br-main::-webkit-scrollbar-track { background: transparent; }
.br-main::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }
.br-main::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Hero Image */
.br-hero-img {
    width: 100%;
    height: 500px;
    object-fit: scale-down;
    border-radius: 12px;
    margin-bottom: 28px;
    display: block;
}

/* Hero wrapper — clips everything, rounded corners */
.br-hero-wrap {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 12px;
    margin-bottom: 28px;
    overflow: hidden;
}

/* Blurred background layer — same image, stretched to fill */
.br-hero-blur {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(22px) brightness(0.75) saturate(1.4);
    transform: scale(1.08); /* hides blur edges */
    z-index: 0;
}

/* Main image — centred, scale-down so full image is always visible */
.br-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    z-index: 1;
    border-radius: 0;
    margin: 0;
    display: block;
    background: transparent;
}

/* Meta row */
.br-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.br-meta-badge {
    font-family: "Roboto", serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-dark);
    background: var(--primary-glow);
    border: 1px solid rgba(159, 205, 34, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
}

.br-meta-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Roboto", serif;
    font-size: 13px;
    color: var(--gray-600);
}

.br-meta-author svg {
    width: 14px;
    height: 14px;
    stroke: var(--gray-400);
    fill: none;
    stroke-width: 1.8;
}

.br-meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gray-400);
}

/* Title */
.br-title {
    font-family: "Roboto", serif;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--black);
    margin: 0 0 28px;
    letter-spacing: -0.02em;
}

/* Divider */
.br-divider {
    width: 48px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    margin-bottom: 28px;
}

/* Body content */
.br-content {
    font-family: "Roboto", serif;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--text-body);
}

.br-content p    { margin-bottom: 1.2em; }
.br-content h2   { font-family: "Roboto", serif; font-size: 20px; font-weight: 600; color: var(--black); margin: 2em 0 0.7em; }
.br-content h3   { font-family: "Roboto", serif; font-size: 17px; font-weight: 600; color: var(--black); margin: 1.6em 0 0.6em; }
.br-content a    { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.br-content ul,
.br-content ol   { padding-left: 1.6em; margin-bottom: 1.2em; }
.br-content li   { margin-bottom: 0.4em; }
.br-content img  { max-width: 100%; border-radius: 8px; margin: 1em 0; }
.br-content blockquote {
    border-left: 3px solid var(--primary);
    margin: 1.5em 0;
    padding: 12px 20px;
    background: var(--gray-100);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--gray-600);
}

/* Sidebar */
.br-sidebar {
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    border-left: 1.5px solid var(--gray-200);
    overflow-y: auto;
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.br-sidebar::-webkit-scrollbar       { width: 4px; }
.br-sidebar::-webkit-scrollbar-track { background: transparent; }
.br-sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }

.br-sidebar-header {
    padding: 24px 22px 16px;
    border-bottom: 1.5px solid var(--gray-200);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 2;
}

.br-sidebar-title {
    font-family: "Roboto", serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-600);
}

/* Related Post Cards */
.br-related-list {
    padding: 16px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.br-related-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px;
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 1.5px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.br-related-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.25s ease;
    border-radius: 0 2px 2px 0;
}

.br-related-card:hover {
    border-color: var(--gray-200);
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transform: translateX(3px);
}

.br-related-card:hover::before {
    transform: scaleY(1);
}

.br-related-card.br-active {
    border-color: var(--primary-light);
    background: rgba(159, 205, 34, 0.06);
}

.br-related-card.br-active::before {
    transform: scaleY(1);
}

.br-related-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--gray-200);
}

.br-related-info {
    flex: 1;
    min-width: 0;
}

.br-related-info h4 {
    font-family: "Roboto", serif;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--gray-800);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.br-related-card:hover .br-related-info h4 {
    color: var(--primary-dark);
}

.br-related-date {
    font-family: "Roboto", serif;
    font-size: 11.5px;
    color: var(--gray-400);
}

.br-related-arrow {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.br-related-arrow .arrow-icon {
    flex-shrink: 0;
    transition: all 0.3s ease;
    transform: rotate(315deg);
    width: 100%;
    height: 100%;
    fill: #92bd26;
}

.br-related-card:hover .br-related-arrow .arrow-icon {
    transform: translateX(5px);
}

/* .br-related-arrow svg {
    width: 10px;
    height: 10px;
    stroke: var(--gray-600);
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease;
}

.br-related-card:hover .br-related-arrow svg {
    stroke: var(--white);
} */

/* Loader */
.br-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.br-loader.br-loading {
    opacity: 1;
    pointer-events: all;
}

.br-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: br-spin 0.7s linear infinite;
}

.br-loader-text {
    font-family: "Roboto", serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    text-transform: uppercase;
}

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

/* Empty / Error State */
.br-empty {
    padding: 32px 20px;
    text-align: center;
    font-family: "Roboto", serif;
    font-size: 13px;
    color: var(--gray-400);
}

/* Progress Bar */
.br-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    width: 0%;
    z-index: 1300;
    transition: width 0.1s linear, opacity 0.4s ease;
    opacity: 0;
}

.br-progress.br-progress-active {
    opacity: 1;
}

/* Responsive - tablet */
@media (max-width: 1024px) {
    .br-main {
        padding: 28px 32px 48px;
    }

    .br-hero-wrap { 
        height: 300px; 
    } 

    .br-hero-img {
        height: 260px;
    }
}

/* Responsive - mobile stacked layout */
@media (max-width: 820px) {
    :root {
        --sidebar-width: 100%;
    }

    .br-body {
        flex-direction: column;
        overflow-y: auto;
        min-height: 0;
    }

    /* Main article: let its content flow naturally, no internal scroll */
    .br-main {
        flex: 0 0 auto;
        overflow-y: visible;
        padding: 22px 20px 24px;
    }

    .br-hero-wrap { 
        height: 240px; 
    }

    /* Sidebar stacks below main, grows to show all cards */
    .br-sidebar {
        flex: 0 0 auto;
        width: 100%;
        border-left: none;
        border-top: 1.5px solid var(--gray-200);
        overflow-y: visible;
    }

    .br-sidebar-header {
        position: static;
    }

    .br-hero-img {
        height: 210px;
    }
}

/* Responsive - small phone */
@media (max-width: 540px) {
    .br-header {
        padding: 0 16px;
        height: 54px;
    }

    .br-main {
        padding: 18px 16px 20px;
    }

    .br-hero-wrap { 
        height: 200px; 
        border-radius: 8px; 
    }

    .br-hero-img {
        height: 180px;
        border-radius: 8px;
    }

    .br-title {
        font-size: 20px;
    }

    .br-content {
        font-size: 14.5px;
        line-height: 1.75;
    }

    .br-related-list {
        padding: 12px 12px 20px;
        gap: 8px;
    }

    .br-related-card {
        padding: 12px;
    }

    .br-related-thumb {
        width: 48px;
        height: 48px;
    }
}

/* Responsive - extra small phone */
@media (max-width: 380px) {
    .br-hero-img {
        height: 150px;
    }

    .br-content {
        font-size: 14px;
    }

    .br-hero-wrap { 
        height: 170px; 
    }
}