html { scroll-snap-type: none; }
body.gallery-page { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
body.gallery-page .page-bg-overlay { background-image: linear-gradient(to right, rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.03) 1px, transparent 1px); animation: none; }
.gallery-page .nav-links a { white-space: nowrap; }
.gallery-main { width: 100%; min-width: 0; position: relative; z-index: 2; flex: 1 0 auto; padding-top: var(--nav-height); }
.gallery-page > .footer { width: 100%; margin-top: auto; }
.gallery-hero {
  min-height: 300px;
  padding: 62px 0 24px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.gallery-hero-content { position: relative; z-index: 2; text-align: center; }
.gallery-hero .section-badge { margin-bottom: 14px; }
.gallery-hero .hero-title { margin-bottom: 10px; }
.gallery-hero .hero-subtitle { margin-bottom: 22px; }
.gallery-hero .glow-orb { display: none; }
.gallery-content-section { padding: 34px 0 78px; min-height: 420px; position: relative; }
.gallery-content-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1152px, calc(100% - 48px));
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .42) 18%, rgba(255,255,255,.12) 50%, rgba(167, 139, 250, .42) 82%, transparent);
  box-shadow: 0 0 16px rgba(139,92,246,.12);
  pointer-events: none;
}
.gallery-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 18px; padding-bottom: 0; border: 0; }
.gallery-heading-row .section-title { font-size: 1.8rem; }
.gallery-admin-trigger { flex: 0 0 auto; }
.gallery-status { min-height: 58px; display: flex; justify-content: center; align-items: center; margin: 12px 0 18px; padding: 16px 20px; color: var(--text-muted); text-align: center; background: rgba(18,14,28,.48); border: 1px solid var(--border-color); border-radius: 14px; }
.gallery-status[hidden] { display: none !important; }
.gallery-status.is-error { color: #fecaca; border-color: rgba(248,113,113,.35); }
.gallery-seasons { min-width: 0; display: flex; flex-wrap: wrap; gap: 9px; margin: 8px 0 14px; }
.gallery-season { min-width: 0; display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; color: var(--text-muted); font: inherit; text-align: left; cursor: pointer; background: rgba(255,255,255,.035); border: 1px solid var(--border-color); border-radius: 12px; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.gallery-season:hover, .gallery-season.active { color: #fff; background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.48); }
.gallery-season-copy { display: grid; line-height: 1.2; }
.gallery-season-copy strong { font-size: .83rem; }
.gallery-season-copy small { margin-top: 3px; color: var(--text-muted); font-size: .7rem; }
.gallery-season-count { min-width: 25px; padding: 3px 7px; color: #ddd1ff; font-size: .7rem; text-align: center; background: rgba(139,92,246,.16); border-radius: 999px; }
.gallery-season.active .gallery-season-count { color: #fff; background: rgba(139,92,246,.48); }
.gallery-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.gallery-filter {
  min-height: 36px;
  padding: 7px 13px;
  color: var(--text-muted);
  font: inherit;
  font-size: .81rem;
  cursor: pointer;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.gallery-filter:hover, .gallery-filter.active { color: #fff; background: rgba(139,92,246,.2); border-color: rgba(139,92,246,.45); }
.gallery-grid { column-count: 3; column-gap: 18px; }
.gallery-card {
  width: 100%;
  display: inline-block;
  position: relative;
  margin: 0 0 18px;
  overflow: hidden;
  vertical-align: top;
  background: linear-gradient(155deg, rgba(22,17,34,.94), rgba(11,9,17,.92));
  border: 1px solid var(--border-color);
  border-radius: 17px;
  break-inside: avoid;
  box-shadow: 0 8px 26px rgba(0,0,0,.2);
  transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.gallery-card:hover { transform: translateY(-3px); border-color: rgba(139,92,246,.42); box-shadow: 0 16px 36px rgba(0,0,0,.32), 0 0 20px rgba(139,92,246,.11); }
.gallery-card-media { position: relative; overflow: hidden; background: rgba(0,0,0,.22); }
.gallery-open { width: 100%; display: block; padding: 0; overflow: hidden; border: 0; background: transparent; cursor: zoom-in; }
.gallery-open img { width: 100%; height: auto; max-height: 680px; display: block; object-fit: contain; transition: transform .45s ease; }
.gallery-card:hover .gallery-open img { transform: scale(1.025); }
.gallery-card-caption { padding: 14px 15px 15px; cursor: zoom-in; }
.gallery-caption-open { display: inline-flex; max-width: 100%; padding: 0; color: inherit; font: inherit; text-align: left; cursor: zoom-in; background: transparent; border: 0; }
.gallery-caption-title-open { width: 100%; display: block; padding: 0; color: inherit; font: inherit; text-align: left; cursor: zoom-in; background: transparent; border: 0; }
.gallery-card-category, .lightbox-category { display: inline-flex; align-items: center; gap: 6px; color: #c4b5fd; font-size: .69rem; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.gallery-card-caption h3 { margin-top: 5px; color: #fff; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.gallery-card-admin-actions { position: absolute; z-index: 2; top: 11px; right: 11px; display: flex; gap: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease; }
.gallery-card:hover .gallery-card-admin-actions, .gallery-card:focus-within .gallery-card-admin-actions { opacity: 1; transform: translateY(0); }
.gallery-card-admin-actions button { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; cursor: pointer; background: rgba(9,7,15,.82); border: 1px solid rgba(255,255,255,.18); border-radius: 11px; backdrop-filter: blur(9px); }
.gallery-card-admin-actions button:hover { background: var(--accent-purple-hover); }
.gallery-empty { min-height: 180px; display: grid; place-items: center; gap: 5px; padding: 28px; color: var(--text-muted); text-align: center; background: rgba(18,14,28,.34); border: 1px dashed rgba(196,181,253,.2); border-radius: 18px; }
.gallery-empty i { color: #c4b5fd; font-size: 1.8rem; margin-bottom: 5px; }
.gallery-empty strong { color: #eee8ff; font-size: 1rem; }
.gallery-admin { width: 100%; min-width: 0; max-width: 100%; margin: 0 0 22px; padding: 16px 18px; box-sizing: border-box; border: 1px solid rgba(139,92,246,.28); border-radius: 16px; background: linear-gradient(145deg, rgba(20,16,32,.9), rgba(12,9,20,.82)); box-shadow: 0 12px 34px rgba(0,0,0,.18); }
.gallery-content-section > .container { min-width: 0; }
.gallery-admin[hidden], .gallery-editor-content[hidden], .gallery-edit-modal[hidden], .gallery-lightbox[hidden], .gallery-auth-modal[hidden] { display: none !important; }
.gallery-admin-bar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.gallery-admin-copy .section-badge { display: block; width: max-content; max-width: 100%; margin: 0 0 5px; }
.gallery-admin-copy h2 { color: #fff; font-size: 1.08rem; line-height: 1.25; }
.gallery-admin-copy p { margin-top: 3px; color: var(--text-muted); font-size: .8rem; }
.gallery-admin-actions { min-width: 0; display: flex; align-items: center; flex: 0 0 auto; gap: 8px; }
.gallery-admin-actions .btn-primary, .gallery-admin-actions .btn-secondary { padding: 9px 14px; font-size: .82rem; }
.gallery-editor-content { padding-top: 20px; margin-top: 16px; border-top: 1px solid var(--border-color); }
.gallery-upload-form { padding: 18px; background: rgba(8,6,15,.43); border: 1px solid var(--border-color); border-radius: 15px; }
.upload-form-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.upload-form-heading h3 { color: #fff; font-size: 1rem; }
.upload-form-heading h3 i { color: #c4b5fd; margin-right: 6px; }
.upload-form-heading p { margin-top: 4px; color: var(--text-muted); font-size: .77rem; }
.gallery-upload-drop { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; position: relative; overflow: hidden; color: #e9e5f4; text-align: center; cursor: pointer; background: rgba(139,92,246,.055); border: 1px dashed rgba(196,181,253,.36); border-radius: 13px; transition: background .2s ease, border-color .2s ease; }
.gallery-upload-drop:hover { background: rgba(139,92,246,.11); border-color: var(--accent-purple); }
.gallery-upload-drop > i { color: #c4b5fd; font-size: 1.55rem; margin-bottom: 3px; }
.gallery-upload-drop strong { font-size: .9rem; }
.gallery-upload-drop span { color: var(--text-muted); font-size: .77rem; }
.gallery-upload-drop input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.gallery-upload-items { display: grid; gap: 8px; margin-top: 12px; }
.gallery-upload-items:empty { display: none; }
.gallery-upload-item { min-width: 0; display: grid; grid-template-columns: 58px minmax(0,1fr); align-items: center; gap: 11px; padding: 8px; background: rgba(255,255,255,.025); border: 1px solid var(--border-color); border-radius: 11px; }
.gallery-upload-thumb { width: 58px; height: 48px; display: block; object-fit: cover; background: rgba(0,0,0,.25); border-radius: 7px; }
.gallery-upload-item-fields { min-width: 0; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.9fr) minmax(0,1fr) minmax(90px,.45fr); align-items: end; gap: 10px; }
.gallery-upload-item-fields .field-label { min-width: 0; }
.gallery-upload-item-fields .field-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-upload-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; margin-top: 13px; }
.gallery-upload-submit { display: flex; justify-content: flex-end; margin-top: 13px; }
.gallery-upload-submit .btn-primary { min-height: 44px; }
.gallery-page .field-label { display: flex; flex-direction: column; gap: 7px; color: #e9e5f4; font-size: .84rem; font-weight: 650; }
.gallery-page .field-label input { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text-main); font: inherit; font-weight: 400; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; outline: none; }
.gallery-page .field-label select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; color: var(--text-main); font: inherit; font-weight: 400; background: #171321; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; outline: none; }
.gallery-page .field-label select option { color: #f3f3f7; background: #171321; }
.gallery-page .field-label input:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139,92,246,.13); }
.gallery-upload-controls .btn-primary { min-height: 44px; }
.gallery-upload-message, .gallery-edit-message { min-height: 18px; margin-top: 10px; color: #c4b5fd; font-size: .82rem; }
.gallery-upload-message.is-error, .gallery-edit-message.is-error { color: #fca5a5; }
.gallery-admin-list-section { margin-top: 24px; }
.gallery-admin-list { display: grid; gap: 9px; }
.gallery-admin-row { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px 12px; background: rgba(255,255,255,.035); border: 1px solid var(--border-color); border-radius: 12px; }
.gallery-admin-thumb { width: 72px; height: 54px; object-fit: cover; background: rgba(0,0,0,.25); border-radius: 8px; }
.gallery-admin-copy { min-width: 0; }
.gallery-admin-copy strong, .gallery-admin-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-admin-copy strong { color: #fff; font-size: .85rem; }
.gallery-admin-copy span { margin-top: 3px; color: var(--text-muted); font-size: .74rem; }
.gallery-admin-row-actions { display: flex; gap: 6px; }
.gallery-admin-row-actions button { min-height: 34px; padding: 6px 9px; font-size: .76rem; }
.gallery-admin-row-actions .delete-button { color: #fecaca; border-color: rgba(248,113,113,.22); }
.gallery-lightbox { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 24px; }
.lightbox-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(4,3,8,.92); backdrop-filter: blur(12px); cursor: zoom-out; }
.lightbox-panel { width: min(100%, 1280px); height: min(90vh, 900px); display: grid; grid-template-columns: 54px minmax(0,1fr) 54px; align-items: center; gap: 12px; position: relative; z-index: 1; }
.lightbox-close, .lightbox-nav { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; cursor: pointer; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 50%; backdrop-filter: blur(8px); }
.lightbox-close { position: absolute; top: 0; right: 4px; z-index: 2; }
.lightbox-nav:hover, .lightbox-close:hover { background: rgba(139,92,246,.5); }
.lightbox-nav[hidden] { display: none !important; }
.lightbox-figure { width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; display: grid; grid-template-rows: minmax(0,1fr) auto; align-items: center; }
.lightbox-figure img { width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; object-fit: contain; border-radius: 8px; box-shadow: 0 16px 60px rgba(0,0,0,.4); }
.lightbox-figure figcaption { min-height: 60px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding-top: 8px; text-align: center; }
.lightbox-figure figcaption strong { color: #fff; font-size: .95rem; }
.gallery-edit-modal, .gallery-auth-modal { position: fixed; inset: 0; z-index: 3200; display: grid; place-items: center; padding: 18px; }
.gallery-modal-backdrop, .gallery-auth-modal .team-modal-backdrop { position: absolute; inset: 0; background: rgba(5,4,9,.8); backdrop-filter: blur(8px); }
.gallery-edit-card, .gallery-auth-modal .team-modal-card { width: min(100%, 460px); max-height: min(90vh, 780px); overflow-y: auto; position: relative; padding: 30px; background: #110e1b; border: 1px solid rgba(139,92,246,.35); border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.gallery-edit-card h2, .gallery-auth-modal .team-modal-card h2 { font-size: 1.4rem; margin: 3px 0 18px; }
.gallery-edit-close, .gallery-auth-modal .modal-close { position: absolute; top: 16px; right: 16px; }
.gallery-edit-form, .gallery-auth-modal .auth-form { display: grid; gap: 14px; }
.gallery-edit-form .form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 0; }
.gallery-auth-modal .auth-form .btn-primary { justify-content: center; }
.gallery-auth-modal .section-badge { margin-bottom: 8px; }
.gallery-auth-modal .modal-copy { margin-bottom: 18px; color: var(--text-muted); font-size: .84rem; }
.gallery-auth-modal .setup-notice { display: flex; gap: 10px; padding: 12px; color: #dcd4ec; font-size: .78rem; line-height: 1.5; background: rgba(139,92,246,.09); border: 1px solid rgba(139,92,246,.2); border-radius: 10px; }
.gallery-auth-modal .setup-notice i { margin-top: 3px; color: #c4b5fd; }
.gallery-auth-modal .auth-message { min-height: 18px; margin: 12px 0 0; color: #c4b5fd; font-size: .82rem; }
.gallery-auth-modal .auth-message.is-error { color: #fca5a5; }
.gallery-auth-modal .auth-form[hidden] { display: none !important; }
.gallery-auth-modal .icon-button, .gallery-edit-card .icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer; color: var(--text-muted); background: rgba(255,255,255,.04); border: 1px solid var(--border-color); border-radius: 10px; }
@media (max-width: 992px) {
  .gallery-grid { column-count: 2; }
  .gallery-content-section { padding-top: 28px; }
}
@media (max-width: 700px) {
  .gallery-admin-bar { align-items: stretch; flex-direction: column; }
  .gallery-admin-bar > *, .gallery-admin-copy { width: 100%; min-width: 0; max-width: 100%; }
  .gallery-admin-copy p { overflow-wrap: anywhere; }
  .gallery-admin-actions { flex-wrap: wrap; }
  .gallery-admin-actions > * { min-width: 0; max-width: 100%; white-space: normal; }
  .gallery-upload-item-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-upload-item-fields .field-label:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .gallery-page .nav-container { padding: 0 16px; }
  .gallery-page .nav-actions .btn-copy-ip { padding: 9px 11px; font-size: .76rem; }
  .gallery-page .nav-actions .btn-icon { display: none; }
  .gallery-hero { min-height: 270px; padding: 48px 0 17px; }
  .gallery-hero .hero-title { font-size: 2.5rem; }
  .gallery-hero .hero-subtitle { font-size: .94rem; }
  .gallery-content-section { padding: 24px 0 54px; }
  .gallery-heading-row { align-items: flex-start; flex-direction: column; gap: 14px; }
  .gallery-heading-row .section-title { font-size: 1.55rem; }
  .gallery-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .gallery-filter { flex: 0 0 auto; }
  .gallery-seasons { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .gallery-season { justify-content: space-between; gap: 5px; padding: 8px 9px; }
  .gallery-season-copy strong { font-size: .76rem; }
  .gallery-season-copy small { font-size: .65rem; }
  .gallery-grid { column-count: 1; }
  .gallery-card { margin-bottom: 14px; }
  .gallery-card-admin-actions { opacity: 1; transform: none; }
  .gallery-admin { padding: 14px 12px; margin-bottom: 18px; }
  .gallery-admin-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .gallery-admin-actions .btn-primary { justify-content: center; }
  .gallery-editor-content { padding-top: 15px; margin-top: 13px; }
  .gallery-upload-form { padding: 13px 10px; }
  .gallery-upload-item { grid-template-columns: 48px minmax(0,1fr); gap: 8px; padding: 7px; }
  .gallery-upload-thumb { width: 48px; height: 44px; }
  .gallery-upload-item-fields { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .gallery-upload-item-fields .field-label:last-child { grid-column: auto; }
  .gallery-upload-submit .btn-primary { width: 100%; justify-content: center; }
  .gallery-admin-row { grid-template-columns: 58px minmax(0,1fr); gap: 9px; padding: 9px; }
  .gallery-admin-thumb { width: 58px; height: 48px; }
  .gallery-admin-row-actions { grid-column: 2; }
  .lightbox-panel { width: 100%; grid-template-columns: 38px minmax(0,1fr) 38px; gap: 4px; height: 84vh; }
  .lightbox-nav { width: 34px; height: 34px; font-size: .78rem; }
  .lightbox-close { width: 38px; height: 38px; top: -8px; right: -2px; }
  .gallery-lightbox { padding: 12px 6px; }
  .gallery-edit-card, .gallery-auth-modal .team-modal-card { padding: 26px 20px 22px; }
  .footer-container { align-items: flex-start; flex-direction: column; gap: 10px; }
}
