.hachtel-gallery {
    --hg-red: #e30413;
    --hg-black: #111;
    --hg-muted: #666;
    width: 100%;
    margin: 40px 0;
    font-family: "Open Sans", sans-serif;
}

.hachtel-gallery__stage {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.hachtel-gallery__slide {
    display: none;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

.hachtel-gallery__slide.is-active { display: block; }

.hachtel-gallery__open {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 4 / 3;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
    box-shadow: none !important;
    cursor: zoom-in;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
}

.hachtel-gallery__open:hover,
.hachtel-gallery__open:focus,
.hachtel-gallery__open:active {
    border: 0 !important;
    background: #000 !important;
    box-shadow: none !important;
    outline: none;
}

.hachtel-gallery__open img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
    object-position: center center;
    background: #000;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.hachtel-gallery__slide figcaption {
    padding: 16px 4px 12px;
    border: 0;
    background: #fff;
    color: var(--hg-muted);
    font-size: 16px;
    font-style: italic;
    line-height: 1.5;
}

/* Supplied rounded SVG arrows, centered on the image area */
.hachtel-gallery__nav,
.hachtel-lightbox__nav {
    position: absolute;
    top: 50% !important;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 64px;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-50%) !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.hachtel-gallery__nav img,
.hachtel-lightbox__nav img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
    pointer-events: none;
}

.hachtel-gallery__nav:hover,
.hachtel-gallery__nav:focus,
.hachtel-gallery__nav:active,
.hachtel-lightbox__nav:hover,
.hachtel-lightbox__nav:focus,
.hachtel-lightbox__nav:active {
    transform: translateY(-50%) !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.hachtel-gallery__nav--prev { left: 8px; }
.hachtel-gallery__nav--next { right: 8px; }

.hachtel-gallery__counter {
    position: absolute;
    right: 4px;
    bottom: -42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #585858;
    font-size: 15px;
    line-height: 1;
}

.hachtel-gallery__thumbs {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 12px;
    padding: 0 0 4px;
    overflow-x: auto;
}

.hachtel-gallery__thumbs button {
    flex: 0 0 92px;
    height: 66px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent !important;
    border-radius: 0 !important;
    background: #eee;
    cursor: pointer;
    opacity: .7;
    box-shadow: none !important;
}

.hachtel-gallery__thumbs button.is-active {
    border: 1px solid var(--hg-red) !important;
    opacity: 1;
}

.hachtel-gallery__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hachtel-lightbox[hidden] { display: none; }

.hachtel-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hachtel-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .92);
}

.hachtel-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 1500px);
    max-height: 96vh;
    display: flex;
    flex-direction: column;
}

.hachtel-lightbox__main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    flex: 1;
}

.hachtel-lightbox__image {
    display: block;
    max-width: calc(100% - 130px);
    max-height: 72vh;
    object-fit: contain;
    object-position: center center;
    border: 0 !important;
    background: transparent;
    box-shadow: none !important;
}

/* Close symbol drawn with two 4px lines to match arrow weight */
.hachtel-lightbox__close {
    position: absolute;
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.hachtel-lightbox__close span::before,
.hachtel-lightbox__close span::after {
    content: "";
    position: absolute;
    top: 22px;
    left: 6px;
    width: 36px;
    height: 4px;
    background: var(--hg-red);
    transform-origin: center;
}
.hachtel-lightbox__close span::before { transform: rotate(45deg); }
.hachtel-lightbox__close span::after { transform: rotate(-45deg); }

.hachtel-lightbox__close:hover,
.hachtel-lightbox__close:focus,
.hachtel-lightbox__close:active {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.hachtel-lightbox__nav--prev { left: 8px; }
.hachtel-lightbox__nav--next { right: 8px; }

.hachtel-lightbox__caption {
    min-height: 28px;
    padding: 12px 0;
    color: #fff;
    text-align: center;
}

.hachtel-lightbox__thumbs {
    display: flex;
    gap: 12px;
    justify-content: center;
    overflow-x: auto;
    padding: 8px 0;
}

.hachtel-lightbox__thumbs button {
    flex: 0 0 82px;
    height: 58px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent !important;
    border-radius: 0 !important;
    background: #222;
    opacity: .65;
    box-shadow: none !important;
}

.hachtel-lightbox__thumbs button.is-active {
    border: 1px solid var(--hg-red) !important;
    opacity: 1;
}

.hachtel-lightbox__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.hachtel-lightbox-open { overflow: hidden; }

@media (max-width: 767px) {
    .hachtel-gallery { margin: 24px 0; }
    .hachtel-gallery__open { aspect-ratio: 1 / 1; }
    .hachtel-gallery__nav,
    .hachtel-lightbox__nav { width: 40px; height: 56px; }
    .hachtel-gallery__nav img,
    .hachtel-lightbox__nav img { width: 26px; height: 26px; }
    .hachtel-gallery__nav--prev { left: 2px; }
    .hachtel-gallery__nav--next { right: 2px; }
    .hachtel-gallery__slide figcaption { font-size: 14px; padding-left: 2px; }
    .hachtel-gallery__thumbs button { flex-basis: 74px; height: 54px; }
    .hachtel-lightbox__image { max-width: calc(100% - 90px); max-height: 68vh; }
    .hachtel-lightbox__close { top: 16px; right: 16px; }
}
