/* Galería de Animales — estilos dark theme
   Paleta: #0f1116 bg, #181b20 card, #2a2d35 border, #C9A84C accent
*/
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f1116;
  color: #e8e6e3;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.gal-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── Header ── */
.gal-header {
  position: relative;
  padding: 28px 0 22px;
  border-bottom: 1px solid #2a2d35;
  margin-bottom: 18px;
}
.gal-header-inner { text-align: center; }
.gal-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 2.5px;
  line-height: 1;
  color: #e8e6e3;
}
.gal-header .sub {
  font-size: 13px;
  color: #9a9a9a;
  margin-top: 6px;
}
.gal-stats {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.stat-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(201,168,76,0.12);
  color: #C9A84C;
  border: 1px solid rgba(201,168,76,0.25);
  letter-spacing: 0.3px;
}

.gal-back {
  position: absolute;
  left: 0;
  top: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #181b20;
  border: 1px solid #2a2d35;
  color: #9a9a9a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.15s;
}
.gal-back:hover {
  color: #C9A84C;
  border-color: rgba(201,168,76,0.4);
}

/* ── Search ── */
.gal-search-wrap {
  position: relative;
  max-width: 640px;
  margin: 0 auto 14px;
}
.gal-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #5a5a5a;
  pointer-events: none;
}
#search {
  width: 100%;
  padding: 12px 44px 12px 44px;
  background: #181b20;
  border: 1px solid #2a2d35;
  border-radius: 10px;
  color: #e8e6e3;
  font: 14px 'Outfit', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
#search:focus { border-color: #C9A84C; }
.gal-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #5a5a5a;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  display: none;
}
.gal-search-clear:hover { color: #e8e6e3; }

/* ── Letters nav ── */
.gal-letters {
  display: flex;
  gap: 4px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid #2a2d35;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.gal-letters::-webkit-scrollbar { height: 4px; }
.gal-letters::-webkit-scrollbar-thumb { background: #2a2d35; border-radius: 2px; }
.letter-pill {
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 13px;
  background: transparent;
  color: #9a9a9a;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s;
  font-weight: 500;
  font-family: inherit;
}
.letter-pill:hover {
  background: #181b20;
  color: #e8e6e3;
}
.letter-pill.active {
  background: #C9A84C;
  color: #0f1116;
  border-color: #C9A84C;
  font-weight: 600;
}
.letter-pill .cnt {
  font-size: 10px;
  opacity: 0.65;
  margin-left: 4px;
}
.letter-pill:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* ── Grid ── */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gal-empty {
  text-align: center;
  padding: 60px 20px;
  color: #5a5a5a;
  font-size: 14px;
  border: 1px dashed #2a2d35;
  border-radius: 10px;
  margin-top: 20px;
}
.gal-loading {
  text-align: center;
  padding: 80px 20px;
}
.gal-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(201,168,76,0.18);
  border-top-color: #C9A84C;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card ── */
.card {
  background: #181b20;
  border: 1px solid #2a2d35;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: #C9A84C;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.card-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: #0f1116;
  position: relative;
  overflow: hidden;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
  display: block;
}
.card:hover .card-img { transform: scale(1.04); }
.card-noimg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a3f47;
}
.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}
.card-sexo {
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.5px;
}
.card-sexo.m { background: rgba(96,165,250,0.85); }
.card-sexo.h { background: rgba(248,113,180,0.85); }
.card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-name-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: space-between;
}
.card-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: #e8e6e3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-fotos-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #C9A84C;
  line-height: 1;
  padding-top: 2px;
}
.card-fotos-count svg {
  opacity: 0.85;
}
.card-meta {
  font-size: 11px;
  color: #9a9a9a;
}
.card-pedigree {
  font-size: 11px;
  color: #5a5a5a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  margin-top: 2px;
}

/* ── Lightbox ── */
.lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.94);
  backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.lb.open {
  display: flex;
  opacity: 1;
}

.lb-stage {
  max-width: min(92vw, 1200px);
  max-height: calc(100vh - 220px);
  margin-bottom: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  transition: opacity 0.2s;
  opacity: 0;
}
.lb-img.loaded { opacity: 1; }
.lb-noimg {
  color: #5a5a5a;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  padding: 60px;
  background: #181b20;
  border-radius: 10px;
  border: 1px solid #2a2d35;
}

.lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 1001;
}
.lb-close:hover {
  background: rgba(201,168,76,0.2);
  border-color: rgba(201,168,76,0.5);
  color: #C9A84C;
}

.lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding-bottom: 4px;
  z-index: 1001;
}
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-btn:disabled { opacity: 0.25; cursor: default; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

.lb-info {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #e8e6e3;
  max-width: min(560px, 92vw);
  padding: 14px 22px 12px;
  background: rgba(15, 17, 22, 0.92);
  border: 1px solid #2a2d35;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}
.lb-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
  color: #e8e6e3;
}
.lb-meta {
  font-size: 12px;
  color: #b8b6b3;
  margin-bottom: 6px;
  line-height: 1.4;
}
.lb-counter {
  font-size: 11px;
  color: #7a7a7a;
  margin-bottom: 10px;
}
.lb-link {
  display: inline-block;
  font-size: 12px;
  color: #C9A84C;
  text-decoration: none;
  border: 1px solid rgba(201,168,76,0.4);
  padding: 5px 14px;
  border-radius: 18px;
  transition: all 0.15s;
}
.lb-link:hover {
  background: rgba(201,168,76,0.15);
  border-color: #C9A84C;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .gal-container { padding: 0 12px 40px; }
  .gal-header { padding: 20px 0 16px; }
  .gal-back { left: 0; top: 22px; width: 36px; height: 36px; }
  .gal-header h1 { font-size: 26px; }
  .gal-header .sub { font-size: 11px; }
  .gal-letters { padding: 10px 0; gap: 3px; }
  .letter-pill { padding: 5px 10px; font-size: 12px; }
  .gal-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
  }
  .card-body { padding: 8px 10px 10px; }
  .card-name { font-size: 13px; }
  .card-meta, .card-criador { font-size: 10px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-close { top: 12px; right: 12px; }
  .lb-name { font-size: 18px; }
  .lb-btn { width: 42px; height: 42px; font-size: 24px; }
}
