.asg-gallery {
  --asg-primary: #021e3d;
  --asg-accent: #d23d33;
  --asg-surface: #fff;
  --asg-soft: #f3f6f9;
  --asg-text: #142337;
  --asg-muted: #617084;
  --asg-radius: 16px;
  color: var(--asg-text);
  font: inherit;
  margin: 30px auto;
  max-width: 1440px;
  position: relative;
}

.asg-gallery *, .asg-gallery *::before, .asg-gallery *::after { box-sizing: border-box; }
.asg-gallery__header { align-items: end; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 24px; }
.asg-gallery__eyebrow { color: var(--asg-accent); font-size: .78rem; font-weight: 800; letter-spacing: .12em; margin: 0 0 7px; text-transform: uppercase; }
.asg-gallery__title { color: var(--asg-primary); font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.15; margin: 0 0 8px; }
.asg-gallery__intro { color: var(--asg-muted); margin: 0; max-width: 680px; }
.asg-gallery__count { background: var(--asg-primary); border-radius: 999px; color: #fff; flex: 0 0 auto; font-size: .9rem; font-weight: 700; padding: 9px 15px; }

.asg-gallery__filters { align-items: center; background: var(--asg-soft); border: 1px solid #dbe3eb; border-radius: var(--asg-radius); display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto; margin-bottom: 28px; padding: 16px; }
.asg-gallery__filters select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath fill='%23021E3D' d='m5 7 5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid #c9d4df; border-radius: 10px; color: var(--asg-text); font: inherit; min-height: 44px; padding: 8px 38px 8px 12px; width: 100%; }
.asg-gallery__filters select:focus, .asg-button:focus-visible, .asg-card__open:focus-visible, .asg-lightbox button:focus-visible { outline: 3px solid var(--asg-accent); outline: 3px solid color-mix(in srgb, var(--asg-accent) 60%, white); outline-offset: 2px; }
.asg-button { align-items: center; border: 1px solid transparent; border-radius: 10px; cursor: pointer; display: inline-flex; font: inherit; font-weight: 700; justify-content: center; min-height: 44px; padding: 9px 16px; text-decoration: none !important; white-space: nowrap; }
.asg-button--primary { background: var(--asg-accent); color: #fff !important; }
.asg-button--primary:hover { background: #b83129; }
.asg-button--secondary { background: #fff; border-color: #c9d4df; color: var(--asg-primary) !important; }

.asg-gallery__grid { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.asg-card { background: var(--asg-surface); border: 1px solid #dfe6ed; border-radius: var(--asg-radius); box-shadow: 0 8px 28px rgba(2, 30, 61, .08); margin: 0; overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.asg-card:hover { box-shadow: 0 14px 38px rgba(2, 30, 61, .15); transform: translateY(-3px); }
.asg-card__open { background: #dbe2e9; border: 0; cursor: zoom-in; display: block; margin: 0; overflow: hidden; padding: 0; position: relative; width: 100%; }
.asg-card__image { aspect-ratio: 3 / 2; display: block; height: auto; object-fit: cover; transition: transform .35s ease; width: 100%; }
.asg-card:hover .asg-card__image { transform: scale(1.025); }
.asg-card__zoom { align-items: center; background: rgba(2, 30, 61, .86); border-radius: 999px; bottom: 12px; color: #fff; display: flex; font-size: 1.15rem; height: 38px; justify-content: center; opacity: 0; position: absolute; right: 12px; transform: translateY(5px); transition: .2s ease; width: 38px; }
.asg-card:hover .asg-card__zoom, .asg-card__open:focus-visible .asg-card__zoom { opacity: 1; transform: translateY(0); }
.asg-card__body { padding: 16px 17px 18px; }
.asg-card__title { color: var(--asg-primary); font-size: 1.08rem; line-height: 1.3; margin: 0; }
.asg-card__author { color: var(--asg-accent); font-size: .9rem; font-weight: 700; margin: 5px 0 0; }
.asg-card__meta { color: var(--asg-muted); display: flex; flex-wrap: wrap; font-size: .82rem; gap: 6px 13px; margin-top: 11px; }
.asg-card__meta span, .asg-card__meta time { position: relative; }
.asg-card__meta span:not(:last-child)::after, .asg-card__meta time:not(:last-child)::after { color: #a8b4c0; content: "•"; position: absolute; right: -9px; }

.asg-gallery__empty { background: var(--asg-soft); border: 1px dashed #b8c5d1; border-radius: var(--asg-radius); padding: 55px 20px; text-align: center; }
.asg-gallery__empty-icon { display: inline-block; font-size: 40px; line-height: 1; }
.asg-gallery__empty h3 { color: var(--asg-primary); margin: 8px 0 4px; }
.asg-gallery__empty p { color: var(--asg-muted); margin: 0; }

.asg-pagination { margin-top: 30px; }
.asg-pagination ul { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.asg-pagination a, .asg-pagination span { align-items: center; border: 1px solid #ccd7e1; border-radius: 9px; color: var(--asg-primary); display: flex; min-height: 40px; min-width: 40px; justify-content: center; padding: 7px 12px; text-decoration: none; }
.asg-pagination .current { background: var(--asg-primary); border-color: var(--asg-primary); color: #fff; }

.asg-lightbox[hidden] { display: none !important; }
.asg-lightbox { align-items: center; background: rgba(1, 13, 27, .94); display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; inset: 0; padding: 28px; position: fixed; z-index: 999999; }
.asg-lightbox__content { align-items: center; display: flex; flex-direction: column; justify-content: center; max-height: 100%; min-width: 0; }
.asg-lightbox__image { border-radius: 10px; box-shadow: 0 18px 65px rgba(0, 0, 0, .48); display: block; max-height: calc(100vh - 125px); max-width: 100%; object-fit: contain; }
.asg-lightbox__caption { color: #fff; font-size: .95rem; line-height: 1.4; margin-top: 14px; max-width: 900px; text-align: center; }
.asg-lightbox button { align-items: center; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; color: #fff; cursor: pointer; display: flex; font: inherit; justify-content: center; }
.asg-lightbox__close { font-size: 28px !important; height: 44px; position: absolute; right: 20px; top: 18px; width: 44px; }
.asg-lightbox__nav { font-size: 42px !important; height: 54px; width: 54px; }
.asg-lightbox__nav:hover, .asg-lightbox__close:hover { background: var(--asg-accent); border-color: var(--asg-accent); }
body.asg-lightbox-open { overflow: hidden; }

@media (max-width: 980px) {
  .asg-gallery__filters { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .asg-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .asg-gallery { margin: 20px auto; }
  .asg-gallery__header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .asg-gallery__filters { grid-template-columns: 1fr; padding: 13px; }
  .asg-gallery__grid { gap: 16px; grid-template-columns: 1fr; }
  .asg-card__zoom { opacity: 1; transform: none; }
  .asg-lightbox { display: block; padding: 68px 12px 80px; }
  .asg-lightbox__content { height: 100%; }
  .asg-lightbox__image { max-height: calc(100vh - 160px); }
  .asg-lightbox__nav { bottom: 14px; position: absolute; }
  .asg-lightbox__prev { left: calc(50% - 66px); }
  .asg-lightbox__next { right: calc(50% - 66px); }
}

@media (prefers-reduced-motion: reduce) {
  .asg-card, .asg-card__image, .asg-card__zoom { transition: none; }
}
