/* ─────────────────────────────────────────────────────────────
   David Zamorano · Fotografía — hoja de estilos
   Paleta neutral (Tailwind): 50 #fafafa · 100 #f5f5f5 · 200 #e5e5e5
   300 #d4d4d4 · 400 #a3a3a3 · 500 #737373 · 600 #525252
   700 #404040 · 800 #262626 · 900 #171717 · 950 #0a0a0a
   ───────────────────────────────────────────────────────────── */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #fff;
  color: #0a0a0a;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; background: none; border: none; cursor: pointer; color: inherit; }

.ic { width: 18px; height: 18px; flex-shrink: 0; }

.kicker {
  font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.3em; color: #737373;
}

/* ── Botones ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; font-size: 14px; font-weight: 500;
  transition: background-color .2s, border-color .2s;
}
.btn .ic { width: 16px; height: 16px; }
.btn-dark { background: #0a0a0a; color: #fff; }
.btn-dark:hover { background: #262626; }
.btn-dark:disabled { opacity: .5; cursor: default; }
.btn-outline { border: 1px solid #d4d4d4; color: #262626; }
.btn-outline:hover { border-color: #0a0a0a; }
.btn-block { width: 100%; justify-content: center; }

/* ── Navegación ────────────────────────────────────────────── */
#nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  transition: all .3s;
}
#nav.scrolled {
  border-bottom: 1px solid #e5e5e5;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: 1152px; margin: 0 auto; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.brand { line-height: 1; }
.brand-top {
  display: block; font-family: var(--font-display);
  font-size: 18px; font-weight: 600; letter-spacing: .025em;
}
.brand-bottom {
  display: block; font-size: 10px; font-weight: 500;
  letter-spacing: .35em; color: #737373;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 14px; color: #525252; transition: color .2s;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-links a:hover { color: #0a0a0a; }
.nav-links a.ext .ic { width: 14px; height: 14px; opacity: .6; }
.nav-links a.ig { color: #737373; }
.nav-links a.ig:hover { color: #0a0a0a; }
@media (max-width: 640px) {
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12px; }
  .nav-links a.ig { display: none; }
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 92vh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; right: -40px; top: 96px;
  font-family: var(--font-display); font-size: 16rem; font-weight: 300;
  line-height: 1; color: #f5f5f5; user-select: none; pointer-events: none;
  display: none;
}
@media (min-width: 1024px) { .hero-bg { display: block; } }
.hero-inner {
  max-width: 1152px; width: 100%; margin: 0 auto;
  padding: 64px 24px 0;
}
.hero .kicker { margin-bottom: 24px; }
.hero-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: 60px; line-height: 1.02; color: #0a0a0a;
  max-width: 768px;
}
.hero-title em { font-weight: 400; }
.hero-name {
  display: block; margin-bottom: 20px;
  font-size: 24px; font-weight: 500; letter-spacing: .025em;
  color: #262626; line-height: 1.3;
}
@media (min-width: 640px) {
  .hero-title { font-size: 72px; }
  .hero-name { font-size: 30px; }
}
@media (min-width: 768px) { .hero-title { font-size: 96px; } }
.hero-sub {
  margin-top: 32px; max-width: 576px;
  font-size: 16px; line-height: 1.625; color: #525252;
}
@media (min-width: 640px) { .hero-sub { font-size: 18px; } }
.hero-actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 16px; }
.hero-arrow {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  color: #a3a3a3; transition: color .2s;
}
.hero-arrow:hover { color: #262626; }
.hero-arrow .ic { width: 20px; height: 20px; }
.bounce { animation: bounce 2s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ── Portafolio ────────────────────────────────────────────── */
.portfolio { max-width: 1152px; margin: 0 auto; padding: 96px 24px; }
.portfolio-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-bottom: 1px solid #e5e5e5; padding-bottom: 24px; margin-bottom: 40px;
}
.portfolio-head h2 {
  font-family: var(--font-display); font-weight: 300;
  font-size: 36px; color: #0a0a0a;
}
@media (min-width: 640px) { .portfolio-head h2 { font-size: 48px; } }
.photo-count {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: .25em; color: #a3a3a3;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.chip {
  border: 1px solid #d4d4d4; padding: 6px 16px;
  font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .15em; color: #737373; transition: all .2s;
}
.chip:hover { border-color: #0a0a0a; color: #0a0a0a; }
.chip.active { border-color: #0a0a0a; background: #0a0a0a; color: #fff; }

.cat-info { margin-bottom: 40px; }
.cat-info h3 {
  font-family: var(--font-display); font-weight: 300;
  font-size: 24px; color: #0a0a0a;
}
@media (min-width: 640px) { .cat-info h3 { font-size: 30px; } }
.cat-info p { margin-top: 12px; max-width: 672px; line-height: 1.625; color: #525252; }

.masonry { columns: 1; column-gap: 20px; }
@media (min-width: 640px) { .masonry { columns: 2; } }
@media (min-width: 1024px) { .masonry { columns: 3; } }
.masonry-item {
  position: relative; display: block; width: 100%;
  margin-bottom: 20px; break-inside: avoid;
  overflow: hidden; background: #f5f5f5; text-align: left;
}
.masonry-item img {
  width: 100%; transition: transform .5s ease-out;
}
.masonry-item:hover img { transform: scale(1.03); }
.item-title {
  position: absolute; inset: auto 0 0 0;
  padding: 40px 16px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  color: #fff; font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(8px);
  transition: all .3s;
}
.masonry-item:hover .item-title { opacity: 1; transform: translateY(0); }
.masonry-item.hidden-item { display: none; }

.empty-msg { padding: 80px 0; text-align: center; color: #a3a3a3; }

/* ── Lightbox ──────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; z-index: 10;
  border: 1px solid #e5e5e5; border-radius: 9999px;
  background: #fff; color: #525252;
  transition: color .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: #0a0a0a; }
.lb-close { right: 20px; top: 20px; padding: 8px; }
.lb-close .ic { width: 20px; height: 20px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); padding: 10px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
@media (min-width: 640px) { .lb-prev { left: 24px; } .lb-next { right: 24px; } }
.lb-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
@media (min-width: 640px) { .lb-stage { padding: 40px; } }
.lb-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
}
.lb-caption { border-top: 1px solid #e5e5e5; background: #fff; }
.lb-caption-inner {
  max-width: 768px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: baseline; justify-content: center;
  gap: 16px; text-align: center; flex-wrap: wrap;
}
.lb-caption-inner h3 { font-family: var(--font-display); font-size: 20px; color: #0a0a0a; }
.lb-caption-inner p { font-size: 14px; line-height: 1.625; color: #737373; }
.lb-counter {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: .25em; color: #a3a3a3;
}

/* ── Sobre mí ──────────────────────────────────────────────── */
.about { border-top: 1px solid #e5e5e5; background: #fafafa; }
.about-inner {
  max-width: 1152px; margin: 0 auto; padding: 96px 24px;
  display: grid; gap: 48px;
}
@media (min-width: 768px) { .about-inner { grid-template-columns: 1fr 2fr; } }
.about-lead {
  font-family: var(--font-display); font-weight: 300;
  font-size: 24px; line-height: 1.4; color: #171717;
}
@media (min-width: 640px) { .about-lead { font-size: 30px; } }
.about-par { margin-top: 24px; font-size: 16px; line-height: 1.625; color: #404040; }
.facts {
  margin-top: 48px; padding-top: 32px;
  border-top: 1px solid #e5e5e5;
  display: grid; gap: 24px;
}
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts dt {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: .2em; color: #a3a3a3;
}
.facts dd { margin-top: 8px; font-size: 14px; font-weight: 500; color: #262626; }

/* ── Contacto ──────────────────────────────────────────────── */
.contact { max-width: 1152px; margin: 0 auto; padding: 112px 24px; text-align: center; }
.contact h2 {
  font-family: var(--font-display); font-weight: 300;
  font-size: 48px; color: #0a0a0a;
}
.contact h2 em { font-weight: 400; }
@media (min-width: 640px) { .contact h2 { font-size: 60px; } }
.contact > p { margin: 24px auto 0; max-width: 448px; color: #525252; }
.contact-actions {
  margin-top: 40px; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 16px;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer { border-top: 1px solid #e5e5e5; }
.footer-inner {
  max-width: 1152px; margin: 0 auto; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; gap: 16px;
  font-size: 12px; color: #a3a3a3;
}
@media (min-width: 640px) { .footer-inner { flex-direction: row; } }
.footer-note { font-style: italic; }
.footer-access { color: #d4d4d4; transition: color .2s; }
.footer-access:hover { color: #525252; }

/* ═══════════════════════════════════════════════════════════
   PANEL DE ADMINISTRACIÓN
   ═══════════════════════════════════════════════════════════ */
.admin-body { background: #fafafa; min-height: 100vh; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 384px;
  border: 1px solid #e5e5e5; background: #fff; padding: 32px;
}
.login-icon {
  width: 44px; height: 44px; border-radius: 9999px;
  background: #f5f5f5; display: flex; align-items: center;
  justify-content: center; margin-bottom: 24px; color: #525252;
}
.login-icon .ic { width: 20px; height: 20px; }
.login-card h1 { font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.login-sub { margin-top: 8px; font-size: 14px; color: #737373; }
.login-card form { margin-top: 24px; display: grid; gap: 12px; }
.login-card input {
  width: 100%; border: 1px solid #d4d4d4; padding: 10px 16px;
  font-size: 14px; font-family: inherit; outline: none;
}
.login-card input:focus { border-color: #0a0a0a; }
.login-error { margin-top: 12px; font-size: 13px; color: #dc2626; }
.login-back {
  margin-top: 24px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #a3a3a3;
}
.login-back:hover { color: #404040; }
.login-back .ic { width: 14px; height: 14px; }

.admin-header { border-bottom: 1px solid #e5e5e5; background: #fff; }
.admin-header-inner {
  max-width: 1152px; margin: 0 auto; height: 64px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-header-left { display: flex; align-items: center; gap: 16px; }
.admin-back { color: #a3a3a3; transition: color .2s; display: inline-flex; }
.admin-back:hover { color: #262626; }
.admin-back .ic { width: 20px; height: 20px; }
.admin-header h1 { font-family: var(--font-display); font-size: 20px; font-weight: 400; }
.admin-exit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: #737373;
}
.admin-exit:hover { color: #171717; }
.admin-exit .ic { width: 16px; height: 16px; }

.admin-main { max-width: 1152px; margin: 0 auto; padding: 40px 24px 120px; }

.card { border: 1px solid #e5e5e5; background: #fff; padding: 20px; margin-bottom: 32px; }
.card-title {
  font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .25em; color: #737373; margin-bottom: 16px;
}

#adminChips { margin-bottom: 0; }
.admin-chip {
  display: inline-flex; align-items: center;
  border: 1px solid #d4d4d4; font-size: 12px; font-weight: 500;
  color: #525252; transition: all .2s;
}
.admin-chip.active { border-color: #0a0a0a; background: #0a0a0a; color: #fff; }
.admin-chip .chip-label { padding: 6px 14px; }
.admin-chip .chip-edit, .admin-chip .chip-del {
  padding: 6px; color: #a3a3a3; display: inline-flex; align-items: center;
}
.admin-chip .chip-edit:hover { color: #171717; }
.admin-chip .chip-del { border-left: 1px solid #d4d4d4; }
.admin-chip .chip-del:hover { color: #dc2626; }
.admin-chip.active .chip-edit { color: rgba(255,255,255,.7); }
.admin-chip.active .chip-edit:hover { color: #fff; }
.admin-chip.active .chip-del { border-left-color: rgba(255,255,255,.3); color: rgba(255,255,255,.7); }
.admin-chip.active .chip-del:hover { color: #fff; }
.admin-chip .ic { width: 12px; height: 12px; }

.newcat-form { margin-top: 16px; display: flex; gap: 8px; max-width: 384px; }
.newcat-form input {
  flex: 1; border: 1px solid #d4d4d4; padding: 8px 12px;
  font-size: 14px; font-family: inherit; outline: none;
}
.newcat-form input:focus { border-color: #0a0a0a; }
.newcat-form .btn { padding: 8px 16px; }

.editcat-panel {
  margin-top: 16px; border: 1px solid #e5e5e5;
  background: #fafafa; padding: 16px;
}
.editcat-title {
  margin-bottom: 12px; font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .2em; color: #737373;
}
.editcat-panel input, .editcat-panel textarea {
  width: 100%; border: 1px solid #d4d4d4; background: #fff;
  padding: 8px 12px; font-size: 14px; font-family: inherit;
  outline: none; resize: none; margin-bottom: 8px;
}
.editcat-panel input:focus, .editcat-panel textarea:focus { border-color: #0a0a0a; }
.editcat-actions { display: flex; gap: 8px; }
.editcat-actions .btn { padding: 8px 16px; }
.editcat-note { margin-top: 8px; font-size: 12px; color: #a3a3a3; }

.dropzone {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; border: 2px dashed #d4d4d4;
  background: #fff; padding: 56px 24px; text-align: center;
  cursor: pointer; transition: all .2s;
}
.dropzone:hover { border-color: #737373; }
.dropzone.dragover { border-color: #0a0a0a; background: #f5f5f5; }
.dz-icon { width: 28px; height: 28px; color: #a3a3a3; margin-bottom: 12px; }
.dz-text { font-size: 14px; font-weight: 500; color: #262626; }
.dz-sub { margin-top: 4px; font-size: 12px; color: #a3a3a3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.dz-sub select {
  border: 1px solid #d4d4d4; background: #fff; padding: 4px 8px;
  font-size: 12px; font-family: inherit; color: #404040; outline: none;
}
.dz-sub strong { color: #525252; font-weight: 500; }

.queue { margin-top: 16px; list-style: none; display: grid; gap: 8px; }
.queue li {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #e5e5e5; background: #fff; padding: 10px 16px;
}
.queue .q-name {
  min-width: 0; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: #404040;
}
.queue .q-bar { width: 128px; height: 4px; border-radius: 4px; background: #f5f5f5; overflow: hidden; }
.queue .q-fill { height: 100%; background: #171717; transition: width .2s; }
.queue .q-fill.error { background: #f87171; }
.queue .ic { width: 16px; height: 16px; }
.q-spin { animation: spin 1s linear infinite; color: #a3a3a3; }
.q-ok { color: #16a34a; }
.q-err { color: #ef4444; }
@keyframes spin { to { transform: rotate(360deg); } }

.published-head {
  margin: 48px 0 20px; display: flex;
  align-items: center; justify-content: space-between;
}
.published-head .card-title { margin-bottom: 0; }
.drag-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #a3a3a3;
}
.drag-hint .ic { width: 14px; height: 14px; }

.admin-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .admin-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .admin-grid { grid-template-columns: repeat(4, 1fr); } }

.photo-card {
  position: relative; border: 1px solid #e5e5e5;
  background: #fff; transition: all .2s;
}
.photo-card.draggable { cursor: grab; }
.photo-card.draggable:active { cursor: grabbing; }
.photo-card.dragging { opacity: .4; }
.photo-card.dragover { border-color: #0a0a0a; box-shadow: 0 0 0 2px rgba(10,10,10,.2); }
.photo-card .thumb { position: relative; }
.photo-card .thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-card .thumb .cat-badge {
  position: absolute; left: 8px; top: 8px;
  background: rgba(255,255,255,.9); padding: 2px 8px;
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .05em; color: #525252;
}
.photo-card .card-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px;
}
.photo-card .card-row .t {
  min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12px; color: #525252;
}
.photo-card .card-row .t em { color: #d4d4d4; }
.photo-card .row-actions { display: flex; flex-shrink: 0; gap: 4px; }
.photo-card .row-actions button { padding: 6px; color: #a3a3a3; display: inline-flex; }
.photo-card .row-actions button:hover { color: #171717; }
.photo-card .row-actions button.del:hover { color: #dc2626; }
.photo-card .row-actions .ic { width: 14px; height: 14px; }

.photo-edit { padding: 12px; display: grid; gap: 8px; }
.photo-edit input, .photo-edit textarea, .photo-edit select {
  width: 100%; border: 1px solid #d4d4d4; background: #fff;
  padding: 6px 10px; font-size: 12px; font-family: inherit;
  outline: none; resize: none;
}
.photo-edit input:focus, .photo-edit textarea:focus, .photo-edit select:focus { border-color: #0a0a0a; }
.photo-edit .edit-actions { display: flex; gap: 8px; }
.photo-edit .edit-actions button {
  flex: 1; padding: 6px 0; font-size: 12px; font-weight: 500;
}
.photo-edit .edit-save { background: #0a0a0a; color: #fff; }
.photo-edit .edit-save:hover { background: #262626; }
.photo-edit .edit-cancel { border: 1px solid #d4d4d4; color: #525252; }
.photo-edit .edit-cancel:hover { border-color: #737373; }

.savebar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  border-top: 1px solid #e5e5e5;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
}
.savebar-inner {
  max-width: 1152px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.savebar-inner > span { font-size: 14px; color: #525252; }
.savebar-actions { display: flex; flex-shrink: 0; gap: 8px; }
.savebar-actions .btn { padding: 8px 16px; }

/* Toasts */
.toast-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px);
}
.toast {
  border: 1px solid #e5e5e5; background: #fff; padding: 12px 16px;
  font-size: 14px; color: #262626; text-align: center;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,.1);
  animation: toast-in .25s ease-out;
}
.toast.success { border-color: #16a34a; color: #15803d; }
.toast.error { border-color: #dc2626; color: #b91c1c; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
