/* ==========================================================
   DANIELA PHOTOGRAPHY · Estilos
   Idea visual: fondo casi blanco, tipografía serif de alto contraste,
   mucho espacio vacío y las fotografías como protagonistas.
   Orden del archivo: 1. Variables  2. Base  3. Componentes
   4. Secciones  5. Visor de imágenes  6. Responsive
   ========================================================== */

/* ---------- 1. VARIABLES ---------- */
:root {
  --paper: #f5f5f3;   /* fondo */
  --ink: #111111;     /* texto y botones */
  --grey: #6b6b66;    /* texto secundario */
  --line: #d9d9d4;    /* líneas finas */
  --error: #a4281c;

  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --font-body: "Jost", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);   /* margen lateral de la página */
  --ease: cubic-bezier(0.77, 0, 0.18, 1);
}

/* ---------- 2. BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
}
.skip-link:focus { top: 1rem; }

/* ---------- 3. COMPONENTES ---------- */
.btn {
  display: inline-block; padding: 1rem 2.2rem; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  font: 500 0.95rem var(--font-body); letter-spacing: 0.06em; text-decoration: none; cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.btn:hover { background: transparent; color: var(--ink); }

.section { padding: clamp(5rem, 11vw, 9.5rem) var(--gutter) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section h2, .about-text h2 { font-size: clamp(2.8rem, 7vw, 5rem); line-height: 1; letter-spacing: -0.01em; }

/* ---------- 4. SECCIONES ---------- */

/* Aviso de demostración */
.demo-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1.25rem;
  padding: 0.55rem 1rem; background: #ebebe7; color: var(--grey);
  font-size: 0.82rem; text-align: center;
}
.demo-bar a { color: var(--ink); font-weight: 500; }

/* Navbar */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 245, 243, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; padding-inline: var(--gutter); }

.wordmark { font: 400 1.35rem var(--font-display); text-decoration: none; letter-spacing: 0.01em; }

.nav-links { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); }
.nav-links a { position: relative; text-decoration: none; font-size: 0.95rem; letter-spacing: 0.03em; padding: 0.3rem 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 1.5px; margin: 7px auto; background: var(--ink); transition: transform 0.3s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 6rem);
  min-height: calc(100svh - 7rem); padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) 2rem;
}
.hero h1 { line-height: 0.92; }
.hero-name { display: block; font-size: clamp(4rem, 11vw, 9.5rem); letter-spacing: -0.02em; }
.hero-role { display: block; margin-top: 1.4rem; font: 300 clamp(1rem, 1.9vw, 1.45rem) var(--font-body); letter-spacing: 0.34em; }
.hero-phrase { max-width: 24rem; margin: 2.5rem 0 2.25rem; color: var(--grey); font-size: 1.15rem; }

.hero-images { position: relative; justify-self: end; width: min(100%, 520px); padding-bottom: 12%; }
.hero-main { aspect-ratio: 4 / 5; overflow: hidden; background: #e4e4df; }
.hero-main img, .hero-second img { width: 100%; height: 100%; object-fit: cover; }
.hero-second {
  position: absolute; left: -17%; bottom: 0; width: 52%; aspect-ratio: 3 / 2; overflow: hidden;
  border: 10px solid var(--paper); background: #e4e4df;
}
.hero-caption { margin-top: 0.9rem; text-align: right; font-size: 0.82rem; color: var(--grey); }

/* Animación de entrada del hero: una sola secuencia al cargar */
.hero-main { clip-path: inset(0 0 100% 0); animation: reveal-down 1.2s var(--ease) 0.15s forwards; }
.hero-second { clip-path: inset(0 100% 0 0); animation: reveal-right 1s var(--ease) 0.8s forwards; }
.hero-name, .hero-role, .hero-phrase, .hero-copy .btn { animation: rise 0.9s var(--ease) both; }
.hero-role { animation-delay: 0.12s; }
.hero-phrase { animation-delay: 0.24s; }
.hero-copy .btn { animation-delay: 0.36s; }

@keyframes reveal-down { to { clip-path: inset(0); } }
@keyframes reveal-right { to { clip-path: inset(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Portafolio: filtros */
.filters { display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; }
.filter-btn {
  padding: 0.25rem 0; border: 0; border-bottom: 1px solid transparent; background: none; cursor: pointer;
  font: 400 1rem var(--font-body); letter-spacing: 0.02em; color: var(--grey); transition: color 0.25s ease, border-color 0.25s ease;
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* Portafolio: galería en columnas */
.gallery { columns: 3; column-gap: 1.5rem; }
.photo { break-inside: avoid; margin-bottom: 1.5rem; animation: fade-in 0.5s ease both; }
.photo-btn {
  position: relative; display: block; width: 100%; padding: 0; border: 0; overflow: hidden;
  background: #e4e4df; cursor: zoom-in; color: #fff; text-align: left;
}
.photo-btn img { width: 100%; height: auto; transition: transform 0.9s var(--ease); }
.photo-btn:hover img { transform: scale(1.04); }
.photo-caption {
  position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 1rem;
  padding: 3rem 1.1rem 1rem; font: 400 0.9rem var(--font-body);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  opacity: 0; transform: translateY(8px); transition: opacity 0.35s ease, transform 0.35s ease;
}
.photo-btn:hover .photo-caption, .photo-btn:focus-visible .photo-caption { opacity: 1; transform: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Servicios */
.service { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1rem 3rem; align-items: baseline; padding: 2rem 0; border-top: 1px solid var(--line); transition: padding-left 0.4s var(--ease); }
.service:last-child { border-bottom: 1px solid var(--line); }
.service:hover { padding-left: 1rem; }
.service h3 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.1; }
.service p { color: var(--grey); max-width: 34rem; }

/* Sobre mí */
.about { display: grid; grid-template-columns: 5fr 6fr; align-items: center; gap: clamp(2rem, 7vw, 7rem); }
.about-image { aspect-ratio: 4 / 5; overflow: hidden; background: #e4e4df; }
.about-image img { width: 100%; height: 100%; object-fit: cover; }
.about-text p { margin-top: 1.4rem; max-width: 33rem; color: var(--grey); }
.about-text h2 { margin-bottom: 2rem; }
.demo-note { display: inline-block; padding: 0.55rem 0.9rem; border: 1px solid var(--line); font-size: 0.88rem; color: var(--grey); }

/* Contacto */
.contact { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 7vw, 7rem); padding-bottom: clamp(5rem, 11vw, 9.5rem); }
.contact-intro p { margin-top: 1.6rem; max-width: 24rem; color: var(--grey); }

.field { margin-bottom: 1.75rem; }
.field label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; color: var(--grey); }
.field input, .field textarea {
  width: 100%; padding: 0.65rem 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; font: 400 1.1rem var(--font-body); color: var(--ink);
  transition: box-shadow 0.25s ease;
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field input:focus, .field textarea:focus { outline: none; box-shadow: 0 1px 0 0 var(--ink); }
.field [aria-invalid="true"] { border-bottom-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }
.field-error { display: block; min-height: 1.3em; margin-top: 0.35rem; font-size: 0.88rem; color: var(--error); }

.form-status { margin-top: 1.5rem; font-size: 0.97rem; }
.form-status.is-visible { padding: 1rem 1.2rem; background: #fff; border-left: 3px solid var(--ink); }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
  padding: 2rem var(--gutter); border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--grey);
}

/* ---------- 5. VISOR DE IMÁGENES ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10, 10, 10, 0.95); color: #fff; overflow: hidden;
}
.lightbox[open] { display: grid; grid-template-columns: 5rem 1fr 5rem; align-items: center; animation: fade-in 0.3s ease; }
.lightbox::backdrop { background: transparent; }

.lb-figure { grid-column: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; min-height: 0; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 8rem); width: auto; height: auto; object-fit: contain; transition: opacity 0.25s ease; }
.lb-figure figcaption { display: flex; gap: 1.5rem; font-size: 0.92rem; color: #cfcfca; }
.lb-figure figcaption span:first-child { color: #fff; }

.lb-btn {
  display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #fff; cursor: pointer; transition: background-color 0.25s ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.14); }
.lb-btn svg { width: 28px; height: 28px; }
.lb-btn:focus-visible { outline-color: #fff; }
.lb-prev { grid-column: 1; grid-row: 1; justify-self: center; }
.lb-next { grid-column: 3; grid-row: 1; justify-self: center; }
.lb-close { position: absolute; top: 1rem; right: 1rem; z-index: 2; }

/* ---------- 6. RESPONSIVE ---------- */
@media (max-width: 960px) {
  .gallery { columns: 2; }
  .hero, .about, .contact { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-images { justify-self: start; width: min(94%, 440px); margin-left: 6%; }
  .hero-second { left: -8%; }
  .about-image { max-width: 420px; }
  .service { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; display: none;
    padding: 0.5rem var(--gutter) 1.5rem; background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .site-header.nav-open .nav { display: block; animation: fade-in 0.25s ease; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { display: block; padding: 0.9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }

  .lightbox[open] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .lb-figure { grid-column: 1; grid-row: 1; padding: 4.5rem 1rem 5rem; }
  .lb-figure img { max-height: calc(100vh - 11rem); }
  .lb-prev, .lb-next { grid-row: 1; align-self: end; margin-bottom: 1rem; z-index: 2; }
  .lb-prev { grid-column: 1; justify-self: start; margin-left: 1rem; }
  .lb-next { grid-column: 1; justify-self: end; margin-right: 1rem; }
}

@media (max-width: 560px) {
  .gallery { columns: 1; }
}

/* En pantallas táctiles no existe "hover": mostramos siempre el título de la foto */
@media (hover: none) {
  .photo-caption { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-main, .hero-second { clip-path: none; }
}
