/* ==========================================================================
   "LIFE AT QIMS" — home page photo mosaic (views block home_gallery_preview).
   ========================================================================== */

body .lq {
  --ink: #0f243e;
  --lime: #a6cf37;
  --teal: #52cfae;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --pad: clamp(1.5rem, 4vw, 4.5rem);

  padding: clamp(3.5rem, 7vw, 6rem) var(--pad);
  font-family: var(--sans);
  background: #fff;
}
body .lq.container { max-width: none; width: 100%; margin: 0; }

/* ----- Heading ----------------------------------------------------------- */
body .lq .lq__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}
body .lq .lq__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  font: 800 0.74rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #4d6b12;
}
body .lq .lq__eyebrow-dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--teal));
  box-shadow: 0 0 0 5px rgba(166, 207, 55, 0.25);
}
body .lq .lq__title {
  margin: 0;
  font: 300 clamp(2.2rem, 4.4vw, 3.8rem)/1.05 var(--serif);
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}
body .lq .lq__sub { margin: 0.9rem 0 0; max-width: 30rem; font: 500 1rem/1.7 var(--sans); color: #4a5a6b; }

body .lq .lq__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 800 0.92rem/1 var(--sans);
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, gap 0.35s var(--ease), transform 0.35s var(--ease);
}
body .lq .lq__cta:hover,
body .lq .lq__cta:focus-visible { background: var(--lime); color: var(--ink); gap: 1.05rem; transform: translateY(-2px); }
body .lq .lq__cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ----- Mosaic ------------------------------------------------------------ */
body .lq .lq__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(150px, 38vw, 230px);
  gap: 0.9rem;
}
body .lq .lq__tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 22px;
  background: #e6efd0;
  box-shadow: 0 24px 44px -32px rgba(15, 36, 62, 0.5);
  isolation: isolate;
  color: inherit;
  text-decoration: none;
}
body .lq .lq__tile > img,
body .lq .lq__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
body .lq .lq__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(15, 36, 62, 0.35), rgba(15, 36, 62, 0) 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
body .lq .lq__tile:hover img,
body .lq .lq__tile:focus-visible img { transform: scale(1.07); }
body .lq .lq__tile:hover::after,
body .lq .lq__tile:focus-visible::after { opacity: 1; }
body .lq .lq__tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* big first tile on small screens */
body .lq .lq__grid .lq__tile:first-child { grid-column: 1 / -1; grid-row: span 2; }

/* last tile: call to action over the photo */
body .lq .lq__tile--more::after { opacity: 1; background: linear-gradient(160deg, rgba(15, 36, 62, 0.72), rgba(15, 36, 62, 0.88)); }
body .lq .lq__tile--more:hover::after { background: linear-gradient(160deg, rgba(40, 80, 30, 0.7), rgba(15, 36, 62, 0.88)); }
body .lq .lq__more {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.9rem;
  padding: 1.4rem;
  color: #fff;
}
body .lq .lq__more-label { font: 300 clamp(1.4rem, 2.4vw, 1.9rem)/1.1 var(--serif); letter-spacing: -0.02em; }
body .lq .lq__more-arrow {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--teal));
  color: var(--ink);
  transition: transform 0.4s var(--ease);
}
body .lq .lq__tile--more:hover .lq__more-arrow { transform: translateX(6px); }

@media (min-width: 900px) {
  body .lq .lq__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, clamp(200px, 17vw, 260px));
    grid-auto-rows: auto;
    gap: 1.1rem;
  }
  body .lq .lq__grid .lq__tile:first-child { grid-column: 1 / 3; grid-row: 1 / 3; }
  body .lq .lq__grid .lq__tile:nth-child(n+2) { grid-column: auto; grid-row: auto; }
}
/* fewer than 5 photos: simple even grid */
body .lq .lq__grid--1 .lq__tile:first-child,
body .lq .lq__grid--2 .lq__tile:first-child,
body .lq .lq__grid--3 .lq__tile:first-child,
body .lq .lq__grid--4 .lq__tile:first-child { grid-row: auto; }
@media (min-width: 900px) {
  body .lq .lq__grid--1, body .lq .lq__grid--2, body .lq .lq__grid--3, body .lq .lq__grid--4 { grid-template-rows: clamp(220px, 20vw, 300px); }
  body .lq .lq__grid--1 .lq__tile:first-child { grid-column: 1 / -1; }
  body .lq .lq__grid--2 .lq__tile:first-child, body .lq .lq__grid--3 .lq__tile:first-child, body .lq .lq__grid--4 .lq__tile:first-child { grid-column: auto; }
}

/* ----- Reveal motion (only when JS added .has-lq-reveal) ------------------ */
.has-lq-reveal .lq [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.has-lq-reveal .lq [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  body .lq * { transition: none !important; }
}
