/* =========================
   Base
========================= */
* { box-sizing: border-box; }
html, body { height: 100%; }

:root{
  --accent: #0066ff;
  --header-h: 80px;
  --side-pad: 32px;
  --logo-h: 38px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 400;
  background: #fff;
  color: #111;
}

/* =========================
   Header fijo (desktop)
========================= */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #fff;
  z-index: 50;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  padding: 0 var(--side-pad);
}

/* Logo */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand img{
  height: var(--logo-h);
  width: auto;
  display: block;
}

/* Menú centrado */
.nav {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 14px;
  flex-wrap: wrap;
}

.nav a {
  color: #111;
  text-decoration: none;
  padding: 4px 0;
  transition: color 160ms ease;
  font-weight: 600; /* semibold */
}

.nav a:hover { color: var(--accent); }

.nav a.active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
}

/* Iconos derecha */
.social {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.social a {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: #111;
  text-decoration: none;
  transition: color 160ms ease;
}

.social a:hover { color: var(--accent); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* =========================
   Botón hamburguesa (solo móvil)
========================= */
.menu-toggle {
  display: none;
  justify-content: flex-end;
  border: 0;
  background: transparent;
  padding: 10px;
  cursor: pointer;
  color: #111;
}

.menu-toggle:focus {
  outline: 2px solid rgba(0, 102, 255, 0.35);
  outline-offset: 4px;
  border-radius: 10px;
}

.menu-icon {
  width: 22px;
  height: 16px;
  position: relative;
  display: inline-block;
}

.menu-icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 7px; }
.menu-icon span:nth-child(3) { top: 14px; }

/* =========================
   Menú móvil (overlay + panel)
========================= */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 80;
}

/* iPhone: dvh + safe area */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  width: min(78vw, 320px);
  background: #fff;
  z-index: 90;
  transform: translateX(-105%);
  transition: transform 220ms ease;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);

  display: flex;
  flex-direction: column;
}

.mobile-menu .mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 600;
}

.mobile-menu .close-btn {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #111;
  padding: 6px 10px;
  border-radius: 10px;
}

.mobile-menu .close-btn:focus {
  outline: 2px solid rgba(0, 102, 255, 0.35);
  outline-offset: 3px;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.mobile-nav a {
  font-weight: 600;
  text-decoration: none;
  color: #111;
  font-size: 16px;
}

.mobile-nav a.active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
}

.mobile-nav a:hover { color: var(--accent); }

.mobile-social {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  gap: 14px;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-social a {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: #111;
  transition: color 160ms ease;
  text-decoration: none;
}

.mobile-social a:hover { color: var(--accent); }
.mobile-social svg { width: 22px; height: 22px; fill: currentColor; }

body.menu-open .mobile-menu-overlay { display: block; }
body.menu-open .mobile-menu { transform: translateX(0); }
body.menu-open { overflow: hidden; }

/* =========================
   Contenido debajo del header fijo
========================= */
main { padding-top: var(--header-h); }

/* =========================
   Galería: columnas reales (ORDEN FIJO)
========================= */
.gallery {
  display: flex;
  width: 100%;
}

.gallery-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* =========================
   Tiles
========================= */
.tile {
  display: block;
  width: 100%;
  margin: 0;
  cursor: pointer;
}

.tile .imgwrap {
  width: 100%;
  overflow: hidden;
}

.tile img {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(1);
  transition: transform 220ms ease;
}

.tile:hover img { transform: scale(1.03); }

/* =========================
   Responsive
========================= */
@media (max-width: 640px) {
  :root{
    --side-pad: 16px;
    --logo-h: 34px;
    --header-h: 64px;
  }

  .header {
    grid-template-columns: 1fr auto;
    height: var(--header-h);
    padding: 0 var(--side-pad);
  }

  .nav { display: none; }
  .social { display: none; }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
  }

  main { padding-top: var(--header-h); }
}
