.gallery-page { min-height: 100vh; background: var(--paper); }
.gallery-topbar { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding: 18px clamp(20px, 5vw, 76px); border-bottom: 1px solid rgba(27,21,20,.16); background: rgba(247,244,238,.9); }
.gallery-back, .gallery-upload-top { color: var(--wine); font-size: 11px; letter-spacing: .12em; }
.gallery-back span { display: inline-block; margin-right: 6px; font-size: 20px; vertical-align: -2px; }
.gallery-brand { display: grid; justify-items: center; gap: 3px; color: var(--ink); }
.gallery-brand strong { font: 400 25px/1 var(--display); letter-spacing: -.09em; }
.gallery-brand small { color: var(--muted); font-size: 7px; letter-spacing: .22em; }
.gallery-upload-top { justify-self: end; padding: 11px 16px 10px; border: 1px solid rgba(112,28,37,.48); background: transparent; cursor: pointer; }
.gallery-upload-top:hover, .gallery-upload-top:focus-visible { color: #fff; background: var(--wine); outline: none; }
.gallery-intro { padding: 30px clamp(20px, 9vw, 140px) 66px; color: #f8f3eb; background: linear-gradient(145deg, #2b1116 0%, #641d2a 58%, #291114 100%); }
.gallery-kicker { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid rgba(247,242,233,.25); color: rgba(247,242,233,.55); font-size: 8px; letter-spacing: .2em; }
.gallery-intro-content { display: flex; justify-content: space-between; align-items: end; gap: 40px; max-width: 1240px; margin: 0 auto; padding: 74px 0 55px; }
.gallery-intro .mini-label { margin: 0 0 24px; color: var(--gold); }
.gallery-intro h1 { margin: 0; font-size: clamp(4.4rem, 12vw, 9.5rem); line-height: .78; letter-spacing: -.12em; }
.gallery-intro h1 em { display: block; margin-left: clamp(30px, 7vw, 92px); color: transparent; -webkit-text-stroke: 1px rgba(247,242,233,.78); font-style: normal; }
.gallery-intro-copy { width: min(300px, 42vw); margin: 0 0 5px; color: rgba(247,242,233,.69); font: 400 14px/1.9 var(--display); letter-spacing: .07em; }
.gallery-primary-actions { display: flex; align-items: center; justify-content: space-between; gap: 22px; max-width: 1240px; margin: 0 auto; }
.gallery-upload-button { display: inline-flex; align-items: center; gap: 25px; padding: 16px 2px 14px; border: 0; border-bottom: 1px solid rgba(247,242,233,.58); color: #f8f3eb; background: transparent; font-size: 12px; letter-spacing: .13em; cursor: pointer; }
.gallery-upload-button b { color: var(--gold); font-size: 21px; font-weight: 400; transition: transform .2s ease; }
.gallery-upload-button:hover b { transform: translate(4px, -4px); }
.gallery-count { color: rgba(247,242,233,.5); font-size: 9px; letter-spacing: .12em; }
.gallery-library { padding: 72px clamp(20px, 9vw, 140px) 110px; }
.gallery-library-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; max-width: 1240px; margin: 0 auto 35px; }
.gallery-library .mini-label { margin: 0 0 15px; color: var(--gold); }
.gallery-library h2 { margin: 0; color: var(--ink); font: 400 clamp(2.7rem, 5vw, 5.2rem)/.9 var(--display); letter-spacing: -.1em; }
.gallery-filter { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.gallery-filter button { padding: 9px 12px 8px; border: 1px solid rgba(27,21,20,.2); color: var(--muted); background: transparent; font-size: 10px; letter-spacing: .08em; cursor: pointer; }
.gallery-filter button.is-active, .gallery-filter button:hover, .gallery-filter button:focus-visible { border-color: var(--wine); color: #fff; background: var(--wine); outline: none; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 1240px; margin: 0 auto; }
.gallery-card { min-width: 0; overflow: hidden; border: 1px solid rgba(27,21,20,.15); background: rgba(255,255,255,.54); box-shadow: 0 10px 25px rgba(65,31,28,.06); transition: transform .25s ease, box-shadow .25s ease; }
.gallery-card:hover { transform: translateY(-5px); box-shadow: 0 18px 35px rgba(65,31,28,.14); }
.gallery-card-media { position: relative; display: block; aspect-ratio: 1 / 1.08; overflow: hidden; color: #f7f2e9; background: linear-gradient(145deg, #32181b, #7b3440); cursor: zoom-in; }
.gallery-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-card:hover .gallery-card-media img { transform: scale(1.04); }
.gallery-placeholder { display: grid; place-items: center; height: 100%; color: rgba(247,242,233,.78); font: 400 42px/1 var(--display); }
.gallery-placeholder small { display: block; margin-top: 10px; color: rgba(247,242,233,.54); font: 500 8px/1 var(--sans); letter-spacing: .18em; }
.gallery-badge { position: absolute; top: 11px; left: 11px; padding: 6px 7px 5px; color: #fff; background: rgba(41,17,20,.75); font-size: 8px; letter-spacing: .12em; }
.gallery-card-arrow { position: absolute; right: 12px; bottom: 9px; color: var(--gold); font-size: 22px; }
.gallery-card-info { display: flex; justify-content: space-between; gap: 10px; padding: 13px 13px 14px; }
.gallery-card-title { overflow: hidden; color: var(--ink); font: 400 15px/1.35 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.gallery-card-date { flex: 0 0 auto; color: var(--muted); font-size: 8px; letter-spacing: .06em; }
.gallery-state { min-height: 52px; padding: 30px 0 4px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-align: center; }
.gallery-load-more { display: flex; justify-content: center; padding-top: 22px; }
.gallery-load-more button { padding: 13px 18px 12px; border: 1px solid rgba(112,28,37,.42); color: var(--wine); background: transparent; font-size: 10px; letter-spacing: .1em; cursor: pointer; }
.gallery-load-more button:hover { color: #fff; background: var(--wine); }
.gallery-footer { margin-top: 0; }
.gallery-modal[hidden] { display: none; }
.gallery-modal { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 18px; }
.gallery-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(16,10,10,.84); backdrop-filter: blur(10px); cursor: default; }
.gallery-viewer-card, .gallery-upload-card { position: relative; z-index: 1; width: min(760px, 100%); max-height: calc(100dvh - 36px); overflow: auto; color: #f7f2e9; background: #211316; box-shadow: 0 25px 90px rgba(0,0,0,.42); animation: modal-in .25s ease both; }
.gallery-viewer-media { display: grid; place-items: center; min-height: 220px; max-height: calc(100dvh - 130px); overflow: hidden; background: #130d0e; }
.gallery-viewer-media img, .gallery-viewer-media video { display: block; width: 100%; max-height: calc(100dvh - 130px); object-fit: contain; }
.gallery-viewer-empty { padding: 90px 30px; color: rgba(247,242,233,.66); text-align: center; }
.gallery-viewer-caption { display: flex; justify-content: space-between; gap: 15px; padding: 16px 20px 17px; color: rgba(247,242,233,.8); font: 400 14px/1.4 var(--display); }
.gallery-viewer-caption a { color: var(--gold); font: 500 9px/1.4 var(--sans); letter-spacing: .1em; }
.gallery-modal-close { position: absolute; z-index: 2; top: 10px; right: 14px; width: 36px; height: 36px; border: 0; color: rgba(247,242,233,.84); background: rgba(20,10,12,.48); font-size: 25px; font-weight: 200; cursor: pointer; }
.gallery-upload-card { width: min(560px, 100%); padding: 36px clamp(22px, 5vw, 44px) 29px; }
.gallery-upload-card .mini-label { margin: 0 0 16px; color: var(--gold); }
.gallery-upload-card h2 { margin: 0 0 13px; font: 400 clamp(2.5rem, 8vw, 4.4rem)/.9 var(--display); letter-spacing: -.1em; }
.gallery-upload-note { margin: 0 0 22px; color: rgba(247,242,233,.65); font: 400 13px/1.8 var(--display); }
.gallery-file-picker { display: grid; justify-items: center; gap: 9px; padding: 28px 16px 25px; border: 1px dashed rgba(229,195,141,.5); color: rgba(247,242,233,.84); text-align: center; cursor: pointer; }
.gallery-file-picker:hover { border-color: var(--gold); background: rgba(255,255,255,.05); }
.gallery-file-picker input { display: none; }
.gallery-file-icon { display: grid; place-items: center; width: 41px; height: 41px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 24px; font-weight: 200; }
.gallery-file-picker strong { font: 400 18px/1.3 var(--display); }
.gallery-file-picker small { color: rgba(247,242,233,.45); font-size: 8px; letter-spacing: .08em; }
#gallery-files { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gallery-selected { display: grid; gap: 4px; max-height: 118px; overflow: auto; margin-top: 13px; padding: 10px 12px; color: rgba(247,242,233,.7); background: rgba(255,255,255,.06); font-size: 10px; }
.gallery-selected-row { display: flex; justify-content: space-between; gap: 10px; }
.gallery-selected-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-selected-row span:last-child { flex: 0 0 auto; color: var(--gold); }
.gallery-caption-field { display: grid; gap: 8px; margin-top: 16px; color: rgba(247,242,233,.58); font-size: 10px; letter-spacing: .08em; }
.gallery-caption-field input { width: 100%; padding: 12px; border: 1px solid rgba(247,242,233,.2); color: #fff; background: rgba(0,0,0,.14); outline: none; }
.gallery-caption-field input:focus { border-color: var(--gold); }
.gallery-upload-progress { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 18px; color: rgba(247,242,233,.65); font-size: 9px; letter-spacing: .06em; }
.gallery-upload-progress::before { content: ""; grid-column: 1 / -1; height: 4px; background: rgba(247,242,233,.14); }
.gallery-upload-progress span { grid-row: 1; width: 0; height: 4px; background: var(--gold); transition: width .15s linear; }
.gallery-upload-progress b { font-weight: 400; }
.gallery-upload-error { min-height: 18px; margin: 12px 0 0; color: #f39b8d; font-size: 10px; }
.gallery-submit { width: 100%; margin-top: 10px; padding: 15px; border: 1px solid var(--gold); color: #2b1116; background: var(--gold); font-size: 11px; letter-spacing: .12em; cursor: pointer; }
.gallery-submit:disabled { cursor: not-allowed; opacity: .42; }
.gallery-submit:not(:disabled):hover { color: #fff; background: var(--wine); }
.gallery-public-note { display: block; margin-top: 14px; color: rgba(247,242,233,.38); font-size: 8px; line-height: 1.6; text-align: center; }
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .gallery-topbar { grid-template-columns: 1fr auto 1fr; padding: 14px 17px; }
  .gallery-back { font-size: 10px; }
  .gallery-brand strong { font-size: 22px; }
  .gallery-upload-top { padding: 9px 12px 8px; font-size: 10px; }
  .gallery-intro { padding: 22px 20px 38px; }
  .gallery-intro-content { display: block; padding: 58px 0 34px; }
  .gallery-intro-copy { width: auto; margin: 27px 0 0; font-size: 13px; }
  .gallery-primary-actions { align-items: start; flex-direction: column; gap: 18px; }
  .gallery-count { font-size: 8px; }
  .gallery-library { padding: 52px 16px 76px; }
  .gallery-library-head { display: block; margin-bottom: 23px; }
  .gallery-filter { justify-content: flex-start; margin-top: 23px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .gallery-filter button { flex: 0 0 auto; padding: 9px 13px 8px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .gallery-card-info { display: block; padding: 10px 10px 11px; }
  .gallery-card-title { font-size: 14px; }
  .gallery-card-date { display: block; margin-top: 5px; }
  .gallery-viewer-card { width: 100%; }
  .gallery-viewer-caption { padding-inline: 15px; }
  .gallery-viewer-caption a { max-width: 115px; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-card, .gallery-card-media img, .gallery-upload-button b { transition: none; }
}
