.work-gallery { background: linear-gradient(145deg,#effafa,#fff 65%); border-block: 1px solid #d6eaea; }
.work-gallery [hidden] { display: none !important; }
.work-gallery-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; opacity: 1; transform: translateY(0); transition: opacity .18s,transform .18s; }
.work-gallery-grid.is-changing { opacity: 0; transform: translateY(8px); }
.work-gallery-card { display: block; position: relative; overflow: hidden; isolation: isolate; border-radius: 16px; background: #0e3539; border: 1px solid #c8e4e4; box-shadow: 0 8px 25px #0e35390a; aspect-ratio: 4/3; }
.work-gallery-card > img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.work-gallery-card:hover > img, .work-gallery-card:focus-visible > img { transform: scale(1.045); }
.gallery-card-caption { position: absolute; inset: auto 0 0; padding: 36px 18px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: white; background: linear-gradient(transparent,#041d22ed); }
.gallery-card-caption strong { font-size: 15px; line-height: 1.5; font-weight: 700; }
.gallery-expand { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 32px; height: 32px; background: #1fdbdc; border-radius: 50%; color: #0e3539; font: 25px/1 Arial,sans-serif; }
.gallery-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 30px; }
.gallery-pagination button { min-height: 43px; padding: 10px 16px; background: white; color: #0e3539; border: 1px solid #bedbdd; border-radius: 9px; font-size: 14px; font-weight: 600; }
.gallery-pagination button:hover:not(:disabled) { background: #e3f8f8; border-color: #08777b; }
.gallery-page-numbers { display: flex; gap: 7px; }
.gallery-page-numbers button[aria-current=page] { background: #0e3539; color: #1fdbdc; border-color: #0e3539; }
.gallery-pagination button:disabled { opacity: .4; cursor: default; }
.gallery-page-status { flex-basis: 100%; text-align: center; margin: 0; font-size: 13px; color: #4e6d70; }
.work-lightbox { padding: 0; width: min(1120px,calc(100vw - 36px)); max-width: 1120px; max-height: calc(100dvh - 36px); border: 1px solid #63b3b65e; border-radius: 21px; background: #0a292d; color: white; box-shadow: 0 25px 110px #0008; overflow: auto; overscroll-behavior: contain; }
.work-lightbox::backdrop { background: #03191deb; backdrop-filter: blur(10px); }
.work-lightbox[open] { animation: gallery-open .22s ease-out; }
.work-lightbox.is-closing { opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .19s,transform .19s; }
.lightbox-shell { padding: 20px; }
.lightbox-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 2px 3px 17px; }
.lightbox-header p { color: #1fdbdc; font-size: 12px; letter-spacing: .1em; margin-bottom: 4px; }
.lightbox-header h2 { color: white; font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0; line-height: 1.5; }
.gallery-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid #ffffff42; border-radius: 50%; background: #ffffff0a; color: white; }
.gallery-close:hover { background: #1fdbdc; border-color: #1fdbdc; color: #0e3539; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; margin: 0; background: #041b1e; border-radius: 12px; overflow: hidden; min-height: 200px; }
.lightbox-image { width: 100%; height: min(57dvh,640px); object-fit: contain; opacity: 1; transform: scale(1); transition: opacity .2s,transform .2s; }
.lightbox-stage.is-changing .lightbox-image { opacity: 0; transform: scale(.985); }
.lightbox-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-block: 17px; }
.lightbox-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 11px; min-height: 44px; border: 1px solid #ffffff35; border-radius: 9px; padding: 10px 15px; background: #ffffff07; color: white; font-size: 14px; }
.lightbox-controls button:hover { background: #1fdbdc; color: #0e3539; border-color: #1fdbdc; }
.gallery-chevron { display: inline-block; width: 8px; height: 8px; border-top: 1.6px solid currentColor; border-right: 1.6px solid currentColor; transform: rotate(45deg); flex-shrink: 0; }
.gallery-chevron.previous { transform: rotate(-135deg); }
.lightbox-count { font-size: 14px; color: #b2d5d7; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lightbox-filmstrip { display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 9px; scrollbar-width: thin; scrollbar-color: #1fdbdc #143b3e; }
.lightbox-filmstrip button { flex: 0 0 82px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #12363a; opacity: .62; transition: opacity .2s,border-color .2s; }
.lightbox-filmstrip button:hover, .lightbox-filmstrip button[aria-current=true] { opacity: 1; border-color: #1fdbdc; }
.lightbox-filmstrip img { width: 100%; height: 59px; object-fit: cover; }
.lightbox-hint { margin: 9px 0 0; text-align: center; font-size: 12px; color: #b2d5d7; }
@keyframes gallery-open { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width:900px) { .work-gallery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; } }
@media (max-width:560px) {
  .work-gallery-grid { gap: 12px; }
  .gallery-card-caption { padding: 25px 11px 11px; gap: 7px; }
  .gallery-card-caption strong { font-size: 12px; }
  .gallery-expand { width: 26px; height: 26px; font-size: 22px; }
  .work-lightbox { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .lightbox-shell { padding: 12px; }
  .lightbox-header h2 { font-size: 17px; }
  .lightbox-header p { font-size: 10px; }
  .lightbox-controls { gap: 8px; }
  .lightbox-controls button { padding: 10px; font-size: 12px; gap: 7px; }
  .lightbox-image { height: 50dvh; }
  .lightbox-filmstrip button { flex-basis: 64px; }
  .lightbox-filmstrip img { height: 48px; }
}
@media (prefers-reduced-motion:reduce) { .work-gallery *, .work-lightbox[open] { transition: none !important; animation: none !important; } }
