/* Dónde encontrarnos: scroll-driven location section (js/pages/ubicacion.js). Loaded after css/base/pages.css. */

.location-page {
  --brand-green: #1E7A5D;
  --ink: #111;
}

html.location-page,
.location-page body {
  color: var(--ink);
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Site header over the green block. */
.location-page .topbar {
  z-index: 30;
}

.location-page .brand {
  color: var(--ink);
}

.location-page .brand-mark {
  color: #fff;
  background: var(--ink);
}

.location-page .topbar nav {
  background: #ffffffe6;
  border-color: #0000000f;
}

.location-page .topbar nav a:hover {
  color: var(--ink);
  background: #e3f1eb;
}

.location-page .topbar nav a[aria-current=page] {
  color: #fff;
  background: var(--ink);
}

.location-page .menu {
  color: var(--ink);
  background: #ffffffcc;
}

.location-page .socials a {
  color: var(--ink);
  background: #0000000f;
}

.location-page a:focus-visible,
.location-page button:focus-visible {
  outline-color: var(--ink);
}

/* ---------- Section ---------- */

.location {
  position: relative;
  display: grid;
  grid-template-rows: 45% 55%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #fff;
}

.location-top {
  position: relative;
  display: grid;
  place-items: center;
  padding-top: 56px;
  overflow: hidden;
  background: var(--brand-green);
  isolation: isolate;
}

/* The map is tinted by the green underneath. */
.location-map {
  position: absolute;
  inset: -8%;
  opacity: .18;
  mix-blend-mode: multiply;
}

.location-map img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.location-pin-wrap {
  --pin-h: clamp(110px, 24vh, 190px);
  position: relative;
  height: var(--pin-h);
}

.location-pin {
  display: block;
  height: 100%;
  overflow: visible;
}

.location-pin path {
  fill: var(--ink);
}

.location-pin circle {
  fill: var(--brand-green);
}

/* "Impact" rays (rayitas-blanco.png points down-right): one group on each side, aimed at the pin.
   Sized and placed from the pin height so they move and scale with it. */
.location-rays {
  position: absolute;
  width: calc(var(--pin-h) * .47);
  aspect-ratio: 1;
}

.location-rays img {
  display: block;
  width: 100%;
  height: auto;
  /* Grow from the corner closest to the pin. */
  transform-origin: 100% 100%;
}

.rays-before {
  top: calc(var(--pin-h) * -.1);
  left: calc(var(--pin-h) * -.38);
}

/* Turned around so it aims at the pin too; its image still grows from the pin side. */
.rays-after {
  top: calc(var(--pin-h) * .4);
  left: calc(var(--pin-h) * .68);
  transform: rotate(180deg);
}

/* ---------- Title and rules ---------- */

.location-bottom {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vh, 36px);
  padding: 2vh 16px 3vh;
}

.location-title {
  margin: 0;
  font-family: 'Montserrat', 'DM Sans', Arial, sans-serif;
  font-size: clamp(40px, min(7vw, 10vh), 110px);
  font-weight: 300;
  line-height: .95;
  letter-spacing: -.01em;
  text-align: center;
  text-transform: uppercase;
}

.lt-line {
  display: block;
}

/* A slot the letters rise out of; the padding keeps accents and "¿" inside the clip. */
.lt-mask {
  margin: -.16em 0 -.08em;
  padding: .16em .1em .08em;
  overflow: hidden;
}

/* Letters become separate boxes after the split: never let a word break between them. */
.lt-text {
  display: inline-block;
  white-space: nowrap;
}

.lt-black {
  font-weight: 900;
}

.lt-3 {
  color: var(--brand-green);
  font-family: 'Rubik Dirt', Impact, 'Arial Black', sans-serif;
  font-size: 1.15em;
  font-weight: 400;
  letter-spacing: .01em;
}

.lt-char {
  display: inline-block;
}

/* Double rule: 4px + 2px with a 6px gap. js/pages/ubicacion.js sets position and length from the text. */
.location-rule {
  position: absolute;
  top: var(--y, 0);
  left: var(--x, 0);
  display: grid;
  gap: 6px;
  width: var(--w, 0);
  pointer-events: none;
}

.rule-thick,
.rule-thin {
  display: block;
  background: var(--ink);
}

.rule-thick {
  height: 4px;
}

.rule-thin {
  height: 2px;
}

.rule-left span {
  transform-origin: left center;
}

.rule-right span {
  transform-origin: right center;
}

.location-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: Georgia, serif;
  font-size: .8rem;
  letter-spacing: .06em;
}

.location-logo .brand-mark {
  width: 22px;
  height: 22px;
  font-size: 17px;
}

/* js/pages/ubicacion.js hides the animated pieces until the fonts load and the first frame is set. */
.location.is-pending .location-pin-wrap,
.location.is-pending .location-rule,
.location.is-pending .location-title,
.location.is-pending .location-logo {
  visibility: hidden;
}

/* ---------- Branches ---------- */

.branches {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) 5.3% 24px;
}

.main-map {
  margin: 0 0 clamp(56px, 8vw, 96px);
}

.main-map iframe {
  display: block;
  width: 100%;
  height: clamp(320px, 60vh, 560px);
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #eef2f0;
}

.branches-title {
  margin: 0 0 32px;
  font-family: 'Montserrat', 'DM Sans', Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.branch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.branch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 26px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: 6px 6px 0 var(--brand-green);
}

.branch-card h3 {
  margin: 0 0 4px;
  font-family: 'Montserrat', 'DM Sans', Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
}

.branch-address,
.branch-hours {
  margin: 0;
  line-height: 1.5;
}

.branch-hours {
  color: #555;
}

.branch-link {
  display: inline-flex;
  align-self: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-weight: 600;
  transition: background .2s, color .2s;
}

.branch-link:hover {
  color: #fff;
  background: var(--brand-green);
}

.location-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 5.3% 48px;
}

@media (max-width: 767px) {
  .location-top {
    padding-top: 72px;
  }

  .location-title {
    font-size: clamp(34px, min(11vw, 7.5vh), 64px);
  }

  /* "ENCONTRARNOS?" is about 9.5em wide in Rubik Dirt: keep it within the screen. */
  .lt-3 {
    font-size: min(1.15em, calc((100vw - 32px) / 9.8));
  }
}

@media (prefers-reduced-motion: reduce) {
  .branch-link {
    transition: none;
  }
}
