/* FloorCraft live gallery — shared by the website and member app. */
.drive-gallery {
  --gallery-surface: var(--white, var(--surface, #ffffff));
  --gallery-surface-2: var(--paper, var(--surface-2, #f3f6fb));
  --gallery-text: var(--ink, var(--text, #071326));
  --gallery-muted: var(--muted, #667085);
  --gallery-line: var(--line, #dfe5ef);
  --gallery-accent: var(--blue, var(--primary, #0759d9));
  --gallery-focus: var(--focus, #ffbf47);
  color: var(--gallery-text);
}
.drive-gallery__navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 16px;
}
.drive-gallery__back,
.drive-gallery__refresh,
.drive-gallery__dialog-controls button,
.drive-gallery__dialog-close {
  min-height: 44px;
  border: 1px solid var(--gallery-line);
  border-radius: 999px;
  color: var(--gallery-text);
  background: var(--gallery-surface);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.drive-gallery__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
}
.drive-gallery__back[hidden] { display: none; }
.drive-gallery__back span[aria-hidden="true"] { font-size: 1.18rem; }
.drive-gallery__breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--gallery-muted);
  font-weight: 750;
}
.drive-gallery__breadcrumbs span[aria-current="page"] {
  color: var(--gallery-text);
  font-weight: 900;
}
.drive-gallery__breadcrumb-separator { opacity: .55; }
.drive-gallery__refresh {
  margin-left: auto;
  padding: 9px 16px;
}
.drive-gallery__refresh:disabled { opacity: .55; cursor: wait; }
.drive-gallery__back:hover,
.drive-gallery__back:focus-visible,
.drive-gallery__refresh:hover,
.drive-gallery__refresh:focus-visible,
.drive-gallery__dialog-controls button:hover,
.drive-gallery__dialog-controls button:focus-visible,
.drive-gallery__dialog-close:hover,
.drive-gallery__dialog-close:focus-visible {
  outline: 3px solid transparent;
  box-shadow: 0 0 0 3px var(--gallery-focus);
}
.drive-gallery__status {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--gallery-line);
  border-radius: 14px;
  color: var(--gallery-muted);
  background: var(--gallery-surface-2);
}
.drive-gallery__status.is-error { color: #8a241e; background: #fff0ee; border-color: #e7aaa6; }
.drive-gallery__status.is-empty { justify-content: center; text-align: center; }
.drive-gallery__status button {
  min-height: 40px;
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.drive-gallery__spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid color-mix(in srgb, var(--gallery-accent) 25%, transparent);
  border-top-color: var(--gallery-accent);
  border-radius: 50%;
  animation: drive-gallery-spin .8s linear infinite;
}
@keyframes drive-gallery-spin { to { transform: rotate(360deg); } }
.drive-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.drive-gallery__card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--gallery-line);
  border-radius: 20px;
  color: var(--gallery-text);
  background: var(--gallery-surface);
  box-shadow: 0 12px 35px rgba(7, 19, 38, .08);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.drive-gallery__card:hover { transform: translateY(-3px); box-shadow: 0 20px 45px rgba(7, 19, 38, .16); }
.drive-gallery__card:focus-visible { outline: 4px solid var(--gallery-focus); outline-offset: 3px; }
.drive-gallery__visual {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0b1b34;
}
.drive-gallery__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.drive-gallery__card:hover .drive-gallery__visual img { transform: scale(1.035); }
.drive-gallery__card.has-image-error .drive-gallery__visual::before,
.drive-gallery__folder-visual:empty::before {
  content: 'FloorCraft';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: .05em;
}
.drive-gallery__card.has-image-error img { opacity: 0; }
.drive-gallery__folder-card .drive-gallery__visual {
  background: linear-gradient(145deg, #102543, #071326);
}
.drive-gallery__folder-tab {
  position: absolute;
  left: 18px;
  top: 0;
  width: 42%;
  height: 14px;
  border-radius: 0 0 10px 10px;
  background: color-mix(in srgb, var(--gallery-accent) 88%, white 12%);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.drive-gallery__folder-badge {
  position: absolute;
  left: 13px;
  bottom: 13px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 999px;
  color: #071326;
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .03em;
}
.drive-gallery__folder-card.is-video .drive-gallery__folder-tab { background: #d9e9ff; }
.drive-gallery__folder-card.is-photo .drive-gallery__folder-tab { background: color-mix(in srgb, var(--gallery-accent) 75%, white 25%); }
.drive-gallery__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  color: #071326;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  transform: translate(-50%, -50%);
}
.drive-gallery__caption {
  display: grid;
  gap: 5px;
  padding: 15px 16px 17px;
}
.drive-gallery__caption strong {
  overflow: hidden;
  font-size: .98rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drive-gallery__caption small { color: var(--gallery-muted); line-height: 1.35; }
.drive-gallery__folder-card .drive-gallery__caption strong { font-size: 1.05rem; }
.drive-gallery__dialog {
  width: min(1120px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  color: #ffffff;
  background: #050b14;
  box-shadow: 0 35px 100px rgba(0,0,0,.58);
}
.drive-gallery__dialog::backdrop { background: rgba(1, 5, 12, .86); backdrop-filter: blur(5px); }
.drive-gallery__dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 24px);
}
.drive-gallery__dialog-topbar,
.drive-gallery__dialog-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: #071326;
}
.drive-gallery__dialog-topbar { justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.14); }
.drive-gallery__dialog-topbar > div { min-width: 0; display: grid; gap: 2px; }
.drive-gallery__dialog-topbar strong,
.drive-gallery__dialog-topbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-gallery__dialog-topbar span { color: rgba(255,255,255,.68); font-size: .82rem; }
.drive-gallery__dialog-close {
  width: 46px;
  min-width: 46px;
  padding: 0;
  color: #ffffff;
  border-color: rgba(255,255,255,.24);
  background: transparent;
  font-size: 1.7rem;
  line-height: 1;
}
.drive-gallery__viewer {
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #02060c;
}
.drive-gallery__viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 170px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.drive-gallery__viewer iframe {
  width: 100%;
  min-height: min(70dvh, 720px);
  border: 0;
  background: #000000;
}
.drive-gallery__dialog-controls { justify-content: center; border-top: 1px solid rgba(255,255,255,.14); }
.drive-gallery__dialog-controls button {
  min-width: 112px;
  padding: 8px 16px;
  color: #ffffff;
  border-color: rgba(255,255,255,.28);
  background: transparent;
}
.drive-gallery__dialog-controls button:disabled { opacity: .35; cursor: default; }
.drive-gallery__dialog-controls span { min-width: 72px; text-align: center; color: rgba(255,255,255,.72); font-weight: 800; }
body.gallery-dialog-open { overflow: hidden; }

@media (max-width: 1000px) {
  .drive-gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .drive-gallery__navigation { align-items: flex-start; flex-wrap: wrap; }
  .drive-gallery__breadcrumbs { order: 3; width: 100%; padding-inline: 2px; }
  .drive-gallery__refresh { margin-left: auto; }
  .drive-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .drive-gallery__caption { padding: 12px; }
  .drive-gallery__dialog { width: 100vw; max-height: 100dvh; border-radius: 0; border: 0; }
  .drive-gallery__dialog-shell { max-height: 100dvh; }
  .drive-gallery__viewer img { max-height: calc(100dvh - 170px); }
  .drive-gallery__viewer iframe { min-height: calc(100dvh - 155px); }
}
@media (max-width: 430px) {
  .drive-gallery__grid { grid-template-columns: 1fr; }
  .drive-gallery__visual { aspect-ratio: 16 / 10; }
  .drive-gallery__dialog-controls { justify-content: space-between; }
  .drive-gallery__dialog-controls button { min-width: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .drive-gallery__spinner { animation-duration: 1.5s; }
  .drive-gallery__card,
  .drive-gallery__visual img { transition: none; }
  .drive-gallery__card:hover,
  .drive-gallery__card:hover .drive-gallery__visual img { transform: none; }
}
@media (forced-colors: active) {
  .drive-gallery__card,
  .drive-gallery__status,
  .drive-gallery__back,
  .drive-gallery__refresh { border: 2px solid CanvasText; box-shadow: none; }
  .drive-gallery__folder-badge { border: 2px solid CanvasText; color: CanvasText; background: Canvas; }
  .drive-gallery__play { border: 2px solid CanvasText; color: CanvasText; background: Canvas; }
}


/* FloorCraft v5.2.5 — event covers are A4 portrait previews, without cropping. */
.drive-gallery__folder-card.is-album {
  width: min(100%, 270px);
  justify-self: start;
}
.drive-gallery__folder-card.is-album .drive-gallery__visual {
  aspect-ratio: 210 / 297;
  background: #071326;
}
.drive-gallery__folder-card.is-album .drive-gallery__visual img {
  object-fit: contain;
  object-position: center;
}
.drive-gallery__folder-card.is-album:hover .drive-gallery__visual img {
  transform: none;
}
@media (max-width: 720px) {
  .drive-gallery__folder-card.is-album {
    width: min(100%, 250px);
  }
}

/* FloorCraft v5.2.5 — gallery accessibility refinements */
.drive-gallery__status:focus-visible { outline: 3px solid var(--gallery-focus); outline-offset: 3px; }
.drive-gallery__dialog[open] { overscroll-behavior: contain; }
.drive-gallery__dialog iframe { border: 0; }
@media (forced-colors: active) {
  .drive-gallery__status, .drive-gallery__card, .drive-gallery__folder-card, .drive-gallery__dialog-shell { border: 2px solid CanvasText; box-shadow: none; }
}
