/* ОУ „Чудомир" — Документи. Светли карти в стила на сайта: Open Sans, златният акцент и текстовите цветове
   идват от глобалните цветове на Elementor kit-а (с резервни стойности). Всичко е под .chu-docs, за да надвие
   общите правила на текстовия редактор (.elementor-widget-text-editor ul …). */

.chu-docs {
    --chu-gold: var(--e-global-color-accent, #e6bc6d);
    --chu-gold-hover: #dcaa4f;
    --chu-gold-text: #a87a22; /* златно за текст върху бяло (контраст AA) */
    --chu-ink: var(--e-global-color-primary, #333);
    --chu-text: var(--e-global-color-text, #666);
    --chu-muted: #8c8c8c;
    --chu-line: #ebe8e2;
    --chu-radius: 12px;
    margin: 0 0 24px;
    color: var(--chu-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.chu-docs *,
.chu-docs *::before,
.chu-docs *::after {
    box-sizing: border-box;
}

.chu-docs .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- лента: търсене + подреждане ---------- */
.chu-docs .chu-docs__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin: 0 0 16px;
}

.chu-docs .chu-docs__search {
    position: relative;
    flex: 1 1 280px;
    margin: 0;
}

.chu-docs .chu-docs__search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--chu-muted);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.chu-docs .chu-docs__search input,
.chu-docs .chu-docs__sort select {
    height: 46px;
    margin: 0;
    border: 1px solid #e2ded6;
    border-radius: 10px;
    background-color: #fff;
    color: var(--chu-ink);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.chu-docs .chu-docs__search input {
    width: 100%;
    padding: 0 16px 0 44px;
}

.chu-docs .chu-docs__search input::placeholder {
    color: #a3a3a3;
    opacity: 1;
}

.chu-docs .chu-docs__sort {
    margin: 0;
}

.chu-docs .chu-docs__sort select {
    padding: 0 40px 0 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c8c8c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-repeat: no-repeat;
    background-size: 16px;
    font-size: 14px;
    cursor: pointer;
}

.chu-docs .chu-docs__search input:focus,
.chu-docs .chu-docs__sort select:focus {
    border-color: var(--chu-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 188, 109, .25);
}

.chu-docs .chu-docs__count {
    margin-left: auto;
    color: var(--chu-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* ---------- списък ---------- */
.chu-docs .chu-docs__list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.5;
}

.chu-docs .chu-doc {
    --chu-kind: #7a7a7a;
    margin: 0;
    padding: 0;
    border: 1px solid var(--chu-line);
    border-radius: var(--chu-radius);
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.chu-docs .chu-doc:hover {
    border-color: rgba(230, 188, 109, .75);
    box-shadow: 0 12px 28px -16px rgba(51, 51, 51, .35);
    transform: translateY(-1px);
}

.chu-docs .chu-doc--pdf { --chu-kind: #e04848; }
.chu-docs .chu-doc--doc { --chu-kind: #2f6bd8; }
.chu-docs .chu-doc--xls { --chu-kind: #1f8a4c; }
.chu-docs .chu-doc--ppt { --chu-kind: #d9622b; }
.chu-docs .chu-doc--zip,
.chu-docs .chu-doc--multi { --chu-kind: #a87a22; }
.chu-docs .chu-doc--img { --chu-kind: #7c5cd6; }

.chu-docs .chu-doc__main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px 14px 14px;
    border-radius: var(--chu-radius);
    color: inherit;
    text-decoration: none;
}

.chu-docs a.chu-doc__main:focus-visible {
    outline: 2px solid var(--chu-gold);
    outline-offset: 2px;
}

/* значка-файл с подгънат ъгъл */
.chu-docs .chu-doc__badge {
    position: relative;
    display: flex;
    flex: 0 0 44px;
    align-items: flex-end;
    justify-content: center;
    width: 44px;
    height: 54px;
    padding-bottom: 9px;
    border-radius: 6px;
    background: var(--chu-kind);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1;
    clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
}

.chu-docs .chu-doc__badge::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 13px;
    height: 13px;
    border-bottom-left-radius: 4px;
    background: rgba(255, 255, 255, .45);
}

.chu-docs .chu-doc__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.chu-docs .chu-doc__title {
    color: var(--chu-ink);
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    transition: color .15s ease;
}

.chu-docs a.chu-doc__main:hover .chu-doc__title {
    color: var(--chu-gold-text);
}

.chu-docs .chu-doc__meta {
    color: var(--chu-muted);
    font-size: 13px;
}

.chu-docs .chu-doc__btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
    background: var(--chu-gold);
    color: #2b2b2b;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s ease;
}

.chu-docs a.chu-doc__main:hover .chu-doc__btn {
    background: var(--chu-gold-hover);
}

.chu-docs .chu-doc__icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* документ с няколко файла: всеки файл поотделно под основния ред */
.chu-docs .chu-doc__files {
    margin: 0 16px 12px 74px;
    padding: 0;
    border-top: 1px solid var(--chu-line);
    list-style: none;
}

.chu-docs .chu-doc__files li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f3f1ec;
}

.chu-docs .chu-doc__files li:last-child {
    border-bottom: 0;
}

.chu-docs .chu-doc__files a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 2px;
    color: var(--chu-text);
    font-size: 14px;
    text-decoration: none;
}

.chu-docs .chu-doc__files a:hover {
    color: var(--chu-gold-text);
}

.chu-docs .chu-doc__file-ext {
    flex: 0 0 auto;
    min-width: 40px;
    padding: 3px 6px;
    border-radius: 4px;
    background: #7a7a7a;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.2;
    text-align: center;
}

.chu-docs .chu-doc__file-ext--pdf { background: #e04848; }
.chu-docs .chu-doc__file-ext--doc { background: #2f6bd8; }
.chu-docs .chu-doc__file-ext--xls { background: #1f8a4c; }
.chu-docs .chu-doc__file-ext--ppt { background: #d9622b; }
.chu-docs .chu-doc__file-ext--zip { background: #a87a22; }
.chu-docs .chu-doc__file-ext--img { background: #7c5cd6; }

.chu-docs .chu-doc__file-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.chu-docs .chu-doc__file-size {
    color: var(--chu-muted);
    font-size: 12.5px;
    white-space: nowrap;
}

.chu-docs .chu-doc__files .chu-doc__icon {
    width: 16px;
    height: 16px;
    color: var(--chu-muted);
}

/* документ без файл */
.chu-docs .chu-doc--empty {
    border-style: dashed;
    background: #fbfbfa;
}

.chu-docs .chu-doc--empty:hover {
    border-color: var(--chu-line);
    box-shadow: none;
    transform: none;
}

.chu-docs .chu-doc--empty .chu-doc__badge {
    background: #d9d6d0;
    font-size: 14px;
}

.chu-docs .chu-doc--empty .chu-doc__title {
    color: #8c8c8c;
}

/* ---------- празно / страниране ---------- */
.chu-docs .chu-docs__empty {
    margin: 0;
    padding: 28px 20px;
    border: 1px dashed #e2ded6;
    border-radius: var(--chu-radius);
    background: #fcfbf9;
    color: var(--chu-muted);
    text-align: center;
}

.chu-docs .chu-docs__pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.chu-docs .chu-docs__pagination li {
    margin: 0;
    padding: 0;
}

.chu-docs .chu-docs__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--chu-line);
    border-radius: 10px;
    background: #fff;
    color: var(--chu-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}

.chu-docs .chu-docs__pagination a.page-numbers:hover {
    border-color: var(--chu-gold);
    color: var(--chu-gold-text);
}

.chu-docs .chu-docs__pagination .page-numbers.current {
    border-color: var(--chu-gold);
    background: var(--chu-gold);
    color: #2b2b2b;
}

.chu-docs .chu-docs__pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: var(--chu-muted);
}

.chu-docs .chu-docs__pagination .prev,
.chu-docs .chu-docs__pagination .next {
    font-size: 20px;
    font-weight: 500;
}

/* ---------- мобилни ---------- */
@media (max-width: 600px) {
    .chu-docs .chu-docs__sort {
        flex: 1 1 auto;
    }

    .chu-docs .chu-docs__sort select {
        width: 100%;
    }

    .chu-docs .chu-doc__main {
        gap: 12px;
        padding: 12px;
    }

    .chu-docs .chu-doc__badge {
        flex-basis: 38px;
        width: 38px;
        height: 47px;
        padding-bottom: 8px;
        font-size: 9.5px;
    }

    .chu-docs .chu-doc__title {
        font-size: 15px;
    }

    /* бутонът става кръгла икона */
    .chu-docs .chu-doc__btn {
        justify-content: center;
        width: 40px;
        padding: 0;
    }

    .chu-docs .chu-doc__btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .chu-docs .chu-doc__files {
        margin-left: 12px;
        margin-right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chu-docs .chu-doc,
    .chu-docs .chu-doc:hover {
        transform: none;
        transition: none;
    }
}
