/* ============================================
   ENCUENTROS ARTE Y VINO - Components
   Nav, Cards, Buttons, Forms, Footer
   ============================================ */

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.nav--scrolled {
  box-shadow: var(--shadow-sm);
}

.nav--transparent {
  background: transparent;
  border-bottom-color: transparent;
}

.nav--transparent .nav__logo,
.nav--transparent .nav__link,
.nav--transparent .nav__toggle span {
  color: var(--color-white);
}

.nav--transparent.nav--scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: var(--color-border);
}

.nav--transparent.nav--scrolled .nav__logo,
.nav--transparent.nav--scrolled .nav__link,
.nav--transparent.nav--scrolled .nav__toggle span {
  color: var(--color-primary);
}

/* Mobile menu open: dark links over white background */
.nav--transparent .nav__menu.active .nav__link {
  color: var(--color-primary);
}

.nav--transparent .nav__menu.active .nav__link--cta {
  color: var(--color-white) !important;
}

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

.nav__logo {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin-right: var(--space-md);
}

.nav__logo span {
  color: inherit;
}

/* Hamburger */
.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.nav__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  transform-origin: center;
}

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

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

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

/* Mobile menu — full-screen centered */
.nav__menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(5rem, 13vh, 7rem) clamp(2rem, 8vw, 3.5rem) clamp(2.5rem, 6vh, 3.5rem);
  text-align: center;
}

.nav__menu.active {
  opacity: 1;
  visibility: visible;
}

/* Header: logo + edition */
.nav__menu-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin: 0 auto clamp(2rem, 5vh, 3rem);
  padding-bottom: clamp(1.25rem, 3.5vh, 2rem);
  border-bottom: 1px solid var(--color-border);
  width: min(280px, 70%);
}

.nav__menu-logo img {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.nav__menu-edition {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-text-light);
  text-align: center;
}

/* Nav links — centered */
.nav__link {
  display: block;
  width: 100%;
  padding: clamp(0.55rem, 1.5vh, 0.85rem) 0;
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 5.5vw, 1.85rem);
  font-weight: 400;
  color: var(--color-primary);
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-align: center;
  position: relative;
  transition: color 0.25s ease;
}

.nav__link:hover {
  color: var(--color-accent);
}

.nav__link--active {
  color: var(--color-accent);
  font-weight: 500;
}

.nav__link--active::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--color-accent);
  margin: 0.45rem auto 0;
  border-radius: 2px;
}

/* CTA button — centered */
.nav__link--cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  margin: clamp(2rem, 5vh, 3rem) auto 0;
  padding: 1em 2.75em;
  background: var(--color-accent);
  color: var(--color-white) !important;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-align: center;
  border-radius: 999px;
  width: auto;
  transition: background 0.25s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.nav__link--cta::after {
  content: '→';
  font-size: 1.05em;
  margin: 0;
  background: transparent;
  width: auto;
  height: auto;
  display: inline;
  border-radius: 0;
  transition: transform 0.25s ease;
}

.nav__link--cta:hover {
  background: var(--color-accent-hover);
  color: var(--color-white) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 102, 0, 0.28);
}

.nav__link--cta:hover::after {
  transform: translateX(4px);
}

/* Social row — centered */
.nav__menu-social {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  margin: clamp(2rem, 5vh, 2.5rem) auto 0;
  padding-top: clamp(1.5rem, 4vh, 2rem);
  border-top: 1px solid var(--color-border);
  width: min(200px, 60%);
}

.nav__menu-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-light);
  transition: var(--transition);
}

.nav__menu-social a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

.nav__menu-social svg {
  width: 17px;
  height: 17px;
}

/* Staggered vertical fade-up for menu items */
.nav__menu > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav__menu.active > * {
  opacity: 1;
  transform: translateY(0);
}

.nav__menu.active > *:nth-child(1) { transition-delay: 0.12s; }
.nav__menu.active > *:nth-child(2) { transition-delay: 0.18s; }
.nav__menu.active > *:nth-child(3) { transition-delay: 0.22s; }
.nav__menu.active > *:nth-child(4) { transition-delay: 0.26s; }
.nav__menu.active > *:nth-child(5) { transition-delay: 0.30s; }
.nav__menu.active > *:nth-child(6) { transition-delay: 0.34s; }
.nav__menu.active > *:nth-child(7) { transition-delay: 0.38s; }
.nav__menu.active > *:nth-child(8) { transition-delay: 0.42s; }
.nav__menu.active > *:nth-child(9) { transition-delay: 0.46s; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 2em;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn--outline:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn--outline-white {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn--outline-white:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

.btn--sm {
  padding: 0.5em 1.2em;
  font-size: var(--text-xs);
}

.btn--lg {
  padding: 1em 2.5em;
  font-size: var(--text-base);
}

/* --- Cards --- */
.card {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--color-border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover .card__image img {
  transform: scale(1.05);
}

.card__date {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background: var(--color-accent);
  color: var(--color-white);
  padding: 0.4em 0.8em;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--border-radius);
}

.card__body {
  padding: var(--space-md);
}

.card__tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.card__text {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.card__meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  overflow: hidden;
  padding: 80px var(--space-md) var(--space-xl);
}

.hero__slider {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.hero__slide.active {
  opacity: 1;
}

.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0) scale(1);
  will-change: transform;
  backface-visibility: hidden;
}

@keyframes hero-zoom {
  from { transform: translateZ(0) scale(1); }
  to { transform: translateZ(0) scale(1.12); }
}

.hero__slide.active img {
  animation: hero-zoom 7s ease-out forwards;
}

.hero__slider::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.hero__logo {
  max-width: 500px;
  width: 85%;
  height: auto;
  margin-bottom: 0;
}

.hero__content {
  max-width: 700px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero__edition {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 500;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}

.hero__subtitle {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
}

.hero__date {
  font-size: var(--text-sm);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-sm);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  align-items: center;
}

.hero__actions .btn {
  padding: 0.6em 1.8em;
  font-size: var(--text-xs);
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-white);
  opacity: 0.6;
  animation: scroll-hint 2s ease-in-out infinite;
}

@keyframes scroll-hint {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.8em 1em;
  font-size: var(--text-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

.form-input::placeholder {
  color: var(--color-text-light);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.form-checkbox input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--color-accent);
}

.form-inline {
  display: flex;
  gap: var(--space-xs);
}

.form-inline .form-input {
  flex: 1;
}

/* --- Footer --- */
.footer {
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-xl) 0 var(--space-sm);
}

.footer h4 {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer__about p {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--space-xs);
}

.footer__links a {
  display: block;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.75);
  padding: 0.2em 0;
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--color-white);
}

.footer__newsletter {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer__newsletter h4 {
  color: var(--color-white);
  margin-bottom: var(--space-xs);
}

.footer__newsletter p {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-sm);
}

.footer__newsletter-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer__newsletter .form-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-white);
  padding: 0.6em 0.8em;
  font-size: var(--text-xs);
}

.footer__newsletter .form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.footer__newsletter .form-input:focus {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.12);
}

.footer__newsletter .form-checkbox {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--text-xs);
}

.footer__newsletter .form-checkbox a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

.footer__contacts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer__contact p {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0;
}

.footer__contact strong {
  color: var(--color-white);
}

.footer__contact a {
  color: rgba(255, 255, 255, 0.8);
}

.footer__contact a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  transition: var(--transition);
}

.footer__social a:hover {
  border-color: var(--color-white);
  color: var(--color-white);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  align-items: center;
  text-align: center;
}

.footer__copyright {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.3);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.footer__legal a {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.3);
  transition: color var(--transition-fast);
}

.footer__legal a:hover {
  color: var(--color-white);
}

/* --- Dividers --- */
.divider {
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: var(--space-md) auto;
}

.divider--left {
  margin-left: 0;
}

/* --- Badge --- */
.badge {
  display: inline-block;
  padding: 0.3em 0.8em;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--border-radius);
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }

  .nav__menu-logo,
  .nav__menu-edition,
  .nav__menu-social {
    display: none;
  }

  .nav__menu {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    background: transparent;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-lg);
    overflow-y: visible;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transition: none;
    text-align: left;
  }

  .nav__menu > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .nav__link {
    display: inline-block;
    width: auto;
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: left;
  }

  .nav__link--active {
    font-weight: 500;
  }

  .nav__link--active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-accent);
    margin: 0;
    border-radius: 0;
    display: block;
  }

  .nav__link--cta {
    margin: 0;
    padding: 0.6em 1.5em;
    border-radius: var(--border-radius);
    font-size: var(--text-base);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
  }

  .nav__link--cta::after {
    display: none;
  }

  .nav__link--cta.nav__link--active::after {
    display: none;
  }

  .nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition);
  }

  .nav__link:hover::after,
  .nav__link--active::after {
    width: 100%;
  }

  .nav__link--cta::after {
    display: none;
  }

  .hero__title {
    font-size: var(--text-5xl);
  }

  .hero__actions {
    flex-direction: row;
    justify-content: center;
  }

  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .footer__newsletter-fields {
    flex-direction: row;
  }

  .footer__contacts-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .nav__inner {
    height: 80px;
  }
}

/* --- Back to top button --- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, visibility 0.3s;
  z-index: 500;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 768px) {
  .back-to-top {
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
  }
}

/* ============================================
   EFECTOS PREMIUM
   Scroll progress · Custom cursor ·
   Magnetic buttons · Headline reveals
   ============================================ */

/* --- Scroll progress bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1100;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.04);
}

.scroll-progress__fill {
  height: 100%;
  width: 0;
  background: var(--color-accent);
  box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
  transition: width 0.08s linear;
}

/* --- Magnetic buttons baseline transition --- */
.btn--primary,
.nav__link--cta {
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.25s ease,
    box-shadow 0.3s ease,
    color 0.25s ease;
}

/* --- Headline reveals on scroll --- */
.headline-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 1.05s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.05s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.headline-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger for sibling subtitle + h2 + divider */
.section__header .headline-reveal:nth-child(1) { transition-delay: 0s; }
.section__header .headline-reveal:nth-child(2) { transition-delay: 0.12s; }
.section__header .headline-reveal:nth-child(3) { transition-delay: 0.24s; }

/* Reduced motion: disable everything fancy */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress {
    display: none !important;
  }
  .headline-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
