.garage-work-gallery {
    --work-gallery-accent: #f5b41a;
    --work-gallery-height: clamp(380px, 43vw, 580px);
    width: 100%;
    min-width: 0;
    margin-block: 40px;
    color: #fff;
}
.garage-work-gallery .garage-work-gallery__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 252px;
    gap: 20px;
    align-items: start;
}
.garage-work-gallery .garage-work-gallery__stage {
    position: relative;
    min-width: 0;
    height: var(--work-gallery-height);
    overflow: hidden;
    border: 1px solid #555659;
    border-radius: 18px;
    background: #151617;
    touch-action: pan-y pinch-zoom;
}
.garage-work-gallery button {
    box-sizing: border-box;
    appearance: none;
    font: inherit;
    cursor: pointer;
}
.garage-work-gallery [data-gallery-open] {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 12px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    cursor: zoom-in;
    touch-action: pan-y pinch-zoom;
}
.garage-work-gallery .garage-work-gallery__expand {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #777;
    border-radius: 8px;
    background: rgb(21 22 23 / 85%);
    color: #fff;
    font-size: 25px;
    line-height: 1;
    pointer-events: none;
}
.garage-work-gallery img[data-gallery-image] {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    user-select: none;
}
.garage-work-gallery [data-gallery-thumbs] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-height: var(--work-gallery-height);
    min-width: 0;
    padding: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #867449 #262628;
}
.garage-work-gallery [data-gallery-thumbs] > button {
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    aspect-ratio: 3 / 4;
    margin: 0;
    padding: 3px;
    border: 2px solid #555659;
    border-radius: 9px;
    background: #151617;
}
.garage-work-gallery [data-gallery-thumbs] > button[aria-current="true"] {
    border-color: var(--work-gallery-accent);
    box-shadow: 0 0 0 1px var(--work-gallery-accent);
}
.garage-work-gallery [data-gallery-thumbs] img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.garage-work-gallery :is([data-gallery-prev], [data-gallery-next], [data-gallery-close]) {
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 6px;
    border: 1px solid #f5b41a;
    border-radius: 50%;
    background: #f5b41a;
    color: #202122;
    font-size: 26px;
    line-height: 1;
}
.garage-work-gallery :is([data-gallery-prev], [data-gallery-next], [data-gallery-close]):hover {
    background: #ffd166;
}
.garage-work-gallery .garage-work-gallery__stage :is([data-gallery-prev], [data-gallery-next]) {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.garage-work-gallery .garage-work-gallery__stage [data-gallery-prev] { left: 12px; }
.garage-work-gallery .garage-work-gallery__stage [data-gallery-next] { right: 12px; }
.garage-work-gallery button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}
.garage-work-gallery [data-gallery-open]:focus-visible {
    outline-offset: -5px;
}
.garage-work-gallery .garage-work-gallery__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 20px;
    margin-top: 14px;
}
.garage-work-gallery [data-gallery-caption] {
    flex: 1 1 220px;
    margin: 0;
    color: #ddd;
    font-size: 15px;
    line-height: 1.5;
}
.garage-work-gallery [data-gallery-counter] {
    flex: 0 0 auto;
    margin: 0;
    color: #ffd166;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.garage-work-gallery [data-gallery-dialog] {
    box-sizing: border-box;
    position: fixed;
    width: min(1260px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid #777;
    border-radius: 16px;
    background: #151617;
    color: #fff;
    overscroll-behavior: contain;
}
.garage-work-gallery [data-gallery-dialog]::backdrop { background: rgb(0 0 0 / 86%); }
.garage-work-gallery [data-gallery-dialog][open] { display: grid; }
.garage-work-gallery .garage-work-gallery__dialog-shell { position: relative; }
.garage-work-gallery [data-gallery-dialog-image] {
    box-sizing: border-box;
    display: block;
    width: 100% !important;
    height: min(76vh, 820px);
    height: min(76dvh, 820px) !important;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    margin: 0;
    padding: 12px 56px;
    object-fit: contain !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}
.garage-work-gallery [data-gallery-dialog] [data-gallery-close] {
    position: absolute;
    top: 10px;
    right: 10px;
}
.garage-work-gallery [data-gallery-dialog] :is([data-gallery-prev], [data-gallery-next]) {
    position: absolute;
    top: calc(50% - 22px);
}
.garage-work-gallery [data-gallery-dialog] [data-gallery-prev] { left: 10px; }
.garage-work-gallery [data-gallery-dialog] [data-gallery-next] { right: 10px; }
.garage-work-gallery [data-gallery-dialog] [data-gallery-counter] {
    min-height: 26px;
    padding: 10px 18px;
    text-align: center;
}
.garage-work-gallery :is([data-gallery-prev], [data-gallery-next], [data-gallery-counter]) { display: none; }
.garage-work-gallery.is-ready :is([data-gallery-prev], [data-gallery-next]) { display: grid; }
.garage-work-gallery.is-ready [data-gallery-counter] { display: block; }
.garage-work-gallery:not(.is-ready) .garage-work-gallery__layout { grid-template-columns: minmax(0, 1fr); }
.garage-work-gallery:not(.is-ready) [data-gallery-thumbs] { display: none; }
.garage-work-gallery [hidden] { display: none !important; }
@media (max-width: 900px) {
    .garage-work-gallery { --work-gallery-height: clamp(260px, 80vw, 480px); margin-block: 28px; }
    .garage-work-gallery .garage-work-gallery__layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .garage-work-gallery .garage-work-gallery__stage { border-radius: 14px; }
    .garage-work-gallery [data-gallery-open] { padding: 8px; }
    .garage-work-gallery [data-gallery-thumbs] {
        display: flex;
        gap: 10px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .garage-work-gallery [data-gallery-thumbs] > button {
        flex: 0 0 68px;
        width: 68px;
        height: 90px;
    }
    .garage-work-gallery .garage-work-gallery__stage [data-gallery-prev] { left: 8px; }
    .garage-work-gallery .garage-work-gallery__stage [data-gallery-next] { right: 8px; }
    .garage-work-gallery .garage-work-gallery__footer { margin-top: 10px; }
    .garage-work-gallery [data-gallery-dialog-image] { padding-inline: 8px; }
}
