/* ========================================
   JEKKYL DOCUMENTS v8.0 — Document Hub
   Premium document navigator
   ======================================== */

/* Montserrat loaded via wp_enqueue_style */

:root {
    --dh-brand-blue: #0087c9;
    --dh-brand-gold: #e1af00;
    --dh-bg: #F4F6FA;
    --dh-white: #FFFFFF;
    --dh-text: #1A2332;
    --dh-text-secondary: #5A6577;
    --dh-text-muted: #8E99A9;
    --dh-border: #E4E8F0;
    --dh-hover-bg: #F0F4FF;
    --dh-pdf: #E53935;
    --dh-doc: #2B6CB0;
    --dh-xls: #38A169;
    --dh-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
    --dh-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --dh-radius: 12px;
    --dh-radius-sm: 8px;
}

/* === WRAPPER === */
.dh {
    background: var(--dh-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--dh-shadow-md);
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px;
    line-height: 1.6;
    color: var(--dh-text);
}

/* === SEARCH === */
.dh-search {
    padding: 20px 24px;
    background: var(--dh-white);
    border-bottom: 1px solid var(--dh-border);
}

.dh-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--dh-border);
    border-radius: var(--dh-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--dh-text);
    background: var(--dh-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238E99A9' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 14px center;
    transition: border-color .2s, background-color .2s;
    box-sizing: border-box;
}

.dh-search-input:focus {
    outline: none;
    border-color: var(--dh-brand-blue);
    background-color: var(--dh-white);
}

.dh-search-input::placeholder {
    color: var(--dh-text-muted);
}

/* === LAYOUT === */
.dh-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 400px;
}

/* === SIDEBAR === */
.dh-sidebar {
    background: var(--dh-white);
    border-right: 1px solid var(--dh-border);
    padding: 16px 0;
}

.dh-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--dh-text-secondary);
    border: none;
    border-left: 3px solid transparent;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: all .2s;
    box-sizing: border-box;
}

.dh-nav-item:hover {
    background: var(--dh-hover-bg);
    color: var(--dh-text);
}

.dh-nav-item.active {
    background: var(--dh-hover-bg);
    color: var(--dh-brand-blue);
    border-left-color: var(--dh-brand-gold);
    font-weight: 600;
}

.dh-nav-item .nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    flex-shrink: 0;
    opacity: .6;
}

.dh-nav-item.active .nav-icon {
    opacity: 1;
}

.dh-nav-label {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.dh-nav-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dh-nav-count {
    background: var(--dh-bg);
    color: var(--dh-text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.dh-nav-item.active .dh-nav-count {
    background: rgba(0, 135, 201, 0.1);
    color: var(--dh-brand-blue);
}

/* === CONTENT === */
.dh-content {
    padding: 24px;
}

.dh-panel {
    display: none;
}

.dh-panel.active {
    display: block;
}

/* === TEXT BLOCK === */
.dh-text-block {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--dh-white);
    border-radius: var(--dh-radius-sm);
    border-left: 4px solid var(--dh-brand-blue);
}

.dh-text-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px;
    font-weight: 700;
    color: var(--dh-brand-blue);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.dh-text-body {
    font-size: 14px;
    color: var(--dh-text-secondary);
    line-height: 1.7;
}

.dh-text-body p {
    margin: 0 0 12px;
}

.dh-text-body p:last-child {
    margin-bottom: 0;
}

.dh-text-body h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dh-brand-blue);
    margin: 20px 0 10px;
}

.dh-text-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dh-text);
    margin: 16px 0 8px;
}

.dh-text-body a {
    color: var(--dh-brand-blue);
    text-decoration: underline;
}

.dh-text-body a:hover {
    color: var(--dh-brand-gold);
}

.dh-text-body ul,
.dh-text-body ol {
    margin: 0 0 12px;
    padding-left: 24px;
}

.dh-text-body li {
    margin-bottom: 6px;
}

.dh-text-body blockquote {
    margin: 12px 0;
    padding: 12px 20px;
    border-left: 4px solid var(--dh-brand-blue);
    background: #f8f9fb;
    font-style: italic;
    color: #555;
}

/* === YEAR ACCORDION === */
.dh-year {
    margin-bottom: 16px;
}

.dh-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--dh-white);
    border-radius: var(--dh-radius-sm);
    cursor: pointer;
    user-select: none;
    transition: background .2s;
}

.dh-year-header:hover {
    background: #EDF0F7;
}

.dh-year-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px;
    font-weight: 700;
    color: var(--dh-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dh-year-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--dh-text-muted);
}

.dh-year-chevron {
    width: 20px;
    height: 20px;
    transition: transform .3s;
    color: var(--dh-text-muted);
}

.dh-year.open .dh-year-chevron {
    transform: rotate(180deg);
}

.dh-year-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height .4s ease;
}

.dh-year.open .dh-year-body {
    max-height: 5000px;
}

.dh-year-list {
    padding: 12px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === DOCUMENT CARD === */
.dh-doc {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--dh-white);
    border-radius: var(--dh-radius-sm);
    border: 1px solid var(--dh-border);
    transition: all .2s;
    text-decoration: none;
}

.dh-doc:hover {
    border-color: var(--dh-brand-blue);
    box-shadow: var(--dh-shadow-sm);
    transform: translateY(-1px);
}

/* File badge */
.dh-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: .5px;
}

.dh-badge.pdf {
    background: var(--dh-pdf);
}

.dh-badge.doc {
    background: var(--dh-doc);
}

.dh-badge.xls {
    background: var(--dh-xls);
}

.dh-badge.default {
    background: var(--dh-text-muted);
}

.dh-badge-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dh-badge-icon svg {
    width: 100%;
    height: 100%;
    transform: scale(0.95);
    transform-origin: center;
    pointer-events: none;
}

/* Doc info */
.dh-doc-info {
    flex: 1;
    min-width: 0;
}

.dh-doc-link {
    color: var(--dh-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    transition: color .2s;
}

.dh-doc-link:hover {
    color: var(--dh-brand-blue);
}

.dh-doc-meta {
    font-size: 12px;
    color: var(--dh-text-muted);
    margin-top: 3px;
}

.dh-doc-desc {
    font-size: 13px;
    color: var(--dh-text-secondary);
    margin-top: 4px;
}

/* Download button */
.dh-download {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--dh-border);
    background: var(--dh-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
    opacity: 0;
    text-decoration: none;
}

.dh-doc:hover .dh-download {
    opacity: 1;
}

.dh-download:hover {
    background: var(--dh-brand-blue);
    border-color: var(--dh-brand-blue);
}

.dh-download:hover svg {
    stroke: #fff;
}

/* No results */
.dh-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--dh-text-muted);
    font-size: 14px;
}

/* === HORIZONTAL TABS MODE === */
.dh.dh-horizontal .dh-body {
    grid-template-columns: 1fr;
}

.dh.dh-horizontal .dh-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--dh-border);
    padding: 0 24px;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dh.dh-horizontal .dh-nav-item {
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 14px 18px;
    white-space: nowrap;
}

.dh.dh-horizontal .dh-nav-item.active {
    border-left: none;
    border-bottom-color: var(--dh-brand-gold);
    background: transparent;
}

.dh.dh-horizontal .dh-nav-item .nav-icon {
    display: none;
}

/* === MOBILE === */
@media (max-width: 768px) {
    .dh-body {
        grid-template-columns: 1fr;
    }

    .dh-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--dh-border);
        padding: 12px;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dh-nav-item {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 8px 14px;
        white-space: nowrap;
        border-radius: var(--dh-radius-sm);
        font-size: 13px;
        width: auto;
    }

    .dh-nav-item.active {
        border-left: none;
        border-bottom-color: var(--dh-brand-gold);
        border-radius: var(--dh-radius-sm) var(--dh-radius-sm) 0 0;
    }

    .dh-nav-count {
        display: none;
    }

    .dh-nav-item .nav-icon {
        display: none;
    }

    .dh-content {
        padding: 16px;
    }

    .dh-download {
        opacity: 1;
    }

    .dh-doc {
        padding: 12px;
        gap: 10px;
    }

    .dh-badge, .dh-badge-icon {
        width: 36px;
        height: 36px;
        font-size: 10px;
    }

    .dh-doc-link {
        font-size: 13px;
    }

    .dh-doc-meta {
        font-size: 11px;
    }

    .dh-search {
        padding: 14px 16px;
    }

    .dh-search-input {
        font-size: 13px;
        padding: 10px 14px 10px 40px;
    }
}