.galria-hide {
    display: none;
}

.mfp-close {
    top: 0;
}

@media(max-width: 600px) {
    .galria-masonry.column-3 .galria-masonry-item{
        width: 100%;
    }
}
/*Controller page*/
#galleries .galria-masonry-item{
    padding: 5px;
}
#galleries .galria-masonry-item > a {
    /* border: 1px solid #ccc; */
    display: block;
    position: relative; 
    overflow: hidden;
    border-radius: 3px;
}
#galleries .galria-masonry-item img{
    max-width: 100%;
}
#galleries .galria-masonry-item h4{
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 11px 20px;
    margin: 0;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    filter: alpha(opacity=90);
    font-family: "Noto Sans", sans-serif;
    transform: translateY(0%);
    -webkit-transition: transform 0.3s;
    -moz-transition: transform 0.3s;
    -ms-transition: transform 0.3s;
    -o-transition: transform 0.3s;
    transition: transform 0.3s;

    display: none;
}
/*End*/

.gallerys-container{
    clear: both;
}
.hig-gallery__block {
    margin-bottom: 30px;
}
body.galria-page-full-width #wrapper .container,
body.galria-page-full-width #content-wrapper,
body.galria-page-full-width #main,
body.galria-page-full-width #content {
    width: 100%;
    max-width: none;
}
body.galria-page-full-width #main .page-content,
body.galria-page-full-width #main .page-cms,
body.galria-page-full-width #content .page-content,
body.galria-page-full-width #content .page-cms {
    width: 100%;
    max-width: none;
    min-height: 0;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}
.galria-page-width {
    width: 100%;
    min-height: 0;
}
.galria-page-width--full {
    position: relative;
    left: 50%;
    width: 100vw;
    max-width: 100vw;
    margin-left: -50vw;
    margin-right: -50vw;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: visible;
}
.galria-page-width--full .hig-gallery__block,
.galria-page-width--full #galleries {
    width: 100%;
}
@supports (width: 100dvw) {
    .galria-page-width--full {
        width: 100dvw;
        max-width: 100dvw;
        margin-left: -50dvw;
        margin-right: -50dvw;
    }
}
.hig-gallery__block .image-content{
    padding: 5px;
    border-radius: 3px;
}
.hig-gallery__block .image-content > a{
    display: block;
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.hig-gallery__block .image-content img{
    max-width: 100%;
    height: auto;
}
/* Caption-on-hover removed — caption now appears only when image is expanded (lightbox). */
.galria-image-container .caption { display: none !important; }

/* .galria-loader,
.mi-gallery-ajax-loader {
    width: 60px;
    height: 60px;
    background: url(../img/loader.gif) no-repeat;
    margin: 0 auto;
}

@media ( -webkit-min-device-pixel-ratio : 1.5) {
   .galria-loader,
   .mi-gallery-ajax-loader {
        background: url(../img/loader@2x.gif) no-repeat;
        background-size: 60px 60px;
    }
} */

.hig-gallery__block {
    margin: 15px 0;
}
.hig-gallery__block-title{
    margin-bottom: 20px;
}

.galria-image-container {
    position: relative;
    overflow: hidden;
}
.galria-image-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 999;
}
/* On mobile/touch devices, always show the on-image action icons (expand / link / share) */
@media (max-width: 767px), (hover: none) {
    .galria-image-actions { opacity: 1 !important; }
    .galria-image-bg { opacity: 1 !important; }
}
.galria-image-actions i {
    margin: 0 5px;
    color: #fff;
    font-size: 30px;
}
.galria-image-actions a,
.galria-image-actions .galria-share-btn {
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    vertical-align: middle;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}
/* Note: hover color is intentionally NOT changed for the on-image overlay icons
   (zoom / link / share) — they remain white per design. */
.galria-image-actions svg {
    display: block;
}
/* Make the whole image area clickable to expand (Simple Gallery).
   Only items with an explicit data-file-type="image" get zoom-in — this
   covers the individual gallery files rendered by media.tpl.
   Category cover items (galleries.tpl, galleryimage.tpl child_galleries)
   are rendered WITHOUT a data-file-type attribute and must show a pointer
   cursor (they are links to sub-galleries, not zoom-able images).  They
   naturally inherit cursor:pointer from the parent <a> element once we
   stop overriding them with zoom-in here. */
.galria-image-container[data-file-type="image"] .mi-gallery-img {
    cursor: zoom-in;
}
/* Explicit pointer for category-cover images (no data-file-type).
   Belt-and-suspenders: even if the theme resets <a> cursor we still
   show the hand icon to make navigation intent obvious. */
.galria-image-container:not([data-file-type]) .mi-gallery-img {
    cursor: pointer;
}
.mi-gallery-link-icon {
    color: #fff;
}
.galria-image-bg {
    position: absolute;
    margin: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    z-index: 99;
    transition: opacity 0.3s ease;
    border-radius: 3px;
}
.galria-image-container:hover .galria-image-actions,
.galria-image-container:hover .galria-image-bg {
    opacity: 1;
}

.mi-gallery-image-skeleton {
    width: 100%;
    padding: 16px;
    border-radius: 4px;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
  
/* Base styles for skeleton elements */
.mi-gallery-image-skeleton-header,
.mi-gallery-image-skeleton-line {
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
  
  /* Header skeleton */
  .mi-gallery-image-skeleton-header {
    width: 100%;
    height: 100px;
    border-radius: 8px;
  }
  
  /* Line skeletons */
  .mi-gallery-image-skeleton-line {
    width: 100%;
    height: 16px;
  }
  
  .mi-gallery-image-skeleton-line.short {
    width: 60%;
  }
  
  /* Animation */
  @keyframes shimmer {
    0% {
      background-position: -200% 0;
    }
    100% {
      background-position: 200% 0;
    }
  }

.mi-gallery-img {
    display: none; /* Initially hide the image */
    width: 100%;
    height: auto;
}

.galria-actions {
    text-align: center;
    margin: 20px 10px;
}

.galria-dot-pulse-loader {
    position: relative;
    left: -9999px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #9880ff;
    color: #9880ff;
    box-shadow: 9999px 0 0 -5px;
    animation: dot-pulse 1.5s infinite linear;
    animation-delay: 0.25s;

    margin: 0 auto;
  }
.galria-dot-pulse-loader::before, .galria-dot-pulse-loader::after {
    content: "";
    display: inline-block;
    position: absolute;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #9880ff;
    color: #9880ff;
}
.galria-dot-pulse-loader::before {
    box-shadow: 9984px 0 0 -5px;
    animation: dot-pulse-before 1.5s infinite linear;
    animation-delay: 0s;
}
.galria-dot-pulse-loader::after {
    box-shadow: 10014px 0 0 -5px;
    animation: dot-pulse-after 1.5s infinite linear;
    animation-delay: 0.5s;
}
  
@keyframes dot-pulse-before {
    0% {
      box-shadow: 9984px 0 0 -5px;
    }
    30% {
      box-shadow: 9984px 0 0 2px;
    }
    60%, 100% {
      box-shadow: 9984px 0 0 -5px;
    }
}
@keyframes dot-pulse {
    0% {
      box-shadow: 9999px 0 0 -5px;
    }
    30% {
      box-shadow: 9999px 0 0 2px;
    }
    60%, 100% {
      box-shadow: 9999px 0 0 -5px;
    }
}
@keyframes dot-pulse-after {
    0% {
      box-shadow: 10014px 0 0 -5px;
    }
    30% {
      box-shadow: 10014px 0 0 2px;
    }
    60%, 100% {
      box-shadow: 10014px 0 0 -5px;
    }
}

.gallery-image-block {
    display: flex;
    flex-wrap: wrap;
}


.galria-mobile-column-1 .galria-masonry-item {
    width: 100%;
}
.galria-mobile-column-2 .galria-masonry-item {
    width: 50%;
}
.galria-mobile-column-3 .galria-masonry-item {
    width: 33%;
}
.galria-mobile-column-4 .galria-masonry-item {
    width: 25%;
}
.galria-mobile-column-5 .galria-masonry-item {
    width: 20%;
}
.galria-mobile-column-6 .galria-masonry-item {
    width: 16.6%;
}

@media (min-width: 576px) {
    .galria-tablet-column-1 .galria-masonry-item {
        width: 100%;
    }
    .galria-tablet-column-2 .galria-masonry-item {
        width: 50%;
    }
    .galria-tablet-column-3 .galria-masonry-item {
        width: 33%;
    }
    .galria-tablet-column-4 .galria-masonry-item {
        width: 25%;
    }
    .galria-tablet-column-5 .galria-masonry-item {
        width: 20%;
    }
    .galria-tablet-column-6 .galria-masonry-item {
        width: 16.6%;
    }
}

@media (min-width: 992px) {
    .galria-column-1 .galria-masonry-item {
        width: 100%;
    }
    .galria-column-2 .galria-masonry-item {
        width: 50%;
    }
    .galria-column-3 .galria-masonry-item {
        width: 33%;
    }
    .galria-column-4 .galria-masonry-item {
        width: 25%;
    }
    .galria-column-5 .galria-masonry-item {
        width: 20%;
    }
    .galria-column-6 .galria-masonry-item {
        width: 16.6%;
    }
}

/* Social Share */
.galria-share-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
}
.galria-share-btn .mi-gallery-share-icon {
    color: #fff;
    font-size: 30px;
    margin: 0 5px;
}
.galria-share-popover {
    position: absolute;
    z-index: 10050;
    background: rgba(0, 0, 0, 0.92);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    gap: 6px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    opacity: 1;
    transition: opacity 0.2s ease;
}
.galria-share-popover.galria-hide {
    opacity: 0;
    pointer-events: none;
}
.galria-share-popover--fixed {
    position: fixed;
}
.galria-share-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(0, 0, 0, 0.92);
}

.galria-share-popover__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
    padding: 0;
    outline: none;
}
.galria-share-popover__btn:hover {
    transform: scale(1.1);
}
.galria-share-popover__btn[data-platform="facebook"]:hover {
    background: #1877F2;
}
.galria-share-popover__btn[data-platform="x"]:hover {
    background: #000;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.galria-share-popover__btn[data-platform="pinterest"]:hover {
    background: #E60023;
}
.galria-share-popover__btn[data-platform="whatsapp"]:hover {
    background: #25D366;
}
.galria-share-popover__btn[data-platform="telegram"]:hover {
    background: #0088cc;
}
.galria-share-popover__btn[data-platform="email"]:hover {
    background: #6c757d;
}
.galria-share-popover__btn[data-platform="copylink"]:hover {
    background: #6c757d;
}

/* Lightbox Overlay Actions */
.mfp-figure {
    position: relative;
}
.galria-lightbox-actions {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.mfp-figure:hover .galria-lightbox-actions,
.galria-lightbox-actions:focus-within {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.galria-lightbox-actions__caption {
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    padding-right: 12px;
    cursor: default;
    max-height: 1.4em;
    transition: max-height 0.35s ease, white-space 0s 0.35s;
}
.galria-lightbox-actions:hover .galria-lightbox-actions__caption {
    white-space: normal;
    max-height: 40em;
    transition: max-height 0.35s ease, white-space 0s;
}
.galria-lightbox-actions__buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
.galria-lightbox-actions__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    padding: 0;
    outline: none;
    text-decoration: none;
    line-height: 1;
}
.galria-lightbox-actions__btn svg,
.galria-lightbox-actions__btn svg path {
    fill: currentColor;
    transition: fill 0.2s ease;
}
.galria-lightbox-actions__btn:hover,
.galria-lightbox-actions__btn:focus {
    background: rgba(255, 255, 255, 0.3);
    color: #662c91 !important;
    transform: scale(1.1);
}
.galria-lightbox-actions__btn:hover svg,
.galria-lightbox-actions__btn:hover svg path,
.galria-lightbox-actions__btn:focus svg,
.galria-lightbox-actions__btn:focus svg path {
    fill: #662c91 !important;
}
.galria-lightbox-actions__btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}
@media (hover: none) {
    .galria-lightbox-actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
    .mfp-img-mobile .galria-lightbox-actions {
        bottom: 0;
    }
}
@media (max-width: 576px) {
    .galria-lightbox-actions {
        padding: 10px 12px;
    }
    .galria-lightbox-actions__btn {
        width: 44px;
        height: 44px;
    }
    .galria-lightbox-actions__caption {
        font-size: 13px;
    }
}

.galria-copied-tooltip {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10051;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.galria-copied-tooltip--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.galria-share-popover__btn {
    flex: 0 0 auto;
    box-sizing: border-box;
    line-height: 0;
}
.galria-share-popover__btn svg,
.galria-share-popover__btn img {
    width: 18px;
    height: 18px;
    display: block;
}

@media (max-width: 767px) {
    .galria-share-popover,
    .galria-share-popover--fixed {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 14px 14px 0 0;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        transform: translateY(0);
        box-sizing: border-box;
    }
    .galria-share-popover.galria-hide {
        transform: translateY(100%);
        opacity: 0;
    }
    .galria-share-popover::after {
        display: none !important;
    }
    .galria-share-popover__btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px;
        min-height: 38px;
        max-width: 38px;
        max-height: 38px;
        flex: 0 0 38px !important;
        padding: 0;
        border-radius: 50%;
        line-height: 0;
    }
    .galria-share-popover__btn svg,
    .galria-share-popover__btn img {
        width: 18px;
        height: 18px;
        display: block;
    }
}
/* Video items */
.mi-gallery-video {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 4px;
    background: #000;
}

/* Audio items */
.mi-gallery-audio-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
    min-height: 160px;
    gap: 10px;
}
.mi-gallery-audio-icon {
    color: #007da5;
}
.mi-gallery-audio-title {
    font-size: 13px;
    color: #333;
    text-align: center;
    margin: 0;
}
.mi-gallery-audio {
    width: 100%;
    max-width: 320px;
}

/* PDF items */
.mi-gallery-pdf-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fff5f5;
    border-radius: 4px;
    min-height: 160px;
    text-decoration: none;
    gap: 8px;
    transition: background 0.2s ease;
}
.mi-gallery-pdf-wrapper:hover {
    background: #ffe8e8;
}
.mi-gallery-pdf-icon {
    position: relative;
    color: #e53935;
}
.mi-gallery-pdf-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: #e53935;
    padding: 1px 4px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}
.mi-gallery-pdf-filename {
    font-size: 12px;
    color: #555;
    text-align: center;
    margin: 0;
    word-break: break-word;
}
.mi-gallery-pdf-thumb-wrap {
    position: relative;
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mi-gallery-pdf-thumb-wrap .mi-gallery-pdf-canvas {
    width: 100%;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mi-gallery-pdf-thumb-wrap .mi-gallery-pdf-icon-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#copyright-tag {
  position: fixed;
  /* Must outrank every gallery overlay/modal so the tag is never
     covered while a YouTube clip is playing. The simple-gallery
     YouTube modal (.mi-gallery-yt-modal) and the advanced-gallery
     video popup (#vid-popup) both sit at z-index 99999 / 9500,
     and because they are appended to <body> AFTER this tag is
     rendered (hookDisplayBeforeBodyClosingTag), DOM order alone
     would push them above the tag at equal z-index. Using the
     32-bit signed max keeps the tag above any reasonable theme
     overlay (lightboxes, mega-menus, cookie banners, …) too. */
  z-index: 2147483647;
  background: rgba(15, 15, 20, 0.92);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.38);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0.15s;
}
#copyright-tag.visible {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0s;
}

/* ============================================================
   Gallery Category Style Variants (Simple Gallery)
   Adapted from css-thumbnail-transition-effects reference.
   All selectors prefixed with #galleries to beat the
   specificity of base #galleries .galria-masonry-item h4.
   Mapping: figure→a, img→.mi-gallery-img, figcaption→h4
   ============================================================ */

/* Shared: show h4 for styles that need it */
#galleries .hig-masonry-style-default      .galria-masonry-item h4,
#galleries .hig-masonry-style-filter       .galria-masonry-item h4,
#galleries .hig-masonry-style-caption1     .galria-masonry-item h4,
#galleries .hig-masonry-style-caption2     .galria-masonry-item h4,
#galleries .hig-masonry-style-caption3     .galria-masonry-item h4,
#galleries .hig-masonry-style-color-overlay .galria-masonry-item h4 {
    display: block;
}
/* zoom keeps h4 hidden — pure image effect, no caption */

/* ── DEFAULT ── static caption bar always visible at bottom */
#galleries .hig-masonry-style-default .galria-masonry-item > a { overflow: hidden; }
#galleries .hig-masonry-style-default .galria-masonry-item h4 {
    position: absolute; bottom: 0; left: 0; width: 100%; margin: 0;
    padding: 10px 14px; background: rgba(0,0,0,0.72); color: #fff;
    font-size: 14px; font-weight: 600; text-align: center;
    transform: none; transition: none; z-index: 2;
}

/* ── FILTER EFFECT ── grayscale default, hover removes filter */
#galleries .hig-masonry-style-filter .galria-masonry-item > a { overflow: hidden; }
#galleries .hig-masonry-style-filter .galria-masonry-item h4 {
    position: absolute; bottom: 0; left: 0; width: 100%; margin: 0;
    padding: 10px 14px; background: rgba(0,0,0,0.72); color: #fff;
    font-size: 14px; font-weight: 600; text-align: center;
    transform: none; transition: none; z-index: 2;
}
#galleries .hig-masonry-style-filter .galria-masonry-item .mi-gallery-img {
    filter: grayscale(100%);
    transition: filter 0.3s ease-in-out;
}
#galleries .hig-masonry-style-filter .galria-masonry-item > a:hover .mi-gallery-img {
    filter: none;
}

/* ── ZOOM EFFECT ── image scale(1) → scale(1.2) on hover, no caption */
#galleries .hig-masonry-style-zoom .galria-masonry-item > a { overflow: hidden; }
#galleries .hig-masonry-style-zoom .galria-masonry-item .mi-gallery-img {
    transform: scale(1);
    transition: transform 0.3s ease-in-out;
}
#galleries .hig-masonry-style-zoom .galria-masonry-item > a:hover .mi-gallery-img {
    transform: scale(1.2);
}

/* ── CAPTION 1 ── white overlay scales in + fades in on hover (centered title) */
#galleries .hig-masonry-style-caption1 .galria-masonry-item > a { overflow: hidden; }
#galleries .hig-masonry-style-caption1 .galria-masonry-item h4 {
    position: absolute;
    top: 1rem; left: 1rem;
    width: calc(100% - 2rem);
    height: calc(100% - 2rem);
    margin: 0; padding: 1rem;
    background: rgba(255,255,255,0.92);
    color: rgba(0,0,0,0.75);
    font-size: 18px; font-weight: 600; text-align: center;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 2; pointer-events: none;
    box-sizing: border-box;
}
#galleries .hig-masonry-style-caption1 .galria-masonry-item > a:hover h4 {
    opacity: 0.95;
    transform: scale(1);
}

/* ── CAPTION 2 ── image inverted+zoomed; hover normalises it, caption slides up */
#galleries .hig-masonry-style-caption2 .galria-masonry-item > a { overflow: hidden; }
#galleries .hig-masonry-style-caption2 .galria-masonry-item .mi-gallery-img {
    filter: invert(25%);
    transform: scale(1.2);
    transition: filter 0.3s ease-in-out, transform 0.3s ease-in-out;
}
#galleries .hig-masonry-style-caption2 .galria-masonry-item > a:hover .mi-gallery-img {
    filter: none;
    transform: scale(1);
}
#galleries .hig-masonry-style-caption2 .galria-masonry-item h4 {
    position: absolute; bottom: 0; left: 0; width: 100%; margin: 0;
    padding: 12px 2rem 2rem;
    background: transparent; color: #fff;
    font-size: 18px; font-weight: 600; text-align: left;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    transform: translate3d(0, 1rem, 0); opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 2; pointer-events: none;
    box-sizing: border-box;
}
#galleries .hig-masonry-style-caption2 .galria-masonry-item > a:hover h4 {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

/* ── CAPTION 3 ── image zoomed; hover desaturates+descales; bordered caption fades in */
#galleries .hig-masonry-style-caption3 .galria-masonry-item > a { overflow: hidden; }
#galleries .hig-masonry-style-caption3 .galria-masonry-item .mi-gallery-img {
    transform: scale(1.2);
    transition: filter 0.3s ease-in-out, transform 0.3s ease-in-out;
}
#galleries .hig-masonry-style-caption3 .galria-masonry-item > a:hover .mi-gallery-img {
    filter: grayscale(100%);
    transform: scale(1);
}
#galleries .hig-masonry-style-caption3 .galria-masonry-item h4 {
    position: absolute;
    top: 5%; left: 5%;
    width: 90%; height: 90%;
    margin: 0; padding: 0;
    border: 1px solid rgba(255,255,255,0.85);
    color: #fff;
    font-size: 18px; font-weight: 600; text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    transform: scale(1.2); opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    z-index: 2; pointer-events: none;
    box-sizing: border-box;
}
#galleries .hig-masonry-style-caption3 .galria-masonry-item > a:hover h4 {
    opacity: 1;
    transform: scale(1);
}

/* ── COLOR OVERLAY ── semi-transparent overlay + centered name; both fade out on hover */
#galleries .hig-masonry-style-color-overlay .galria-masonry-item > a {
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
#galleries .hig-masonry-style-color-overlay .galria-masonry-item > a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #000000;
    opacity: 0.7;
    z-index: 2;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
#galleries .hig-masonry-style-color-overlay .galria-masonry-item > a .mi-gallery-img {
    display: block;
    width: 100%;
    height: auto;
}
#galleries .hig-masonry-style-color-overlay .galria-masonry-item h4 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    background: transparent;
    font-size: 1.2rem;
    font-weight: 600;
    z-index: 3;
    opacity: 1;
    transition: opacity 0.35s ease;
    pointer-events: none;
    box-sizing: border-box;
}
#galleries .hig-masonry-style-color-overlay .galria-masonry-item > a:hover::before,
#galleries .hig-masonry-style-color-overlay .galria-masonry-item > a:hover h4 {
    opacity: 0;
}

/* ============================================================
   Media Cover Placeholders (non-image gallery covers)
   ============================================================ */
.mi-gallery-media-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 180px;
    padding: 24px 16px 16px;
    box-sizing: border-box;
    gap: 12px;
}
.mi-gallery-media-cover--video  { background: linear-gradient(135deg, #e8f4fd 0%, #d0e8f8 100%); }
.mi-gallery-media-cover--audio  { background: linear-gradient(135deg, #fdf4ff 0%, #f3e5f5 100%); }
.mi-gallery-media-cover--pdf    { background: linear-gradient(135deg, #fff1f0 0%, #fce4e4 100%); }
.mi-gallery-media-cover--symbol { background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%); }

/* Gallery category name inside non-image cover */
.mi-gallery-cover-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    line-height: 1.4;
}
.mi-gallery-media-cover--video  .mi-gallery-cover-name { color: #1a4a8a; }
.mi-gallery-media-cover--audio  .mi-gallery-cover-name { color: #6a2f8a; }
.mi-gallery-media-cover--pdf    .mi-gallery-cover-name { color: #b71c1c; }
.mi-gallery-media-cover--symbol .mi-gallery-cover-name { color: #444; }

.mi-gallery-cover-symbol {
    width: 72px; height: 72px; object-fit: contain; opacity: 0.55;
}

/* ── Video wrapper for link-icon overlay ──────────────────── */
.mi-gallery-video-wrapper {
    position: relative;
    display: block;
    width: 100%;
}
.mi-gallery-video-wrapper .mi-gallery-video {
    display: block;
    width: 100%;
}

/* ── YouTube embed wrapper (16:9 responsive) ─────────────── */
.mi-gallery-youtube-wrapper {
    position: relative;
    display: block;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}
.mi-gallery-youtube-wrapper .mi-gallery-youtube,
.mi-gallery-youtube-wrapper .mi-gallery-youtube-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}
.mi-gallery-youtube-wrapper .mi-gallery-youtube-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 3;
}
.mi-gallery-youtube-wrapper .mi-gallery-youtube-play:hover {
    background: rgba(204, 0, 0, 0.95);
    transform: translate(-50%, -50%) scale(1.08);
}
.mi-gallery-youtube-wrapper:hover .hi-media-link-btn {
    opacity: 1;
}

/* ── YouTube full-screen modal ─────────────────────────── */
.mi-gallery-yt-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
}
.mi-gallery-yt-modal.is-open {
    display: flex;
}
.mi-gallery-yt-modal__box {
    position: relative;
    width: min(96vw, 960px);
    aspect-ratio: 16 / 9;
    max-height: 90vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}
.mi-gallery-yt-modal__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ── Right-click capture overlay over the YouTube iframe ──
   Cross-origin policy means click / contextmenu events fired
   inside a YouTube iframe never bubble to our document — so
   without this overlay there is no way to surface the copyright
   tag when the user right-clicks the playing video. The overlay
   is fully transparent and sits in front of the iframe (z-index
   above), so it absorbs every pointer event in the video area.
   We deliberately leave the BOTTOM 60 px uncovered so YouTube's
   own play / volume / fullscreen / progress-bar controls remain
   reachable. Left-clicks on the overlay are forwarded to the
   player via postMessage to toggle play / pause (see front.js)
   so the user keeps the familiar "click video to pause" gesture.
*/
.mi-gallery-yt-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;          /* leave YouTube's controls bar free  */
    z-index: 5;            /* above the iframe (which has z:auto) */
    background: transparent;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mi-gallery-yt-modal__close {
    position: absolute;
    top: -42px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mi-gallery-yt-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ── Audio wrapper for link-icon overlay ──────────────────── */
.mi-gallery-audio-wrapper {
    position: relative;
}

/* ── PDF outer wrapper for link-icon overlay ─────────────── */
.mi-gallery-pdf-outer {
    position: relative;
    display: block;
}

/* ── Link icon for audio/video/pdf items (top-right on hover) */
.hi-media-link-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.55);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}
.mi-gallery-video-wrapper:hover .hi-media-link-btn,
.mi-gallery-audio-wrapper:hover .hi-media-link-btn,
.mi-gallery-pdf-outer:hover .hi-media-link-btn {
    opacity: 1;
}
.hi-media-link-btn:hover {
    background: rgba(0,0,0,0.8);
    color: #fff;
}

/* ── Hide native audio speed/overflow menu (3-dot) ─────────── */
audio::-webkit-media-controls-overflow-button {
    display: none;
}


/* ── Parent / child gallery hierarchy ─────────────────────── */
.hig-gallery__children {
    margin-top: 8px;
    padding-left: 24px;
    border-left: 2px solid rgba(0,0,0,0.06);
    margin-left: 4px;
}
.hig-gallery__block--depth-0 > .hig-gallery__block-title {
    font-size: 1.6rem;
}
.hig-gallery__block--depth-1 > .hig-gallery__block-title,
.hig-gallery__block--depth-2 > .hig-gallery__block-title,
.hig-gallery__block--depth-3 > .hig-gallery__block-title {
    font-size: 1.3rem;
    opacity: 0.92;
}
@media (max-width: 600px) {
    .hig-gallery__children {
        padding-left: 12px;
    }
}
