html {
  font-size: 14px;
}

/* Informational cookie notice — a slim bar pinned to the bottom of the viewport. */
.cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, .125);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Image-save deterrents (public visitors only — body gets .protect-images when signed out):
   no drag-out, no long-press callout (iOS), no accidental selection. */
.protect-images img,
.protect-images .artwork-viewer canvas {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* --- Artwork studio & viewer --- */
.artwork-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.artwork-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.artwork-thumb {
  height: 300px;
  object-fit: cover;
}

.artwork-viewer {
  width: 100%;
  height: 75vh;
  min-height: 420px;
  background: #1a1a1a;
  border-radius: 0.5rem;
}

/* --- Drag & drop upload --- */
.drop-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  border: 2px dashed #adb5bd;
  border-radius: 0.5rem;
  background: #f8f9fa;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.drop-zone--over {
  border-color: #0d6efd;
  background: #e7f1ff;
}

.drop-zone__input {
  display: none;
}

.drop-zone__icon {
  font-size: 2.5rem;
}

.drop-zone__preview {
  display: none;
  max-width: 100%;
  max-height: 300px;
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
}

/* --- Room hierarchy navigation --- */
.room-nav .room-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: #212529;
}

.room-nav .room-link:hover {
  background: #f1f3f5;
}

.room-nav .room-link.active {
  background: #0d6efd;
  color: #fff;
}

.room-nav .room-link.active .badge {
  color: #212529;
}

/* Nested sub-rooms: indent and add a guide line. */
.room-tree {
  margin-left: 0.75rem;
  padding-left: 0.5rem;
  border-left: 1px solid #dee2e6;
}

/* --- "Find a work like this" image search --- */
.image-search-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 0.375rem 0.75rem;
  text-align: center;
  cursor: pointer;
  border: 2px dashed #adb5bd;
  border-radius: 0.375rem;
  background: #f8f9fa;
  color: #495057;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.image-search-zone:hover,
.image-search-zone:focus {
  border-color: #0d6efd;
  outline: none;
}

.image-search-zone--over {
  border-color: #0d6efd;
  background: #e7f1ff;
}

.image-search-zone--busy {
  opacity: 0.7;
  pointer-events: none;
}

.image-search-zone__label {
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Studio sidebar — the current StudioArtist as the root of the room tree. */
.room-studioArtist {
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.room-studioArtist::before {
  content: "\1F3DB"; /* 🏛 classical building */
  font-size: 1rem;
}

/* The studio heading doubles as a link back to the whole (unfiltered) studio. */
.room-studioArtist--link {
  color: #212529;
  text-decoration: none;
  border-radius: 0.375rem;
}
.room-studioArtist--link:hover {
  background: #f1f3f5;
}
.room-studioArtist--link.active {
  color: #0d6efd;
}
.room-studioArtist-children {
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid #dee2e6;
}

/* StudioArtists landing — avatar initial on each studioArtist card. */
.studioArtist-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  font-size: 1.25rem;
}

/* --- Landing page: "Open Studio" hero over an artwork mosaic --- */
body {
  overflow-x: hidden; /* guard the full-bleed hero's 100vw breakout against a stray scrollbar */
  background: transparent; /* let the fixed faint mosaic (below) show through on every page */
}

/* Very faint full-page mosaic of the landing images, fixed behind all content. */
html {
  background: #fff;
}

.page-bg-mosaic {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  opacity: 0.12;
  pointer-events: none;
  overflow: hidden;
  /* Soften; scale up so the blur doesn't fade at the viewport edges. */
  filter: blur(4px);
  transform: scale(1.06);
}

.page-bg-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767.98px) {
  .page-bg-mosaic {
    grid-template-columns: repeat(4, 1fr);
  }
}

.landing-hero {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -1rem; /* absorb the navbar's mb-3 so the hero sits flush under it */
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Fallback when there is no artwork yet to build the mosaic from. */
  background: linear-gradient(135deg, #232526, #414345);
}

.landing-hero__mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: 2px;
  /* Soften the mosaic; scale up slightly so the blur doesn't fade at the edges. */
  filter: blur(5px);
  transform: scale(1.06);
}

.landing-hero__mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.landing-hero__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.landing-hero__content {
  position: relative;
  text-align: center;
  color: #fff;
  padding: 2rem;
  max-width: 900px;
}

.landing-hero__title {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  font-size: clamp(3rem, 13vw, 9rem);
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.55);
}

.landing-hero__subtitle {
  margin: 1.25rem auto 2rem;
  max-width: 42ch;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.landing-hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .landing-hero__mosaic {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 767.98px) {
  .landing-hero__mosaic {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Studio open/closed toggle, styled like a hanging door sign. */
.studio-sign {
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 1.1rem;
  border-radius: 0.5rem;
  line-height: 1.1;
  font-size: 1rem;
  cursor: pointer;
  /* Thin inset white rule for the classic double-border sign look, plus a soft drop shadow. */
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: filter 0.12s ease;
}

.studio-sign--open {
  background: #1b8f3a;
}

.studio-sign--closed {
  background: #cc2027;
}

.studio-sign:hover {
  filter: brightness(1.06);
}

.studio-sign:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* Live password-strength checklist on the sign-up form. */
.password-rules li {
  padding-left: 1.25em;
  position: relative;
}
.password-rules li::before {
  position: absolute;
  left: 0;
  content: "\2022"; /* bullet, unmet */
}
.password-rules li.rule-unmet {
  color: #dc3545;
}
.password-rules li.rule-met {
  color: #198754;
}
.password-rules li.rule-met::before {
  content: "\2713"; /* check mark, met */
}

/* "Curate my Art" — tray of works on the left, freely arrangeable scratch space on the right. */
.curate-wrap {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.curate-tray {
  width: 240px;
  flex: 0 0 240px;
  height: 72vh;
  min-height: 480px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.curate-wall {
  position: relative;
  height: 72vh;
  min-height: 480px;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
  overflow: hidden;
}

.curate-wall__title {
  font-size: 1.15rem;
}

/* Faint placeholder ("Title") — don't inherit the input's semibold weight. */
.curate-wall__title::placeholder {
  color: #adb5bd;
  font-weight: 400;
}

.curate-wall__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  pointer-events: none;
}

.curate-tile {
  position: relative; /* anchors the remove (×) badge on list tiles as well as wall ones */
  width: 210px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.12);
  cursor: grab;
  user-select: none;
  touch-action: none; /* let pointer events drive dragging on touch screens */
  flex: 0 0 auto;
}

.curate-tile.on-wall {
  position: absolute;
}

.curate-tile.dragging {
  position: fixed;
  cursor: grabbing;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25);
}

.curate-tile img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-radius: 0.375rem;
  pointer-events: none; /* clicks/drags land on the tile, not the image */
}

/* The × that removes a work from the Curation Space entirely. */
.curate-tile__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  padding: 3px;
  line-height: 0;
}

.curate-tile__remove .btn-close {
  font-size: 0.6rem;
}

/* Only remove works from the list (tray); once placed on the wall, hide the × so it isn't
   accidentally deleted mid-arrangement — drag it back to the list to remove it. */
.curate-tile.on-wall .curate-tile__remove {
  display: none;
}

/* Print from the Gallery Wall: just the title + wall arrangement. */
@media print {
  body.curate-page header,
  body.curate-page footer,
  body.curate-page .page-bg-mosaic,
  body.curate-page .curate-tray,
  body.curate-page .curate-saved-panel,
  body.curate-page .curate-controls,
  body.curate-page .curate-wall__hint,
  body.curate-page #clearWallBtn,
  body.curate-page p.text-muted {
    display: none !important;
  }

  body.curate-page .curate-wrap {
    display: block;
  }

  body.curate-page .curate-wall__title {
    border: none;
    box-shadow: none;
    padding: 0;
    font-size: 1.6rem;
  }

  body.curate-page .curate-wall {
    border: 1px solid #999;
    height: 23cm;
    min-height: 0;
  }

  body.curate-page .curate-tile {
    box-shadow: none;
  }
}

/* Admin thumbnails for the landing-page mosaic images. */
.landing-thumb {
  width: 150px;
}

.landing-thumb img {
  width: 150px;
  height: 105px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
  display: block;
}

/* Gallery convention: a physical red dot beside a piece marks it as sold. */
.sold-dot {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background-color: #d32f2f;
  /* White ring + soft shadow, so it reads like a stuck-on sticker. */
  box-shadow: 0 0 0 2px #fff, 0 1px 2px rgba(0, 0, 0, 0.35);
  vertical-align: middle;
}

/* Larger dot stuck to the top-right corner of a gallery thumbnail. */
.sold-dot--overlay {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 1.1rem;
  height: 1.1rem;
}

.sold-label {
  color: #d32f2f;
  font-weight: 600;
}

/* Scrollable checkbox list for choosing an artwork's mediums. */
.medium-picker {
  max-height: 20rem;
  overflow-y: auto;
}

/* Two columns of medium checkboxes (single column on narrow screens). */
.medium-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}

@media (max-width: 575.98px) {
  .medium-grid {
    grid-template-columns: 1fr;
  }
}

/* Saved Gallery Walls panel to the right of the wall. */
.curate-saved-panel {
  width: 170px;
  flex: 0 0 170px;
  height: 72vh;
  overflow-y: auto;
}

/* Saved gallery-wall thumbnails on the Curate page — click to reload the arrangement. */
.curate-saved {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.curate-saved-panel .curate-saved__tile {
  width: 100%;
}

.curate-saved__tile {
  position: relative;
  width: 130px;
  cursor: pointer;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  overflow: hidden;
  background-color: #fff;
}

.curate-saved__tile:hover {
  border-color: #adb5bd;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.curate-saved__tile img {
  width: 100%;
  height: 85px;
  object-fit: cover;
  display: block;
}

.curate-saved__title {
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.curate-saved__remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  padding: 0.25rem;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}

/* Small chip for each of an artwork's mediums. */
.medium-chip {
  font-weight: 500;
  color: #495057;
  background-color: #f1f3f5;
  border: 1px solid #dee2e6;
}