@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Outfit:wght@300;400;500&display=swap');

/* ─── Variables ─────────────────────────────────────── */
:root {
  --bg:           #ffffff;
  --text:         #111111;
  --muted:        #888888;
  --border:       #e5e5e5;
  --nav-h:        58px;
  --max-w:        1440px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Outfit', system-ui, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; height: 100%; }
body { font-family: var(--font-ui); background: var(--bg); color: var(--text); min-height: 100vh; }
img  { display: block; max-width: 100%; height: auto; }
a    { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }

/* ─── Header ────────────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 8rem;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-right: auto;
  white-space: nowrap;
}

/* ─── Desktop nav ───────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link,
.nav-trigger {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0;
  position: relative;
  white-space: nowrap;
}

.nav-link::after,
.nav-trigger::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-link:hover::after,
.nav-trigger:hover::after,
.nav-link.active::after { transform: scaleX(1); }

/* Dropdown */
.nav-dropdown { position: relative; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 130px;
  padding: 0.4rem 0;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* Bridge invisible que cubre el gap entre el trigger y el menú */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu { display: block; }

.dropdown-menu a {
  display: block;
  padding: 0.55rem 1.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.15s;
}
.dropdown-menu a:hover { background: #f7f7f7; }

/* ─── Hamburger ─────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── Mobile nav overlay ─────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 90;
  overflow-y: auto;
  padding: 1.5rem 2rem 3rem;
}
.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.mobile-section {
  margin-top: 1.5rem;
}
.mobile-section-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 400;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  user-select: none;
  margin-bottom: 0;
}
.mobile-section-label::after {
  content: '+';
  font-size: 1rem;
  font-weight: 300;
  line-height: 1;
  color: var(--muted);
}
.mobile-section.open .mobile-section-label::after { content: '−'; }
.mobile-section.collapsible > a { display: none; }
.mobile-section.collapsible.open > a { display: block; }
.mobile-section a {
  padding-left: 0.75rem;
  color: #444;
  font-size: 0.72rem;
}

/* ─── Main offset ────────────────────────────────────── */
main { padding-top: var(--nav-h); }

/* ─── HOME ───────────────────────────────────────────── */
.page-home { overflow: hidden; height: 100%; }
.page-home footer { display: none; }
.home-split {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

/* Left — bio */
.home-bio {
  padding: 5rem 4rem 4rem 8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-bio-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.75;
  color: #333;
  letter-spacing: 0.01em;
}

/* Right — images */
.home-images {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 4rem 8rem 4rem 0;
}
.home-main-img {
  flex: 1;
  overflow: hidden;
  background: #e8e5e0;
  min-height: 0;
}
.home-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: block;
}
.home-main-img img.loaded { opacity: 1; }

.home-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 3px 0 0;
  height: 18vh;
  flex-shrink: 0;
}
.home-thumb {
  overflow: hidden;
  background: #e8e5e0;
  display: block;
  height: 100%;
}
.home-thumb-mobile-only {
  display: none;
}
.home-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.4s ease;
}
.home-thumb img.loaded { opacity: 1; }
.home-thumb:hover img { transform: scale(1.05); }

/* ─── Gallery pages ──────────────────────────────────── */
.gallery-header {
  padding: 3.5rem 2rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.gallery-header h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: 0.04em;
}
.gallery-header .gallery-count {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.gallery-grid {
  columns: 4;
  column-gap: 4px;
  padding: 0 2rem 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 4px;
  overflow: hidden;
  display: block;
}
.gallery-item img {
  width: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.4s ease;
}
.gallery-item img.loaded { opacity: 1; }
.gallery-item:hover img { transform: scale(1.02); }

/* Gallery index (list of series) */
.gallery-index {
  max-width: 640px;
  margin: 3rem auto;
  padding: 0 2rem;
}
.gallery-index h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
}
.gallery-index ul { list-style: none; }
.gallery-index li a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.gallery-index li a:hover { color: var(--muted); }
.gallery-index .count {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--muted);
  font-weight: 300;
}

/* ─── About ──────────────────────────────────────────── */
.about-wrap {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 2rem 4rem 2rem;
}
.about-wrap h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}
.bio-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.75;
  color: #333;
  margin-bottom: 3rem;
}
.bio-text p + p { margin-top: 1.2rem; }

.about-portrait {
  float: left;
  width: 240px;
  margin: 0 1.5rem 1.5rem 0;
  display: block;
  border-radius: 4px;
}

.about-social {
  display: flex;
  gap: 2rem;
  margin-bottom: 4rem;
  padding-top: 0.5rem;
}
.about-social a {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.about-social a:hover { color: var(--muted); border-color: var(--muted); }

.cv-block { margin-bottom: 3rem; }
.cv-block h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: 0.06em;
}
.cv-block h3 {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.5rem 0 0.75rem;
  font-weight: 400;
}
.cv-block ul { list-style: none; }
.cv-block li {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #333;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.cv-block li:last-child { border-bottom: none; }
.cv-year {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  width: 52px;
  color: var(--muted);
  flex-shrink: 0;
}
.cv-entry {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.cv-entry:last-child { border-bottom: none; }
.cv-entry-text { font-size: 0.85rem; line-height: 1.6; color: #333; }

/* ─── Contact ────────────────────────────────────────── */
.contact-wrap {
  max-width: 480px;
  margin: 7rem auto;
  padding: 0 2rem;
  text-align: center;
}
.contact-wrap h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
}
.contact-email {
  font-size: 1rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--text);
  padding-bottom: 3px;
  display: inline-block;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}
.contact-email:hover { color: var(--muted); }
.contact-social {
  display: flex;
  gap: 2rem;
  justify-content: center;
}
.contact-social a {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.contact-social a:hover { color: var(--muted); border-color: var(--muted); }

/* ─── Tango Book ─────────────────────────────────────── */
.tango-wrap {
  max-width: 600px;
  margin: 7rem auto;
  padding: 0 2rem;
}
.tango-wrap h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 300;
  margin-bottom: 2rem;
}
.tango-wrap p {
  font-size: 1rem;
  line-height: 1.85;
  color: #333;
  margin-bottom: 2rem;
}
.tango-link {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 3px;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s;
}
.tango-link:hover { color: var(--muted); border-color: var(--muted); }

/* ─── Footer ─────────────────────────────────────────── */
footer { display: none; }

/* ─── Loading state ──────────────────────────────────── */
.loading-msg {
  text-align: center;
  padding: 4rem 2rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Responsive ─────────────────────────────────────── */

/* Large tablet landscape — reduce heavy desktop padding */
@media (max-width: 1280px) {
  header         { padding: 0 4rem; }
  .home-bio      { padding: 4rem 3rem 4rem 4rem; }
  .home-images   { padding: 4rem 4rem 4rem 0; }
}

/* Tablet landscape / small laptop — hamburger kicks in here */
@media (max-width: 1024px) {
  header          { padding: 0 2.5rem; }
  nav             { display: none; }
  .nav-hamburger  { display: flex; }
  .home-split     { grid-template-columns: 1fr 1.4fr; }
  .home-bio       { padding: 3rem 2rem 3rem 2.5rem; }
  .home-images    { padding: 3rem 2.5rem 3rem 0; }
  .home-bio-text  { font-size: 1.15rem; }
  .gallery-grid   { columns: 3; }
}

/* Tablet portrait + mobile — stack layout, allow scroll */
@media (max-width: 768px) {
  header          { padding: 0 1.25rem; }
  nav             { display: none; }
  .nav-hamburger  { display: flex; }

  /* Home: remove fixed-height / overflow constraints */
  .page-home    { overflow: auto; height: auto; }
  .home-split   {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .home-bio {
    padding: 2.5rem 1.5rem;
    border-right: none;
    justify-content: flex-start;
    min-height: 0;
  }
  .home-bio-text    { font-size: 1.1rem; line-height: 1.7; }
  .home-images      { padding: 0 1.5rem; height: auto; }
  .home-main-img    { flex: none; height: 66vw; }
  .home-thumbs      { height: 22vw; grid-template-columns: repeat(5, 1fr); }

  /* Galleries */
  .gallery-grid   { columns: 2; padding: 0 0.75rem 1rem; }
  .gallery-header { padding: 2rem 1rem 1rem; }
  .gallery-header h1 { font-size: 2rem; }

  /* Inner pages */
  .about-wrap, .contact-wrap, .tango-wrap { margin: 2.5rem auto; }
  .about-wrap h1, .contact-wrap h1, .tango-wrap h1 { font-size: 2.4rem; }

  footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* Mobile */
@media (max-width: 480px) {
  .home-main-img  { height: 80vw; }
  .home-thumbs    { grid-template-columns: repeat(3, 1fr); height: 30vw; }
  .gallery-grid   { columns: 1; padding: 0 0.5rem 0.5rem; }
  .about-wrap h1, .contact-wrap h1, .tango-wrap h1 { font-size: 2rem; }
  .about-portrait { width: 180px; }
  .home-thumb-mobile-only { display: block; }
}
