/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  --color-fondo: #000;
  --color-texto: #fff;
  --fuente: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  --alto-header: 5rem;                         /* altura aprox. del header fijo */
  --margen-lateral: clamp(1.25rem, 5vw, 3.5rem);

  /* Capa oscura sobre las fotos de fondo para que el texto se lea bien */
  --capa: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .35));
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;                     /* sustituye al JavaScript anterior */
  scroll-padding-top: var(--alto-header);      /* el menú fijo no tapa el título */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--fuente);
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-texto);
  background: var(--color-fondo);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul { list-style: none; }

a { color: inherit; }
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--color-texto);
  outline-offset: 4px;
}

h1, h2 {
  font-weight: 300;
  line-height: 1.3;
}

h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }

h2 { font-size: clamp(1.25rem, 3vw, 1.75rem);  margin-bottom: 1.5rem; }


/* ==========================================================================
   Cabecera y navegación
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  padding: 1rem var(--margen-lateral);
  background: linear-gradient(rgba(0, 0, 0, .7), transparent);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
}

.logo {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.logo a { text-decoration: none; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
}

.nav-links a { text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }

/* ==========================================================================
   Secciones
   ========================================================================== */
.section {
  padding: 4rem var(--margen-lateral);
}

/* En pantallas pequeñas el texto ocupa todo el ancho;
   en escritorio ocupa ~60% y deja ver la foto de fondo a la derecha */
@media (min-width: 900px) {
  .section__inner {
    max-width: min(60%, 70rem);
  }
}

.section--black {
  background-color: var(--color-fondo);
}

/* Secciones con foto de fondo */
.section--hero,
.section--sobre-mi,
.section--contacto {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section--hero {
  min-height: 50vh;
  min-height: 50svh;
  background-image: var(--capa), url('img/portada.jpg');
}

.section--sobre-mi {
  display: flow-root;                          /* contiene la imagen flotante */
  background-image: var(--capa), url('img/2.jpg');
}

.section--contacto {
  background-image: var(--capa), url('img/4.jpg');
}

.section--guitarras,
.section--galeria {
	text-align: center;
}

.separado { margin-top: 1.5rem; }

.section--contacto a { text-decoration: underline; }

/* ==========================================================================
   Imágenes
   ========================================================================== */
.imagen-sobremi {
  float: left;
  width: 300px;
  aspect-ratio: 3 / 5;
  object-fit: cover;
  margin: 0 1.5rem 1rem 0;
}

.fotos {
  display: grid;
  justify-content: center;                     /* centra las imágenes */
  gap: 2rem;
  margin-top: 2rem;
}

.fotos img {
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.fotos--guitarras { grid-template-columns: repeat(auto-fit, minmax(160px, 200px)); }
.fotos--guitarras img { aspect-ratio: 1 / 2; }

.fotos--galeria { grid-template-columns: repeat(auto-fit, minmax(160px, 250px)); }
.fotos--galeria img { aspect-ratio: 1; }

/* ==========================================================================
   Pie
   ========================================================================== */
.site-footer {
  padding: 1.5rem var(--margen-lateral);
  font-size: .875rem;
  text-align: center;
  background: var(--color-fondo);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
  :root { --alto-header: 6rem; }               /* título y enlaces en dos filas */

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }

  .nav-links { gap: .25rem 1rem; font-size: .9rem; }

  .imagen-sobremi {
    float: none;
    width: min(300px, 100%);
    margin: 0 auto 1.5rem;
  }
}
