/* ============================================
   SANDRA ALMARCHA — Portfolio
   Tipografía: Anton (Google Fonts)
   ============================================ */

@font-face {
  font-family: 'Anton';
  src: url('fonts/Anton-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: block;
}

:root {
  --color-fondo: #ffffff;
  --color-texto: #111111;
  --color-gris: #999999;
  --espacio-galeria: 16px; /* separación entre fotos (galerías con hueco) */
}

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

body {
  background: var(--color-fondo);
  color: var(--color-texto);
  font-family: 'Anton', 'Arial Narrow', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cabecera: nombre a la izquierda, menú a la derecha ---------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;  /* el menú se alinea con la base del nombre */
  /* la fuente Anton deja más aire debajo de la línea que encima:
     por eso el hueco superior es algo mayor, para centrar a ojo */
  padding: 42px 40px 30px;
}

/* En las páginas interiores no hay nombre: el menú queda a la derecha */
header.solo-menu { justify-content: flex-end; }

.nombre {
  font-size: 68px;
  font-weight: 400;
  letter-spacing: -1.5px;
  text-transform: uppercase;
  color: var(--color-texto);
  text-decoration: none;
  line-height: 1;
}

nav a {
  color: var(--color-texto);
  text-decoration: none;
  line-height: 1;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin-left: 38px;
  display: inline-block;
}

nav a:hover { color: var(--color-gris); }
nav a.activo { color: var(--color-gris); }

/* ---------- HOME: cuadrícula 4x4 sin separación ---------- */
.galeria-cuadricula {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.galeria-cuadricula img {
  width: 100%;
  aspect-ratio: 1 / 1;   /* fotos cuadradas, como en Wix */
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* ---------- Galerías interiores: mosaico con separación ---------- */
.galeria {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px var(--espacio-galeria) 40px;
  column-count: 3;
  column-gap: var(--espacio-galeria);
}

.galeria figure {
  break-inside: avoid;
  margin-bottom: var(--espacio-galeria);
}

.galeria img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.galeria figcaption {
  font-size: 13px;
  color: var(--color-gris);
  padding: 8px 2px 0;
  line-height: 1.5;
  letter-spacing: 0.5px;
}


/* ---------- Pie de página ---------- */
footer {
  display: flex;
  justify-content: center;
  gap: 140px;
  text-align: center;
  padding: 60px 20px 50px;
}

footer .titulo-pie {
  font-size: 20px;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

footer .email {
  color: var(--color-texto);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

footer .email:hover { text-decoration: underline; }

.redes { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
.redes a { display: inline-block; line-height: 0; }
.redes svg { transition: opacity 0.15s; }
.redes a:hover svg { opacity: 0.6; }

.banda-inferior {
  height: 90px;
  background: #eff0f2;
}

/* ---------- Adaptación a tablet y móvil ---------- */
@media (max-width: 900px) {
  .galeria { column-count: 2; }
  .galeria-cuadricula { grid-template-columns: repeat(2, 1fr); }
  header {
    flex-direction: column;
    align-items: flex-start; /* menú debajo del nombre, alineado con la S */
    gap: 8px;
    padding: 26px 20px 20px;
  }
  header.solo-menu { flex-direction: row; }
  .nombre { font-size: 42px; }
  nav { white-space: nowrap; }
  nav a { font-size: 20px; margin: 0 18px 0 0; }
  nav a:last-child { margin-right: 0; }
}

@media (max-width: 560px) {
  header { flex-direction: column; gap: 8px; }
  header.solo-menu { flex-direction: row; justify-content: center; }
  .nombre { font-size: 40px; }
  nav a { font-size: 17px; margin: 0 16px 0 0; }
  .galeria { column-count: 1; }
  .galeria-cuadricula { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; gap: 36px; }
}

/* ---------- Visor de fotos (lightbox) ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
}

#lightbox.abierto { display: flex; }

/* Flechas y botón de cerrar del visor */
.lb-flecha, .lb-cerrar {
  position: absolute;
  background: none;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
  padding: 10px 18px;
  opacity: 0.55;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.lb-flecha:hover, .lb-cerrar:hover { opacity: 1; }

.lb-flecha { top: 50%; transform: translateY(-50%); font-size: 52px; }
.lb-anterior { left: 8px; }
.lb-siguiente { right: 8px; }

.lb-cerrar { top: 10px; right: 14px; font-size: 34px; }

@media (max-width: 560px) {
  .lb-flecha { font-size: 38px; padding: 10px 10px; }
}


#lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
}
