/* Alex Retivov site additions: galleries, filters, lightbox, mobile fixes. */
:root { --ar-gap: 18px; --ar-accent: #f5d33a; }

/* gallery sections: let content set the height instead of Nicepage's fixed heights */
.ar-gallery-section .u-sheet { min-height: 0 !important; }
.ar-gallery-section .ar-gallery-head { min-height: 0 !important; margin-bottom: 10px !important; }
.ar-gallery-section .ar-gallery-head .u-container-layout { padding-bottom: 0 !important; }

.ar-gallery { width: 100%; max-width: 1140px; margin: 10px auto 60px; padding: 0 12px; box-sizing: border-box; }
.ar-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 24px; padding: 0; list-style: none; }
.ar-filters button {
  font: 600 14px/1 "Roboto Condensed", Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.6); border-radius: 22px;
  min-height: 44px; padding: 0 20px; cursor: pointer;
}
.ar-filters button[aria-pressed="true"] { background: var(--ar-accent); border-color: var(--ar-accent); color: #111; }
.ar-filters button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ar-grid { display: grid; gap: var(--ar-gap); grid-template-columns: repeat(2, minmax(0,1fr)); margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px)  { .ar-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }

.ar-item[hidden] { display: none; }
.ar-item a { display: block; color: inherit; text-decoration: none; }
.ar-thumb { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; container-type: size; }
@media (min-width: 700px) { .ar-thumb { aspect-ratio: 4 / 3; } }
.ar-frame { position: relative; display: inline-block; line-height: 0; }
.ar-hover { display: none; }
.ar-thumb img { max-width: 100cqw; max-height: 100cqh; width: auto; height: auto; object-fit: contain; transition: transform .25s ease; }
.ar-item a:hover .ar-thumb img, .ar-item a:focus-visible .ar-thumb img { transform: scale(1.04); }
.ar-item a:focus-visible { outline: 3px solid var(--ar-accent); outline-offset: 3px; }
.ar-caption { margin: 8px 2px 0; text-align: center; color: #fff; font: 15px/1.3 "Roboto Condensed", Arial, sans-serif; }
.ar-caption .ar-size, .ar-caption .ar-note { display: block; color: #cfcfcf; font-size: 13px; margin-top: 2px; }
.ar-badge { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 10px; background: #b3261e; color: #fff; font-size: 12px; }
.ar-empty { color: #ddd; text-align: center; }

/* lightbox */
.ar-lb { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.94); display: none; flex-direction: column; align-items: center; justify-content: center; touch-action: pan-y; }
.ar-lb.open { display: flex; }
.ar-lb figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 94vw; }
.ar-lb img { max-width: 94vw; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); object-fit: contain; }
.ar-lb figcaption { color: #fff; text-align: center; margin-top: 12px; font: 17px/1.35 "Roboto Condensed", Arial, sans-serif; }
.ar-lb figcaption small { display: block; color: #ccc; font-size: 14px; }
.ar-lb button { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 24px; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; line-height: 48px; cursor: pointer; }
.ar-lb .ar-close { top: 12px; right: 12px; }
.ar-lb .ar-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.ar-lb .ar-next { right: 12px; top: 50%; transform: translateY(-50%); }
.ar-lb .ar-count { position: absolute; top: 22px; left: 20px; color: #bbb; font: 14px "Roboto Condensed", Arial, sans-serif; }
body.ar-lb-open { overflow: hidden; }

/* header: the red-dot menu button ran off the right edge on phones and iPads */
@media (max-width: 1199px) {
  header.u-header .u-sheet-1 { max-width: 100%; box-sizing: border-box; }
  header.u-header .u-menu-1 { margin-right: 0 !important; width: auto !important; }
  header.u-header .u-menu-1 .menu-collapse a { width: 110px !important; height: 60px !important; padding: 0 !important; display: flex !important; align-items: center; justify-content: flex-end; }
  header.u-header .u-menu-1 .menu-collapse img { width: 100% !important; height: auto !important; }
}
@media (max-width: 575px) {
  header.u-header .u-menu-1 .menu-collapse a { width: 80px !important; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
body.ar-lb-open .u-back-to-top { display: none !important; }
.ar-thumb picture { display: contents; }


/* desktop and laptop (mouse): like the original site, title and size appear over the piece on hover */
@media (hover: hover) and (min-width: 700px) {
  html:not(.ar-touch) .ar-grid { gap: 22px; }
  html:not(.ar-touch) .ar-caption { display: none; }
  html:not(.ar-touch) .ar-hover { display: flex; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: flex-end; padding: 12px; text-align: center;
    background: rgba(0,0,0,.8); color: #fff; font: 15px/1.3 "Roboto Condensed", Arial, sans-serif; opacity: 0; transition: opacity .3s ease; }
  html:not(.ar-touch) .ar-hover small { display: block; color: #cfcfcf; font-size: 13px; margin-top: 3px; }
  html:not(.ar-touch) .ar-item a:hover .ar-hover, html:not(.ar-touch) .ar-item a:focus-visible .ar-hover { opacity: 1; }
  html:not(.ar-touch) .ar-item a:hover .ar-thumb img { transform: none; }
}
