/* ================================================================
   Álvaro Morales · Fotografía
   Tokens (design handoff): fondo #fbfaf8, texto #1a1a1a, secundario
   #5c574c, terciario #8a8378, nav inactivo #4a463d, divisores
   rgba(0,0,0,.08), bordes de formulario rgba(0,0,0,.15).
   EB Garamond 400/500 (itálica en titulares y nav). Sin border-radius.
   ================================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fbfaf8;
  color: #1a1a1a;
  font-family: 'EB Garamond', serif;
  min-height: 100vh;
}

::selection { background: #1a1a1a; color: #fbfaf8; }

a { color: #1a1a1a; text-decoration: none; }
a:hover { color: #8a8378; }

img { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 40px; }

.divider { height: 1px; background: rgba(0, 0, 0, 0.08); }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8378;
}
.eyebrow-center {
  text-align: center;
  letter-spacing: 0.12em;
  margin-bottom: 36px;
}

/* ── Placeholder rayado (sin foto subida aún) ──────────────────── */
.ph-block {
  background: repeating-linear-gradient(135deg, #e8e4de, #e8e4de 10px, #ddd8d0 10px, #ddd8d0 20px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-block span {
  color: #8a8378;
  font: 12px 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}

/* ── Header público ────────────────────────────────────────────── */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 0 28px;
}

.wordmark {
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.02em;
  margin-bottom: 22px;
}
.wordmark:hover { color: #1a1a1a; }

.site-nav {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  font-style: italic;
  font-size: 15px;
  color: #4a463d;
  text-transform: lowercase;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.nav-link:hover { color: #8a8378; }
.nav-link.active { color: #1a1a1a; border-bottom-color: #1a1a1a; }

.site-header + .divider { margin-bottom: 8px; }

/* ── Home ──────────────────────────────────────────────────────── */
.hero { margin: 32px 0 8px; }
.hero-media { width: 100%; height: 560px; object-fit: cover; }

.hero-copy {
  text-align: center;
  padding: 36px 0 56px;
  max-width: 640px;
  margin: 0 auto;
}
.hero-headline {
  font-size: 34px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
}
.hero-body {
  font-size: 15px;
  line-height: 1.7;
  color: #5c574c;
  margin: 18px 0 0;
}

.divider-collections { margin: 8px 0 48px; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 80px;
}

.album-card { display: flex; flex-direction: column; gap: 14px; }
.album-card:hover { color: inherit; }
.album-card:hover .album-cover,
.album-card:hover .ph-block.album-cover { opacity: 0.92; }

.album-cover { width: 100%; height: 320px; object-fit: cover; transition: opacity 0.2s; }

.album-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.album-card-name { font-size: 22px; font-style: italic; color: #1a1a1a; }
.album-card-count { font-size: 13px; color: #8a8378; }

.about-teaser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 0 0 72px;
}
.teaser-media { width: 100%; height: 380px; object-fit: cover; }

.about-teaser-text { display: flex; flex-direction: column; gap: 16px; }
.teaser-headline {
  font-size: 26px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
}
.teaser-body { font-size: 15px; line-height: 1.75; color: #5c574c; margin: 0; }
.teaser-link {
  font-size: 14px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #1a1a1a;
  width: fit-content;
  padding-bottom: 3px;
  margin-top: 6px;
}
.teaser-link:hover { color: #8a8378; border-bottom-color: #8a8378; }

/* ── Galería de álbum ──────────────────────────────────────────── */
.album-page { padding: 32px 0 80px; }

.back-link { font-size: 13px; color: #8a8378; display: inline-block; margin-bottom: 20px; }
.back-link:hover { color: #1a1a1a; }

.album-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
}
.album-title { font-size: 34px; font-style: italic; font-weight: 400; margin: 0; }
.album-count { font-size: 13px; color: #8a8378; }

.masonry { column-count: 3; column-gap: 18px; }
.masonry-item {
  width: 100%;
  display: block;
  break-inside: avoid;
  margin-bottom: 18px;
}

.album-empty { font-size: 15px; color: #8a8378; padding: 40px 0 80px; }

/* ── Sobre Álvaro ──────────────────────────────────────────────── */
.about-page {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 56px;
  padding: 32px 0 90px;
}

.about-text { display: flex; flex-direction: column; gap: 22px; }
.about-heading { font-size: 32px; font-style: italic; font-weight: 400; margin: 0; }
.about-subheading { font-size: 19px; font-style: italic; font-weight: 400; margin: 0; }
.about-body { font-size: 15px; line-height: 1.8; color: #5c574c; margin: 0; }
.divider-about { margin: 6px 0; }

.about-photos { display: flex; flex-direction: column; gap: 18px; }
.about-img-1 { width: 100%; height: 340px; object-fit: cover; }
.about-img-2 { width: 100%; height: 260px; object-fit: cover; }
.about-img-3 { width: 100%; height: 300px; object-fit: cover; }

/* ── Contacto ──────────────────────────────────────────────────── */
.contact-page {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  padding: 32px 0 90px;
}

.contact-heading { font-size: 32px; font-style: italic; font-weight: 400; margin: 0 0 10px; }
.contact-email { font-size: 14px; color: #8a8378; margin-bottom: 32px; }
.contact-email a { color: #8a8378; }
.contact-email a:hover { color: #1a1a1a; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-field { margin-bottom: 22px; }
.form-field label {
  display: block;
  font-size: 13px;
  color: #8a8378;
  margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  border-radius: 0;
}
.form-field textarea { height: 140px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: #1a1a1a; }

.submit-btn {
  display: inline-block;
  padding: 14px 34px;
  background: #1a1a1a;
  color: #fbfaf8;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
}
.submit-btn:hover { background: #4a463d; }

.form-sent { font-size: 15px; line-height: 1.7; color: #5c574c; }
.form-error { font-size: 14px; color: #a04434; margin: 0 0 18px; }

.studio-heading { font-size: 19px; font-style: italic; font-weight: 400; margin: 0 0 6px; }
.studio-address { font-size: 14px; color: #5c574c; margin-bottom: 20px; }
.studio-map { width: 100%; height: 220px; border: 0; display: block; margin-bottom: 18px; }
.studio-photo { width: 100%; height: 260px; object-fit: cover; }

/* ── Footer público ────────────────────────────────────────────── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
  font-size: 12px;
  color: #8a8378;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.fotomica-link {
  color: #8a8378;
  border-bottom: 1px solid rgba(138, 131, 120, 0.4);
}
.fotomica-link:hover { color: #1a1a1a; }
.footer-plain-link { color: #8a8378; }
.footer-plain-link:hover { color: #1a1a1a; }

/* ── Responsive mínimo (mobile aún sin diseñar — ver handoff) ──── */
@media (max-width: 800px) {
  .container { padding: 0 20px; }
  .site-header { padding: 36px 0 20px; }
  .site-nav { gap: 20px; }
  .hero-media, .ph-block.hero-media { height: 320px; }
  .album-grid { grid-template-columns: 1fr; }
  .about-teaser, .about-page, .contact-page { grid-template-columns: 1fr; gap: 32px; }
  .masonry { column-count: 2; }
}
@media (max-width: 520px) {
  .masonry { column-count: 1; }
  .form-row-2 { grid-template-columns: 1fr; }
}

/* ================================================================
   Admin — mismo lenguaje visual (crema/negro, EB Garamond, esquinas
   rectas), layout funcional simple.
   ================================================================ */

.admin-body { background: #fbfaf8; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.admin-brand { display: flex; align-items: baseline; gap: 12px; }
.admin-wordmark { font-size: 22px; font-weight: 500; }
.admin-brand span:last-child {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #8a8378;
}

.admin-nav { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.admin-nav a {
  font-size: 15px;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.admin-nav a.active { border-bottom-color: #1a1a1a; }

.unread-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  text-align: center;
  background: #1a1a1a;
  color: #fbfaf8;
  font-size: 12px;
  margin-left: 4px;
}

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

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

.admin-title {
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  margin: 0 0 30px;
}

.admin-section-heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: #8a8378;
  margin: 48px 0 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 10px;
}
.admin-section-heading:first-of-type { margin-top: 0; }
.admin-subsection-heading {
  font-size: 17px;
  font-style: italic;
  font-weight: 400;
  margin: 26px 0 12px;
}

.flash {
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}
.flash-ok { border-left: 3px solid #1a1a1a; }
.flash-error { border-left: 3px solid #a04434; color: #a04434; }

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

.admin-body input[type="text"],
.admin-body input[type="email"],
.admin-body input[type="password"],
.admin-body input[type="url"],
.admin-body select,
.admin-body textarea,
.login-body input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0;
}
.admin-body input:focus,
.admin-body select:focus,
.admin-body textarea:focus,
.login-body input:focus { outline: none; border-color: #1a1a1a; }
.admin-body textarea { min-height: 110px; resize: vertical; line-height: 1.6; }

.admin-body input[type="file"] { font-family: inherit; font-size: 14px; }

.current-image { margin-bottom: 10px; }
.current-image img { height: 90px; width: auto; display: block; border: 1px solid rgba(0, 0, 0, 0.08); }

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

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

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

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

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fbfaf8;
  font-family: 'EB Garamond', serif;
  color: #1a1a1a;
  margin: 0;
}
.login-card { width: 340px; padding: 20px; }
.login-wordmark { text-align: center; font-size: 34px; font-weight: 500; margin-bottom: 20px; }
.login-title {
  text-align: center;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #8a8378;
  margin: 0 0 30px;
}
.login-error { font-size: 14px; color: #a04434; margin-bottom: 18px; text-align: center; }
.login-card .btn { width: 100%; margin-top: 8px; }

/* Dashboard */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.stat-tile {
  flex: 1;
  min-width: 180px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  padding: 26px 22px;
}
.stat-num { font-size: 40px; font-style: italic; }
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #8a8378;
  margin-top: 6px;
}
.dash-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* Álbumes */
.album-list { border-top: 1px solid rgba(0, 0, 0, 0.08); }
.album-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
  background: #fbfaf8;
}
.album-row.dragging { opacity: 0.4; }

.drag-handle { cursor: grab; color: #8a8378; font-size: 16px; user-select: none; }

.album-row-thumb {
  width: 64px;
  height: 48px;
  display: block;
  flex: none;
  background: repeating-linear-gradient(135deg, #e8e4de, #e8e4de 6px, #ddd8d0 6px, #ddd8d0 12px);
}
.album-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.album-rename { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.album-rename input { max-width: 220px; }
.album-row-count { font-size: 13px; color: #8a8378; white-space: nowrap; }

.hidden-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8a8378;
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 2px 8px;
}

.cat-new { display: flex; gap: 10px; margin-top: 10px; max-width: 420px; }

/* Fotos por álbum */
.upload-zone {
  border: 1px dashed rgba(0, 0, 0, 0.25);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 14px;
  background: #fff;
}
.upload-zone:hover, .upload-zone.dragover { border-color: #1a1a1a; }
.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #4a463d;
  font-size: 14px;
  cursor: pointer;
}
.upload-hint { font-size: 12px; color: #8a8378; }
.upload-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.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: 14px; color: #8a8378; margin: 30px 0 14px; }

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

.photo-card { border: 1px solid rgba(0, 0, 0, 0.08); background: #fff; }
.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;
}

.cover-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(26, 26, 26, 0.8);
  color: #fbfaf8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
}

.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: #a04434; }

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

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

/* Bloques de texto (Sobre Álvaro) */
.block-form {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  padding: 18px;
  margin-bottom: 16px;
}
.block-new { border-style: dashed; background: transparent; }
.block-actions { display: flex; gap: 10px; }

/* Cuenta */
.account-form { max-width: 420px; }

/* Mensajes */
.message-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  padding: 18px;
  margin-bottom: 14px;
}
.message-unread { border-left: 3px solid #1a1a1a; }
.message-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.message-from { font-size: 15px; }
.message-meta { display: flex; gap: 14px; align-items: baseline; }
.message-subject {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8a8378;
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 2px 8px;
}
.message-date { font-size: 12px; color: #8a8378; }
.message-body { font-size: 15px; line-height: 1.7; color: #5c574c; margin: 0 0 14px; white-space: pre-wrap; }

/* Progress modal */
.progress-modal {
  position: fixed;
  inset: 0;
  background: rgba(251, 250, 248, 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 rgba(0, 0, 0, 0.08);
  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: rgba(0, 0, 0, 0.08); }
.progress-bar { height: 100%; width: 0; background: #1a1a1a; transition: width 0.15s; }
.progress-pct { font-size: 13px; color: #8a8378; margin: 10px 0 0; }
.progress-hint { font-size: 12px; color: #b5afa4; margin: 14px 0 0; }

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