/* Photo Gallery — public styles (Forge dark-safe brand tokens) */

.oso-gallery-page,
.oso-gallery-section {
  --gal-gap: 0.75rem;
}

.main-content section.oso-gallery-section.section,
.main-content > section.oso-gallery-section {
  padding-top: 0;
  background: transparent;
}

.oso-gallery-shell {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  padding-right: clamp(1.25rem, 3vw, 2.5rem);
}

.oso-gallery-empty {
  color: var(--text-secondary, #64748b);
  text-align: center;
  padding: 2.5rem 1rem;
}

.oso-gallery-index-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.oso-gallery-index-hero h1 {
  color: var(--text-headline, var(--text-primary, #0f172a));
}

/* —— Index album cards —— */
.oso-gallery-album-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.oso-gallery-album-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-secondary, var(--form-bg, var(--bg-primary, #fff)));
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.1));
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.oso-gallery-album-card:hover,
.oso-gallery-album-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 40%, var(--border-color, #e2e8f0));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  outline: none;
}

.oso-gallery-album-card:focus-visible {
  outline: 2px solid var(--accent, #ff7a00);
  outline-offset: 3px;
}

.oso-gallery-album-card-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-primary, #1e1e1e);
}

.oso-gallery-album-card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.oso-gallery-album-card:hover .oso-gallery-album-card-media img {
  transform: scale(1.05);
}

.oso-gallery-album-card-placeholder {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #94a3b8);
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--accent, #ff7a00) 12%, var(--bg-secondary, #2b2b2b)),
      var(--bg-primary, #1e1e1e));
}

.oso-gallery-album-card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: flex-end;
  padding: 2.5rem 0.9rem 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 550;
  pointer-events: none;
}

.oso-gallery-album-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.oso-gallery-album-badge--featured {
  left: auto;
  right: 0.65rem;
  background: color-mix(in srgb, var(--accent, #ff7a00) 85%, #000);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 40%, transparent);
}

.oso-gallery-album-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem 1.2rem;
  flex: 1;
}

.oso-gallery-album-card-body h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-headline, var(--text-primary, #0f172a));
}

.oso-gallery-album-card-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary, var(--text-paragraph, #64748b));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.oso-gallery-album-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent, #ff7a00);
}

.oso-gallery-album-cta::after {
  content: "→";
  transition: transform 0.15s ease;
}

.oso-gallery-album-card:hover .oso-gallery-album-cta::after {
  transform: translateX(3px);
}

/* —— Album hero —— */
.oso-gallery-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 0 0;
  min-height: clamp(280px, 42vw, 420px);
  display: flex;
  align-items: stretch;
  color: #fff;
}

.oso-gallery-hero-bg {
  position: absolute;
  inset: -24px;
  z-index: 0;
  background-image: var(--hero-cover);
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.05);
  transform: scale(1.08);
}

.oso-gallery-hero-bg--fallback {
  background-image: none;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--accent, #ff7a00) 22%, var(--bg-primary, #1e1e1e)),
    var(--bg-secondary, #2b2b2b) 55%,
    var(--bg-primary, #1e1e1e));
  filter: none;
  transform: none;
  inset: 0;
}

.oso-gallery-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(115deg, rgba(8, 10, 14, 0.88) 0%, rgba(8, 10, 14, 0.55) 48%, rgba(8, 10, 14, 0.72) 100%),
    linear-gradient(to top, rgba(8, 10, 14, 0.55), transparent 40%);
}

.oso-gallery-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 900px) {
  .oso-gallery-hero-inner {
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.75fr);
    gap: 2.5rem;
  }
}

.oso-gallery-hero-copy {
  min-width: 0;
}

.oso-gallery-album-back {
  margin: 0 0 0.85rem;
}

.oso-gallery-hero .oso-gallery-back {
  color: rgba(255, 255, 255, 0.72);
}

.oso-gallery-hero .oso-gallery-back:hover,
.oso-gallery-hero .oso-gallery-back:focus-visible {
  color: #fff;
}

.oso-gallery-hero-copy h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-wrap: balance;
}

.oso-gallery-album-desc {
  margin: 0 0 1rem;
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.oso-gallery-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
}

.oso-gallery-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  font-size: 0.8125rem;
  font-weight: 550;
  color: rgba(255, 255, 255, 0.92);
}

.oso-gallery-meta-chip svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.oso-gallery-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.oso-gallery-hero-cover-card {
  position: relative;
  justify-self: center;
  width: min(100%, 320px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
}

@media (min-width: 900px) {
  .oso-gallery-hero-cover-card {
    justify-self: end;
    width: min(100%, 340px);
  }
}

.oso-gallery-hero-cover-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.oso-gallery-hero-cover-meta {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 2rem 0.9rem 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
}

/* —— Sticky toolbar —— */
.oso-gallery-toolbar-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-primary, #1e1e1e) 88%, transparent);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.oso-gallery-toolbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem clamp(1.25rem, 3vw, 2.5rem);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.oso-gallery-toolbar-inner::-webkit-scrollbar {
  display: none;
}

.oso-gallery-toolbar-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-secondary, #2b2b2b) 80%, transparent);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.oso-gallery-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary, #ccc);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.oso-gallery-tab:hover {
  color: var(--text-headline, #fff);
}

.oso-gallery-tab.is-active,
.oso-gallery-tab[aria-selected="true"] {
  background: var(--accent, #ff7a00);
  color: #fff;
}

.oso-gallery-toolbar-controls {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 0.65rem;
  align-items: center;
}

/* —— Collection chips —— */
.oso-gallery-collections-row {
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  background: color-mix(in srgb, var(--bg-primary, #1e1e1e) 94%, transparent);
}

.oso-gallery-collections-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem clamp(1.25rem, 3vw, 2.5rem);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.oso-gallery-collections-inner::-webkit-scrollbar {
  display: none;
}

.oso-gallery-collection-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  background: var(--bg-secondary, #2b2b2b);
  color: var(--text-secondary, #ccc);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.oso-gallery-collection-chip:hover {
  color: var(--text-headline, #fff);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 45%, transparent);
}

.oso-gallery-collection-chip.is-active {
  background: var(--accent, #ff7a00);
  border-color: var(--accent, #ff7a00);
  color: #fff;
}

.oso-gallery-collection-chip-count {
  font-size: 0.7rem;
  font-weight: 550;
  opacity: 0.75;
}

.oso-gallery-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary, #ccc);
}

.oso-gallery-control-label {
  font-weight: 550;
  white-space: nowrap;
}

.oso-gallery-select {
  appearance: none;
  min-height: 2.15rem;
  padding: 0.3rem 1.75rem 0.3rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
  background:
    var(--bg-secondary, #2b2b2b)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ccc' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 0.55rem center;
  color: var(--text-headline, #fff);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.oso-gallery-density-control input[type="range"] {
  width: 5.5rem;
  accent-color: var(--accent, #ff7a00);
  cursor: pointer;
}

.oso-gallery-view-toggle {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  background: var(--bg-secondary, #2b2b2b);
}

.oso-gallery-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #ccc);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.oso-gallery-view-btn:hover {
  color: var(--text-headline, #fff);
}

.oso-gallery-view-btn.is-active,
.oso-gallery-view-btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent, #ff7a00) 22%, transparent);
  color: var(--accent, #ff7a00);
}

.oso-gallery-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  border: 1.5px solid var(--accent, #ff7a00);
  background: transparent;
  color: var(--accent, var(--text-headline, #f8fafc));
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.oso-gallery-chip:hover {
  background: color-mix(in srgb, var(--accent, #ff7a00) 16%, transparent);
  color: var(--accent, var(--text-headline, #fff));
}

.oso-gallery-chip.is-active,
.oso-gallery-chip[aria-pressed="true"] {
  background: var(--accent, #ff7a00);
  border-color: var(--accent, #ff7a00);
  color: #fff;
}

.oso-gallery-chip .oso-gallery-fav-icon {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linejoin: round;
}

.oso-gallery-credits {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.72);
  padding: 0 0.25rem;
}

.oso-gallery-back {
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  font-size: 0.9375rem;
}

.oso-gallery-back:hover,
.oso-gallery-back:focus-visible {
  color: var(--accent, var(--text-primary, #f8fafc));
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* —— Grid / masonry —— */
.oso-gallery-shell > .oso-gallery-album {
  margin-top: 1.35rem;
  margin-bottom: 1rem;
}

.oso-gallery-grid,
.oso-gallery-masonry {
  display: grid;
  gap: var(--gal-gap, 0.75rem);
  grid-template-columns: repeat(var(--gal-cols-m, 2), 1fr);
}

@media (min-width: 640px) {
  .oso-gallery-grid,
  .oso-gallery-masonry {
    grid-template-columns: repeat(var(--gal-cols-t, 3), 1fr);
  }
}

@media (min-width: 1024px) {
  .oso-gallery-grid,
  .oso-gallery-masonry {
    grid-template-columns: repeat(var(--gal-cols-d, 4), 1fr);
  }
}

.oso-gallery-masonry {
  grid-auto-flow: dense;
}

.oso-gallery-item {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-secondary, #2b2b2b);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.oso-gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 42%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.oso-gallery-item:hover,
.oso-gallery-item:focus-within {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.oso-gallery-item:hover::after,
.oso-gallery-item:focus-within::after {
  opacity: 1;
}

.oso-gallery-thumb-btn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  width: 100%;
  position: relative;
  z-index: 0;
}

.oso-gallery-thumb-btn img {
  display: block;
  width: 100%;
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0;
}

.oso-gallery-item.is-loaded .oso-gallery-thumb-btn img {
  opacity: 1;
}

.oso-gallery-item:hover .oso-gallery-thumb-btn img,
.oso-gallery-item:focus-within .oso-gallery-thumb-btn img {
  transform: scale(1.04);
}

.oso-gallery-grid .oso-gallery-item img {
  height: auto;
  aspect-ratio: var(--gal-aspect, auto);
  object-fit: cover;
}

.oso-gallery-masonry .oso-gallery-item img {
  height: auto;
  object-fit: cover;
}

.oso-gallery-item-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 1.5rem 0.65rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fav button — opaque dark circle, outline heart */
.oso-gallery-fav-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: none;
  color: #fff;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  cursor: pointer;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  opacity: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.2s ease;
}

.oso-gallery-fav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.oso-gallery-fav-btn .oso-gallery-fav-icon {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.oso-gallery-fav-btn.is-on,
.oso-gallery-fav-btn[aria-pressed="true"] {
  color: #fb7185;
  background: rgba(0, 0, 0, 0.82);
  border-color: color-mix(in srgb, #fb7185 55%, rgba(255, 255, 255, 0.28));
}

.oso-gallery-fav-btn.is-on .oso-gallery-fav-icon,
.oso-gallery-fav-btn[aria-pressed="true"] .oso-gallery-fav-icon {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.25;
}

/* Tile action dock */
.oso-gallery-item-actions {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  z-index: 3;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.oso-gallery-item:hover .oso-gallery-item-actions,
.oso-gallery-item:focus-within .oso-gallery-item-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.oso-gallery-tile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.oso-gallery-tile-action:hover {
  background: rgba(0, 0, 0, 0.92);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 55%, #fff);
  transform: scale(1.05);
}

@media (max-width: 767px) {
  .oso-gallery-fav-btn {
    opacity: 1;
  }

  .oso-gallery-item-actions {
    opacity: 0;
    pointer-events: none;
  }

  .oso-gallery-item:hover .oso-gallery-item-actions,
  .oso-gallery-item:focus-within .oso-gallery-item-actions {
    opacity: 0;
    pointer-events: none;
  }
}

@media (hover: none) {
  .oso-gallery-item-actions {
    opacity: 0;
    pointer-events: none;
  }
}

/* Selection mode */
.oso-gallery-select-check {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 4;
  display: none;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  cursor: pointer;
}

.oso-gallery-select-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.oso-gallery-select-box {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.oso-gallery-select-input:checked + .oso-gallery-select-box {
  background: var(--accent, #ff7a00);
  border-color: var(--accent, #ff7a00);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 70%;
  background-repeat: no-repeat;
  background-position: center;
}

.oso-gallery-select-input:focus-visible + .oso-gallery-select-box {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.oso-gallery-selecting .oso-gallery-select-check,
#oso-gallery-root.is-selecting .oso-gallery-select-check {
  display: block;
}

body.oso-gallery-selecting .oso-gallery-item-actions,
#oso-gallery-root.is-selecting .oso-gallery-item-actions {
  display: none;
}

body.oso-gallery-selecting .oso-gallery-item.is-selected,
#oso-gallery-root.is-selecting .oso-gallery-item.is-selected {
  outline: 2px solid var(--accent, #ff7a00);
  outline-offset: 2px;
}

body.oso-gallery-selecting .oso-gallery-thumb-btn {
  cursor: default;
}

.oso-gallery-load-more {
  margin: 1.75rem auto 2.5rem;
  display: block;
}

/* Floating selection bar */
.oso-gallery-selection-bar {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  width: min(calc(100vw - 1.5rem), 560px);
  pointer-events: none;
}

.oso-gallery-selection-bar[hidden] {
  display: none !important;
}

.oso-gallery-selection-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 18, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  color: #fff;
}

.oso-gallery-selection-count {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0 0.35rem;
  white-space: nowrap;
}

.oso-gallery-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.oso-gallery-selection-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  min-height: 2.1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.oso-gallery-selection-btn:hover {
  background: color-mix(in srgb, var(--accent, #ff7a00) 28%, transparent);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 45%, transparent);
}

.oso-gallery-selection-done {
  flex-shrink: 0;
  min-height: 2.15rem !important;
  padding: 0.35rem 1rem !important;
  border-radius: 999px !important;
}

@media (max-width: 520px) {
  .oso-gallery-selection-inner {
    border-radius: 18px;
    justify-content: center;
  }
}

/* Carousel (embed displays) */
.oso-gallery-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.oso-gallery-carousel-track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  flex: 1;
  padding: 0.25rem 0;
}

.oso-gallery-carousel-track .oso-gallery-item {
  flex: 0 0 min(70vw, 280px);
  scroll-snap-align: start;
}

.oso-gallery-carousel-prev,
.oso-gallery-carousel-next {
  border: 1px solid var(--border-color, #ddd);
  background: var(--bg-primary, #fff);
  color: var(--text-headline, #0f172a);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  cursor: pointer;
}

/* Before/After */
.oso-gallery-before-after {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.oso-gallery-ba-track {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #111;
  border-radius: 12px;
}

.oso-gallery-ba-after,
.oso-gallery-ba-before {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.oso-gallery-ba-before-wrap {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
  border-right: 2px solid #fff;
}

.oso-gallery-ba-before {
  width: 100vw;
  max-width: none;
  height: 100%;
}

.oso-gallery-ba-range {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  width: 90%;
  margin: 0 auto;
  display: block;
}

/* —— Compare overlay —— */
.oso-gallery-compare[hidden] {
  display: none !important;
}

.oso-gallery-compare {
  --lb-glass: rgba(15, 23, 42, 0.55);
  --lb-glass-border: rgba(255, 255, 255, 0.14);
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 10, 14, 0.96);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

.oso-gallery-compare-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.oso-gallery-compare-modes {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--lb-glass-border);
}

.oso-gallery-compare-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.oso-gallery-compare-mode-btn.is-active {
  background: var(--accent, #ff7a00);
  color: #fff;
}

.oso-gallery-compare-zoom-together {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  margin-left: auto;
}

.oso-gallery-compare-zoom-together input {
  accent-color: var(--accent, #ff7a00);
  cursor: pointer;
}

.oso-gallery-compare-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 0 1rem;
}

.oso-gallery-compare-side-view {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.oso-gallery-compare-pane {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--lb-glass-border);
}

.oso-gallery-compare-pane-label {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 2;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--lb-glass);
  border: 1px solid var(--lb-glass-border);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 600;
  max-width: calc(100% - 4rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oso-gallery-compare-pane-media {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.oso-gallery-compare-pane-media.is-panning {
  cursor: grabbing;
}

.oso-gallery-compare-pane-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.oso-gallery-compare-pane-media.is-panning img {
  transition: none;
}

.oso-gallery-compare-fav {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--lb-glass-border);
  background: var(--lb-glass);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.oso-gallery-compare-fav svg {
  width: 1.05rem;
  height: 1.05rem;
}

.oso-gallery-compare-fav:hover {
  background: rgba(255, 255, 255, 0.16);
}

.oso-gallery-compare-fav.is-on {
  color: #fb7185;
  border-color: color-mix(in srgb, #fb7185 50%, transparent);
}

.oso-gallery-compare-fav.is-on svg {
  fill: currentColor;
  stroke: currentColor;
}

.oso-gallery-compare-ba-view {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
}

.oso-gallery-compare-ba-track {
  --ba-pos: 50%;
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  border: 1px solid var(--lb-glass-border);
  touch-action: none;
}

.oso-gallery-compare-ba-after,
.oso-gallery-compare-ba-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.oso-gallery-compare-ba-before {
  clip-path: inset(0 calc(100% - var(--ba-pos)) 0 0);
}

.oso-gallery-compare-ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-pos);
  width: 3px;
  background: rgba(255, 255, 255, 0.85);
  transform: translateX(-50%);
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.oso-gallery-compare-ba-handle-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.oso-gallery-compare-ba-tag {
  position: absolute;
  top: 0.75rem;
  z-index: 2;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--lb-glass);
  border: 1px solid var(--lb-glass-border);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.oso-gallery-compare-ba-tag--before { left: 0.75rem; }
.oso-gallery-compare-ba-tag--after { right: 0.75rem; }

.oso-gallery-compare-ba-favs {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}

.oso-gallery-compare-ba-favs .oso-gallery-compare-fav {
  position: static;
}

.oso-gallery-compare-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0));
}

.oso-gallery-compare-move {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
}

.oso-gallery-compare-move-label {
  margin-right: 0.15rem;
}

.oso-gallery-compare-move-btn {
  appearance: none;
  border: 1px solid var(--lb-glass-border);
  background: var(--lb-glass);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.oso-gallery-compare-move-btn.is-active {
  background: var(--accent, #ff7a00);
  border-color: var(--accent, #ff7a00);
}

.oso-gallery-compare-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.oso-gallery-compare-nav .oso-lightbox-nav {
  position: static;
  transform: none;
}

.oso-gallery-compare-swap {
  border-radius: 999px !important;
}

@media (max-width: 780px) {
  .oso-gallery-compare-stage {
    padding: 0 0.65rem;
  }

  .oso-gallery-compare-side-view {
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
  }

  .oso-gallery-compare-pane {
    flex: 1 1 auto;
    min-height: 40vh;
  }

  .oso-gallery-compare-bottom {
    justify-content: center;
  }

  .oso-gallery-compare-nav {
    margin-left: 0;
  }

  .oso-gallery-compare-top {
    justify-content: center;
  }

  .oso-gallery-compare-zoom-together {
    margin-left: 0;
    flex-basis: 100%;
    justify-content: center;
  }
}

/* Password / access gate */
.oso-gallery-gate {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 2rem;
}

.oso-gallery-gate-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-headline, var(--text-primary, #0f172a));
  background: var(--bg-secondary, var(--form-bg, var(--bg-primary, #fff)));
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.1));
  border-radius: 18px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.oso-gallery-gate-card h1 {
  color: inherit;
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.oso-gallery-gate-card > p {
  color: var(--text-secondary, #64748b);
  margin: 0.65rem 0;
}

.oso-gallery-gate-form label {
  display: block;
  text-align: left;
  font-weight: 550;
  font-size: 0.875rem;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.35rem;
}

.oso-gallery-gate-form input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #0f172a);
  font: inherit;
}

.oso-gallery-gate-form input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent, #ff7a00) 55%, transparent);
  outline-offset: 1px;
  border-color: var(--accent, #ff7a00);
}

.oso-gallery-gate-actions {
  margin: 1.25rem 0 0.75rem;
}

.oso-gallery-gate-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
}

.oso-gallery-gate-nav {
  margin-top: 1.5rem;
}

.oso-gallery-gate .oso-gallery-back {
  color: var(--text-secondary, #64748b);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-weight: 500;
}

.oso-gallery-gate .oso-gallery-back:hover,
.oso-gallery-gate .oso-gallery-back:focus-visible {
  color: var(--accent, var(--text-primary, #0f172a));
}

.oso-gallery-gate .oso-gallery-portal-hint {
  color: var(--text-secondary, #64748b);
}

/* My Galleries portal */
.oso-gallery-portal-form {
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.oso-gallery-portal-form label {
  display: block;
  font-weight: 600;
  margin-top: 0.75rem;
  text-align: left;
}

.oso-gallery-portal-form input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0.5rem 0 0;
  text-align: left;
}

.oso-gallery-portal-form .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

.oso-gallery-portal-form .oso-gallery-portal-hint {
  text-align: center;
  margin-top: 0.85rem;
}

.oso-gallery-portal-error {
  color: #b91c1c;
  text-align: center;
}

.oso-gallery-portal-hint,
.oso-gallery-optional {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.875rem;
  font-weight: 400;
}

.oso-gallery-portal-session {
  margin-bottom: 1.25rem;
}

.oso-gallery-portal-favs-title {
  margin-top: 2rem;
}

.oso-gallery-portal-favs {
  padding-left: 1.25rem;
}

/* —— Lightbox —— */
.oso-lightbox[hidden] {
  display: none !important;
}

.oso-lightbox {
  --lb-glass: rgba(15, 23, 42, 0.55);
  --lb-glass-border: rgba(255, 255, 255, 0.14);
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 10, 14, 0.94);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

.oso-lightbox:fullscreen,
.oso-lightbox:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background: #000;
}

.oso-lightbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  flex-shrink: 0;
}

.oso-lightbox-top-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.oso-lightbox-count {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--lb-glass);
  border: 1px solid var(--lb-glass-border);
  backdrop-filter: blur(10px);
  font-size: 0.875rem;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.oso-lightbox-icon-btn,
.oso-lightbox-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--lb-glass-border);
  background: var(--lb-glass);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.oso-lightbox-icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.oso-lightbox-icon-btn:hover,
.oso-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.oso-lightbox-icon-btn.is-active {
  color: var(--accent, #ff7a00);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 45%, transparent);
}

.oso-lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  padding: 0.25rem 3.5rem;
  cursor: grab;
}

.oso-lightbox-stage.is-zoomed {
  touch-action: none;
  cursor: grab;
}

.oso-lightbox-stage.is-panning {
  cursor: grabbing;
}

.oso-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.oso-lightbox-stage.is-zoomed img {
  transition: none;
}

.oso-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--lb-glass);
  border: 1px solid var(--lb-glass-border);
  backdrop-filter: blur(10px);
  color: #fff;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 2;
}

.oso-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.16);
}

.oso-lightbox-prev { left: 0.65rem; }
.oso-lightbox-next { right: 0.65rem; }

.oso-lightbox-filmstrip {
  flex-shrink: 0;
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem 1rem 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.oso-lightbox-thumb {
  flex: 0 0 auto;
  width: 3.4rem;
  height: 2.4rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.oso-lightbox-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oso-lightbox-thumb:hover {
  opacity: 0.9;
}

.oso-lightbox-thumb.is-active {
  opacity: 1;
  border-color: var(--accent, #ff7a00);
}

.oso-lightbox-bottom {
  flex-shrink: 0;
  padding: 0.55rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0));
  text-align: center;
}

.oso-lightbox-caption {
  min-height: 1.25rem;
  margin-bottom: 0.55rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.78);
}

.oso-lightbox-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0.1rem;
  scrollbar-width: none;
}

.oso-lightbox-actions::-webkit-scrollbar {
  display: none;
}

.oso-lb-action {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 4.25rem;
  min-height: 3.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--lb-glass-border);
  background: var(--lb-glass);
  backdrop-filter: blur(10px);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.oso-lb-action svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.95;
}

.oso-lb-action:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 50%, transparent);
}

.oso-lb-action.is-on,
.oso-lb-action.is-active {
  color: var(--accent, #ffb366);
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 55%, transparent);
  background: color-mix(in srgb, var(--accent, #ff7a00) 22%, rgba(15, 23, 42, 0.55));
}

.oso-lb-action.is-on svg,
.oso-lb-action.is-active svg {
  opacity: 1;
}

.oso-lb-action.oso-lb-fav.is-on {
  color: #fb7185;
  border-color: color-mix(in srgb, #fb7185 50%, transparent);
}

.oso-lb-action.oso-lb-fav.is-on svg {
  fill: currentColor;
  stroke: currentColor;
}

.oso-lightbox button:focus-visible,
.oso-lightbox a:focus-visible,
.oso-gallery-thumb-btn:focus-visible,
.oso-gallery-fav-btn:focus-visible,
.oso-gallery-chip:focus-visible,
.oso-gallery-tab:focus-visible,
.oso-gallery-view-btn:focus-visible,
.oso-gallery-selection-btn:focus-visible,
.oso-gallery-tile-action:focus-visible {
  outline: 2px solid var(--accent, #fff);
  outline-offset: 2px;
}

/* Toast */
.oso-gallery-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%) translateY(120%);
  z-index: 10000;
  max-width: min(90vw, 360px);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.oso-gallery-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.oso-gallery-toast.is-error {
  background: rgba(127, 29, 29, 0.95);
}

@media (max-width: 640px) {
  .oso-lightbox-stage {
    padding: 0.25rem 0.5rem;
  }

  .oso-lightbox-nav {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.2rem;
  }

  .oso-lightbox-prev { left: 0.35rem; }
  .oso-lightbox-next { right: 0.35rem; }

  .oso-lb-action {
    min-width: 3.85rem;
    min-height: 3.35rem;
  }

  .oso-lightbox-thumb {
    width: 2.85rem;
    height: 2.1rem;
  }

  .oso-gallery-control-label {
    display: none;
  }
}

/* —— Index landing: hero band —— */
.oso-gallery-index-hero-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  min-height: clamp(260px, 36vw, 380px);
  display: flex;
  align-items: stretch;
  margin-bottom: 2rem;
}

.oso-gallery-index-hero-bg {
  position: absolute;
  inset: -24px;
  z-index: 0;
  background-image: var(--hero-index-bg, none);
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
}

.oso-gallery-index-hero-band.is-blurred .oso-gallery-index-hero-bg {
  filter: blur(26px) saturate(1.05);
}

.oso-gallery-index-hero-band:not(.has-bg) .oso-gallery-index-hero-bg {
  inset: 0;
  transform: none;
  background-image: none;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--accent, #ff7a00) 22%, var(--bg-primary, #1e1e1e)),
    var(--bg-secondary, #2b2b2b) 55%,
    var(--bg-primary, #1e1e1e));
}

.oso-gallery-index-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg,
    rgba(8, 10, 14, var(--hero-index-overlay, 0.68)) 0%,
    rgba(8, 10, 14, calc(var(--hero-index-overlay, 0.68) * 0.65)) 55%,
    rgba(8, 10, 14, calc(var(--hero-index-overlay, 0.68) * 0.85)) 100%);
}

.oso-gallery-index-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 900px) {
  .oso-gallery-index-hero-inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.7fr);
    gap: 2.5rem;
  }
}

.oso-gallery-index-hero-copy {
  min-width: 0;
}

.oso-gallery-index-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 550;
  color: rgba(255, 255, 255, 0.7);
}

.oso-gallery-index-breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.oso-gallery-index-breadcrumb a:hover,
.oso-gallery-index-breadcrumb a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.oso-gallery-index-breadcrumb span:last-child {
  color: #fff;
}

.oso-gallery-index-hero-copy h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.85rem, 3.75vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-wrap: balance;
}

.oso-gallery-index-hero-desc {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.oso-gallery-index-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
}

.oso-gallery-index-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.oso-gallery-index-stat-value {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.oso-gallery-index-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

/* —— Featured album card (hero) —— */
.oso-gallery-index-featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-self: center;
  width: min(100%, 320px);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.oso-gallery-index-featured-card:hover,
.oso-gallery-index-featured-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.5);
}

@media (min-width: 900px) {
  .oso-gallery-index-featured-card {
    justify-self: end;
    width: min(100%, 340px);
  }
}

.oso-gallery-index-featured-card img,
.oso-gallery-index-featured-card .oso-gallery-album-card-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.oso-gallery-index-featured-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent, #ff7a00);
}

.oso-gallery-index-featured-meta {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 2.5rem 1rem 0.85rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
}

.oso-gallery-index-featured-meta strong {
  font-size: 1rem;
  font-weight: 650;
}

.oso-gallery-index-featured-meta span {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.78);
}

/* —— Index toolbar —— */
.oso-gallery-index-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0 0 1.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 16px;
  background: var(--bg-secondary, var(--form-bg, var(--bg-primary, #fff)));
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.1));
}

.oso-gallery-index-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-primary, #1e1e1e) 6%, transparent);
}

.oso-gallery-index-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.oso-gallery-index-tab:hover {
  color: var(--text-headline, var(--text-primary, #0f172a));
}

.oso-gallery-index-tab.is-active {
  background: var(--accent, #ff7a00);
  color: #fff;
}

.oso-gallery-index-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.oso-gallery-index-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.14));
  background: var(--bg-primary, #fff);
}

.oso-gallery-index-search input[type="search"] {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary, #0f172a);
  font: inherit;
  font-size: 0.8125rem;
  width: clamp(9rem, 16vw, 14rem);
}

.oso-gallery-index-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
}

.oso-gallery-index-search-btn:hover {
  color: var(--accent, #ff7a00);
}

/* —— Album grid density —— */
.oso-gallery-album-list--compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.oso-gallery-album-list--large {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.oso-gallery-album-list--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 440px;
}

.oso-gallery-album-list.is-list-view {
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.oso-gallery-album-list.is-list-view .oso-gallery-album-card {
  flex-direction: row;
  align-items: stretch;
}

.oso-gallery-album-list.is-list-view .oso-gallery-album-card-media {
  flex: 0 0 220px;
}

.oso-gallery-album-list.is-list-view .oso-gallery-album-card-media img,
.oso-gallery-album-list.is-list-view .oso-gallery-album-card-placeholder {
  aspect-ratio: auto;
  height: 100%;
  min-height: 140px;
}

.oso-gallery-album-list.is-list-view .oso-gallery-album-card-body {
  flex: 1;
  justify-content: center;
}

@media (max-width: 640px) {
  .oso-gallery-album-list.is-list-view .oso-gallery-album-card {
    flex-direction: column;
  }

  .oso-gallery-album-list.is-list-view .oso-gallery-album-card-media {
    flex: none;
  }
}

.oso-gallery-album-card-views {
  color: rgba(255, 255, 255, 0.85);
}

/* —— Pagination —— */
.oso-gallery-index-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.oso-gallery-index-page-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.14));
  background: var(--bg-secondary, var(--bg-primary, #fff));
  color: var(--text-headline, var(--text-primary, #0f172a));
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.oso-gallery-index-page-link:hover,
.oso-gallery-index-page-link:focus-visible {
  border-color: var(--accent, #ff7a00);
  color: var(--accent, #ff7a00);
}

.oso-gallery-index-page-status {
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--text-secondary, #64748b);
}

/* —— Feature strip —— */
.oso-gallery-feature-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0 1rem;
}

.oso-gallery-feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  background: var(--bg-secondary, var(--form-bg, var(--bg-primary, #fff)));
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.1));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

a.oso-gallery-feature-card:hover,
a.oso-gallery-feature-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent, #ff7a00) 45%, var(--border-color, #e2e8f0));
  transform: translateY(-2px);
}

.oso-gallery-feature-card-title {
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--text-headline, var(--text-primary, #0f172a));
}

.oso-gallery-feature-card-desc {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary, var(--text-paragraph, #64748b));
}

@media (max-width: 640px) {
  .oso-gallery-index-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .oso-gallery-index-toolbar-controls {
    justify-content: space-between;
  }

  .oso-gallery-index-search input[type="search"] {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oso-gallery-album-card,
  .oso-gallery-album-card-media img,
  .oso-gallery-album-cta::after,
  .oso-gallery-item,
  .oso-gallery-item::after,
  .oso-gallery-thumb-btn img,
  .oso-gallery-fav-btn,
  .oso-gallery-item-actions,
  .oso-gallery-tile-action,
  .oso-gallery-tab,
  .oso-gallery-index-tab,
  .oso-gallery-index-featured-card,
  .oso-gallery-feature-card,
  .oso-gallery-index-page-link,
  .oso-lightbox-stage img,
  .oso-gallery-toast,
  .oso-lb-action,
  .oso-lightbox-thumb {
    transition: none !important;
  }

  .oso-gallery-album-card:hover,
  .oso-gallery-album-card:hover .oso-gallery-album-card-media img,
  .oso-gallery-item:hover .oso-gallery-thumb-btn img,
  .oso-gallery-item:focus-within .oso-gallery-thumb-btn img,
  .oso-gallery-fav-btn:hover,
  .oso-gallery-tile-action:hover,
  .oso-gallery-index-featured-card:hover,
  a.oso-gallery-feature-card:hover {
    transform: none;
  }

  .oso-gallery-hero-bg,
  .oso-gallery-index-hero-bg {
    filter: blur(12px) saturate(1);
  }
}
