/* =========================================================================
   Dokumenty ČFB
   ========================================================================= */

/* ---------- hero ---------- */

.docs-hero { position: relative; overflow: hidden; background: var(--navy-deep); color: var(--white); isolation: isolate; }
.docs-hero-media { position: absolute; inset: 0 0 0 auto; width: 60%; z-index: -1; }
.docs-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; display: block; }
.docs-hero-media::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--navy-deep) 0%, rgba(11, 29, 51, .8) 30%, rgba(11, 29, 51, .3) 70%, rgba(11, 29, 51, .15) 100%);
}
.docs-hero-inner { min-height: 172px; padding-top: 26px; padding-bottom: 22px; display: flex; flex-direction: column; justify-content: center; }
.docs-hero h1 { margin: 0 0 6px; font-size: clamp(32px, 4.2vw, 58px); font-weight: 800; line-height: 1; text-transform: uppercase; }
.docs-hero h1 span { color: var(--gold); }
.docs-hero p { margin: 0 0 14px; font-size: clamp(16px, 1.3vw, 19px); font-weight: 500; }
.docs-hero .breadcrumb ol { margin: 0; }

/* ---------- rozvržení ---------- */

.docs-layout {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr) 328px;
    gap: 16px;
    align-items: start;
    margin-top: 14px;
}
.docs-left, .docs-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.docs-main { min-width: 0; padding: 10px; border: 1px solid #E5E5E5; border-radius: var(--radius-card); background: var(--white); scroll-margin-top: 12px; transition: opacity .2s; }
.docs-main.is-loading { opacity: .45; pointer-events: none; }

.docs-box {
    padding: 12px;
    border: 1px solid #E5E5E5; border-radius: var(--radius-card);
    background: var(--white);
    box-shadow: 0 1px 3px rgba(16, 40, 70, .05);
}
.docs-box .section-title { font-size: 16px; margin: 4px 4px 10px; }

/* ---------- kategorie ---------- */

.cat-box > summary { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 8px; list-style: none; cursor: default; }
.cat-box > summary::-webkit-details-marker { display: none; }
.cat-box > summary h2 { margin: 0; font-size: 15px; font-weight: 800; }
.cat-box > summary i { display: none; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { border-top: 1px solid #F0F1F3; }
.cat-list a, .cat-list .is-empty {
    display: flex; align-items: center; gap: 12px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13.5px; color: var(--text); text-decoration: none;
}
.cat-list a:hover { background: #F4F5F7; }
.cat-list i { width: 18px; text-align: center; color: #8C939C; }
.cat-list span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-list b {
    min-width: 24px; padding: 1px 7px; border-radius: 10px;
    background: #EEF0F3; text-align: center;
    font-size: 11px; font-weight: 700; color: #4A525C;
}
.cat-list a.is-active { background: var(--navy); color: var(--white); font-weight: 700; }
.cat-list a.is-active i { color: var(--gold-light); }
.cat-list a.is-active b { background: rgba(255, 255, 255, .2); color: var(--white); }
.cat-list li:has(a.is-active) + li, .cat-list li:has(+ li > a.is-active) { border-color: transparent; }
.cat-list .is-empty { color: #A3A9B1; }

.useful-links { list-style: none; margin: 0; padding: 0; }
.useful-links li + li { border-top: 1px solid #F0F1F3; }
.useful-links a { display: flex; align-items: center; gap: 12px; padding: 9px 8px; font-size: 13.5px; color: var(--navy); text-decoration: none; }
.useful-links a > i:first-child { width: 18px; text-align: center; color: #6B7A8C; }
.useful-links span { flex: 1; }
.useful-links .ext { font-size: 11px; color: var(--navy); }
.useful-links a:hover span { text-decoration: underline; }

/* ---------- nástrojová lišta ---------- */

.docs-toolbar { display: flex; gap: 10px; margin-bottom: 8px; }
.docs-search { position: relative; flex: 1; min-width: 0; display: block; }
.docs-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--navy); pointer-events: none; }
.docs-search input, .docs-select select {
    width: 100%; height: 40px;
    border: 1px solid #DCDCDC; border-radius: var(--radius-btn);
    background: var(--white); font: 500 14px var(--font); color: var(--text);
}
.docs-search input { padding: 0 12px 0 40px; }
.docs-select { position: relative; flex: 0 0 auto; display: block; }
.docs-select select { appearance: none; -webkit-appearance: none; padding: 0 34px 0 12px; cursor: pointer; }
.docs-select > i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; pointer-events: none; }
.docs-search input:focus, .docs-select select:focus { outline: none; border-color: var(--navy); box-shadow: var(--focus); }

.docs-results-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 4px 8px; }
.docs-count { margin: 0; font-size: 14px; color: var(--text-muted); }
.docs-count strong { color: var(--text); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.active-filters a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 10px; border-radius: 14px;
    background: #FDF3DF; border: 1px solid #F0D9AA;
    font-size: 12.5px; font-weight: 600; color: var(--navy-deep); text-decoration: none;
}
.active-filters a i { font-size: 11px; opacity: .7; }
.active-filters .clear-filters { background: none; border-color: transparent; color: var(--navy); text-decoration: underline; }

/* ---------- seznam dokumentů ---------- */

.docs-list { list-style: none; margin: 0; padding: 0; }
.doc-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 126px auto;
    gap: 6px 18px; align-items: center;
    padding: 13px 10px;
    border-top: 1px solid #EEF0F2;
    transition: background-color .15s;
}
.doc-row:first-child { border-top: 0; }
.doc-row:hover { background: #FAFAFB; }
.doc-type {
    width: 32px; height: 36px;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 5px;
    border-radius: 4px 10px 4px 4px;
    background: #8C939C; color: var(--white);
    font-size: 9.5px; font-weight: 800; letter-spacing: .02em;
    box-shadow: inset -7px 7px 0 -4px rgba(255, 255, 255, .35);
}
.doc-type-pdf { background: var(--red); }
.doc-type-doc { background: #2B579A; }
.doc-type-xls { background: #217346; }
.doc-type-ppt { background: #C43E1C; }
.doc-main { min-width: 0; }
.doc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 14.5px; font-weight: 800; line-height: 1.3; }
.doc-title > a:first-child { color: var(--text); text-decoration: none; }
.doc-title > a:first-child:hover { color: var(--navy); text-decoration: underline; }
.doc-cat {
    padding: 2px 10px; border-radius: 6px;
    background: #EEF0F3; color: #4A525C;
    font-size: 11.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.doc-cat:hover { background: #E2E6EB; }
.doc-desc { margin: 3px 0 0; font-size: 13px; color: var(--text-muted); }
.doc-meta { display: flex; flex-direction: column; gap: 1px; margin: 0; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.doc-actions { display: flex; align-items: center; gap: 6px; }
.doc-download { min-height: 36px; padding: 0 16px; font-size: 13.5px; }
.doc-preview {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-btn); border: 1px solid #DCDCDC;
    color: var(--navy); text-decoration: none;
}
.doc-preview:hover { border-color: var(--navy); background: #F4F5F7; }

.docs-empty { padding: 44px 20px; text-align: center; }
.docs-empty > i { font-size: 32px; color: var(--gold-dark); }
.docs-empty h2 { margin: 10px 0 4px; font-size: 19px; }
.docs-empty p { margin: 0 0 16px; color: var(--text-muted); }

/* ---------- pravý panel ---------- */

.box-title { display: flex; align-items: center; gap: 10px; margin: 4px 6px 8px; font-size: 15px; font-weight: 800; }
.box-title i { color: var(--gold-dark); font-size: 18px; }
.featured-docs { list-style: none; margin: 0; padding: 0; }
.featured-docs li + li { border-top: 1px solid #F0F1F3; }
.featured-docs a { display: flex; align-items: center; gap: 12px; padding: 8px 8px; font-size: 13.5px; color: var(--text); text-decoration: none; }
.featured-docs a > i:first-child { color: #8C939C; width: 18px; text-align: center; }
.featured-docs span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.featured-docs small { font-size: 11px; color: var(--text-muted); }
.featured-docs a > i:last-child { font-size: 12px; color: var(--navy); transition: transform .15s; }
.featured-docs a:hover span { color: var(--navy); }
.featured-docs a:hover > i:last-child { transform: translateX(3px); }

.help-box { padding: 16px; }
.help-head { display: flex; gap: 14px; margin-bottom: 14px; }
.help-ico {
    flex: none; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--gold-gradient); color: var(--white); font-size: 17px;
}
.help-head h2 { margin: 0 0 3px; font-size: 16px; }
.help-head p { margin: 0; font-size: 13px; color: var(--text-muted); }
.btn-block { width: 100%; }

.forms-promo {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    min-height: 150px; padding: 22px 22px 18px;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: linear-gradient(135deg, #F7E3B4 0%, #E3BC82 55%, #B88452 100%);
    color: var(--navy-deep); text-decoration: none;
}
.forms-promo b { position: relative; font-size: 18px; }
.forms-promo > span:not(.forms-promo-btn) { position: relative; max-width: 60%; font-size: 13px; }
.forms-promo-art {
    position: absolute; right: -10px; top: 6px;
    font-size: 120px; color: rgba(16, 40, 70, .12);
    transform: rotate(-20deg); pointer-events: none;
}
.forms-promo-btn {
    position: relative;
    display: inline-flex; align-items: center; gap: 9px;
    margin-top: 8px; padding: 8px 18px;
    border-radius: var(--radius-btn);
    background: var(--white); font-size: 13.5px; font-weight: 700;
    box-shadow: 0 2px 8px rgba(80, 52, 20, .2);
    transition: gap .15s;
}
.forms-promo:hover .forms-promo-btn { gap: 13px; }

/* =========================================================================
   Responzivita
   ========================================================================= */

@media (max-width: 1280px) {
    .docs-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .docs-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
    .doc-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .doc-meta { grid-column: 2; grid-row: 2; flex-direction: row; gap: 14px; }
    .doc-actions { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 900px) {
    .docs-layout { grid-template-columns: minmax(0, 1fr); }
    /* pořadí: kategorie → dokumenty → pravý panel → užitečné odkazy */
    .docs-left { display: contents; }
    .cat-box { order: 1; }
    .docs-main { order: 2; }
    .docs-right { order: 3; }
    .links-box { order: 4; }
    .docs-right { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .docs-right > .docs-box:first-child { grid-column: 1 / -1; }

    /* kategorie jako rozbalovací panel */
    .cat-box > summary { cursor: pointer; padding: 4px 6px; }
    .cat-box > summary i { display: block; transition: transform .2s; }
    .cat-box[open] > summary { padding-bottom: 8px; }
    .cat-box[open] > summary i { transform: rotate(180deg); }
}

@media (max-width: 640px) {
    .docs-main { padding: 8px; }
    .docs-toolbar { flex-wrap: wrap; }
    .docs-search { flex: 1 1 100%; }
    .docs-select { flex: 1 1 0; }
    .docs-select select { text-overflow: ellipsis; }

    .doc-row { grid-template-columns: 30px minmax(0, 1fr); gap: 6px 12px; padding: 12px 6px; }
    .doc-type { width: 28px; height: 32px; font-size: 8.5px; }
    .doc-meta { grid-column: 2; grid-row: auto; }
    .doc-actions { grid-column: 2; grid-row: auto; }
    .doc-download { flex: 1; }

    .docs-right { grid-template-columns: minmax(0, 1fr); }
}
