/* =================
   CVE Library - Complete Styles
   ================= */

/* Variables */
:root {
    --cve-accent: #00CCFF;
    --cve-border: #F5F5F5;
    --cve-text: #000000;
    --cve-text-light: #505050;
    --cve-sidebar-w: 307px;
    --cve-right-w: 280px;
    --cve-radius: 10px;
}

/* =================
   Layout - 3 Column
   ================= */

.cve-layout {
    display: grid;
    grid-template-columns:
        var(--cve-sidebar-w) 1fr var(--cve-right-w);
    gap: 0;
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.cve-main {
    padding: 32px 48px;
    padding-bottom: 0px !important;
    min-width: 0;
}

/* =================
   Left Sidebar
   ================= */

.cve-sidebar {
    width: var(--cve-sidebar-w);
    overflow-y: auto;
    position: sticky;
    top: -0;
    height: 100vh;
    background-color: #F5F5F5;
    border: solid 1px #AEAEAE;
    border-top: 0;
	border-radius: 0 0 5px 5px;
}

.cve-sidebar__inner {
    padding: 24px 0;
}

.cve-sidebar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 16px;
}

.cve-sidebar__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--cve-text-light);
    text-transform: uppercase;
}

.cve-sidebar__close {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--cve-text);
    line-height: 1;
}

/* Nav Tree */

.cve-nav-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cve-nav-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--cve-text);
    text-align: left;
    transition: color 0.2s;
}

.cve-nav-toggle:hover {
    color: var(--cve-accent);
}

.cve-nav-toggle .chevron {
    transition: transform 0.2s;
}

.cve-nav-year.is-open > .cve-nav-toggle,
.cve-nav-month.is-open > .cve-nav-toggle {
    color: var(--cve-accent);
}

.cve-nav-year.is-open > .cve-nav-toggle .chevron,
.cve-nav-month.is-open > .cve-nav-toggle .chevron {
    transform: rotate(0deg);
}

.cve-nav-year:not(.is-open) > .cve-nav-toggle .chevron,
.cve-nav-month:not(.is-open) > .cve-nav-toggle .chevron {
    transform: rotate(-90deg);
}

/* Children (collapsed by default) */
.cve-nav-children,
.cve-nav-items {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cve-nav-year.is-open > .cve-nav-children,
.cve-nav-month.is-open > .cve-nav-items {
    display: block;
}

.cve-nav-month .cve-nav-toggle {
    padding-left: 36px;
    font-size: 14px;
    font-weight: 500;
}

.cve-nav-item a {
    display: block;
    padding: 6px 20px 6px 52px;
    font-size: 13px;
    color: var(--cve-text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.cve-nav-item a:hover {
    color: var(--cve-accent);
    background: #f9f9f9;
}

.cve-nav-item.is-active a {
    color: var(--cve-accent);
    border-left-color: var(--cve-accent);
    font-weight: 600;
    background: rgba(0, 204, 255, 0.04);
}

/* =================
   Right Sidebar
   ================= */

.cve-right-sidebar {
    width: var(--cve-right-w);
    padding: 32px 20px;
    border-left: 1px solid #AEAEAE;
}

/* Search */

.cve-search {
    width: 267px;
    position: relative;
    margin-bottom: 24px;
}

.cve-search__wrapper {
    position: relative;
}

.cve-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.cve-search__input {
    width: 267px;
    padding: 10px 12px 10px 38px !important;
    border: 1px solid #AEAEAE;
    border-radius: var(--cve-radius);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.cve-search__input:focus {
    border-color: var(--cve-accent);
}

.cve-search__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 var(--cve-radius) var(--cve-radius);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cve-search__results.is-visible {
    display: block;
}

.cve-search__result-item {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--cve-text);
    font-size: 13px;
    border-bottom: 1px solid var(--cve-border);
    transition: background 0.15s;
}

.cve-search__result-item:hover {
    background: #f5f5f5;
}

.cve-search__result-item:last-child {
    border-bottom: none;
}

.cve-search__result-id {
    font-weight: 600;
}

.cve-search__result-score {
    float: right;
    font-size: 12px;
    color: var(--cve-text-light);
}

.cve-search__no-results {
    padding: 12px 14px;
    color: var(--cve-text-light);
    font-size: 13px;
}

/* Key Takeaways Card */

.cve-takeaways {
    width: 267px;
    overflow: hidden;
}

.cve-takeaways__header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #000000;
    border: 1px solid #000000;
    border-radius: var(--cve-radius) var(--cve-radius) 0 0;
    color: #FFFFFF;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.cve-takeaways__body {
    background-color: #F5F5F5;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 var(--cve-radius) var(--cve-radius);
}

.cve-takeaways__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 2px;
    font-size: 13px;
}

.cve-takeaways__body {
    background-color: #F5F5F5;
    overflow: hidden;
}

.cve-takeaways__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 13px;
    position: relative;
}

.cve-takeaways__row::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 1px;
    background-color: #AEAEAE;
}

.cve-takeaways__row:last-child::after {
    display: none;
}

.cve-takeaways__label {
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--cve-text-light);
}

.cve-takeaways__value {
    font-weight: 500;
    color: var(--cve-text);
    text-align: right;
}

/* =================
   Breadcrumbs
   ================= */

.cve-breadcrumbs {
    font-size: 16px;
    margin-bottom: 24px;
    color: #000000;
}

.cve-breadcrumbs a {
    color: var(--cve-text-light);
    text-decoration: none;
    transition: color 0.15s;
}

.cve-breadcrumbs a:hover {
    color: var(--cve-accent);
}

.cve-breadcrumbs .sep {
    margin: 0 6px;
}

.cve-breadcrumbs .current {
    color: var(--cve-accent);
    font-weight: 500;
}

/* =================
   Page Title
   ================= */

.cve-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: #000000;
    margin: 0 0 20px;
}

/* =================
   Badges
   ================= */

.cve-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.cve-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.6;
}

.cve-badge--outlined {
    background: transparent;
    border: 1px solid;
}

.cve-badge--filled {
    border: none;
}

.cve-badge--type {
    background: transparent;
    border: 1px solid #999999;
    color: #555555;
    font-weight: 500;
}

.cve-badge--small {
    padding: 2px 10px;
    font-size: 11px;
    border-radius: 12px;
}

/* =================
   Highlighted Quote
   ================= */

.cve-quote {
    border-left: 1px solid var(--cve-accent);
    background: #f9fcfd;
    margin: 0 0 32px;
    padding: 5px 24px;
    min-height: 33px !important;
    border-radius: 0 var(--cve-radius) var(--cve-radius) 0;
}

.cve-quote p {
    margin: 0;
    font-style: italic;
    font-size: 16px;
    color: #505050;
}

/* =================
   Post Content
   ================= */

.cve-content {
    font-size: 15px;
    line-height: 1.75;
    color: var(--cve-text);
    margin-bottom: 40px;
}

.cve-content p {
    margin: 0px;
    font-size: 16px !important;
}

/* H2 with blue left bar + allcaps */

.cve-content h2 {
    position: relative;
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #000000;
    margin: 10px 0 16px;
    padding: 23px 0 0 16px;
    border-top: 1px solid var(--cve-border);
}

.cve-content h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 24px;
    width: 1px;
    height: 16px;
    background: var(--cve-accent);
    border-radius: 2px;
}

/* First h2 - no top border */
.cve-content h2:first-child {
    border-top: none;
    padding-top: 0px;
    margin-top: 0;
}

.cve-content h2:first-child::before {
    top: 1px;
}

/* =================
   Key Details Table
   ================= */

.cve-key-details h2 {
    position: relative;
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #000000;
    margin: 0 0 16px;
    padding: 24px 0 0 16px;
    border-top: 1px solid var(--cve-border);
}

.cve-key-details h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 24px;
    width: 1px;
    height: 16px;
    background: var(--cve-accent);
    border-radius: 2px;
}

.cve-details-table {
    margin: 0;
    padding: 0;
}

.cve-details-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--cve-border);
}

.cve-details-row:last-child {
    border-bottom: none;
}

.cve-details-row dt {
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--cve-text-light);
    flex: 0 0 200px;
}

.cve-details-row dd {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--cve-text);
    text-align: left;
    margin-left: 60px;
    flex: 1;
}

/* =================
   CTA Banner
   ================= */

.cve-cta {
    background: #000000;
    border-radius: var(--cve-radius);
    padding: 32px 36px;
    margin-top: 48px;
}

.cve-cta__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.cve-cta__text strong {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 22px;
}

.cve-cta__text span {
    font-size: 14px;
    color: #AEAEAE;
    line-height: 1.5;
}

.cve-cta__form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cve-cta__form input {
    flex: 1;
    min-width: 140px;
    padding: 8px 16px !important;
    height: 34px !important;
    border: 1px solid #AEAEAE !important;
    border-radius: var(--cve-radius);
    background-color: #333333 !important;
    color: #AEAEAE !important;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    line-height: 0px !important;
}

.cve-cta__form input:focus {
    color: #AEAEAE !important;
}

.cve-cta__form input::placeholder {
    color: #AEAEAE;
}

.cve-cta__form input:focus {
    border-color: var(--cve-accent);
}

.cve-cta__btn {
    padding: 0 28px;
    height: 34px !important;
    background: var(--cve-accent);
    color: #000000;
    border: none;
    border-radius: var(--cve-radius);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.cve-cta__btn:hover {
    opacity: 0.85;
}

/* =================
   Empty State (Archive Page)
   ================= */

.cve-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
    padding: 60px 20px;
    color: var(--cve-text-light);
}

.cve-empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.cve-empty-state h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--cve-text);
    margin: 0 0 10px;
}

.cve-empty-state p {
    font-size: 15px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0;
}

/* =================
   Mobile Sidebar Toggle + Overlay
   ================= */

.cve-sidebar-toggle {
    display: none;
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1100;
    background: #000000;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 14px 6px 14px 4px;
    cursor: pointer;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    line-height: 1;
    transition: background 0.2s;
}

.cve-sidebar-toggle:hover {
    background: #222222;
}

.cve-sidebar-toggle__icon {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    display: block;
    line-height: 1;
    pointer-events: none;
}

@media (max-width: 768px) {
    .cve-sidebar-toggle {
        display: block;
    }

    .cve-sidebar.is-open ~ .cve-sidebar-toggle {
        left: calc(var(--cve-sidebar-w));
        opacity: 0;
        pointer-events: none;
    }
}

/* Hide tab when sidebar is open */
.cve-sidebar.is-open ~ .cve-sidebar-toggle,
body.cve-sidebar-open .cve-sidebar-toggle {
    display: none;
}

.cve-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.cve-overlay.is-visible {
    display: block;
}

@media (max-width: 768px) {
    .cve-sidebar-toggle {
        display: block;
    }
}

/* =================
   Responsive: Tablet (≤ 1024px)
   ================= */

@media (max-width: 1024px) {
    .cve-layout {
        grid-template-columns: var(--cve-sidebar-w) 1fr;
    }

    .cve-right-sidebar {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--cve-border);
        padding: 24px 48px;
    }

    .cve-takeaways {
        max-width: 380px;
    }

    .cve-search {
        max-width: 380px;
    }
}

/* =================
   Responsive: Mobile (≤ 768px)
   ================= */

@media (max-width: 768px) {

    /* Show hamburger + overlay */
    .cve-sidebar-toggle {
        display: block;
    }

    .cve-sidebar__close {
        display: block;
    }

    /* Off-canvas sidebar */
    .cve-layout {
        grid-template-columns: 1fr;
    }

    .cve-sidebar {
        position: fixed;
        top: 0;
        left: -var(--cve-sidebar-w);
        left: calc(-1 * var(--cve-sidebar-w));
        bottom: 0;
        width: var(--cve-sidebar-w);
        z-index: 1000;
        transform: none;
        transition: left 0.3s ease;
        box-shadow: none;
    }

    .cve-sidebar.is-open {
        left: 0;
        transform: none;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    }

    /* Main content full width */
    .cve-main {
        grid-column: 1;
        grid-row: auto;
        padding: 24px 20px;
        padding-top: 60px;
        padding-bottom: 0px !important;
        width: 100%;
        min-width: 0;
    }

    /* Right sidebar stacks below main, full width */
    .cve-right-sidebar {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--cve-border);
        padding: 24px 20px;
    }

    .cve-takeaways,
    .cve-search {
        max-width: 100%;
        width: 100%;
    }

    /* Title smaller */
    .cve-title {
        font-size: 22px;
    }

    /* CTA stack vertically */
    .cve-cta {
        padding: 24px 20px;
    }

    .cve-cta__form {
        flex-direction: column;
    }

    .cve-cta__form input {
        height: 34px !important;
        min-width: 100%;
    }

    .cve-cta__btn {
        width: 100%;
        text-align: center;
    }

    /* Key details stack */
    .cve-details-row {
        flex-direction: column;
        gap: 4px;
    }

    .cve-details-row dt {
        flex: unset;
    }

    .cve-details-row dd {
        text-align: left;
    }
}

/* =================
   Responsive: Small Mobile (≤ 480px)
   ================= */

@media (max-width: 480px) {
    .cve-main {
        padding: 20px 16px;
        padding-top: 56px;
        padding-bottom: 0px !important;
    }

    .cve-title {
        font-size: 19px;
    }

    .cve-badges {
        gap: 6px;
    }

    .cve-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .cve-content h2 {
        font-size: 14px;
    }

    .cve-quote {
        padding: 12px 16px;
    }

    .cve-quote p {
        font-size: 14px;
    }
}