/* ============================================== */
/* PÁGINA ÁLBUM COMPARTIDO — /fotos                 */
/* ============================================== */

body.fotos-page {
  background: var(--cream);
  max-width: 720px;
  padding-bottom: 4rem;
}

.fotos-header {
  text-align: center;
  padding: 2.5rem 1.25rem 1.5rem;
}
.fotos-eyebrow {
  font-family: var(--ui);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.fotos-title {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 2.6rem);
  color: var(--text-dark);
  font-weight: 400;
  margin-bottom: 0.6rem;
}
.fotos-subtitle {
  color: var(--text-gray);
  font-size: 0.95rem;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.5;
}

.fotos-main {
  padding: 0 1rem;
}

/* ====== Uploader card ====== */
.fotos-uploader {
  margin: 1rem auto 2.5rem;
  max-width: 460px;
}
.uploader-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 1.75rem 1.25rem;
  box-shadow: none;
  text-align: center;
}
.uploader-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: rgba(138, 145, 82, 0.14);
  color: var(--olive-lit);
  display: grid;
  place-items: center;
}
.uploader-icon svg { width: 30px; height: 30px; }
.uploader-card h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}
.uploader-hint {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.btn-pick {
  display: inline-block;
  padding: 0.9rem 1.9rem;
  background: var(--olive);
  color: var(--bone);
  border: 1px solid var(--olive);
  border-radius: 0;
  font-family: var(--ui);
  font-weight: 400;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-pick:active { transform: scale(0.97); background: var(--gold-dark); }
.picker-hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-gray);
}

.preview-wrap {
  position: relative;
  margin: 0 auto 1rem;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: #f0ebe2;
}
.preview-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.preview-clear {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.upload-form {
  margin-top: 1.25rem;
  text-align: left;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin: 0.85rem 0 0.5rem;
  letter-spacing: 0.05em;
}
.cat-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.cat-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background 0.15s, border-color 0.15s;
}
.cat-options label:has(input:checked) {
  background: rgba(201, 169, 110, 0.12);
  border-color: var(--gold);
  color: var(--text-dark);
}
.cat-options input { accent-color: var(--gold); }

#autor-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-family: var(--ui);
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--text-dark);
}
#autor-input:focus {
  outline: none;
  border-color: var(--olive-lit);
  background: transparent;
}

.btn-send {
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  background: var(--olive);
  color: var(--bone);
  border: 1px solid var(--olive);
  border-radius: 0;
  font-family: var(--ui);
  font-size: 1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.btn-send:disabled { opacity: 0.7; cursor: progress; }
.btn-send-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  text-align: center;
}
.toast.ok { background: #e7f4e7; color: #2f5d2f; border: 1px solid #b6dcb6; }
.toast.err { background: #fbe7e7; color: #7a2424; border: 1px solid #efbcbc; }

/* ====== Galería ====== */
.fotos-gallery {
  margin-top: 1rem;
}
.gallery-header {
  text-align: center;
  margin-bottom: 1rem;
}
.gallery-header h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}
.gallery-count {
  color: var(--text-gray);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.gallery-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: flex-start;
}
.gallery-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.95rem;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--bone-dim);
  border-radius: 0;
  font-family: var(--ui);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tab.active {
  background: var(--olive);
  color: var(--bone);
  border-color: var(--olive);
}
.tab-count {
  background: rgba(240, 237, 230, 0.14);
  color: inherit;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  min-width: 18px;
  text-align: center;
}
.tab.active .tab-count { background: rgba(255,255,255,0.25); }

.gallery-grid {
  column-count: 2;
  column-gap: 0.5rem;
}
@media (min-width: 600px) {
  .gallery-grid { column-count: 3; }
}
@media (min-width: 900px) {
  .gallery-grid { column-count: 4; }
}
.gallery-grid figure {
  break-inside: avoid;
  margin: 0 0 0.5rem;
  border-radius: 10px;
  overflow: hidden;
  background: #f4eee2;
  position: relative;
  cursor: pointer;
}
.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-grid figure:hover img { transform: scale(1.03); }
.gallery-grid figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  color: #fff;
  padding: 1.5rem 0.6rem 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-grid figure:hover figcaption,
.gallery-grid figure:active figcaption { opacity: 1; }

.gallery-empty {
  text-align: center;
  color: var(--text-gray);
  font-size: 0.9rem;
  padding: 2rem 1rem;
  font-style: italic;
}

/* ====== Lightbox ====== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 10, 0.92);
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: lbIn 0.2s ease-out;
}
.lightbox[hidden] { display: none !important; }
.preview-wrap[hidden],
.upload-form[hidden],
.toast[hidden],
.gallery-empty[hidden] { display: none !important; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lb-meta {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #f5f0e6;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-align: center;
  background: rgba(0,0,0,0.4);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  max-width: 92vw;
}

/* ====== Descargas ====== */
.gallery-downloads {
  text-align: center;
  margin: 0.5rem 0 1rem;
}
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--ui);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-download:hover { background: var(--gold-dark); }
.btn-download:active { transform: scale(0.97); }
.btn-download svg { flex-shrink: 0; }

.dl-options {
  margin-top: 0.75rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.dl-options summary {
  cursor: pointer;
  text-align: center;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.3rem;
  list-style: none;
}
.dl-options summary::-webkit-details-marker { display: none; }
.dl-options[open] summary { color: var(--text-dark); }
.dl-help {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.8rem;
  color: var(--text-gray);
  letter-spacing: 0.04em;
}
.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}
@media (min-width: 500px) {
  .dl-grid { grid-template-columns: repeat(4, 1fr); }
}
.btn-download-sm {
  padding: 0.55rem 0.6rem;
  background: transparent;
  color: var(--bone-dim);
  border: 1px solid var(--hairline);
  border-radius: 0;
  font-family: var(--ui);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-download-sm:hover {
  background: rgba(138, 145, 82, 0.14);
  border-color: var(--olive-lit);
  color: var(--bone);
}

/* ====== Admin banner ====== */
.admin-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #2d2d2d;
  color: #f5f0e6;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  margin: 0.5rem 0 1rem;
  letter-spacing: 0.03em;
}
.admin-banner[hidden] { display: none; }
.admin-banner button {
  background: transparent;
  color: #f5f0e6;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}
.admin-banner button:hover {
  background: rgba(255,255,255,0.1);
}

/* ====== Botón eliminar en figura ====== */
.gallery-grid figure .btn-delete-foto {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.gallery-grid figure:hover .btn-delete-foto,
.gallery-grid figure:focus-within .btn-delete-foto,
.gallery-grid figure.is-mine .btn-delete-foto,
.gallery-grid figure.is-admin .btn-delete-foto {
  opacity: 1;
}
.gallery-grid figure .btn-delete-foto:hover {
  background: #b2373b;
}
.gallery-grid figure .btn-delete-foto svg {
  pointer-events: none;
}

.mine-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  padding: 0.1rem 0.5rem;
  background: rgba(201, 169, 110, 0.92);
  color: #fff;
  font-size: 0.68rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
  z-index: 2;
}

/* ====== Botón eliminar en lightbox ====== */
.lb-delete {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: rgba(178, 55, 59, 0.9);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--ui);
  font-size: 0.85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lb-delete[hidden] { display: none !important; }
.lb-delete:hover { background: #b2373b; }

.lb-download {
  position: absolute;
  top: 1rem;
  right: 4.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: rgba(201, 169, 110, 0.95);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--ui);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.lb-download:hover { background: var(--gold-dark); }

.gallery-grid figure .btn-download-foto {
  position: absolute;
  top: 0.35rem;
  right: 2.6rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  text-decoration: none;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.gallery-grid figure:hover .btn-download-foto,
.gallery-grid figure:focus-within .btn-download-foto {
  opacity: 1;
}
.gallery-grid figure .btn-download-foto:hover {
  background: var(--gold);
}
.gallery-grid figure .btn-download-foto svg { pointer-events: none; }

/* Si hay badge "Tuya", el botón eliminar queda solo (no hay download en la misma esquina) */
.gallery-grid figure:not(.is-mine):not(.is-admin) .btn-download-foto {
  right: 0.35rem;
}

/* ====== Footer ====== */
.fotos-footer {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem 1rem;
  color: var(--text-gray);
  font-size: 0.85rem;
}
.footer-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.88rem;
}
.footer-link:hover { text-decoration: underline; }
