/*
 * «Сервісний хаб» on /applicant/main, /doctors/main, /patient/main (2026-10): search, «Найчастіше відкривають» and section
 * tiles with panels. Markup: dec_audience_hub() in inc/dec-audience-menus.php; behaviour: js/hub.js.
 * Loaded on those pages only (inc/functions/assets.php). Square corners throughout, like the site's buttons.
 */
.dec-hub {
    --hub-teal: #00A9AF;
    --hub-teal-ink: #007F84;
    --hub-teal-50: #e6f6f7;
    --hub-blue: #006AB6;
    --hub-blue-50: #eaf2fa;
    --hub-ink: #1f2a30;
    --hub-muted: #5d6d76;
    --hub-line: #e3e8ec;
    --hub-bg: #f6f8fa;
    margin-top: 14px;
    color: var(--hub-ink);
}
.dec-hub__lead {
    margin: 0 0 14px;
    color: var(--hub-muted);
    font-size: 16px;
}

/* search */
.dec-hub__field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    margin: 0 0 22px;
    padding: 0 16px;
    border: 1px solid var(--hub-line);
    border-radius: 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 60, 80, .06);
    cursor: text;
}
.dec-hub__field:focus-within {
    border-color: var(--hub-teal);
}
.dec-hub__field .fa {
    color: var(--hub-teal);
    font-size: 18px;
}
.dec-hub__field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
}
.dec-hub__found {
    margin: 0 0 6px;
    color: var(--hub-muted);
    font-size: 14px;
}

.dec-hub__h {
    margin: 4px 0 12px;
    font-family: 'Akrobat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    scroll-margin-top: 72px;
}
.dec-hub__icon {
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 0;
    background: var(--hub-teal-50);
    color: var(--hub-teal-ink);
    font-size: 20px;
}

/* «Найчастіше відкривають» / «Ви найчастіше відкриваєте» */
.dec-hub__popular {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}
.dec-hub__pop {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--hub-line);
    border-radius: 0;
    background: #fff;
    color: var(--hub-ink);
    text-decoration: none;
    transition: box-shadow .2s, border-color .2s, transform .2s;
    -webkit-tap-highlight-color: transparent;
}
.dec-hub__pop:hover,
.dec-hub__pop:focus {
    border-color: var(--hub-teal);
    box-shadow: 0 8px 22px rgba(0, 60, 80, .10);
    color: var(--hub-ink);
    text-decoration: none;
    transform: translateY(-2px);
}
.dec-hub__pop-t {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.dec-hub__pop-s {
    margin-top: auto;
    color: var(--hub-muted);
    font-size: 13px;
}
/* «Ви найчастіше відкриваєте» (js/hub-top.js): the visitor's own links, then a note with «Очистити» */
.dec-hub__popular.dec-hub__popular--mine {
    margin-bottom: 8px;
}
.dec-hub__mine {
    margin: 0 0 24px;
    color: var(--hub-muted);
    font-size: 13px;
}
.dec-hub__forget {
    padding: 0;
    border: 0;
    background: none;
    color: var(--hub-teal-ink);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* section tiles; the panel of a tile follows it in the HTML and is ordered under the tile (phones) or its row */
.dec-hub__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}
.dec-hub__grid > * {
    order: var(--o-m);
}
.dec-hub__tile {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--hub-line);
    border-radius: 0;
    background: #fff;
    color: var(--hub-ink);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .2s, border-color .2s;
    /* js/hub.js scrolls tiles and panels into view: keep them clear of the site's fixed bars */
    scroll-margin-top: 72px;
    -webkit-tap-highlight-color: transparent;
}
.dec-hub__tile:hover {
    color: var(--hub-ink);
    text-decoration: none;
}
.dec-hub__tile[aria-expanded="true"] {
    border-color: var(--hub-teal);
    box-shadow: 0 8px 22px rgba(0, 60, 80, .10);
    background: var(--hub-teal-50);
}
.dec-hub__tile-b {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.dec-hub__tile-t {
    font-family: 'Akrobat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}
.dec-hub__tile-d {
    color: var(--hub-muted);
    font-size: 14px;
    line-height: 1.35;
}
.dec-hub__tile-n {
    color: var(--hub-teal-ink);
    font-size: 13px;
    font-weight: 600;
}
.dec-hub__chev {
    flex: 0 0 auto;
    color: var(--hub-teal);
    font-size: 22px;
    transition: transform .2s;
}
.dec-hub__tile[aria-expanded="true"] .dec-hub__chev {
    transform: rotate(180deg);
}

.dec-hub__panel {
    grid-column: 1 / -1;
    padding: 18px 20px;
    border: 1px solid var(--hub-teal);
    border-radius: 0;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 60, 80, .10);
    scroll-margin-top: 72px;
    scroll-margin-bottom: 16px;
}
.dec-hub.is-ready .dec-hub__panel:not(.is-open) {
    display: none;
}
.dec-hub__panel-h {
    display: none;
}
.dec-hub__sub {
    margin: 16px 0 4px;
    color: var(--hub-blue);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.dec-hub__group:first-child > .dec-hub__sub,
.dec-hub__panel-h + .dec-hub__group > .dec-hub__sub {
    margin-top: 4px;
}
.dec-hub__sub span {
    display: inline-block;
    margin-left: 4px;
    padding: 0 7px;
    border-radius: 0;
    background: var(--hub-blue-50);
    color: var(--hub-blue);
    font-size: 12px;
}
.dec-hub__links {
    margin: 0;
    padding: 0;
    list-style: none;
}
.dec-hub__links li {
    border-bottom: 1px solid var(--hub-line);
}
.dec-hub__links li:last-child {
    border-bottom: 0;
}
.dec-hub__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 4px;
    color: var(--hub-ink);
    text-decoration: none;
}
a.dec-hub__link:hover,
a.dec-hub__link:focus {
    background: var(--hub-bg);
    color: var(--hub-ink);
    text-decoration: none;
}
a.dec-hub__link:hover .dec-hub__link-t,
a.dec-hub__link:focus .dec-hub__link-t {
    color: var(--hub-teal-ink);
}
.dec-hub__link.is-disabled {
    color: var(--hub-muted);
}
.dec-hub__link-t {
    flex: 1;
    font-size: 15px;
    line-height: 1.35;
}
.dec-hub__link-t small {
    display: block;
    margin-top: 2px;
    color: var(--hub-muted);
    font-size: 12px;
}
.dec-hub__arrow {
    color: #a3b1b9;
    font-size: 18px;
}
.dec-hub__badge {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 0;
    background: var(--hub-blue-50);
    color: var(--hub-blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
}
.dec-hub__badge--pdf {
    background: #fdecea;
    color: #b3261e;
}
.dec-hub__badge--site {
    background: #f1f3f4;
    color: var(--hub-muted);
    font-weight: 600;
}
/* «Згорнути розділ» under a long panel (added by js/hub.js) */
.dec-hub__close {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 12px 0 0;
    padding: 10px;
    border: 1px solid var(--hub-line);
    border-radius: 0;
    background: var(--hub-bg);
    color: var(--hub-teal-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.dec-hub__close:hover {
    border-color: var(--hub-teal);
}

.dec-hub__tile:focus,
.dec-hub__close:focus {
    outline: none;
}
.dec-hub__tile:focus-visible,
.dec-hub__pop:focus-visible,
.dec-hub__link:focus-visible,
.dec-hub__close:focus-visible {
    outline: 2px solid var(--hub-teal);
    outline-offset: 2px;
}

/* the hover frame only where there is a mouse: on a phone it would stay on a tile after its panel is closed */
@media (hover: hover) {
    .dec-hub__tile:hover {
        border-color: var(--hub-teal);
        box-shadow: 0 8px 22px rgba(0, 60, 80, .10);
    }
}

@media (min-width: 768px) {
    .dec-hub__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dec-hub__grid > * {
        order: var(--o-d);
    }
    .dec-hub__panel {
        padding: 20px 22px;
    }
    .dec-hub__panel-h {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 10px;
    }
    .dec-hub__panel-h b {
        display: block;
        font-family: 'Akrobat', sans-serif;
        font-size: 22px;
        line-height: 1.1;
    }
    .dec-hub__panel-h span span {
        color: var(--hub-muted);
        font-size: 14px;
    }
}

/* phones: the top links and the sections become compact lists (no sideways scrolling, half the height);
   a section's description stays on wider screens, its name and count are enough here */
@media (max-width: 767.98px) {
    .dec-hub__h {
        margin-bottom: 10px;
    }
    .dec-hub__icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 17px;
    }
    .dec-hub__popular {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        margin-bottom: 22px;
    }
    .dec-hub__pop {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 11px 12px;
    }
    /* neighbours share one border line */
    .dec-hub__pop + .dec-hub__pop,
    .dec-hub__grid > * + * {
        margin-top: -1px;
    }
    .dec-hub__pop:hover,
    .dec-hub__pop:focus {
        position: relative;
        box-shadow: none;
        transform: none;
    }
    .dec-hub__pop::after {
        content: "\f105";
        color: #a3b1b9;
        font: normal 18px/1 FontAwesome;
    }
    .dec-hub__pop-t {
        flex: 1;
        -webkit-line-clamp: 2;
    }
    .dec-hub__pop-s,
    .dec-hub__tile-d {
        display: none;
    }
    .dec-hub__grid {
        gap: 0;
    }
    .dec-hub__tile {
        align-items: center;
        gap: 12px;
        padding: 12px;
    }
    .dec-hub__tile[aria-expanded="true"] {
        position: relative;
        box-shadow: none;
    }
    .dec-hub__tile-b {
        gap: 2px;
    }
    .dec-hub__tile-t {
        font-size: 18px;
    }
    .dec-hub__panel {
        padding: 6px 14px 14px;
        border-top: 0;
        box-shadow: none;
        scroll-margin-bottom: 70px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dec-hub__pop,
    .dec-hub__tile,
    .dec-hub__chev {
        transition: none;
    }
}

@media print {
    .dec-hub__search,
    .dec-hub__results,
    .dec-hub__chev,
    .dec-hub__close,
    .dec-hub__mine {
        display: none !important;
    }
    .dec-hub .dec-hub__panel {
        display: block !important;
        box-shadow: none;
    }
}
