/* =========================================
   category_map.css – Mobile Accordion + Desktop Directory
   - Mobil: egy oszlop, lenyitható fő kategóriák (UX barát)
   - Desktop: bal/jobb directory + right safe area
   - Nincs extra bold
   ========================================= */

.cd {
    --cd-text: rgba(17, 24, 39, .94);
    --cd-muted: rgba(107, 114, 128, 1);
    --cd-line: rgba(15, 23, 42, .08);
    --cd-line2: rgba(15, 23, 42, .14);

    --cd-surface: rgba(255, 255, 255, .98);
    --cd-surface2: rgba(248, 250, 252, .98);

    --cd-accent: rgba(245, 158, 11, .95);

    --cd-r: 12px;
    --cd-r2: 10px;

    --cd-gutter: 16px;
    --cd-gutter-desktop: 22px;

    --cd-left-w: 380px;
    --cd-right-safe: 96px;

    max-width: 1200px;
    margin: 18px auto 0;
    padding: 0 var(--cd-gutter);

    content-visibility: auto;
    contain-intrinsic-size: 520px;
}

@media (max-width:640px) {
    .cd {
        margin-top: 14px;
        padding: 0 12px;
    }
}

/* Full-bleed desktop */
@media (min-width: 1024px) {
    .cd.cd--fullbleed {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: 0;
        max-width: none;

        padding-left: var(--cd-gutter-desktop);
        padding-right: var(--cd-gutter-desktop);
    }
}

.cd-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.cd-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -.01em;
    color: var(--cd-text);
}

.cd-sub {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--cd-muted);
}

/* =============== MOBILE accordion =============== */
.cd-mobile {
    display: block;
}

.cd-acc {
    border: 1px solid var(--cd-line);
    border-radius: var(--cd-r);
    background: var(--cd-surface);
    overflow: hidden;
}

.cd-acc+.cd-acc {
    margin-top: 10px;
}

.cd-accHead {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 14px 14px;
    color: var(--cd-text);
}

.cd-accName {
    font-size: 14.5px;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-accBadges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.cd-pill {
    height: 22px;
    min-width: 34px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .98);
    font-size: 11px;
    font-weight: 450;
    color: rgba(15, 23, 42, .82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cd-pill--soft {
    opacity: .58;
    background: var(--cd-surface2);
}

.cd-accChevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(17, 24, 39, .55);
    border-bottom: 2px solid rgba(17, 24, 39, .55);
    transform: rotate(45deg);
    transition: transform .18s ease;
    flex: 0 0 auto;
}

.cd-acc.is-open .cd-accChevron {
    transform: rotate(-135deg);
}

.cd-accBody {
    padding: 0 14px 14px;
    border-top: 1px solid rgba(15, 23, 42, .06);
}

.cd-accActions {
    padding: 12px 0 10px;
}

.cd-openAll {
    text-decoration: none;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 12.5px;
    color: rgba(15, 23, 42, .90);
    background: transparent;
    display: inline-flex;
}

.cd-subGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cd-subGrid--mobile {
    grid-template-columns: minmax(0, 1fr);
}

.cd-sub {
    text-decoration: none;
    color: var(--cd-text);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: var(--cd-r2);
    background: var(--cd-surface2);
    padding: 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

.cd-subName {
    font-weight: 500;
    font-size: 13.5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-subBadges {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex: 0 0 auto;
}

.cd-subBadge {
    height: 22px;
    min-width: 34px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .98);
    font-size: 11px;
    font-weight: 450;
    color: rgba(15, 23, 42, .82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cd-subBadge--soft {
    opacity: .58;
}

.cd-moreRow {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.cd-more {
    text-decoration: none;
    border: 1px dashed rgba(15, 23, 42, .16);
    border-radius: 12px;
    padding: 10px 12px;
    color: rgba(15, 23, 42, .88);
    font-weight: 500;
    background: transparent;
}

.cd-empty {
    margin: 0;
    padding: 10px 0 0;
    color: var(--cd-muted);
    font-size: 12px;
}

/* =============== DESKTOP directory =============== */
.cd-layout {
    display: none;
}

@media (min-width: 981px) {
    .cd-mobile {
        display: none;
    }

    .cd-layout {
        display: grid;
        grid-template-columns: var(--cd-left-w) minmax(0, 1fr);
        gap: 14px;
        align-items: start;
    }

    .cd-left {
        border: 1px solid var(--cd-line);
        border-radius: var(--cd-r);
        background: var(--cd-surface);
        overflow: hidden;
        contain: content;
    }

    .cd-leftList {
        display: flex;
        flex-direction: column;
    }

    .cd-root {
        appearance: none;
        border: 0;
        border-top: 1px solid rgba(15, 23, 42, .06);
        background: transparent;
        width: 100%;
        text-align: left;
        cursor: pointer;

        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;

        padding: 14px 14px;
        color: var(--cd-text);
    }

    .cd-root:first-child {
        border-top: 0;
    }

    .cd-rootName {
        font-weight: 500;
        font-size: 13px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cd-badges {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .cd-badge {
        height: 22px;
        min-width: 34px;
        padding: 0 8px;
        border-radius: 999px;
        border: 1px solid rgba(15, 23, 42, .10);
        background: rgba(255, 255, 255, .98);
        font-size: 11px;
        font-weight: 450;
        color: rgba(15, 23, 42, .82);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cd-badge--soft {
        opacity: .58;
        background: var(--cd-surface2);
    }

    .cd-root.is-active {
        background: rgba(15, 23, 42, .02);
        position: relative;
    }

    .cd-root.is-active::before {
        content: "";
        position: absolute;
        left: 0;
        top: 12px;
        bottom: 12px;
        width: 3px;
        border-radius: 999px;
        background: var(--cd-accent);
    }

    .cd-right {
        border: 1px solid var(--cd-line);
        border-radius: var(--cd-r);
        background: var(--cd-surface);
        overflow: hidden;
        contain: content;
    }

    .cd-panel {
        padding: 14px;
    }

    .cd-panelHead {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 2px 12px;
        border-bottom: 1px solid rgba(15, 23, 42, .06);
        margin-bottom: 12px;
    }

    /* Safe area a floating gombok miatt (desktop) */
    .cd-panel {
        padding-right: calc(14px + var(--cd-right-safe));
    }

    .cd-panelTitle {
        margin: 0;
        font-size: 15px;
        font-weight: 520;
        color: var(--cd-text);
    }

    .cd-panelMeta {
        margin-top: 6px;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        color: var(--cd-muted);
        font-size: 12.5px;
    }

    .cd-panelMeta strong {
        font-weight: 520;
        color: var(--cd-text);
    }

    .cd-subGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cd {
        content-visibility: visible;
    }

    .cd-accChevron {
        transition: none;
    }
}