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

:root {
  --bg:          #f8f6f2;
  --bg-alt:      #efefeb;
  --text:        #1a1a18;
  --text-muted:  #6b6b65;
  --accent:      #1a1a18;
  --border:      rgba(26,26,24,0.12);
  --nav-h:       64px;
  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Jost', system-ui, sans-serif;
  --r:           2px;
  --trans:       0.25s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #111110;
    --bg-alt:     #1c1c1a;
    --text:       #e8e6e0;
    --text-muted: #888880;
    --accent:     #e8e6e0;
    --border:     rgba(232,230,224,0.1);
  }
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ── Cookie Notice ────────────────────────────────────────────────────── */
#cookie-notice {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
#cookie-notice button {
  background: var(--bg);
  color: var(--text);
  border: none;
  padding: 0.3rem 0.9rem;
  border-radius: 2rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
}

/* ── Navigation ───────────────────────────────────────────────────────── */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--trans);
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}
#main-nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}
#main-nav ul a {
  font-size: 0.92rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--trans);
}
#main-nav ul a:hover,
#main-nav ul a.active { color: var(--text); }

.nav-burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: var(--nav-h);
}
.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 3rem 5rem 4rem;
}
.hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.hero-content h1 {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero-content h1 em {
  font-style: italic;
  font-weight: 300;
}
.hero-bio {
  margin-bottom: 2.5rem;
}
.hero-bio p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  max-width: 480px;
}
.hero-image-placeholder {
  overflow: hidden;
  background: var(--bg-alt);
}
.hero-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.hero-image-placeholder:hover img { transform: scale(1.03); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  border: 1px solid var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background var(--trans), color var(--trans);
  align-self: flex-start;
}
.btn-primary:hover {
  background: var(--text);
  color: var(--bg);
}

/* ── Section Shared ───────────────────────────────────────────────────── */
.section-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.section-header {
  padding: 4rem 4rem 2rem;
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
}

/* ── Categorías Grid ──────────────────────────────────────────────────── */
#categorias {
  padding-bottom: 6rem;
  background: var(--bg);
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}
.cat-card {
  display: block;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}
.cat-img {
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-alt);
}
.cat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.cat-card:hover .cat-img img { transform: scale(1.04); }
.cat-info {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cat-num {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.cat-info h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 300;
}
.cat-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Contacto ─────────────────────────────────────────────────────────── */
#contacto {
  padding: 6rem 0;
  background: var(--bg);
}
.contact-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem;
}
.contact-inner h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  margin-bottom: 2.5rem;
}
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-group input,
.form-group textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border-radius: var(--r);
  outline: none;
  transition: border-color var(--trans);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--text);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-success {
  color: #3a7a4a;
  font-size: 0.9rem;
  padding: 0.75rem 0;
}
.form-error {
  color: #a03a3a;
  font-size: 0.9rem;
  padding: 0.75rem 0;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 2.5rem 4rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
}
footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-nav {
  display: flex;
  gap: 2rem;
}
.footer-nav a {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  transition: color var(--trans);
}
.footer-nav a:hover { color: var(--text); }

/* ── Gallery Page ─────────────────────────────────────────────────────── */
.gallery-main {
  padding-top: calc(var(--nav-h) + 3rem);
  min-height: 100vh;
}
.gallery-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 3rem;
  overflow-x: auto;
}
.gallery-tab {
  padding: 1.25rem 2rem;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color var(--trans), border-color var(--trans);
}
.gallery-tab:hover     { color: var(--text); }
.gallery-tab.active    { color: var(--text); border-bottom-color: var(--text); }

.gallery-cat-header {
  padding: 3rem 3rem 2rem;
  max-width: 700px;
}
.gallery-cat-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  margin-bottom: 0.75rem;
}
.gallery-cat-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  margin-bottom: 4rem;
}
.photo-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-alt);
  cursor: pointer;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.photo-item:hover img { transform: scale(1.05); }
.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--trans);
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-overlay span {
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}
.gallery-empty {
  padding: 4rem 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Lightbox ─────────────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,8,0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-content {
  max-width: 1000px;
  width: 90%;
  text-align: center;
}
#lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
#lightbox-caption {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  margin-top: 1rem;
  letter-spacing: 0.08em;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color var(--trans);
  line-height: 1;
  padding: 0.5rem;
}
.lightbox-close:hover { color: #fff; }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 1rem;
  transition: color var(--trans);
}
.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ── Links Page ───────────────────────────────────────────────────────── */
.links-main {
  padding-top: calc(var(--nav-h) + 4rem);
  max-width: 800px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 6rem;
}
.links-header {
  margin-bottom: 4rem;
}
.links-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  margin-bottom: 0.75rem;
}
.links-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.links-grid { display: flex; flex-direction: column; gap: 3rem; }
.links-category h2 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.links-list { list-style: none; }
.links-list li { border-bottom: 1px solid var(--border); }
.links-list a {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0;
  transition: gap var(--trans);
}
.links-list a:hover { gap: 2rem; }
.link-name {
  font-size: 0.95rem;
  font-weight: 400;
  min-width: 180px;
}
.link-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex: 1;
}
.link-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: auto;
  transition: transform var(--trans), color var(--trans);
}
.links-list a:hover .link-arrow {
  transform: translateX(4px);
  color: var(--text);
}
.links-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Tablet ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #main-nav { padding: 0 1.5rem; }
  #main-nav ul { display: none; flex-direction: column; gap: 0; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1rem 0; }
  #main-nav ul.open { display: flex; }
  #main-nav ul li a { display: block; padding: 0.75rem 1.5rem; }
  .nav-burger { display: block; }

  #hero { grid-template-columns: 1fr; }
  .hero-image-placeholder { aspect-ratio: 16/9; }
  .hero-content { padding: 3rem 1.5rem; }

  .cat-grid { grid-template-columns: 1fr; }
  .section-header { padding: 3rem 1.5rem 2rem; }

  .contact-inner { padding: 0 1.5rem; }
  .form-row { grid-template-columns: 1fr; }

  footer { padding: 2rem 1.5rem; }
  .footer-inner { flex-direction: column; text-align: center; }

  .gallery-tabs { padding: 0 1rem; }
  .gallery-cat-header { padding: 2rem 1.5rem 1.5rem; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }

  .links-main { padding-top: calc(var(--nav-h) + 2rem); }
  .link-desc { display: none; }

  #cookie-notice { white-space: normal; text-align: center; flex-direction: column; width: 90%; }

  .lightbox-prev { left: 0.25rem; }
  .lightbox-next { right: 0.25rem; }
}
