/* ================================================================
   Jona · Portafolio de fotografía
   Tokens: blanco #fff, texto #111, secundarios #888/#666/#444,
   bordes #eee, overlay visor #0a0a0a, Work Sans 300/400/500/600.
   ================================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: #111;
  font-family: 'Work Sans', system-ui, sans-serif;
  min-height: 100vh;
}

::selection { background: #111; color: #fff; }

a { color: #111; text-decoration: none; }
a:hover { color: #666; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Placeholder gradients (fotos sin archivo aún) ─────────────── */
.ph-g0 { background: linear-gradient(160deg, #2b2b2b, #050505); }
.ph-g1 { background: linear-gradient(160deg, #1b2530, #04060a); }
.ph-g2 { background: linear-gradient(160deg, #241b2e, #05040a); }
.ph-g3 { background: linear-gradient(160deg, #1a1f16, #050604); }
.ph-g4 { background: linear-gradient(160deg, #2a1e1a, #070402); }
.ph-g5 { background: linear-gradient(160deg, #151b22, #03050a); }

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  border-bottom: 1px solid #eee;
}

.logo-link { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.logo { height: 38px; width: auto; display: block; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  position: relative;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  background: none;
  border: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav-item:hover { color: #666; }
.nav-item.active { border-bottom-color: #111; }

.nav-arrow {
  font-size: 11px;
  transform: rotate(0deg);
  transition: transform 0.15s;
}
.nav-arrow.rotated { transform: rotate(180deg); }

.nav-work-wrap { position: relative; }

.dropdown {
  position: absolute;
  top: 36px;
  left: 0;
  background: #fff;
  border: 1px solid #eee;
  min-width: 180px;
  padding: 10px 0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.dropdown-item {
  display: block;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
}
.dropdown-item.active { text-decoration: underline; text-underline-offset: 4px; }

.insta-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
}

/* ── Grid de trabajo ───────────────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #fff;
  min-height: 70vh;
  align-content: start;
}

.cell {
  position: relative;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  overflow: hidden;
  margin: 0;
}

.cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cell-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.cell-cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.7;
  margin-bottom: 4px;
}

.grid-empty {
  grid-column: 1 / -1;
  padding: 80px 32px;
  text-align: center;
  color: #888;
  font-size: 15px;
}

/* ── Vista Info ────────────────────────────────────────────────── */
.info-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 70px 32px 120px;
}

.info-title {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: 0.08em;
  margin: 0 0 40px;
}

.info-section { margin-bottom: 56px; }
.info-section.last { margin-bottom: 0; }

.info-heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: #888;
  margin: 0 0 16px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.info-about {
  font-size: 17px;
  line-height: 1.7;
  color: #222;
  white-space: pre-wrap;
  margin: 0;
}

.info-copyright {
  font-size: 15px;
  line-height: 1.7;
  color: #444;
  white-space: pre-wrap;
  margin: 0;
}

.info-contact { font-size: 16px; line-height: 2; color: #222; }

/* ── Visor a pantalla completa ─────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.18s ease;
}
.lightbox[hidden] { display: none; }

.lb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  color: #fff;
}

.lb-counter { font-size: 13px; letter-spacing: 0.1em; opacity: 0.7; }

.lb-close {
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  padding: 4px 10px;
  color: #fff;
  background: none;
  border: none;
  font-family: inherit;
}

.lb-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  opacity: 0.6;
  padding: 10px;
  user-select: none;
  background: none;
  border: none;
  font-family: inherit;
  z-index: 2;
}
.lb-prev { left: 18px; }
.lb-next { right: 18px; }

.lb-stage {
  width: min(78vw, 900px);
  height: 82vh;
  border-radius: 2px;
  display: flex;
  align-items: flex-end;
  padding: 34px;
  background: #111;
}

.lb-caption { color: rgba(255, 255, 255, 0.85); }

.lb-cat {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.7;
  margin-bottom: 6px;
}

.lb-title { font-size: 20px; font-weight: 300; }

.lb-note {
  text-align: center;
  color: #666;
  font-size: 12px;
  padding: 16px;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .site-header { padding: 16px 20px; }
  .site-nav { gap: 22px; }
  .cell-caption { padding: 14px; }
  .info-title { font-size: 42px; }
  .lb-stage { width: 92vw; padding: 20px; }
}

/* ================================================================
   Admin — mismo lenguaje visual (blanco/negro, Work Sans, esquinas
   rectas), layout funcional simple.
   ================================================================ */

.admin-body { background: #fff; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 40px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-brand img { height: 30px; width: auto; display: block; }
.admin-brand span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #888;
}

.admin-nav { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }

.admin-nav a {
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.admin-nav a.active { border-bottom-color: #111; }

.admin-session { display: flex; align-items: center; gap: 16px; }
.admin-user { font-size: 12px; color: #888; }

.admin-main { max-width: 1000px; margin: 0 auto; padding: 40px 32px 100px; }

.admin-title {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.06em;
  margin: 0 0 30px;
}

.admin-section-heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: #888;
  margin: 40px 0 16px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
.admin-section-heading:first-of-type { margin-top: 0; }

.flash {
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 24px;
  border: 1px solid #eee;
}
.flash-ok { border-left: 3px solid #111; }
.flash-error { border-left: 3px solid #c0392b; color: #c0392b; }

/* Forms */
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #888;
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #111; }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

.btn {
  display: inline-block;
  padding: 10px 26px;
  font-size: 14px;
  font-family: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
  background: #111;
  color: #fff;
  border: 1px solid #111;
  border-radius: 0;
}
.btn:hover { background: #333; }

.btn-outline {
  display: inline-block;
  padding: 8px 18px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  color: #111;
  border: 1px solid #111;
  border-radius: 0;
}
.btn-outline:hover { background: #f5f5f5; }

.btn-danger {
  display: inline-block;
  padding: 8px 18px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  color: #c0392b;
  border: 1px solid #c0392b;
  border-radius: 0;
}
.btn-danger:hover { background: #fdf0ee; }

.logout-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  padding: 0;
}
.logout-btn:hover { color: #111; }

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fff;
}
.login-card { width: 340px; padding: 20px; }
.login-logo { display: block; margin: 0 auto 26px; height: 54px; width: auto; }
.login-title {
  text-align: center;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #888;
  font-weight: 500;
  margin: 0 0 30px;
}
.login-error {
  font-size: 13px;
  color: #c0392b;
  margin-bottom: 18px;
  text-align: center;
}
.login-card .btn { width: 100%; margin-top: 8px; }

/* Dashboard */
.stat-row { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 40px; }
.stat-tile {
  flex: 1;
  min-width: 180px;
  border: 1px solid #eee;
  padding: 26px 22px;
}
.stat-num { font-size: 40px; font-weight: 300; }
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #888;
  margin-top: 6px;
}
.dash-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* Categorías */
.cat-list { border-top: 1px solid #eee; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.cat-rename { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; }
.cat-rename input { max-width: 260px; }
.cat-count { font-size: 13px; color: #888; white-space: nowrap; }
.cat-new { display: flex; gap: 10px; margin-top: 26px; max-width: 420px; }

/* Fotos */
.upload-zone {
  border: 1px dashed #ccc;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 14px;
}
.upload-zone:hover { border-color: #111; }
.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #444;
  font-size: 14px;
  cursor: pointer;
}
.upload-hint { font-size: 12px; color: #888; }
.upload-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
.upload-controls select { max-width: 220px; }

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  margin-top: 16px;
}
.preview-thumb { aspect-ratio: 1; overflow: hidden; }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photos-hint { font-size: 13px; color: #888; margin: 30px 0 14px; }

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.photo-card { border: 1px solid #eee; }
.photo-card.dragging { opacity: 0.4; }

.photo-card-img {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  cursor: grab;
}
.photo-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-card-img .ph-fill { position: absolute; inset: 0; }

.photo-delete-form { position: absolute; top: 8px; right: 8px; }
.photo-delete-btn {
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.photo-delete-btn:hover { background: #c0392b; }

.photo-card-form { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.photo-card-form input,
.photo-card-form select { font-size: 13px; padding: 7px 9px; }
.photo-card-form .btn-outline { align-self: flex-start; }

.order-actions { margin-top: 20px; }

/* Progress modal */
.progress-modal {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.progress-modal.open { display: flex; }
.progress-card {
  width: 320px;
  border: 1px solid #eee;
  background: #fff;
  padding: 30px;
  text-align: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}
.progress-title { font-size: 15px; margin: 0 0 16px; }
.progress-bar-wrap { height: 4px; background: #eee; }
.progress-bar { height: 100%; width: 0; background: #111; transition: width 0.15s; }
.progress-pct { font-size: 13px; color: #888; margin: 10px 0 0; }
.progress-hint { font-size: 12px; color: #aaa; margin: 14px 0 0; }

@media (max-width: 640px) {
  .admin-header { padding: 14px 20px; }
  .admin-main { padding: 28px 20px 80px; }
}
