/* ============================================================
   Casa Julia — sistema visual
   Cocina española tradicional · rústico-elegante
   ============================================================ */

:root {
  /* Superficies (negro carbón cálido, sacado del portón del mural) */
  --ink:        oklch(0.165 0.008 55);   /* fondo principal casi negro */
  --ink-2:      oklch(0.205 0.010 50);   /* paneles */
  --ink-3:      oklch(0.255 0.012 48);   /* tarjetas / bordes suaves */
  --line:       oklch(0.34  0.012 50 / 0.55);

  /* Tinta crema */
  --cream:      oklch(0.935 0.020 78);   /* texto principal claro */
  --cream-dim:  oklch(0.80  0.022 76 / 0.78);
  --cream-faint:oklch(0.80  0.022 76 / 0.45);

  /* Rojo vino (acento de marca) — editable por Tweaks */
  --wine:       oklch(0.50 0.175 24);
  --wine-bright:oklch(0.58 0.205 26);
  --wine-deep:  oklch(0.34 0.13 26);

  /* Verde trébol (detalle) */
  --clover:     oklch(0.66 0.115 145);

  --maxw: 1240px;
  --gut: clamp(20px, 5vw, 64px);

  --font-script: "Pinyon Script", cursive;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Spectral", Georgia, serif;

  --r-sm: 4px;
  --r-md: 10px;
  --shadow: 0 24px 60px -28px rgba(0,0,0,0.85);
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* paper grain — textura sutil rústica */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/></svg>");
  mix-blend-mode: overlay;
}

/* ---------- tipografía ---------- */
.kicker {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cream-dim);
}
.script { font-family: var(--font-script); font-weight: 400; line-height: 0.9; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; margin: 0; }
h2.section-title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: 0.005em; }
p { margin: 0 0 1em; text-wrap: pretty; }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--cream-dim); }

.shell { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
section { position: relative; z-index: 2; }

/* divisor con trébol */
.divider {
  display: flex; align-items: center; gap: 18px;
  color: var(--wine-bright);
}
.divider::before, .divider::after {
  content: ""; height: 1px; flex: 1; background: var(--line);
}

/* ---------- botones ---------- */
.btn {
  --bg: var(--wine);
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.95em 1.7em;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-wine { background: var(--bg); color: var(--cream); }
.btn-wine:hover { background: var(--wine-bright); }
.btn-ghost { background: transparent; color: var(--cream); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cream-dim); background: rgba(255,255,255,0.04); }
.btn-lg { padding: 1.1em 2.1em; font-size: 0.86rem; }

/* ---------- placeholders de imagen ---------- */
.ph {
  position: relative;
  background-color: var(--ink-2);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 14px,
    rgba(255,255,255,0.022) 14px 28px
  );
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--cream-faint);
}
.ph span {
  font-family: "Courier New", monospace;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.5em 0.9em;
  border: 1px dashed var(--line);
  border-radius: 3px;
  background: rgba(0,0,0,0.25);
  text-align: center;
  max-width: 80%;
}

.clover { display: inline-block; color: var(--clover); }

/* ---------- imagen real ---------- */
.shot {
  position: relative;
  overflow: hidden;
  background-color: var(--ink-2);
  border-radius: var(--r-sm);
}
.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s ease, border-color .3s ease, padding .3s ease;
  border-bottom: 1px solid transparent;
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav.scrolled {
  background: oklch(0.155 0.008 55 / 0.86);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav.scrolled .nav-inner { padding-block: 12px; }
.nav-logo { font-family: var(--font-script); font-size: 2rem; line-height: 1; color: var(--cream); white-space: nowrap; }
section#top { padding-top: 92px; padding-bottom: 48px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cream-dim); font-weight: 600; transition: color .2s;
}
.nav-links a:hover { color: var(--cream); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-burger { display: none; background: none; border: 0; color: var(--cream); cursor: pointer; padding: 8px; }

/* móvil */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--ink);
  display: flex; flex-direction: column;
  padding: 80px var(--gut) 40px;
  gap: 6px;
  overflow-y: auto;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform .35s cubic-bezier(.4,0,.2,1), visibility 0s linear .35s;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; transition: transform .35s cubic-bezier(.4,0,.2,1), visibility 0s; }
.mobile-menu a {
  font-family: var(--font-display); font-size: 2rem; padding: 14px 0;
  border-bottom: 1px solid var(--line); color: var(--cream);
}
.mobile-close { position: absolute; top: 24px; right: var(--gut); background: none; border: 0; color: var(--cream); cursor: pointer; }

/* ---------- barra flotante reservar + domicilio (móvil) ---------- */
.fab-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 45;
  display: none;
  gap: 10px;
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.fab-bar.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.fab-bar .btn {
  flex: 1; justify-content: center;
  padding-inline: 0.7em; letter-spacing: 0.06em;
  box-shadow: var(--shadow);
}

/* ---------- secciones genéricas ---------- */
.pad { padding-block: clamp(56px, 6.5vw, 92px); }
.eyebrow-row { display: flex; flex-direction: column; gap: 14px; margin-bottom: 48px; }

/* utilidades grid */
.grid { display: grid; gap: clamp(18px, 2.4vw, 32px); }

/* ---------- galería · mosaico de fotos ---------- */
.mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, clamp(66px, 8.4vw, 104px));
  grid-template-areas:
    "a a a a b b"
    "a a a a b b"
    "a a a a c c"
    "d d e e c c"
    "d d e e f f"
    "d d e e f f";
  gap: clamp(12px, 1.5vw, 20px);
  margin-top: clamp(28px, 4vw, 52px);
}
.mosaic-tile {
  position: relative;
  margin: 0;
  transform: rotate(var(--rot, 0deg));
  transition: transform .5s cubic-bezier(.2,.75,.2,1), box-shadow .5s ease;
}
.mosaic-ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  object-fit: cover;
  border: 7px solid #f3ece0;
  border-radius: 2px;
  background-color: var(--ink);
  box-shadow: 0 16px 34px rgba(0,0,0,.46), 0 4px 12px rgba(0,0,0,.36);
}
.mosaic-tile figcaption {
  position: absolute;
  left: 7px; right: 7px; bottom: 7px;
  padding: 26px 14px 12px;
  text-align: center;
  font-family: var(--font-script);
  font-size: clamp(0.95rem, 1.4vw, 1.3rem);
  line-height: 1;
  color: var(--cream);
  background: linear-gradient(to top, rgba(0,0,0,0.66) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  pointer-events: none;
}
.mosaic-tile:hover {
  transform: rotate(0deg) scale(1.03);
  z-index: 5;
}
.mosaic-tile:hover .mosaic-ph {
  box-shadow: 0 26px 56px rgba(0,0,0,.56), 0 8px 18px rgba(0,0,0,.46);
}

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* HERO a una columna — ahora SÍ se ve la foto (antes se ocultaba) */
  #top { min-height: auto !important; padding-top: 96px !important; padding-bottom: 54px !important; }
  #top .shell { grid-template-columns: 1fr !important; }
  .hero-copy { grid-column: 1 / -1; }
  .hero-img {
    display: block !important;
    order: -1;                       /* la foto arriba, el texto debajo */
    aspect-ratio: 16 / 11 !important;
    width: 100%;
    margin-bottom: 26px;
  }
  #top h1 { font-size: clamp(3.4rem, 14.5vw, 5.4rem) !important; }
  #top .lead { max-width: none !important; }
  /* hero editorial: foto a altura contenida, no pantalla completa */
  section#top.hero-split { grid-template-columns: 1fr !important; min-height: auto !important; }
  .hero-split > div:first-child { padding: 96px var(--gut) 36px !important; }
  .hero-split > div:first-child > div { margin-inline: 0 !important; max-width: none !important; }
  .hero-split .shot { min-height: 44vh !important; }
  /* secciones a una columna */
  .pad .grid { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: 1fr !important; }
  .about-img, .map-img { max-height: 60vh; }
  /* galería · mosaico simplificado */
  .mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(5, clamp(120px, 30vw, 190px));
    grid-template-areas:
      "a a"
      "a a"
      "b c"
      "d e"
      "f f";
  }
  /* footer */
  footer .shell:first-child { grid-template-columns: 1fr !important; gap: 30px !important; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav .btn-ghost, .nav .btn-wine { display: none; }
  .nav-burger { display: inline-flex; }
  .fab-bar { display: flex; }
  body { font-size: 17px; }
  /* que el botón flotante no tape el contenido del pie */
  footer { padding-bottom: 76px; }
  /* la banda de domicilio ya lleva su CTA: evitamos que el flotante la solape */
  #domicilio { scroll-margin-bottom: 84px; }
}

/* ---------- móvil · carta ---------- */
@media (max-width: 640px) {
  /* filas de la carta a altura automática: nombres largos ya no se solapan */
  .menu-grid { grid-auto-rows: auto !important; row-gap: 28px !important; }
  /* precios largos pueden partir en varias líneas sin desbordar */
  .menu-price { white-space: normal !important; text-align: right; }
}

/* teléfonos estrechos: reserva a una sola columna interna */
@media (max-width: 420px) {
  .res-datetime { grid-template-columns: 1fr !important; }
}
