/* ============================================================
   Arte Decoración Europa — styles.css  (v2)
   Layout editorial: hero contenido, galería con scroll fijo,
   nav vertical a la derecha.
   ============================================================ */


/* ── VARIABLE GLOBAL: altura del header ──────────────────── */
:root {
  --header-h: 76px;    /* actualizado por JS al cargar */
}


/* ── FUENTE LOCAL ─────────────────────────────────────────── */
@font-face {
  font-family: 'HelveticaNeue';
  src: url('../fonts/HelveticaNeue Thin.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}


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

* {
  font-family: 'HelveticaNeue', Helvetica, Arial, sans-serif;
  font-weight: 300;
}

html {
  scroll-padding-top: var(--header-h);
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body {
  background-color: #ffffff;
  color: #000000;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}


/* ══════════════════════════════════════════════════════════
   HEADER
   Logo izquierda · Nav vertical derecha · Fondo blanco siempre
══════════════════════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 24px clamp(20px, 20vw, 240px);
  padding-top: max(28px, env(safe-area-inset-top));
  padding-right: max(40px, env(safe-area-inset-right));
  border-bottom: none;
}


/* ── LOGOTIPO ─────────────────────────────────────────────── */
.logo {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 30px;
  line-height: 1;
  flex-shrink: 0;
}

.logo-main {
  font-size: clamp(14px, 3.5vw, 35px);
  letter-spacing: 0.18em;
  color: #888888;
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 300;
}

.logo-main strong {
  font-weight: 700;
  color: #000000;
}

.logo-obras {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: #e02020;
  text-transform: uppercase;
}


/* ── NAV DESKTOP — fija en esquina inferior derecha ──────── */
.nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  position: fixed;
  right: 40px;
  bottom: 40px;
  z-index: 100;
}

.nav-link {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000000;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #e02020;
}


/* ── HAMBURGER — solo mobile ──────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 4px;
  z-index: 200;
  position: relative;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background-color: #000000;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


/* ══════════════════════════════════════════════════════════
   SECCIÓN 1 — HERO
   Dos zonas: imagen contenida izquierda + blanco derecha
══════════════════════════════════════════════════════════ */
#hero {
  align-items: flex-start;
  padding-top: calc(var(--header-h) + 40px);
  padding-left: 160px;
  padding-bottom: 40px;
  background-color: #ffffff;
  min-height: 100vh;
  min-height: 100dvh;
}

.hero-image-wrap {
  width: 42%;
  flex-shrink: 0;
  height: calc(100vh - var(--header-h) - 80px);
  height: calc(100dvh - var(--header-h) - 80px);
  overflow: hidden;
}

.hero-image {
  height: 100%;
  width: auto;
  max-width: 100%;
  display: block;
}

.hero-space {
  flex: 1;
}


/* ══════════════════════════════════════════════════════════
   SECCIÓN 2 — TRABAJOS
   Galería con scroll interno y altura fija (desktop/tablet)
   Paginada en mobile
══════════════════════════════════════════════════════════ */
#trabajos {
  padding: var(--header-h) 42% 0 160px;
}

/* ── Contenedor de scroll fijo ── */
.gallery-viewport {
  height: calc(100vh - var(--header-h) - 40px);
  height: calc(100dvh - var(--header-h) - 40px);
  overflow-y: scroll;
  overflow-x: hidden;
  /* Scrollbar discreta */
  scrollbar-width: thin;
  scrollbar-color: #cccccc transparent;
}

.gallery-viewport::-webkit-scrollbar {
  width: 3px;
}
.gallery-viewport::-webkit-scrollbar-track {
  background: transparent;
}
.gallery-viewport::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 0;
}

/* ── Grid: filas se adaptan a la proporción de cada imagen ── */
.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  align-items: start;   /* cada celda crece solo lo que necesita su imagen */
}

.grid-item {
  position: relative;
  background-color: #eeecea;
  /* sin overflow: hidden ni height fija — la imagen decide la altura */
}

.grid-item img {
  width: 100%;
  height: auto;         /* proporción original, sin recorte */
  display: block;
  transition: opacity 0.3s ease;
}

.grid-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.grid-item:hover::after {
  background: rgba(0, 0, 0, 0.08);
}

/* ── Paginación mobile (oculta en desktop) ── */
.pagination {
  display: none;
}


/* ══════════════════════════════════════════════════════════
   SECCIÓN 3 — EQUIPO
══════════════════════════════════════════════════════════ */
#equipo {
  padding: 100px 42% 100px 160px;
}

#equipo .section-inner {
  max-width: 560px;
  margin: 0;
}

#equipo p {
  font-size: 15px;
  line-height: 1.85;
  color: #000000;
  margin-bottom: 30px;
}

#equipo p:last-of-type {
  margin-bottom: 0;
}

.contact-block {
  margin-top: 52px;
  padding-top: 36px;
  border-top: 0.5px solid #000000;
}

.contact-block p {
  font-size: 13px;
  line-height: 2;
}

.contact-block strong {
  font-weight: 300;
}

.contact-block a {
  color: #000000;
}

.contact-block a:hover {
  opacity: 0.6;
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.instagram-link:hover {
  opacity: 1;
}

.instagram-handle {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #000000;
  line-height: 1;
}


/* ══════════════════════════════════════════════════════════
   SECCIÓN 4 — CLIENTES
══════════════════════════════════════════════════════════ */
#clientes {
  padding: 100px 42% 100px 160px;
}

#clientes .section-inner {
  max-width: 560px;
  margin: 0;
}

.client-block {
  padding: 38px 0;
  border-bottom: 0.5px solid #000000;
}

.client-block:first-child {
  border-top: 0.5px solid #000000;
}

.client-block h2 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 300;
  margin-bottom: 14px;
}

.client-block p {
  font-size: 15px;
  line-height: 1.85;
}


/* ══════════════════════════════════════════════════════════
   SECCIÓN 5 — PRESUPUESTO
══════════════════════════════════════════════════════════ */
#presupuesto {
  padding: 100px 42% 100px 160px;
}

.presupuesto-form {
  max-width: 560px;
  margin: 0;
}

/* ── Título de la sección dentro del form ── */
.form-section-title {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #222222;
  margin-bottom: 10px;
}

.form-section-subtitle {
  font-size: 12.5px;
  color: #666666;
  margin-bottom: 44px;
  line-height: 1.5;
}

/* ── Campo individual ── */
.form-field {
  margin-bottom: 38px;
}

.form-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #aaaaaa;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.form-field:focus-within .form-label {
  color: #000000;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field input[type="date"] {
  width: 100%;
  border: none;
  border-bottom: 1px solid #999999;
  background: transparent;
  padding: 10px 0;
  font-family: 'HelveticaNeue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #000000;
  outline: none;
  -webkit-appearance: none;
  border-radius: 0;
  transition: border-bottom-color 0.2s ease;
}

.form-field input:focus {
  border-bottom-color: #000000;
}

.form-field input::placeholder {
  color: #999999;
}

/* ── Layout dos columnas ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* ── Separador entre inmueble y contacto ── */
.form-divider {
  border: none;
  border-top: 0.5px solid #000000;
  margin: 4px 0 44px;
}

/* ── Toggles calidades ── */
.form-field--toggles {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toggle-row {
  display: flex;
}

.toggle-btn {
  font-family: 'HelveticaNeue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000000;
  background: transparent;
  border: 1px solid #999999;
  padding: 10px 26px;
  margin-right: -1px;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.toggle-btn:hover {
  border-color: #000000;
  background-color: rgba(0, 0, 0, 0.04);
}

.toggle-btn.selected {
  background-color: #000000;
  border-color: #000000;
  color: #ffffff;
  z-index: 1;
}

/* ── Botón submit ── */
.form-group {
  margin-bottom: 38px;
}

.form-group--submit {
  margin-top: 12px;
}

.btn-submit {
  font-family: 'HelveticaNeue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #000000;
  background: transparent;
  border: 1px solid #000000;
  padding: 16px 38px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-submit:hover {
  background-color: #000000;
  color: #ffffff;
}

.form-success-msg {
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: #000000;
  padding-top: 10px;
  min-height: 22px;
}


/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
.site-footer {
  position: relative;
  padding: 28px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #aaaaaa;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 160px; /* deja espacio para el nav fijo */
  height: 0.5px;
  background-color: #e0e0e0;
}


/* ══════════════════════════════════════════════════════════
   NAVEGACIÓN POR SECCIONES
══════════════════════════════════════════════════════════ */
main > section {
  display: none;
}

#hero.active {
  display: flex;
}

main > section.active {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}



/* ══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 960px)
══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  #hero {
    padding-left: 0;
  }

  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    /* sin grid-auto-rows — la altura la dicta cada imagen */
  }

  #trabajos {
    padding: 40px 0 0 0;
  }

  #equipo {
    padding: 100px 40px;
  }

  #clientes {
    padding: 100px 40px;
  }

  #presupuesto {
    padding: 100px 40px;
  }

  .hero-image-wrap {
    width: 50%;
  }
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 640px)
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Header mobile */
  .header {
    padding: 18px 16px 16px 20px;
    align-items: center;
  }

  .logo {
    gap: 8px;
  }

  .logo-main {
    font-size: clamp(11px, 3.8vw, 14px);
    letter-spacing: 0.10em;
  }

  .logo-obras {
    font-size: clamp(6px, 1.8vw, 7.5px);
    letter-spacing: 0.2em;
  }

  /* Ocultar nav desktop, mostrar hamburger */
  .nav {
    display: none;
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 44px;
    z-index: 150;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    font-size: 26px;
    letter-spacing: 0.2em;
  }

  .hamburger {
    display: flex;
  }

  /* Hero mobile: imagen completa sin recorte */
  #hero {
    flex-direction: column;
    min-height: unset;
    height: auto;
    padding-top: calc(var(--header-h) + 64px);
    padding-left: clamp(20px, 8vw, 36px);
    padding-right: clamp(20px, 8vw, 36px);
  }

  .hero-image-wrap {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .hero-image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: unset;
  }

  .hero-space {
    display: none;
  }

  /* Galería mobile: scroll interno igual que desktop */
  .gallery-viewport {
    height: calc(100vh - 70px - max(12px, 4vw));
    height: calc(100dvh - 70px - max(12px, 4vw));
    max-width: 100%;
  }

  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: max(12px, 4vw);
    /* sin grid-auto-rows — height: auto en las imágenes */
  }

  /* Ocultar items extra (JS los controla) */
  .grid-item.hidden {
    display: none;
  }

  /* Paginación mobile — oculta, se usa scroll vertical */
  .pagination {
    display: none;
  }

  /* Secciones texto mobile */
  #equipo,
  #presupuesto {
    padding: 70px max(16px, 5vw);
  }

  #clientes {
    padding: 70px max(16px, 5vw);
  }

  #trabajos {
    padding: 70px max(12px, 4vw) max(12px, 4vw) max(12px, 4vw);
  }

  #equipo p,
  .client-block p {
    font-size: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toggle-btn {
    padding: 10px 16px;
    font-size: 12px;
  }

  .btn-submit {
    width: 100%;
    text-align: center;
  }
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MÓVIL EN LANDSCAPE
   Detecta teléfono girado: ancho > 640px pero altura < 500px.
   Sin esto hereda estilos desktop que no le corresponden.
══════════════════════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 500px) {

  .header {
    padding: 10px 16px 10px 20px;
    align-items: center;
  }

  .logo { gap: 8px; }

  .logo-main {
    font-size: clamp(11px, 2.8vh, 15px);
    letter-spacing: 0.08em;
  }

  .logo-obras {
    font-size: clamp(6px, 1.4vh, 8px);
    letter-spacing: 0.18em;
  }

  .nav {
    display: none;
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 150;
  }
  .nav.open { display: flex; }
  .nav-link  { font-size: 22px; letter-spacing: 0.2em; }
  .hamburger { display: flex; }

  #hero {
    flex-direction: row;
    align-items: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding-top: var(--header-h);
    padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left));
    padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .hero-image-wrap {
    width: 50%;
    height: calc(100vh - var(--header-h) - 20px);
    flex-shrink: 0;
  }

  .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-space { display: block; flex: 1; }

  #trabajos {
    padding: var(--header-h) max(10px, 3vw) max(10px, 3vw) max(10px, 3vw);
  }

  .gallery-viewport {
    height: calc(100vh - var(--header-h) - 20px);
  }

  .grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: max(8px, 2vw);
  }

  #equipo,
  #clientes,
  #presupuesto {
    padding: calc(var(--header-h) + 24px) clamp(16px, 5vw, 40px) 40px;
  }
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET EN LANDSCAPE
   iPad girado: altura 600–900px, ancho > 960px.
══════════════════════════════════════════════════════════ */
@media (orientation: landscape) and (min-height: 501px) and (max-height: 900px) and (max-width: 1200px) {

  .hero-image-wrap {
    width: 55%;
    height: calc(100vh - var(--header-h) - 40px);
  }

  .gallery-viewport {
    height: calc(100vh - var(--header-h) - 40px);
  }
}

/* ── Accesibilidad / SEO: oculto visualmente, legible por bots ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
