/*
 * Single pages and file blocks (2026-10): the line under the title (template-parts/entry-meta.php), the file block
 * (mu-plugins/dec-shortcodes/doc-block.php) with the document view right on the page, «Інші матеріали розділу»
 * (template-parts/related-materials.php), compact breadcrumbs on phones. Behaviour: js/doc.js. Square corners.
 * Loaded on every page but the home page (inc/functions/assets.php).
 */
.dec-meta,
.dec-doc,
.dec-related {
    --d-teal: #00A9AF;
    --d-teal-ink: #007F84;
    --d-blue: #006AB6;
    --d-blue-ink: #00538f;
    --d-ink: #1f2a30;
    --d-muted: #5d6d76;
    --d-line: #e3e8ec;
    --d-bg: #f6f8fa;
}

/* the line under the title */
.dec-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin: 0 0 24px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--d-line);
    color: var(--d-muted);
    font-size: 14px;
}
.dec-meta__i .fa {
    margin-right: 6px;
    color: var(--d-teal-ink);
}
.dec-meta__tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.dec-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    min-width: 34px;
    padding: 0 12px;
    border: 1px solid var(--d-line);
    border-radius: 0;
    background: #fff;
    color: var(--d-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
.dec-tool:hover,
.dec-tool:focus {
    border-color: var(--d-teal);
    color: var(--d-ink);
    text-decoration: none;
}
.dec-tool .fa {
    color: var(--d-teal-ink);
}
.dec-share {
    position: relative;
}
.dec-share > summary {
    list-style: none;
}
.dec-share > summary::-webkit-details-marker {
    display: none;
}
.dec-share[open] > summary {
    border-color: var(--d-teal);
}
.dec-share__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    min-width: 240px;
    padding: 6px 0;
    border: 1px solid var(--d-line);
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 60, 80, .14);
}
.dec-share__menu a,
.dec-share__menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--d-ink);
    font: inherit;
    font-size: 15px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.dec-share__menu a:hover,
.dec-share__menu a:focus,
.dec-share__menu button:hover,
.dec-share__menu button:focus {
    background: var(--d-bg);
    color: var(--d-ink);
    text-decoration: none;
}
.dec-share__menu .fa {
    width: 18px;
    color: var(--d-teal-ink);
    text-align: center;
}
.dec-share__menu .fa-facebook-official {
    color: #1877f2;
}
.dec-share__menu .fa-telegram {
    color: #229ed9;
}

/* the file block */
.dec-doc {
    margin: 0 0 10px;
    border: 1px solid var(--d-line);
    background: #fff;
    color: var(--d-ink);
}
.dec-doc__head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
}
.dec-doc__fmt {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    background: #6b7a83;
    color: #fff;
    font: 700 14px/1 'Akrobat', sans-serif;
    letter-spacing: .6px;
}
.dec-doc__fmt--pdf {
    background: #c62828;
}
.dec-doc__fmt--doc {
    background: #1e5bb8;
}
.dec-doc__fmt--xls {
    background: #1e7e45;
}
.dec-doc__fmt--ppt {
    background: #c4511a;
}
.dec-doc--missing .dec-doc__fmt {
    background: #b26a00;
}
.dec-doc__t {
    flex: 1;
    min-width: 0;
}
.dec-doc__t b {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.dec-doc__t em {
    display: block;
    margin-top: 2px;
    font-size: 14px;
}
.dec-doc__t span {
    display: block;
    margin-top: 3px;
    color: var(--d-muted);
    font-size: 13px;
}
.dec-doc__a {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
}
.dec-doc__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--d-blue);
    border-radius: 0;
    background: #fff;
    color: var(--d-blue);
    font: 700 16px/1 'Akrobat', sans-serif;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}
.dec-doc__btn:hover,
.dec-doc__btn:focus {
    border-color: var(--d-blue-ink);
    color: var(--d-blue-ink);
    text-decoration: none;
}
.dec-doc__btn--primary {
    background: var(--d-blue);
    color: #fff;
}
.dec-doc__btn--primary:hover,
.dec-doc__btn--primary:focus {
    background: var(--d-blue-ink);
    color: #fff;
}
.dec-doc__btn--icon {
    width: 42px;
    padding: 0;
}
.dec-doc__btn--icon[aria-expanded="true"] {
    background: var(--d-blue);
    color: #fff;
}
.dec-doc__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border: 0;
    border-top: 1px solid var(--d-line);
    border-radius: 0;
    background: var(--d-bg);
    color: var(--d-teal-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.dec-doc__toggle[hidden] {
    display: none;
}
.dec-doc__toggle:hover {
    background: #eef3f5;
}
.dec-doc__toggle .fa-angle-down {
    transition: transform .2s;
}
.dec-doc__toggle[aria-expanded="true"] .fa-angle-down {
    transform: rotate(180deg);
}
.dec-doc__viewer {
    border-top: 1px solid var(--d-line);
    background: #525659;
}
.dec-doc__vbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    background: #323639;
    color: #e8eaed;
    font-size: 13px;
}
.dec-doc__vbar span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dec-doc__vbar a,
.dec-doc__vbar button {
    padding: 0;
    border: 0;
    background: none;
    color: #e8eaed;
    font: inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.dec-doc__vbar a:hover,
.dec-doc__vbar button:hover {
    color: #fff;
    text-decoration: underline;
}
.dec-doc__frame {
    position: relative;
    height: 82vh;
    min-height: 420px;
    max-height: 900px;
}
.dec-doc__frame::before {
    content: "Завантажуємо документ…";
    position: absolute;
    top: 45%;
    left: 0;
    right: 0;
    color: #d5d9dc;
    font-size: 14px;
    text-align: center;
}
.dec-doc__frame iframe {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* «Інші матеріали розділу» */
.dec-related {
    margin: 40px 0 0;
    color: var(--d-ink);
}
.dec-related__h {
    position: relative;
    margin: 0 0 12px;
    padding-left: 12px;
    font: 700 20px/1.2 'Akrobat', sans-serif;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.dec-related__h::before {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    width: 4px;
    background: var(--d-teal);
}
.dec-related__list {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--d-line);
    list-style: none;
}
.dec-related__list a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--d-line);
    color: var(--d-ink);
    text-decoration: none;
}
.dec-related__list a:hover,
.dec-related__list a:focus {
    background: var(--d-bg);
    color: var(--d-ink);
    text-decoration: none;
}
.dec-related__d {
    flex: 0 0 auto;
    color: var(--d-muted);
    font-size: 13px;
}
.dec-related__t {
    flex: 1;
    font-size: 15px;
}
.dec-related__list .fa {
    color: #a3b1b9;
}
.dec-related__all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--d-teal-ink);
    font-weight: 600;
}
.dec-related__all:hover,
.dec-related__all:focus {
    color: var(--d-teal-ink);
}

.dec-tool:focus,
.dec-doc__toggle:focus {
    outline: none;
}
.dec-tool:focus-visible,
.dec-doc__btn:focus-visible,
.dec-doc__toggle:focus-visible,
.dec-share__menu a:focus-visible,
.dec-share__menu button:focus-visible,
.dec-related__list a:focus-visible {
    outline: 2px solid var(--d-teal);
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    .dec-meta {
        gap: 6px 16px;
    }
    .dec-meta__tools {
        width: 100%;
        margin-left: 0;
    }
    .dec-meta__tools [data-dec-print] {
        display: none;
    }
    .dec-share__menu {
        right: auto;
        left: 0;
    }
    .dec-doc__head {
        flex-wrap: wrap;
        gap: 12px 14px;
    }
    .dec-doc__a {
        width: 100%;
    }
    .dec-doc__a .dec-doc__btn--primary {
        flex: 1;
    }
    .dec-related__list a {
        flex-wrap: wrap;
        gap: 2px 12px;
    }
    .dec-related__d {
        width: 100%;
    }
    /* breadcrumbs: just the way back to the section */
    .breadcrumb .breadcrumb-item {
        display: none;
    }
    .breadcrumb .breadcrumb-item:nth-last-child(2) {
        display: block;
        padding-left: 0;
    }
    .breadcrumb .breadcrumb-item:nth-last-child(2)::before {
        content: "\f104";
        padding-right: 8px;
        color: #007F84;
        font-family: FontAwesome;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dec-doc__toggle .fa-angle-down {
        transition: none;
    }
}

@media print {
    .dec-doc__a,
    .dec-doc__toggle,
    .dec-doc__viewer,
    .dec-meta__tools {
        display: none !important;
    }
}
