/* ============================================
   JUANJO CACHO — Portfolio Fotográfico
   Diseño: minimalista editorial, fondo claro,
   la foto es protagonista.
   ============================================ */

:root {
  --color-bg: #f8f7f5;
  --color-bg-nav: rgba(248, 247, 245, 0.92);
  --color-text: #1a1a1a;
  --color-text-secondary: #6b6b6b;
  --color-text-light: #999;
  --color-accent: #1a1a1a;
  --color-border: #e0ddd8;
  --color-hover: #444;

  --font-body: 'DM Sans', 'Helvetica Neue', Helvetica, sans-serif;
  --font-display: 'Libre Baskerville', 'Georgia', serif;

  --max-width: 960px;
  --max-width-narrow: 680px;
  --nav-height: 56px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-hover);
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}

.nav__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav__links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  position: relative;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width 0.25s ease;
}

.nav__links a:hover {
  color: var(--color-text);
}

.nav__links a:hover::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  margin: 5px 0;
  transition: all 0.25s ease;
}

@media (max-width: 640px) {
  .nav__toggle {
    display: block;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: center;
    padding: var(--space-md) 0;
    gap: var(--space-sm);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__toggle.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav__toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

/* ---------- Home / Hero ---------- */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-xl) var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.hero__tagline {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--color-text-secondary);
  font-weight: 300;
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: var(--space-lg);
}

.hero__cta {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  border: 1px solid var(--color-text);
  padding: 0.75em 1.8em;
  transition: background 0.25s ease, color 0.25s ease;
}

.hero__cta:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ---------- Section headings ---------- */
.section {
  padding: var(--space-xl) 0;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 400;
  margin-bottom: var(--space-md);
}

.section__divider {
  width: 40px;
  height: 1px;
  background: var(--color-border);
  margin-bottom: var(--space-lg);
}

/* ---------- Gallery index (listing) ---------- */
.gallery-list {
  display: grid;
  gap: var(--space-lg);
}

.gallery-card {
  display: block;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-lg);
  transition: opacity 0.2s ease;
}

.gallery-card:hover {
  opacity: 0.75;
}

.gallery-card__image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-bottom: var(--space-md);
}

.gallery-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: var(--space-xs);
}

.gallery-card__meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* ---------- Gallery detail (storytelling) ---------- */
.gallery-header {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}

.gallery-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  margin-bottom: var(--space-xs);
}

.gallery-header__subtitle {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.gallery-header__intro {
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.gallery-story {
  padding: var(--space-md) 0 var(--space-xl);
}

.story-item {
  margin-bottom: var(--space-xl);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.story-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.story-item__figure {
  position: relative;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.story-item__img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.story-item__watermark {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  user-select: none;
  font-family: var(--font-body);
  font-weight: 400;
}

.story-item__number {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.story-item__text {
  max-width: 600px;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--color-text-secondary);
}

@media (min-width: 768px) {
  .story-item__text {
    padding-left: var(--space-md);
  }
}

/* ---------- About page ---------- */
.about {
  padding: var(--space-xl) 0;
}

.about__content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.about__photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-md);
}

.about__text {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--color-text-secondary);
}

.about__text p {
  margin-bottom: var(--space-sm);
}

/* ---------- Contact ---------- */
.contact {
  padding: var(--space-xl) 0;
}

.contact__content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.contact__text {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.contact__link:hover {
  color: var(--color-hover);
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-light);
  letter-spacing: 0.04em;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Disable right-click save on gallery images */
.story-item__img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: auto;
}
