/* ================================================================
   Heirloomix Web Vault — Styles
   ================================================================ */

/* ── Access Screen ── */
.vault-access {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.vault-access__card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(44, 24, 16, 0.1);
  padding: 48px 36px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.vault-access__brand {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--brown);
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.vault-access__accent {
  color: var(--gold);
}

.vault-access__tagline {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 32px;
}

.vault-access__desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 24px;
}

.vault-access__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vault-access__input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
}

.vault-access__input:focus {
  outline: none;
  border-color: var(--gold);
}

.vault-access__input::placeholder {
  color: #b8a898;
}

.vault-access__btn {
  width: 100%;
  text-align: center;
  padding: 14px;
  font-size: 1rem;
}

.vault-access__row {
  display: flex;
  gap: 8px;
}

.vault-access__row .vault-access__input {
  flex: 1;
}

.vault-access__divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  gap: 12px;
  color: var(--text-light);
  font-size: 0.85rem;
}

.vault-access__divider::before,
.vault-access__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cream-dark);
}

.vault-access__alt {
  font-size: 0.9rem;
  color: var(--text-light);
}

.vault-access__link {
  color: var(--brown);
  font-weight: 600;
  text-decoration: none;
}

.vault-access__link:hover {
  text-decoration: underline;
}

.vault-access__back {
  margin-top: 16px;
  font-size: 0.85rem;
}

.vault-access__loading {
  padding: 40px 0;
}

.vault-access__loading p {
  color: var(--text-light);
  margin-top: 16px;
  font-size: 0.95rem;
}

.vault-access__error {
  margin-top: 16px;
  padding: 12px 16px;
  background: #FFF0F0;
  color: #B33;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* ── Vault Bar (Header) ── */
.vault-bar {
  background: var(--brown);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}

.vault-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vault-bar__brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.vault-bar__accent {
  color: var(--gold);
}

.vault-bar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vault-bar__name {
  font-size: 0.9rem;
  opacity: 0.8;
}

.vault-bar__signout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color 0.15s;
}

.vault-bar__signout:hover {
  color: var(--white);
}

/* ── Toolbar ── */
.vault-toolbar {
  background: var(--white);
  border-bottom: 1px solid var(--cream-dark);
}

.vault-toolbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vault-toolbar__count {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.vault-toolbar__actions {
  display: flex;
  gap: 4px;
}

.vault-toolbar__sort {
  background: none;
  border: 1px solid transparent;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}

.vault-toolbar__sort:hover {
  background: var(--cream);
}

.vault-toolbar__sort.active {
  background: var(--brown);
  color: var(--white);
  border-color: var(--brown);
}

/* ── Photo Grid ── */
.vault-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
  min-height: 60vh;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

@media (min-width: 640px) {
  .vault-grid {
    gap: 6px;
  }
}

@media (min-width: 768px) {
  .vault-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

@media (min-width: 1024px) {
  .vault-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.vault-grid__item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  background: var(--cream-dark);
}

.vault-grid__item:hover {
  opacity: 0.92;
}

.vault-grid__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.vault-grid__item:hover .vault-grid__img {
  transform: scale(1.03);
}

.vault-grid__date {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.vault-grid__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 0.7rem;
  padding: 16px 8px 6px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Empty State ── */
.vault-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

.vault-empty__icon {
  margin-bottom: 16px;
  opacity: 0.4;
}

.vault-empty h3 {
  font-size: 1.2rem;
  color: var(--brown);
  margin-bottom: 8px;
}

.vault-empty p {
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Loading ── */
.vault-loading {
  text-align: center;
  padding: 40px;
}

/* ── Load More ── */
.vault-loadmore {
  text-align: center;
  padding: 24px;
}

.vault-loadmore__btn {
  color: var(--text);
  border-color: var(--brown);
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 2rem;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
}

.lightbox__close:hover {
  color: white;
}

.lightbox__img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  object-fit: contain;
}

.lightbox__info {
  text-align: center;
  margin-top: 16px;
  color: rgba(255,255,255,0.9);
}

.lightbox__caption {
  font-size: 1rem;
  margin-bottom: 4px;
}

.lightbox__date {
  font-size: 0.85rem;
  opacity: 0.6;
}

.lightbox__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.lightbox__actions .btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
}

.lightbox__actions .btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}

/* ── Order Modal ── */
.order-modal {
  max-width: 440px;
}

.order-modal__title {
  color: var(--brown);
  font-size: 1.4rem;
  margin-bottom: 16px;
  text-align: center;
}

.order-modal__preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.order-modal__products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}

.order-product:hover {
  background: var(--cream-dark);
}

.order-product.selected {
  border-color: var(--gold);
  background: #FFF9E8;
}

.order-product__name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.order-product__size {
  font-size: 0.8rem;
  color: var(--text-light);
}

.order-product__price {
  font-weight: 700;
  color: var(--brown);
  font-size: 0.95rem;
}

.order-modal__notice {
  margin-top: 16px;
  padding: 14px 16px;
  background: #FFF9E8;
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ── Responsive adjustments ── */
@media (max-width: 480px) {
  .vault-access__card {
    padding: 36px 24px;
  }

  .lightbox__content {
    max-width: 95vw;
  }

  .lightbox__close {
    top: -36px;
    right: -4px;
  }

  .lightbox__actions {
    gap: 8px;
  }

  .lightbox__actions .btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
}
