/* --- Layout --- */
.gallery-new-bottom{
    --gap: 24px;
    --pad: 10px;              /* mezera mezi linkou a fotkou */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    padding: 8px;
}


.gallery-item-bottom{
    display: flex;
    align-items: center;
    justify-content: center;
    /*border: 1px solid #000;*/
    /*padding: 10px;*/
    aspect-ratio: 1 / 1;
    background: #fff;
    overflow: hidden;
    text-decoration: none;   /* odstraní podtržení odkazu */
    color: inherit;          /* zdědí barvu textu (kdyby někdy) */
}


/* --- Obrázek --- */
.gallery-item-bottom img{
    width: 100%;
    height: 100%;
    object-fit: contain;         /* fotka se vejde celá */
    transition: transform .45s ease, filter .45s ease;
    backface-visibility: hidden;
    display: block;
}

.gallery-item-bottom:hover img{
    transform: scale(1.03);
    filter: brightness(1.15);
}

/* --- Responzivita --- */
@media (max-width: 1080px){
    .gallery-new-bottom{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
    .gallery-new-bottom{ grid-template-columns: repeat(2, 1fr); }
}


/* Overlay + centrální kontejner */
.glb-overlay{
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    z-index: 9999;
}
.glb-stage{
    position: fixed; /* lepší pro overlay než absolute, ať se chová k viewportu */
    inset: 64px;
    display: grid;
    place-items: center;
}
@media (max-width: 640px){
    .glb-stage{ inset: 56px 12px 72px; }
}

/* Obrázek */
.glb-img-wrap{
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden; /* může zůstat kvůli případnému zoomu */
}
.glb-img{
    width: 100%;
    height: 100%;
    object-fit: contain;        /* ZABRÁNÍ ořezu */
    transform-origin: center center;
    transition: transform .25s ease;
    will-change: transform;
    display: block;

}


/* Mobilní insety */
@media (max-width: 640px){
    .glb-stage{ inset: 56px 12px 72px; }
}

/* Ovládací lišta */
.glb-ui{
    position: absolute; top: 8px; right: 8px; left: 8px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; pointer-events: none;
}
.glb-left, .glb-right{
    display: flex; gap: 6px; align-items: center;
}
.glb-btn{
    pointer-events: auto;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(0,0,0,.35);
    color: #fff; font: 500 14px/1.1 system-ui, -apple-system, Segoe UI, Roboto, Arial;
    padding: 10px 12px; border-radius: 8px;
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none;
    transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}
.glb-btn:hover{ background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.6); }
.glb-btn:active{ transform: translateY(1px); }
.glb-btn svg{ width: 18px; height: 18px; fill: currentColor; }

/* Šipky (vedle obrázku) */
.glb-nav{
    pointer-events: none;
}
.glb-arrow{
    pointer-events: auto;
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(0,0,0,.35);
    color: #fff; display: grid; place-items: center;
    cursor: pointer;
}
.glb-arrow:hover{ background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.6); }
.glb-prev{ left: 12px; }
.glb-next{ right: 12px; }

/* Spodní info */
.glb-footer{
    position: absolute; bottom: 10px; left: 12px; right: 12px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    color: #fff; font: 500 13px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial;
    opacity: .9;
}
.glb-caption{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glb-counter{ opacity: .85; }

/* Kliknutí mimo obrázek = zavřít */
.glb-overlay-close{
    position: absolute; inset: 0;
}

/* Skrytý (pro animace, pokud bys později chtěl) */
.glb-hidden{ display: none; }




/* ===== Career Modal (cm-) ===== */
.cm-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    z-index: 9990;
}

.cm-overlay[aria-hidden="false"]{ display: flex; }

.cm-modal{
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    max-width: min(860px, 92vw);
    width: 860px;

    /* přidáno kvůli vnitřnímu scrollu */
    display: flex;
    flex-direction: column;

    /* max výška modalu podle stránky */
    max-height: min(92vh, 100dvh - 40px); /* 40px rezerva od okrajů */
    /* alternativně: max-height: calc(100dvh - 40px); */

    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 2px 10px rgba(0,0,0,.08);
    overflow: hidden; /* nechť přeteče jen .cm-body */
    z-index: 10000;
    font-family: "Roboto Condensed", sans-serif;
    color: #151718;
}


.cm-header{
    position: sticky; top: 0; z-index: 2;

}

.cm-title{
    margin: 0; line-height: 1.2;
    font-weight: 700;
    font-size: clamp(22px, 2.6vw, 28px);
    padding-right: 48px;
    margin: 22px;
    font-family: "Roboto Condensed",sans-serif !important;
    margin-bottom: 22px !important;
}

.cm-close{
    position: absolute; top: 12px; right: 12px;
    width: 40px; height: 40px;
    background: #111; color: #fff;
    display: grid; place-items: center;
    border: 0; cursor: pointer;
    z-index: 5000;
    border-radius: 0px;
}
.cm-close:hover{ filter: brightness(1.07); }
.cm-close:focus-visible{ outline: 3px solid #0f62fe; outline-offset: 2px; }
.cm-close svg{ width: 18px; height: 18px; }

.cm-body{
    padding: 18px 22px 20px 22px;


    /* klíčové: ať roste a scrolluje se jen obsah */
    flex: 1 1 auto;
    min-height: 0;           /* nutné pro správné shrinknutí uvnitř flexu */
    overflow: auto;
}

.cm-intro{ color: #666b70; margin-top: -4px; }

/* tabulka uvnitř modalu */
.cm-details{
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e7eaee;
    border-radius: 10px;
    overflow: hidden;
    font-size: 15px;
}
.cm-details th, .cm-details td{
    padding: 12px 14px; vertical-align: top;
}
.cm-details thead th{
    text-align: left; background: #fafbfc;
    border-bottom: 1px solid #e7eaee; font-weight: 500 !important;
    color: black !important;
    width: unset !important;
}
.cm-details tbody tr + tr td{ border-top: 1px solid #eef1f4; }
.cm-details tbody th{
    width: 32%; color: #2c2f33; background: #fcfdff;
    font-weight: 500;
    border-right: 1px solid #eef1f4;
}

.cm-details tbody td {
    font-weight: normal !important;
    font-size: 1.2em !important;
}

@media (max-width: 560px){
    .cm-details tbody th{ width: 40%; }
}


table.cm-details th{
    width: unset;

}

.cm-body table th{
    font-size: 1.5rem !important;
    width: unset !important;
}

.cm-body table th:first-child{
    width: 30% !important;
}

.cm-body table td{
    font-size: 1.5rem !important;
}



.main .work-offers .flex-holder table tbody tr td.cons {
    color: #8D097B
}
.main .work-offers .flex-holder table tbody tr td.group {
    color: silver
}


.main .work-offers .flex-holder table tbody tr td.inv{
    color: #d03320 !important;
}